Automatic adaption for install scripts....

Since I wanna have some kind of quickNdirty backup-installation I’m curious if I can adjust the scripts from BeagleBoneUbuntu to have something like:

  • automatically set my preferred time-zone
  • password for ubuntu-user is changed (resp. for root set)
  • PAM common-password has minlen=4 (instead of obscure)
  • use nginx as webserver instead of apache
  • have my own script-files already preconfigured (e.g. grepp for checking if a process is running)
  • install resp. compile automatically the latest kernel

To my understanding in the armhf-rootfs-ubuntu-raring.tar I could most of the things above configure by unpacking and repacking. But the question is if this could be made more prone to upgrade-scenarios, e.g. raring==> saucy. I thought about having some kind of individual dir-structure which would finally be added/replaced to the current structure, some kind of rm, cp…
Are there any hints for this?

And my second question for this: If I have made the script the way I like it, i.e. run perfectly on the SD card - how to flash the content to the eMMC?

leo

Since I wanna have some kind of quickNdirty backup-installation I'm curious
if I can adjust the scripts from BeagleBoneUbuntu to have something like:

You could adapt the "omap-image-builder" script that builds those images..

- automatically set my preferred time-zone

not at the moment, could be added genericly here:
https://github.com/RobertCNelson/omap-image-builder/blob/master/scripts/chroot.sh#L332

- password for ubuntu-user is changed (resp. for root set)

https://github.com/RobertCNelson/omap-image-builder/blob/master/build_image.sh#L179

- PAM common-password has minlen=4 (instead of obscure)

not at the moment, could be added genericly here:
https://github.com/RobertCNelson/omap-image-builder/blob/master/scripts/chroot.sh#L332

- use nginx as webserver instead of apache

https://github.com/RobertCNelson/omap-image-builder/blob/master/var/pkg_list.sh#L19

- have my own script-files already preconfigured (e.g. grepp for checking if
a process is running)

add to:
https://github.com/RobertCNelson/omap-image-builder/blob/master/scripts/chroot.sh#L275
(it's already configured to run on bootup..)

- install resp. compile automatically the latest kernel

easy enough...

To my understanding in the armhf-rootfs-ubuntu-raring.tar I could most of
the things above configure by unpacking and repacking. But the question is
if this could be made more prone to upgrade-scenarios, e.g. raring==> saucy.
I thought about having some kind of individual dir-structure which would
finally be added/replaced to the current structure, some kind of rm, cp...
Are there any hints for this?

And my second question for this: If I have made the script the way I like
it, i.e. run perfectly on the SD card - how to flash the content to the
eMMC?

(this was designed for images created with "omap-image-builder"
https://github.com/RobertCNelson/tools/blob/master/scripts/beaglebone-black-copy-microSD-to-eMMC.sh

Regards,

THX for the details which makes the whole stuff little easier

Robert Nelson robertcnelson@gmail.com schrieb:

Once again thx for the details. I tried now to setup and apply the changes but more questions appear. I hope you don’t mind especially since I might lack some basics.

I followed the instruction, downloaded the scripts, launch ./build_image.sh and this starts automatically a download for Ubuntu quantal (12.10). Since I am not very familiar with the syntax for command-line arguments I have no idea, what arguments should I apply to get a build for raring (13.04). Neither --distro raring nor --release raring work. Changing config.in to only get raring didn’t help either.

Hm’, I’m not really sure if I made myself clear - I guess not. I want to have something like

ln -s /usr/share/zoneinfo/Europe/Paris /etc/localtime

resp.

"cat > grepall
#!/bin/sh
find . -type f -exec grep -q $1 {} ; -print
" ########### which I can as well store in a prepared file and then only
“cp grepall /usr/local/bin/”

(Or static eth0 config).

The reason why I mention it is due to the pointers I assume regular boot-up-scripts should run regularly. But I’m not interested in that cause to my understanding the changes are already save permanently. So, they need to copied/applied just once.

Thx. Is it also possible to assign root as well a default password? On the above link or somewhere else?

Thx. I guess my workaround will be the default user with some default pwd.

Looks great. Thx. Especially this give freedom to add own packages.

  • install resp. compile automatically the latest kernel
    easy enough…

Hm’, I assume that the build should take automatically the latest build. Right?

When I review the output I get e.g.

chroot_KERNEL_HTTP_DIR=“https://rcn-ee.net/deb/quantal-armhf/v3.11.0-rc6-armv7-x10/ https://rcn-ee.net/deb/quantal-armhf/v3.7.10-x13/ https://rcn-ee.net/deb/quantal-armhf/v3.8.13-bone26/

which gives me headache cause its bone26 instead of bone28.

And my second question for this: If I have made the script the way I like
it, i.e. run perfectly on the SD card - how to flash the content to the
eMMC?

(this was designed for images created with “omap-image-builder”
https://github.com/RobertCNelson/tools/blob/master/scripts/beaglebone-black-copy-microSD-to-eMMC.sh

I didn’t test it due to my above obstacles, but I’m curious if there is the practical restriction of the SD-card. Namely e.g. 15GB SD card wouldn’t fit into 2GB eMMC - which is clear. When I boot up I see 13GB space are left, 1.2 GB used. Am I able to flash that amount or is there the logical limit restriction for 2GB? PLUS when I configure swap-file of eg. 500 MB do they remain on the SD-card or will they be flashed as well?

Response rep. help would be highly appreciated.

leo

Once again thx for the details. I tried now to setup and apply the changes
but more questions appear. I hope you don't mind especially since I might
lack some basics.

I followed the instruction, downloaded the scripts, launch ./build_image.sh
and this starts automatically a download for Ubuntu quantal (12.10).

Disable what distros you do not want:
https://github.com/RobertCNelson/omap-image-builder/blob/master/build_image.sh#L297

Remember this script is for my maintance, which builds a lot of distros..

Since I
am not very familiar with the syntax for command-line arguments I have no
idea, what arguments should I apply to get a build for raring (13.04).
Neither --distro raring nor --release raring work. Changing config.in to
only get raring didn't help either.

> - automatically set my preferred time-zone
not at the moment, could be added genericly here:

https://github.com/RobertCNelson/omap-image-builder/blob/master/scripts/chroot.sh#L332

- have my own script-files already preconfigured (e.g. grepp for checking
if
a process is running)

add to:
https://github.com/RobertCNelson/omap-image-builder/blob/master/scripts/chroot.sh#L275

(>it's already configured to run on bootup..)

Hm', I'm not really sure if I made myself clear - I guess not. I want to
have something like

ln -s /usr/share/zoneinfo/Europe/Paris /etc/localtime

resp.

"cat > grepall
#!/bin/sh
find . -type f -exec grep -q $1 {} \; -print
" ########### which I can as well store in a prepared file and then only
"cp grepall /usr/local/bin/"

(Or static eth0 config).

The reason why I mention it is due to the pointers I assume regular
boot-up-scripts should run regularly. But I'm not interested in that cause
to my understanding the changes are already save permanently. So, they need
to copied/applied just once.

> - password for ubuntu-user is changed (resp. for root set)

https://github.com/RobertCNelson/omap-image-builder/blob/master/build_image.sh#L179

Thx. Is it also possible to assign root as well a default password? On the
above link or somewhere else?

root user is disabled in ubuntu by default..

> - PAM common-password has minlen=4 (instead of obscure)
not at the moment, could be added genericly here:

https://github.com/RobertCNelson/omap-image-builder/blob/master/scripts/chroot.sh#L332

Thx. I guess my workaround will be the default user with some default pwd.

> - use nginx as webserver instead of apache

https://github.com/RobertCNelson/omap-image-builder/blob/master/var/pkg_list.sh#L19

Looks great. Thx. Especially this give freedom to add own packages.

> - install resp. compile automatically the latest kernel
easy enough...

Hm', I assume that the build should take automatically the latest build.
Right?

When I review the output I get e.g.

chroot_KERNEL_HTTP_DIR="https://rcn-ee.net/deb/quantal-armhf/v3.11.0-rc6-armv7-x10/
https://rcn-ee.net/deb/quantal-armhf/v3.7.10-x13/
https://rcn-ee.net/deb/quantal-armhf/v3.8.13-bone26/"

which gives me headache cause its bone26 instead of bone28.

try again.. "./build_kernel.sh" as of top of git (no changes in over a
week) is pulling in:

chroot_KERNEL_HTTP_DIR="http://rcn-ee.net/deb/quantal-armhf/v3.11.1-armv7-x13/
http://rcn-ee.net/deb/quantal-armhf/v3.7.10-x13/
http://rcn-ee.net/deb/quantal-armhf/v3.8.13-bone28/"

>
> And my second question for this: If I have made the script the way I
> like
> it, i.e. run perfectly on the SD card - how to flash the content to the
> eMMC?

(this was designed for images created with "omap-image-builder"

https://github.com/RobertCNelson/tools/blob/master/scripts/beaglebone-black-copy-microSD-to-eMMC.sh

I didn't test it due to my above obstacles, but I'm curious if there is the
practical restriction of the SD-card. Namely e.g. 15GB SD card wouldn't fit
into 2GB eMMC - which is clear. When I boot up I see 13GB space are left,
1.2 GB used. Am I able to flash that amount or is there the logical limit
restriction for 2GB? PLUS when I configure swap-file of eg. 500 MB do they
remain on the SD-card or will they be flashed as well?

Response rep. help would be highly appreciated.

It just copies by rsync, so as long as your data is "less then 2GB"
you could use a 128GB microSD card for all it cares...

Regards,

Disable what distros you do not want:
https://github.com/RobertCNelson/omap-image-builder/blob/master/build_image.sh#L297

I thought there is a better way, but

Remember this script is for my maintance, which builds a lot of distros…

I achieved it. Thx.

chroot_KERNEL_HTTP_DIR=“https://rcn-ee.net/deb/quantal-armhf/v3.11.0-rc6-armv7-x10/
https://rcn-ee.net/deb/quantal-armhf/v3.7.10-x13/
https://rcn-ee.net/deb/quantal-armhf/v3.8.13-bone26/

which gives me headache cause its bone26 instead of bone28.

try again… “./build_kernel.sh” as of top of git (no changes in over a
week) is pulling in:

chroot_KERNEL_HTTP_DIR=“http://rcn-ee.net/deb/quantal-armhf/v3.11.1-armv7-x13/
http://rcn-ee.net/deb/quantal-armhf/v3.7.10-x13/
http://rcn-ee.net/deb/quantal-armhf/v3.8.13-bone28/

Did like this, but once again thought there is some kind of dynamic adaption possible…

It just copies by rsync, so as long as your data is “less then 2GB”
you could use a 128GB microSD card for all it cares…

Thx for the hint. I’ll try later on.

Most of the changes were done - great. Two more tiny requests:

  • How to add my own service which launch at boot-time (namely to set the time automatically from NTP and after this execute hwclock).
    (I guess this could be done with some cat > , but I have no clue where to place it so the service would launch automatically.)
  • You have clue how to configure bash-keyboard to get del-key working to delete the char under the cursor (instead of working as backspace)?

thx

leo

After running my own customized distro (which in fact has only little tweaks) I’m facing the fact that the time is not any longer updated properly. Since the date/time varies from the real time I tried to set it up properly:

ntpdate -b -s -u pool.ntp.org

which returns without any errors therefore I guess, this should work. But the command date shows no specific update of the timestamp. Timestamp remains somehow wrong. The strange thing with this issue:

  1. On the regular Ubuntu image this works
  2. ntpdate are both in the same location and I didn’t change anything
  3. I get somehow the impression that as soon as I reboot resp turn the system on I get the continued time stamp from last time, when I shutdown/rebooted the image.

Any hint what I could check additionally?

After running my own customized distro (which in fact has only little
tweaks) I'm facing the fact that the time is not any longer updated
properly. Since the date/time varies from the real time I tried to set it up
properly:

ntpdate -b -s -u pool.ntp.org

Drop the "-s" so you can see the error...

which returns without any errors therefore I guess, this should work. But
the command date shows no specific update of the timestamp. Timestamp
remains somehow wrong. The strange thing with this issue:

1) On the regular Ubuntu image this works
2) ntpdate are both in the same location and I didn't change anything
3) I get somehow the impression that as soon as I reboot resp turn the
system on I get the continued time stamp from last time, when I
shutdown/rebooted the image.

Well it was done here:
https://github.com/RobertCNelson/omap-image-builder/blob/master/scripts/chroot.sh#L283

which calls:
https://github.com/RobertCNelson/boot-scripts/blob/master/set_date.sh

Regards,

ntpdate -b -s -u pool.ntp.org

Drop the “-s” so you can see the error…

root@arm:~# ntpdate -b -u 0.at.pool.ntp.org
18 Sep 22:21:22 ntpdate[839]: no servers can be used, exiting
root@arm:~# ntpdate -b -u pool.ntp.org
18 Sep 22:23:46 ntpdate[840]: no servers can be used, exiting

Well it was done here:
https://github.com/RobertCNelson/omap-image-builder/blob/master/scripts/chroot.sh#L283

which calls:
https://github.com/RobertCNelson/boot-scripts/blob/master/set_date.sh

Thx for the hints, but I didn’t change anything there. The last mentioned script is still in the /opt/bootscripts/ folder. I guess the script is never executed cause the hwclock shows Jan 1, 2000.

Seems like I screwed something up but I have no real clue how to get it back working…

I guess this is somehow due to my network changes :frowning: I tried to assign a static IP-address on

https://github.com/RobertCNelson/omap-image-builder/blob/master/tools/setup_sdcard.sh#L954

and ended up in a misconfiguration. Thx for the hint… (And forget the problem, it was due to…)