diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2011-10-11 19:18:50 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-10-14 12:53:30 +0100 |
commit | 3fc8cec53038f41d31344040c56d62aac90ba7e0 (patch) | |
tree | a9071a02c411227cdc3eda60ba6fa994e719036e /meta/recipes-core | |
parent | 989238c366499aa3420c5594a7e256e50c78cc4b (diff) | |
download | openembedded-core-3fc8cec53038f41d31344040c56d62aac90ba7e0.tar.gz openembedded-core-3fc8cec53038f41d31344040c56d62aac90ba7e0.tar.bz2 openembedded-core-3fc8cec53038f41d31344040c56d62aac90ba7e0.tar.xz openembedded-core-3fc8cec53038f41d31344040c56d62aac90ba7e0.zip |
initramfs-live-boot: make it more generic and easy to use
The script was making some assumptions that enforced many requirement
in the machine kernel configuration and usage, besides it were too
while booting.
Changes included:
* fix indentation;
* rdepends on udev;
* allow use of isofs as module;
* remove rootdelay param parsing as it was unused;
* don't verbosely kill udevd and mknod;
* mount devtmpfs into rootfs, if available, before swithing root;
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r-- | meta/recipes-core/initrdscripts/files/init-live.sh | 32 | ||||
-rw-r--r-- | meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb | 3 |
2 files changed, 22 insertions, 13 deletions
diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh index c054863a2..eb5ab5b7a 100644 --- a/meta/recipes-core/initrdscripts/files/init-live.sh +++ b/meta/recipes-core/initrdscripts/files/init-live.sh @@ -13,6 +13,11 @@ early_setup() { mkdir /sys mount -t proc proc /proc mount -t sysfs sysfs /sys + + # support modular kernel + modprobe isofs 2> /dev/null + + mkdir /run udevd --daemon udevadm trigger --action=add } @@ -25,21 +30,25 @@ read_args() { root=*) ROOT_DEVICE=$optarg ;; rootfstype=*) - ROOT_FSTYPE=$optarg ;; - rootdelay=*) - rootdelay=$optarg ;; - LABEL=*) - label=$optarg ;; - video=*) - video_mode=$arg ;; - vga=*) - vga_mode=$arg ;; + modprobe $optarg 2> /dev/null ;; + LABEL=*) + label=$optarg ;; + video=*) + video_mode=$arg ;; + vga=*) + vga_mode=$arg ;; esac done } boot_live_root() { - killall udevd + killall udevd 2>/dev/null + + # use devtmpfs if available + if grep -q devtmpfs /proc/filesystems; then + mount -t devtmpfs devtmpfs $ROOT_MOUNT/dev + fi + cd $ROOT_MOUNT exec switch_root -c /dev/console $ROOT_MOUNT /sbin/init } @@ -78,7 +87,7 @@ done case $label in boot) mkdir $ROOT_MOUNT - mknod /dev/loop0 b 7 0 + mknod /dev/loop0 b 7 0 2>/dev/null if ! $MOUNT -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then fatal "Couldnt mount rootfs image" @@ -97,4 +106,3 @@ case $label in fatal "Installation image failed" ;; esac - diff --git a/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb index b404f8c60..e85a0e118 100644 --- a/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb +++ b/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb @@ -1,9 +1,10 @@ DESCRIPTION = "A live image init script" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" +RDEPENDS = "udev" SRC_URI = "file://init-live.sh" -PR = "r6" +PR = "r7" do_install() { install -m 0755 ${WORKDIR}/init-live.sh ${D}/init |