altboot:
authorMatthias Hentges <oe@hentges.net>
Wed, 12 Apr 2006 14:05:43 +0000 (14:05 +0000)
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>
Wed, 12 Apr 2006 14:05:43 +0000 (14:05 +0000)
- Emmit a low-volume beep on alsa devices before running the timeout
- Removed some redirects from init_rootfs
- Fixed CF booting w/ kernel 2.6.16
- Fixed altboot menu on c7x0 running kernel 2.6

packages/altboot/altboot_0.0.0.bb
packages/altboot/files/altboot-menu/Advanced/40-bootNFS
packages/altboot/files/altboot.func
packages/altboot/files/altboot.rc/playbeep.sh [new file with mode: 0644]
packages/altboot/files/init.altboot

index a87574b..fbfad3c 100644 (file)
@@ -13,7 +13,8 @@ SRC_URI = "file://altboot-menu \
           file://altboot.rc \
           file://altboot.func \         
           file://init.altboot \
-          file://altboot*.cfg"
+          file://altboot*.cfg \
+          file://beep.raw"
 
 # S = "${WORKDIR}/files"
  
@@ -23,7 +24,9 @@ do_install() {
        install -d ${D}/etc/altboot-menu/Advanced
        install -d ${D}/etc/altboot.rc
        install -d ${D}/usr/share/doc/altboot
+       install -d ${D}/usr/share/sounds
        
+       install -m 0644 ${WORKDIR}/beep.raw ${D}/usr/share/sounds
        install -m 0644 ${WORKDIR}/altboot*.cfg ${D}/etc
        install -m 0644 ${WORKDIR}/altboot.func ${D}/etc
 #      install -m 0644 ${WORKDIR}/docs/altboot/*.txt ${D}/usr/share/doc/altboot
index 33d5f27..c3fb7ce 100644 (file)
@@ -37,6 +37,8 @@ run_module() {
        else    
                # With kernel 2.6.16+ udev is used 
                /etc/init.d/udev start >/dev/null 2>&1 || die "/etc/init.d/udev start failed!"
+               
+               /etc/init.d/udev stop
        fi
        
        nfs_host="`cat /etc/fstab | grep -v ^# | grep nfs | awk '{print $1}'|sed -n "s/\(.*\)\:\(.*\)/\1/p" `"
index 83acb94..f87cef4 100644 (file)
@@ -439,8 +439,8 @@ check_fs() {
 
 # Make the initial rootfs a bit more usable
 init_rootfs(){
-       echo -n "Mounting rootfs rw..." >/dev/tty0
-       mount -o remount,rw / >/dev/tty0 2>&1 && echo ok  >/dev/tty0|| die "mount -o remount,rw / failed"
+       echo -n "Mounting rootfs rw..." 
+       mount -o remount,rw / && echo ok || die "mount -o remount,rw / failed"
 
        mount | grep -q "/proc " >/dev/null 2>&1 && echo "Note: /proc is already mounted" || mount proc -t proc /proc >/dev/tty0 2>&1
        
@@ -449,8 +449,8 @@ init_rootfs(){
                mount | grep -q "/sys " >/dev/null 2>&1 && echo "Note: /sys is already mounted" || mount sys -t sysfs /sys >/dev/tty0 2>&1
        fi
        
-       echo -n "Generating device files..." >/dev/tty0
-       /etc/init.d/devices start && echo ok  >/dev/tty0 || die "FAILED"
+       echo -n "Generating device files..." 
+       /etc/init.d/devices start && echo ok || die "FAILED"
 }
 
 mount_sd(){
@@ -498,18 +498,26 @@ mount_cf(){
        then
                echo "Note: /media/cf is already mounted"
        else    
-               # As of kernel 2.6.16, /e/i/pcmcia is replaced by udev
-               if test -x /etc/init.d/pcmcia
+               if ( cat /etc/fstab | grep -v "^#" | grep -q "/media/cf" )
                then
-                       /etc/init.d/pcmcia status | grep -q running || /etc/init.d/pcmcia start && echo "Note: cardmgr is already active"
-               fi
-                       
-               echo ""
+                       # As of kernel 2.6.16, /e/i/pcmcia is replaced by udev
+                       if test -x /etc/init.d/pcmcia
+                       then
+                               /etc/init.d/pcmcia status | grep -q running || /etc/init.d/pcmcia start && echo "Note: cardmgr is already active"
+                       else
+                               for n in 1 2 3
+                               do
+                                       ! test -e "/dev/hda$n" && mknod /dev/hda$n b 3 $n
+                               done
+                       fi                      
 
-               # Give the SD and CF mounting some time. This is a must for SD                  
-               sleep 2
-               
-               mount | grep -q "/media/cf " || mount /media/cf
+                       # Give the SD and CF mounting some time. This is a must for SD                  
+                       sleep 2
+
+                       mount /media/cf -o async
+               else
+                       echo "Note: Your system's fstab does not include an entry for /media/cf"
+               fi
        fi
 }
 
@@ -519,7 +527,7 @@ mount_home(){
                echo "Note: /home is already mounted"
        else
 
-               if ( cat /etc/fstab | grep -v "^#" | grep "/home " )
+               if ( cat /etc/fstab | grep -v "^#" | grep -q "/home " )
                then
                        echo "Mounting /home"
                        home_fstab="`grep "/home " /etc/fstab`"
@@ -528,6 +536,8 @@ mount_home(){
                        home_options="`echo "$home_fstab" | awk '{print $4}'`"
 
                        mount -t "$home_fs" -o $home_options "$home_dev" /home
-               fi      
+               else
+                       echo "Note: Your system's fstab does not include an entry for /home"
+               fi
        fi
 }
diff --git a/packages/altboot/files/altboot.rc/playbeep.sh b/packages/altboot/files/altboot.rc/playbeep.sh
new file mode 100644 (file)
index 0000000..198a874
--- /dev/null
@@ -0,0 +1,32 @@
+#! /bin/sh
+#
+# Copyright Matthias Hentges <devel@hentges.net> (c) 2006
+# License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the license)
+#
+# Filename: playbeep.sh
+# Date: 12-Apr-06
+
+if test -x /usr/sbin/alsactl
+then
+       for module in `cat /etc/modules | grep snd | grep -v ^#`
+       do
+               #echo "loading $module"
+               modprobe $module
+       done
+
+       mount -o remount,rw /
+       
+       init_rootfs >/dev/null 2>&1
+
+       ! test -e /dev/audio && mknod /dev/audio c 14 4
+       ! test -e /dev/dsp && mknod /dev/dsp c 14 3
+               
+       mkdir /dev/snd >/dev/null 2>&1
+       mknod /dev/snd/controlC0 c 116 0 >/dev/null 2>&1
+       mknod /dev/snd/pcmC0D0c c 116 24 >/dev/null 2>&1
+       mknod /dev/snd/pcmC0D0p c 116 16 >/dev/null 2>&1
+       mknod /dev/snd/timer c 116 33 >/dev/null 2>&1
+       /usr/sbin/alsactl restore >/dev/null 2>&1
+       
+       test -e /usr/share/sounds/beep.raw && cat /usr/share/sounds/beep.raw > /dev/dsp  
+fi
index 22f3e86..273160b 100644 (file)
@@ -157,7 +157,8 @@ run_timer() {
                
                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`";;     
+               2.6*)   key_ints="`cat /proc/interrupts | grep Spitzkbd`"
+                       test -z "$key_ints" && key_ints="`cat /proc/interrupts | grep -i corgikbd`";;   
                esac            
        
                stty -echo
@@ -171,10 +172,11 @@ run_timer() {
                        sleep 1
                        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`";; 
+                       2.6*)   key_ints_now="`cat /proc/interrupts | grep Spitzkbd`"
+                               test -z "$key_ints_now" && key_ints_now="`cat /proc/interrupts | grep -i corgikbd`";;   
                        esac            
                        
-                       if test "$key_ints_now" != "$key_ints" 
+                       if test "$key_ints_now" != "$key_ints" -o -z "$key_ints_now"
                        then                            
                                launch_altboot=yes                              
                                stty echo