initramfs-module-bootmenu, initramfs-module-kexecboot: Fixes for kexecing.
authorPaul Sokolovsky <pmiscml@gmail.com>
Sat, 16 Feb 2008 03:00:52 +0000 (03:00 +0000)
committerPaul Sokolovsky <pmiscml@gmail.com>
Sat, 16 Feb 2008 03:00:52 +0000 (03:00 +0000)
* Be sure to pass original command line contents to new kernel.
* Add protection against infinite recursive kexecing.

packages/initrdscripts/files/30-bootmenu.sh
packages/initrdscripts/files/87-kexecboot.sh
packages/initrdscripts/initramfs-module-bootmenu_1.0.bb
packages/initrdscripts/initramfs-module-kexecboot_1.0.bb

index 7bc1429..d54a643 100644 (file)
@@ -145,12 +145,13 @@ path=`expr "$sel" : '[^/]*\([^ ]*\).*'`
 
 if [ "$dev" == "NFS" ]; then
     ROOT_DEVICE="/dev/nfs"
-    CMDLINE="$CMDLINE nfsroot=192.168.2.200:/srv/nfs/oe/image"
+    CMDLINE="$CMDLINE root=/dev/nfs nfsroot=192.168.2.200:/srv/nfs/oe/image"
 elif [ -n "$path" ]; then
     ROOT_DEVICE="/dev/loop"
-    CMDLINE="looproot=/dev/$dev:$path"
+    CMDLINE="$CMDLINE root=/dev/loop looproot=/dev/$dev:$path"
 else
     ROOT_DEVICE="/dev/$dev"
+    CMDLINE="$CMDLINE root=$ROOT_DEVICE"
 fi
 
 echo ROOT_DEVICE=$ROOT_DEVICE
index ab28157..9232934 100644 (file)
@@ -2,16 +2,18 @@
 # Allow kexecing to kernel in rootfs
 
 if [ -n "$BOOT_ROOT" -a -f "$BOOT_ROOT/boot/zImage" ]; then
-    echo "Kernel found in rootfs:"
-    ls -l "$BOOT_ROOT/boot/zImage"
-    initramfs=""
-    if [ -f "$BOOT_ROOT/boot/initramfs.bin" ]; then
-       echo "Initramfs found in rootfs:"
-       ls -l "$BOOT_ROOT/boot/initramfs.bin"
-       initramfs="--initrd=$BOOT_ROOT/boot/initramfs.bin"
+    if ! expr "$CMDLINE" : '.*nokexec'; then
+       echo "Kernel found in rootfs:"
+       ls -l "$BOOT_ROOT/boot/zImage"
+       initramfs=""
+       if [ -f "$BOOT_ROOT/boot/initramfs.bin" ]; then
+           echo "Initramfs found in rootfs:"
+           ls -l "$BOOT_ROOT/boot/initramfs.bin"
+           initramfs="--initrd=$BOOT_ROOT/boot/initramfs.bin"
+        fi
+       echo /usr/sbin/kexec -f "$BOOT_ROOT/boot/zImage" $initramfs --command-line="$CMDLINE nokexec"
+        sleep 10
+       /usr/sbin/kexec -f "$BOOT_ROOT/boot/zImage" $initramfs --command-line="$CMDLINE nokexec"
+        sleep 10000
     fi
-    echo /usr/sbin/kexec -f "$BOOT_ROOT/boot/zImage" $initramfs --command-line="$CMDLINE"
-    sleep 10
-    /usr/sbin/kexec -f "$BOOT_ROOT/boot/zImage" $initramfs --command-line="$CMDLINE"
-    sleep 10000
 fi
index e87ba69..8b9a49f 100644 (file)
@@ -1,5 +1,5 @@
 SRC_URI = "file://30-bootmenu.sh"
-PR = "r8"
+PR = "r9"
 DESCRIPTION = "An initramfs module with UI for selection of boot device."
 RDEPENDS = "klibc-utils-fstype initramfs-uniboot initramfs-module-block initramfs-module-loop initramfs-module-nfs"
 # For VFAT mounting.
index e8be2fd..35100a9 100644 (file)
@@ -1,5 +1,5 @@
 SRC_URI = "file://87-kexecboot.sh"
-PR = "r0.2"
+PR = "r0.4"
 DESCRIPTION = "An initramfs module for kexecing kernel from rootfs."
 RDEPENDS = "initramfs-uniboot kexec-static"