altboot:
authorMatthias Hentges <oe@hentges.net>
Tue, 31 Jan 2006 23:52:30 +0000 (23:52 +0000)
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>
Tue, 31 Jan 2006 23:52:30 +0000 (23:52 +0000)
- More kernel 2.6 changes
- Booting off SD seems to work as expected now
- Turn off printk before showing the menu, kernel messages make a mess of it
- Load keympas before showing the menu. init=/bin/sh is useless with a b0rked keymapping.

packages/altboot/altboot.bb
packages/altboot/files/altboot-menu/15-bootSD
packages/altboot/files/altboot.func
packages/altboot/files/altboot.rc/disable_printk.sh [new file with mode: 0644]
packages/altboot/files/altboot.rc/loadkeymap.sh [new file with mode: 0644]
packages/altboot/files/init.altboot

index 46a95ac..a6b2bcb 100644 (file)
@@ -6,7 +6,7 @@ MAINTAINER = "Matthias 'CoreDump' Hentges  <oe@hentges.net>"
 LICENSE = "GPL"
 IGNORE_STRIP_ERRORS = "1"
 
-PR = "r15"
+PR = "r16"
 
 
 SRC_URI = "file://altboot-menu \
@@ -30,6 +30,8 @@ do_install() {
        install -m 0755 ${WORKDIR}/init.altboot ${D}/sbin       
        install -m 0755 ${WORKDIR}/altboot-menu/*-* ${D}/etc/altboot-menu
        install -m 0755 ${WORKDIR}/altboot-menu/Advanced/*-* ${D}/etc/altboot-menu/Advanced
+       install -m 0755 ${WORKDIR}/altboot.rc/*.sh ${D}/etc/altboot.rc
+       install -m 0644 ${WORKDIR}/altboot.rc/*.txt ${D}/etc/altboot.rc 
 }              
 
 
index 6ce0cdc..d086cde 100644 (file)
@@ -24,23 +24,24 @@ run_module() {
        /etc/init.d/devices start && echo ok  >/dev/tty0|| die "FAILED"
 
        # We can't trust that the SD device file is there when running kernel 2.6 w/ udev
-       # Starting udev at this point may not be the best idea...
-#      echo "*1*"
+       # and starting udev at this point may not be the best idea...
+
        if `uname -r | grep -q "2.6"`
        then
-               #echo "***"
+               #Let's just assume the device file name never changes...
                dev_no="`echo "$SD_DEVICE" | sed -n "s/\/dev\/mmcblk\(.*\)p\(.*\)/\1/p"`"
                part_no="`echo "/dev/mmcblk0p1" | sed -n "s/\/dev\/mmcblk\(.*\)p\(.*\)/\2/p"`"
                ! test -e /dev/mmcblk${dev_no} && mknod /dev/mmcblk${dev_no} b 254 0
-               ! test -e /dev/mmcblk${dev_no}p${part_no} && mknod /dev/mmcblk${dev_no}p${part_no} b 254 $part_no
-               
-               #echo "[mknod /dev/mmcblk${dev_no}p${part_no}]"
+               ! test -e /dev/mmcblk${dev_no}p${part_no} && mknod /dev/mmcblk${dev_no}p${part_no} b 254 $part_no                               
        fi
        
-       if test -n "$SD_KERNEL_MODULE"
+       # Kernel 2.6 has the SD driver compiled into the kernel
+       if test -n "$SD_KERNEL_MODULE"  
        then
                echo -n "Loading SD kernel module..."
                /sbin/insmod $SD_KERNEL_MODULE >/dev/null 2>&1 && echo ok || die "insmod failed"
+       else
+               echo "No SD kernel module, configured, assuming it's build-in"
        fi
 
        echo -n "Mounting $SD_MOUNTPOINT..."  >/dev/tty0
index e1196ec..ceee6ab 100644 (file)
@@ -205,14 +205,14 @@ set_password() {
                                then
                                        crypt_pw="`echo "$junk1" | md5sum | awk '{print $1}'`"
                                        
-                                       if test -e /etc/altboot.cfg
+                                       if test -e "${ALTBOOT_CFG_FILE}"
                                        then
-                                               sed "/^MASTER_PASSWORD/s/\(.*\=\).*/\1\"$crypt_pw\"/" /etc/altboot.cfg > /etc/altboot.cfg_
-                                               mv /etc/altboot.cfg_ /etc/altboot.cfg
+                                               sed "/^MASTER_PASSWORD/s/\(.*\=\).*/\1\"$crypt_pw\"/" "${ALTBOOT_CFG_FILE}" > ${ALTBOOT_CFG_FILE}_
+                                               mv ${ALTBOOT_CFG_FILE}_ ${ALTBOOT_CFG_FILE}
                                                MASTER_PASSWORD="$crypt_pw"
                                                echo "Password changed."
                                        else
-                                               echo "/etc/altboot.cfg is missing, no password saved"
+                                               echo "${ALTBOOT_CFG_FILE} is missing, no password saved"
                                        fi
                                        
                                        break
diff --git a/packages/altboot/files/altboot.rc/disable_printk.sh b/packages/altboot/files/altboot.rc/disable_printk.sh
new file mode 100644 (file)
index 0000000..9d5f918
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+echo 0 > /proc/sys/kernel/printk
+
diff --git a/packages/altboot/files/altboot.rc/loadkeymap.sh b/packages/altboot/files/altboot.rc/loadkeymap.sh
new file mode 100644 (file)
index 0000000..f9a7774
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+# Note: With kernel 2.6 the standard keymap is unusable
+test -x /etc/init.d/keymap && /etc/init.d/keymap start >/dev/null 2>&1
+
index 2de4ba2..cd8b6b8 100644 (file)
@@ -18,11 +18,15 @@ INIT_RUNLEVEL="`cat /etc/inittab | sed -n "/^id\:/s/id\:\([0-9]\)\:.*$/\1/p"`"
 test -z "$INIT_RUNLEVEL" && INIT_RUNLEVEL=5
 
 case "`uname -r`" in
-2.6*)  test -e /etc/altboot-2.6.cfg && . /etc/altboot-2.6.cfg || echo "WARNING: No altboot-2.6.cfg found! Check your installation of Altboot!" > /dev/tty1;;
-2.4*)  test -e /etc/altboot-2.4.cfg && . /etc/altboot-2.4.cfg || echo "WARNING: No altboot-2.4.cfg found! Check your installation of Altboot!" > /dev/tty1;;
-*)     die "Unknown kernel [uname -r], no configuration found.";;
+2.6*)  ALTBOOT_CFG_FILE="/etc/altboot-2.6.cfg";;
+2.4*)  ALTBOOT_CFG_FILE="/etc/altboot-2.4.cfg";;
+*)     echo "Warning: Unknown kernel [`uname -r`], using kernel 2.6 configuration!"
+       ALTBOOT_CFG_FILE="/etc/altboot-2.6.cfg";;
 esac
 
+echo "Using [${ALTBOOT_CFG_FILE}]"
+test -e "$ALTBOOT_CFG_FILE" && . "$ALTBOOT_CFG_FILE" || echo "WARNING: No $ALTBOOT_CFG_FILE found! Check your installation of Altboot!" > /dev/tty1
+
 C_RED="\033[31m"
 C_BLUE="\033[34m"
 C_WHITE="\033[37m"