diff options
author | Mike Westerhof <mwester@dls.net> | 2007-07-03 16:43:23 +0000 |
---|---|---|
committer | Mike Westerhof <mwester@dls.net> | 2007-07-03 16:43:23 +0000 |
commit | 985b1d1346fca88c8dec191a50756c4d8d421145 (patch) | |
tree | fed5c651e4b07b22048673571e5db0aa91ea5bd1 /packages | |
parent | 9a3be9e1943af1c7e54781e5de8d91794d3528bc (diff) |
/boot/kexec: Added tftp method to fetch kernel to boot, added notes on
usage to the comments section.
Diffstat (limited to 'packages')
-rw-r--r-- | packages/slugos-init/files/boot/kexec | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/packages/slugos-init/files/boot/kexec b/packages/slugos-init/files/boot/kexec index c5b428cd07..7c02a14f04 100644 --- a/packages/slugos-init/files/boot/kexec +++ b/packages/slugos-init/files/boot/kexec @@ -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\"" ;; |