On 21/02/08 12:23 -0500, Ward Vandewege wrote:
> -- 
> Ward Vandewege <[EMAIL PROTECTED]>
> Free Software Foundation - Senior System Administrator

> 
> This patch adds an optional delay before the LAB environment kexecs the 
> on-disk
> kernel. This allows entering the busybox shell, which can be useful for
> maintenance and debugging. The delay is configurable from kconfig, and 
> defaults
> to 5 seconds.
> 
> The patch enables CONFIG_ASH_READ_TIMEOUT in the uclibc configuration because
> the 'read' command in the ash shell does not support the '-t' timeout 
> parameter
> otherwise.
> 
> It also changes the default for including a statically compiled copy of kexec
> into the LAB payload to no, because this makes the payload too large for 1MB
> rom chips.
> 
> Tested on real hardware.
> 
> Signed-off-by: Ward Vandewege <[EMAIL PROTECTED]>
Acked-by: Jordan Crouse <[EMAIL PROTECTED]>

> Index: skeleton/linuxrc
> ===================================================================
> --- skeleton/linuxrc  (revision 117)
> +++ skeleton/linuxrc  (working copy)
> @@ -17,11 +17,24 @@
>  # Show the version 
>  cat /buildrom-version > /dev/tty$VT
>  
> -message "Trying to boot from hdd."
> -cd /bin
> -./boot-hdd
> +message "Press enter to start the busybox shell (pausing %%LAB_PAUSE%% 
> seconds)."
> +read -t %%LAB_PAUSE%% UNUSED
>  RET=$?
> -cd /
> +if [ "$RET" == '0' ]; then
> +     message "NOTICE: Starting the shell..."
> +  message ""
> +  message "To boot your system as normal, type:"
> +  message " cd /bin; ./boot-hdd"
> +  message ""
> +     openvt $VT /bin/ash
> +     exec /bin/ash
> +else
> +     message "Trying to boot from hdd."
> +     cd /bin
> +     ./boot-hdd
> +     RET=$?
> +     cd /
> +fi
>  
>  message "NOTICE: Starting the shell..."
>  openvt $VT /bin/ash
> Index: config/payloads/Config.in
> ===================================================================
> --- config/payloads/Config.in (revision 117)
> +++ config/payloads/Config.in (working copy)
> @@ -95,12 +95,20 @@
>  
>  config KBL
>       bool "Reduced size kexec-tools"
> -     default y
> +     default n
>       select KBL_KEXEC_ONLY
>       help
>         Say 'Y' here to include the the Kexec Bootloader as a cheep
>         substitute for kexec-tools
>  
> +config LAB_PAUSE
> +     int "Seconds to pause before booting, to allow access to the busybox 
> environment"
> +     default 5
> +     help
> +             Set the number of seconds you'd like to pause before booting 
> the kexec'ed
> +             kernel here. During this pause, you can press enter to gain 
> access to the
> +             busybox environment.
> +
>  config BUSYBOX
>       bool "Busybox"
>       default y
> Index: scripts/Makefile.lab
> ===================================================================
> --- scripts/Makefile.lab      (revision 117)
> +++ scripts/Makefile.lab      (working copy)
> @@ -3,6 +3,7 @@
>  $(OUTPUT_DIR)/initrd.uncompressed: $(PAYLOAD-y)
>       @ cp -af $(SKELETON_DIR)/* $(INITRD_DIR)
>       @ chmod 0755 $(INITRD_DIR)/linuxrc
> +     @ sed -i 's/%%LAB_PAUSE%%/$(CONFIG_LAB_PAUSE)/' $(INITRD_DIR)/linuxrc
>  
>       @ echo "Cleaning up shared libraries..."
>  
> Index: packages/busybox/conf/defconfig
> ===================================================================
> --- packages/busybox/conf/defconfig   (revision 117)
> +++ packages/busybox/conf/defconfig   (working copy)
> @@ -556,7 +556,7 @@
>  #
>  # CONFIG_ASH_JOB_CONTROL is not set
>  # CONFIG_ASH_READ_NCHARS is not set
> -# CONFIG_ASH_READ_TIMEOUT is not set
> +CONFIG_ASH_READ_TIMEOUT=y
>  CONFIG_ASH_ALIAS=y
>  CONFIG_ASH_MATH_SUPPORT=y
>  # CONFIG_ASH_MATH_SUPPORT_64 is not set
> Index: packages/busybox/conf/defconfig-serengeti_cheetah-x86_64
> ===================================================================
> --- packages/busybox/conf/defconfig-serengeti_cheetah-x86_64  (revision 117)
> +++ packages/busybox/conf/defconfig-serengeti_cheetah-x86_64  (working copy)
> @@ -556,7 +556,7 @@
>  #
>  # CONFIG_ASH_JOB_CONTROL is not set
>  # CONFIG_ASH_READ_NCHARS is not set
> -# CONFIG_ASH_READ_TIMEOUT is not set
> +CONFIG_ASH_READ_TIMEOUT=y
>  CONFIG_ASH_ALIAS=y
>  CONFIG_ASH_MATH_SUPPORT=y
>  # CONFIG_ASH_MATH_SUPPORT_64 is not set

> -- 
> coreboot mailing list
> [email protected]
> http://www.coreboot.org/mailman/listinfo/coreboot

-- 
Jordan Crouse
Systems Software Development Engineer 
Advanced Micro Devices, Inc.


-- 
coreboot mailing list
[email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to