altboot: More kernel 2.4 fixes
authorMatthias Hentges <oe@hentges.net>
Thu, 23 Feb 2006 03:08:49 +0000 (03:08 +0000)
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>
Thu, 23 Feb 2006 03:08:49 +0000 (03:08 +0000)
packages/altboot/altboot_0.0.0.bb
packages/altboot/files/altboot-menu/Advanced/70-install-tgz
packages/altboot/files/altboot.func
packages/altboot/files/init.altboot

index 20245ef..455fff1 100644 (file)
@@ -6,7 +6,7 @@ MAINTAINER = "Matthias 'CoreDump' Hentges  <oe@hentges.net>"
 LICENSE = "GPL"
 IGNORE_STRIP_ERRORS = "1"
 
-PR = "r21"
+PR = "r22"
 
 
 SRC_URI = "file://altboot-menu \
index 2ff3804..c525b91 100644 (file)
@@ -51,8 +51,18 @@ run_module(){
                read junk
                
                case "$junk" in
-               1)      rootfs_target="/media/card"; break ;;
-               2)      rootfs_target="/media/cf" ; break ;;
+               1)      if (mount | grep -q "/media/card ")
+                       then
+                               rootfs_target="/media/card"; break 
+                       else
+                               echo -e "\nInstallation target [/media/card] not mounted\n"
+                       fi ;;
+               2)      if (mount | grep -q "/media/cf ")
+                       then
+                               rootfs_target="/media/cf"; break 
+                       else
+                               echo -e "\nInstallation target [/media/cf] not mounted\n"
+                       fi ;;
                esac
        done
 
@@ -68,7 +78,13 @@ run_module(){
                read junk
                
                case "$junk" in
-               1)      rootfs_type="image"; break ;;
+               1)      if test -x /sbin/mkfs.ext2
+                       then
+                               rootfs_type="image"
+                                break 
+                       else
+                               echo -e "\nNOTE: mkfs.ext2 (from e2fsprogs-mke2fs) not found, loop-images not supported\n"
+                       fi ;;                   
                2)      rootfs_type="direct" ; break ;;
                esac
        done
@@ -95,6 +111,8 @@ clear_directories(){
 
 install_rootfs_direct(){
        
+       mount | grep -q "$1 " || die "Installation target [$1] not mounted"
+       
        echo -e "Do you want to remove existing directories from [$1]\n before installing the new rootfs?"
        echo ""
        
@@ -152,7 +170,7 @@ install_rootfs_image(){
                                
                                while true 
                                do
-                                       echo -n "Overwrite? [N|y] "
+                                       echo -n "Overwrite? [y|N] "
                                        read junk2
                                        
                                        case "$junk2" in
index 9b57011..ec34792 100644 (file)
@@ -278,7 +278,7 @@ check_fs() {
                        elif [ -e /sbin/e2fsck ]; then
                                FSCK="/sbin/e2fsck"
                        fi
-                       FSCK="$FSCK -p"
+                       test -n "$FSCK" && FSCK="$FSCK -p"
                ;;
                vfat)
                    if [ -e /sbin/dosfsck ]; then
@@ -351,8 +351,8 @@ mount_cf(){
        if mount | grep -q "/media/cf "
        then
                echo "Note: /media/cf is already mounted"
-       else
-               /etc/init.d/pcmcia start || die "/etc/init.d/pcmcia/start failed!"
+       else    
+               /etc/init.d/pcmcia status | grep -q running || /etc/init.d/pcmcia start && echo "Note: cardmgr already active"
 
                echo ""
 
@@ -369,7 +369,7 @@ mount_home(){
                echo "Note: /home is already mounted"
        else
 
-               if ( grep -q "/home " /etc/fstab )
+               if ( cat /etc/fstab | grep -v "^#" | grep "/home " )
                then
                        echo "Mounting /home"
                        home_fstab="`grep "/home " /etc/fstab`"
index 2ba6f65..871ae82 100644 (file)
@@ -278,6 +278,7 @@ if test "`runlevel`" != "unknown" -a "$1" != "-force"
 then
        echo "altboot: Using real init [$REAL_INIT] [$*] *" >/dev/tty1
        exec $REAL_INIT $*
+#      exec $SH_SHELL </dev/tty0 >/dev/tty0 2>&1
        exit 0
 else   
        # Boot original init if altboot is turned off