diff options
Diffstat (limited to 'packages/initrdscripts')
| -rw-r--r-- | packages/initrdscripts/files/01-bootldr-buster.sh | 41 | ||||
| -rw-r--r-- | packages/initrdscripts/files/30-bootmenu.sh | 10 | ||||
| -rw-r--r-- | packages/initrdscripts/files/init.sh | 15 | ||||
| -rw-r--r-- | packages/initrdscripts/initramfs-module-bootldr-buster_1.0.bb | 12 | ||||
| -rw-r--r-- | packages/initrdscripts/initramfs-module-bootmenu_1.0.bb | 4 | ||||
| -rw-r--r-- | packages/initrdscripts/initramfs-uniboot_1.0.bb | 2 |
6 files changed, 75 insertions, 9 deletions
diff --git a/packages/initrdscripts/files/01-bootldr-buster.sh b/packages/initrdscripts/files/01-bootldr-buster.sh new file mode 100644 index 0000000000..46d01903ed --- /dev/null +++ b/packages/initrdscripts/files/01-bootldr-buster.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +cmdl=`cat /proc/cmdline` +#cmdl="console=ttySA0,115200 console=ttySB0,115200" +if expr "$cmdl" : '.*mtdparts=ipaq' > /dev/null; then + echo "!!!!!!!!" + echo "Detected Compaq bootldr or derivative" + echo "Kernel command line is assumed to be bogus and ignored" + echo "!!!!!!!!" + CMDLINE=" " + sleep 3 +fi + +# The main trouble is the bogus console=ttySA0 passed by bootldr +# It appears that kernel doesn't have protection against only invalid +# consoles being passed on the command line, which means that the +# kernel is deaf and dumb when booted by bootldr + +INVALID_CONSOLE=0 +VALID_CONSOLE=0 + +for arg in $cmdl; do + optarg=`expr "x$arg" : 'x[^=]*=\(.*\)'` + case $arg in + console=*) + if expr "$optarg" : 'ttySA[0-9]\+' > /dev/null; then + INVALID_CONSOLE=1 + elif expr "$optarg" : 'ttyS\?[0-9]\+' > /dev/null; then + VALID_CONSOLE=1 + fi + ;; + esac +done + +if [ $INVALID_CONSOLE -eq 1 -a $VALID_CONSOLE -eq 0 ]; then + echo "!!!!!!!!" + echo "No valid system console is detected" + echo "Explicitly using /dev/tty0 for input/output" + echo "!!!!!!!!" + CONSOLE="/dev/tty0" +fi diff --git a/packages/initrdscripts/files/30-bootmenu.sh b/packages/initrdscripts/files/30-bootmenu.sh index 3f3b8c7079..f5ecb8c828 100644 --- a/packages/initrdscripts/files/30-bootmenu.sh +++ b/packages/initrdscripts/files/30-bootmenu.sh @@ -15,6 +15,13 @@ if ! (echo " " | read -n1 foo) >/dev/null 2>&1; then exit 1 fi +if [ -z "$rootdelay" ]; then + echo "rootdelay parameter was not passed on kernel command line - assuming 2s delay" + echo "If you would like to avoid this delay, pass explicit rootdelay=0" + sleep 2 + dev_setup +fi + mkdir -p $MOUNTLOC list="" @@ -82,7 +89,8 @@ while read maj min nblk dev; do get_partition_type if [ "$fstype" != "ext2" -a "$fstype" != "ext3" -a "$fstype" != "vfat" -a "$fstype" != "jffs2" ]; then -# continue + # Comment following line to show all available block devices regardless of FS (for debug purposes) + continue true fi diff --git a/packages/initrdscripts/files/init.sh b/packages/initrdscripts/files/init.sh index 8b9fe12429..c3b4336e40 100644 --- a/packages/initrdscripts/files/init.sh +++ b/packages/initrdscripts/files/init.sh @@ -25,7 +25,7 @@ dev_setup() } read_args() { - CMDLINE=`cat /proc/cmdline` + [ -z "$CMDLINE" ] && CMDLINE=`cat /proc/cmdline` for arg in $CMDLINE; do optarg=`expr "x$arg" : 'x[^=]*=\(.*\)'` case $arg in @@ -40,7 +40,7 @@ read_args() { } load_modules() { - for module in $MODULE_DIR/*; do + for module in $MODULE_DIR/$1; do echo "initramfs: Loading $module module" source $module done @@ -52,14 +52,18 @@ boot_root() { } fatal() { - echo $1 - echo + echo $1 >$CONSOLE + echo >$CONSOLE exec sh } echo "Starting initramfs boot..." early_setup +load_modules '0*' + +[ -z "$CONSOLE" ] && CONSOLE="/dev/console" + read_args if [ -n "$rootdelay" ]; then @@ -69,7 +73,8 @@ fi dev_setup -load_modules +load_modules '[1-9]*' + [ -n "$BOOT_ROOT" ] && boot_root fatal "No valid root device was specified. Please add root=/dev/something to the kernel command-line and try again." diff --git a/packages/initrdscripts/initramfs-module-bootldr-buster_1.0.bb b/packages/initrdscripts/initramfs-module-bootldr-buster_1.0.bb new file mode 100644 index 0000000000..a3141f5a9f --- /dev/null +++ b/packages/initrdscripts/initramfs-module-bootldr-buster_1.0.bb @@ -0,0 +1,12 @@ +SRC_URI = "file://01-bootldr-buster.sh" +PR = "r1" +DESCRIPTION = "An initramfs module for ignoring bogus kernel commandline from Compaq bootldr" +RDEPENDS = "initramfs-uniboot" + +do_install() { + install -d ${D}/initrd.d + install -m 0755 ${WORKDIR}/01-bootldr-buster.sh ${D}/initrd.d/ +} + +PACKAGE_ARCH = "all" +FILES_${PN} += " /initrd.d/* " diff --git a/packages/initrdscripts/initramfs-module-bootmenu_1.0.bb b/packages/initrdscripts/initramfs-module-bootmenu_1.0.bb index 02d696aa2e..6c01b5edc5 100644 --- a/packages/initrdscripts/initramfs-module-bootmenu_1.0.bb +++ b/packages/initrdscripts/initramfs-module-bootmenu_1.0.bb @@ -1,7 +1,7 @@ SRC_URI = "file://30-bootmenu.sh" -PR = "r12" +PR = "r15" DESCRIPTION = "An initramfs module with UI for selection of boot device." -RDEPENDS = "klibc-utils-fstype-static initramfs-uniboot initramfs-module-block initramfs-module-loop initramfs-module-nfs" +RDEPENDS = "klibc-utils-static-fstype initramfs-uniboot initramfs-module-block initramfs-module-loop initramfs-module-nfs" # For VFAT mounting. RRECOMMENDS = "kernel-module-nls-cp437 kernel-module-nls-iso8859-1" diff --git a/packages/initrdscripts/initramfs-uniboot_1.0.bb b/packages/initrdscripts/initramfs-uniboot_1.0.bb index e0f726582e..cfa065b619 100644 --- a/packages/initrdscripts/initramfs-uniboot_1.0.bb +++ b/packages/initrdscripts/initramfs-uniboot_1.0.bb @@ -1,5 +1,5 @@ SRC_URI = "file://init.sh" -PR = "r4" +PR = "r6" DESCRIPTON = "A modular initramfs init script system." RRECOMMENDS = "kernel-module-mtdblock" |
