altboot:
authorMatthias Hentges <oe@hentges.net>
Mon, 30 Jan 2006 10:53:54 +0000 (10:53 +0000)
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>
Mon, 30 Jan 2006 10:53:54 +0000 (10:53 +0000)
- First changes to support Kernel 2.6
- As of this push altboot should be considered *unstable* until work on 2.6 has finished!
- Add IGNORE_STRIP_ERRORS = "1" to allow for snapshots

packages/altboot/altboot.bb
packages/altboot/files/akita/altboot-2.6.cfg [new file with mode: 0644]
packages/altboot/files/altboot-menu/15-bootSD
packages/altboot/files/init.altboot

index 8912cc1..786d45e 100644 (file)
@@ -4,9 +4,9 @@ SECTION = "base"
 PRIORITY = "optional"
 MAINTAINER = "Matthias 'CoreDump' Hentges  <oe@hentges.net>"
 LICENSE = "GPL"
+IGNORE_STRIP_ERRORS = "1"
 
-PR = "r13"
+PR = "r14"
 
 
 SRC_URI = "file://altboot-menu \
diff --git a/packages/altboot/files/akita/altboot-2.6.cfg b/packages/altboot/files/akita/altboot-2.6.cfg
new file mode 100644 (file)
index 0000000..ad15f71
--- /dev/null
@@ -0,0 +1,26 @@
+# Handled by /sbin/init.altboot
+# Allow booting images from SD or CF instead of booting
+# the ROM. 
+ENABLE_ALTBOOT="yes"
+TIMEOUT="4"
+REAL_INIT="/sbin/init.sysvinit"
+SH_SHELL="/bin/sh"
+
+IMAGE_PATH="boot-images"
+IMAGE_TYPE="ext2"
+FSCK_IMAGES="yes"
+
+SD_DEVICE="/dev/mmcblk0p1"
+SD_KERNEL_MODULE=""
+
+USB_STORAGE_MODULES="usb_ohci_pxa27x usb-storage"
+USB_STORAGE_PARTITION="/dev/sda1"
+USB_STORAGE_WAIT="4"
+
+INIT_RUNLEVEL="5"
+NO_GUI_RL="2"
+MASTER_PASSWORD=""
+ASK_PW_ON_BOOT="no"
+
+SD_MOUNTPOINT="/media/card"
+CF_MOUNTPOINT="/media/cf"
index 60d9da4..6ce0cdc 100644 (file)
@@ -23,9 +23,25 @@ run_module() {
        echo -n "Generating device files..." >/dev/tty0
        /etc/init.d/devices start && echo ok  >/dev/tty0|| die "FAILED"
 
-
-       echo -n "Loading SD kernel module..."
-       /sbin/insmod $SD_KERNEL_MODULE >/dev/null 2>&1 && echo ok || die "insmod 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*"
+       if `uname -r | grep -q "2.6"`
+       then
+               #echo "***"
+               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}]"
+       fi
+       
+       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"
+       fi
 
        echo -n "Mounting $SD_MOUNTPOINT..."  >/dev/tty0
        /bin/mount -t auto -o defaults,noatime $SD_DEVICE $SD_MOUNTPOINT >/dev/null 2>&1 && echo ok  >/dev/tty0|| die "/bin/mount -t auto -o defaults,noatime $SD_DEVICE $SD_MOUNTPOINT failed"
index 4d795ce..506f175 100644 (file)
@@ -143,7 +143,11 @@ run_timer() {
        then
                        
                mount -t proc proc /proc >/dev/null 2>&1
-               key_ints="`cat /proc/interrupts | grep keyboard | awk '{print $2}'`"
+               
+               case "`uname -r`" in
+               2.4*)   key_ints="`cat /proc/interrupts | grep keyboard | awk '{print $2}'`";;
+               2.6*)   key_ints="`cat /proc/interrupts | grep Spitzkbd`";;     
+               esac            
        
                stty -echo
                echo -en "\n\nPlease press any key to launch altboot." > /dev/tty1
@@ -152,9 +156,14 @@ run_timer() {
 
                cnt=0
                while test "$cnt" != "$TIMEOUT"
-               do
+               do              
                        sleep 1
-                       if test "`cat /proc/interrupts | grep keyboard | awk '{print $2}'`" != "$key_ints" 
+                       case "`uname -r`" in
+                       2.4*)   key_ints_now="`cat /proc/interrupts | grep keyboard | awk '{print $2}'`";;
+                       2.6*)   key_ints_now="`cat /proc/interrupts | grep Spitzkbd`";; 
+                       esac            
+                       
+                       if test "$key_ints_now" != "$key_ints" 
                        then                            
                                launch_altboot=yes                              
                                stty echo