[oe-commits] org.oe.dev /boot/kexec: Added tftp method to fetch kernel to boot, added notes on

mwester commit openembedded-commits at lists.openembedded.org
Tue Jul 3 17:06:04 UTC 2007


/boot/kexec: Added tftp method to fetch kernel to boot, added notes on
usage to the comments section.

Author: mwester at openembedded.org
Branch: org.openembedded.dev
Revision: 1293c35f9186cb98ae4e1efe9e3cb8cc0e607def
ViewMTN: http://monotone.openembedded.org/revision.psp?id=1293c35f9186cb98ae4e1efe9e3cb8cc0e607def
Files:
1
packages/slugos-init/files/boot/kexec
Diffs:

#
# mt diff -r2d48e0fc062c46f883515824089be8f20112f660 -r1293c35f9186cb98ae4e1efe9e3cb8cc0e607def
#
# 
# 
# patch "packages/slugos-init/files/boot/kexec"
#  from [b1ddcced6d9e71541270a6164d283c40b6bf4c53]
#    to [673016bf05b9aa6cb772a7c6b241caedab27151a]
# 
============================================================
--- packages/slugos-init/files/boot/kexec	b1ddcced6d9e71541270a6164d283c40b6bf4c53
+++ packages/slugos-init/files/boot/kexec	673016bf05b9aa6cb772a7c6b241caedab27151a
@@ -1,7 +1,7 @@
 #!/bin/sh
 #
 # Loads the specified kernel and kexecs it.
-# 
+
 # The access method and path from which to fetch the kernel
 # is specified in "$1" and "$2":
 #
@@ -11,9 +11,34 @@
 # wget       ftp://ftpserv/pub/zImage
 # /dev/sda1  /kernels/zImage-test
 # UUID       /kernels/zImage-test
+# tftp       server:/pub/kernels/vmlinuz
 #
 # Command-line options for the new kernel are in "$3".
 
+
+# In order to use this, you must exec this script from the /linuxrc file.
+#
+# This sample linuxrc script boots from external disk.  The last line of
+# this example (exec /boot/flash) is a fallback; it will not normally be
+# executed unless /boot/kexec is missing or damaged.
+#--------------------
+#  #!/bin/sh
+#  sleep=8 exec /boot/kexec /dev/sda1 /boot/zImage-ixp4xxbe \
+#  "console=ttyS0,115200n8 root=/dev/sda1 rootfstype=ext3 rw init=/linuxrc"
+#  exec /boot/flash
+#--------------------
+#
+# This one boots from flash in the normal fashion, except the kernel is
+# loaded using wget.  This is common for kernel debugging.
+#--------------------
+#  #!/bin/sh
+#  exec /boot/kexec wget http://myserver/boot/zImage-ixp4xxbe \
+#  "console=ttyS0,115200n8 root=/dev/mtdblock4 rootfstype=jffs2 rw \
+#    init=/boot/flash noirqdebug"
+#  exec /boot/flash
+#--------------------
+
+
 # Use the standard init path (see /etc/init.d/rcS)
 export PATH=/sbin:/bin:/usr/sbin:/usr/bin
 
@@ -26,6 +51,11 @@ fi
 . /etc/default/functions
 . /etc/default/modulefunctions
 
+# Print a distinctive banner to make it easy to separate the in-flash
+# kernel boot from the kexec'd kernel boot when looking at logs, etc.
+echo '###########################################################'
+echo '######################     KEXEC     ######################'
+
 leds boot system
 
 if [ -n "$1" -a -n "$2" ] ; then
@@ -100,6 +130,19 @@ if [ -n "$1" -a -n "$2" ] ; then
 		fi
 		;;
 
+	    tftp )
+		if /boot/network ; then
+		    echo "mounting tmpfs partition..."
+		    if mount -t tmpfs tmpfs /mnt ; then
+			need_umount=1
+			t=`basename "$kpath"`
+			kexec_image="/mnt/$t"
+			echo "Loading kexec kernel using tftp \"$kpath\"..."
+			tftp -g -l "$kexec_image" -r "${kpath#*:}" "${kpath%%:*}"
+		    fi
+		fi
+		;;
+
 	    * )
 		echo "Unrecognized method: \"$method\""
 		;;






More information about the Openembedded-commits mailing list