[oe-commits] Mike Westerhof : SlugOS: initscripts - simplify kexec handling in reboot, fix option ordering.

git version control git at git.openembedded.org
Sun Feb 6 19:44:32 UTC 2011


Module: openembedded.git
Branch: org.openembedded.dev
Commit: 42136288cb7919b2841ffde39c9fa9f3ab1c5fc2
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=42136288cb7919b2841ffde39c9fa9f3ab1c5fc2

Author: Mike Westerhof <mwester at dls.net>
Date:   Sun Feb  6 13:41:49 2011 -0600

SlugOS: initscripts - simplify kexec handling in reboot, fix option ordering.
At some point, kexec became sensitive to the order of the --exec and --force
options, so kexec was no longer booting a previously-loaded kernel at reboot.

---

 recipes/initscripts/initscripts-1.0/slugos/reboot |   15 ++++++---------
 recipes/initscripts/initscripts-slugos_1.0.bb     |    5 +----
 2 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/recipes/initscripts/initscripts-1.0/slugos/reboot b/recipes/initscripts/initscripts-1.0/slugos/reboot
index ca640fe..4479226 100755
--- a/recipes/initscripts/initscripts-1.0/slugos/reboot
+++ b/recipes/initscripts/initscripts-1.0/slugos/reboot
@@ -5,15 +5,12 @@
 
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 
-# Test if we should boot into the new kernel
-if test -x /usr/sbin/kexec -a -f /sys/kernel/kexec_loaded ; then
-    read loaded < /sys/kernel/kexec_loaded
-    if test "$loaded" = "1" ; then
-        echo -n "Loaded kernel image found, executing ... "
-        /usr/sbin/kexec --exec --force --no-ifdown
-        echo "${warn}failed, doing normal reboot${norm}"
-    fi
+echo "Rebooting... "
+
+if test -x /usr/sbin/kexec ; then
+    echo " Trying kexec first..."
+    /usr/sbin/kexec --force --exec #--no-ifdown
+    echo " No kexec kernel loaded (or kexec failed), doing normal reboot..."
 fi
 
-echo -n "Rebooting... "
 reboot -d -f -i
diff --git a/recipes/initscripts/initscripts-slugos_1.0.bb b/recipes/initscripts/initscripts-slugos_1.0.bb
index ce80fe5..8620459 100644
--- a/recipes/initscripts/initscripts-slugos_1.0.bb
+++ b/recipes/initscripts/initscripts-slugos_1.0.bb
@@ -17,7 +17,7 @@ RDEPENDS_${PN} = "update-rc.d"
 # All other standard definitions inherited from initscripts
 # Except the PR which is hacked here.  The format used is
 # a suffix
-PR := "${PR}.26"
+PR := "${PR}.27"
 
 # Avoid a clash on /etc/device_table by ensuring that it gets removed
 # from the list of configuration files handled specially by opkg.
@@ -174,9 +174,6 @@ do_install_append() {
 	# any network file systems which failed to umount before.
 	update-rc.d -r ${D} umountfs		start 70 0 6 .
 
-	# Remount /sys here, the reboot script needs it to check for kexec
-	update-rc.d -r ${D} sysfs.sh		start 80 6 .
-
 	update-rc.d -r ${D} halt		start 90 0 .
 	update-rc.d -r ${D} reboot		start 90 6 .
 }





More information about the Openembedded-commits mailing list