aboutsummaryrefslogtreecommitdiffstats
path: root/packages/initrdscripts
diff options
context:
space:
mode:
authorPaul Sokolovsky <pmiscml@gmail.com>2008-03-08 21:16:39 +0000
committerPaul Sokolovsky <pmiscml@gmail.com>2008-03-08 21:16:39 +0000
commit4ae946cea1f95584e7be2796e045c10244d48eb4 (patch)
tree32bd7f6de2f6393c79de0c953d877329d65581ad /packages/initrdscripts
parenta2d06cfbf0b255f01d7214565e8fad64aa99d811 (diff)
downloadopenembedded-4ae946cea1f95584e7be2796e045c10244d48eb4.tar.gz
initramfs-module-bootldr-buster: Add initial code to workaround bogus system console issue.
* 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.
Diffstat (limited to 'packages/initrdscripts')
-rw-r--r--packages/initrdscripts/files/01-bootldr-buster.sh30
-rw-r--r--packages/initrdscripts/initramfs-module-bootldr-buster_1.0.bb2
2 files changed, 31 insertions, 1 deletions
diff --git a/packages/initrdscripts/files/01-bootldr-buster.sh b/packages/initrdscripts/files/01-bootldr-buster.sh
index 7bf312ad66..46d01903ed 100644
--- a/packages/initrdscripts/files/01-bootldr-buster.sh
+++ b/packages/initrdscripts/files/01-bootldr-buster.sh
@@ -1,6 +1,7 @@
#!/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"
@@ -9,3 +10,32 @@ if expr "$cmdl" : '.*mtdparts=ipaq' > /dev/null; then
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/initramfs-module-bootldr-buster_1.0.bb b/packages/initrdscripts/initramfs-module-bootldr-buster_1.0.bb
index bd10f16873..a3141f5a9f 100644
--- a/packages/initrdscripts/initramfs-module-bootldr-buster_1.0.bb
+++ b/packages/initrdscripts/initramfs-module-bootldr-buster_1.0.bb
@@ -1,5 +1,5 @@
SRC_URI = "file://01-bootldr-buster.sh"
-PR = "r0"
+PR = "r1"
DESCRIPTION = "An initramfs module for ignoring bogus kernel commandline from Compaq bootldr"
RDEPENDS = "initramfs-uniboot"