altboot
authorMatthias Hentges <oe@hentges.net>
Sun, 12 Feb 2006 13:57:42 +0000 (13:57 +0000)
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>
Sun, 12 Feb 2006 13:57:42 +0000 (13:57 +0000)
- Do not show option for USB boot on devices w/o USB host
- Disable "Boot original INIT"
- Do not drop into emergency shell on die() but restart altboot with menu (doesn't work for every plugin, yet)
- Some fixes / enhancements for tar.gz installer
- Remove "orce" error message when cmdline "-force" is used (should have seen this coming heh)

packages/altboot/altboot.bb
packages/altboot/files/akita/altboot-2.4.cfg
packages/altboot/files/akita/altboot-2.6.cfg
packages/altboot/files/altboot-menu/Advanced/30-bootUSB-Stick
packages/altboot/files/altboot-menu/Advanced/40-bootNFS
packages/altboot/files/altboot-menu/Advanced/60-orig-init
packages/altboot/files/altboot-menu/Advanced/70-install-tgz
packages/altboot/files/init.altboot
packages/altboot/files/spitz/altboot-2.4.cfg

index ef87e88..ce586f6 100644 (file)
@@ -6,7 +6,7 @@ MAINTAINER = "Matthias 'CoreDump' Hentges  <oe@hentges.net>"
 LICENSE = "GPL"
 IGNORE_STRIP_ERRORS = "1"
 
-PR = "r19"
+PR = "r20"
 
 
 SRC_URI = "file://altboot-menu \
index 9175cb1..8c404d4 100644 (file)
@@ -13,6 +13,7 @@ FSCK_IMAGES="yes"
 SD_DEVICE="/dev/mmcda1"
 SD_KERNEL_MODULE="/lib/modules/2.4.20/kernel/drivers/block/sharp_mmcsd_m.o"
 
+USB_HOST_AVAILABLE="yes"
 USB_STORAGE_MODULES="usb_ohci_pxa27x usb-storage"
 USB_STORAGE_PARTITION="/dev/sda1"
 USB_STORAGE_WAIT="4"
index ad15f71..42f0968 100644 (file)
@@ -13,6 +13,7 @@ FSCK_IMAGES="yes"
 SD_DEVICE="/dev/mmcblk0p1"
 SD_KERNEL_MODULE=""
 
+USB_HOST_AVAILABLE="no"
 USB_STORAGE_MODULES="usb_ohci_pxa27x usb-storage"
 USB_STORAGE_PARTITION="/dev/sda1"
 USB_STORAGE_WAIT="4"
index 3ef1776..c522280 100644 (file)
@@ -7,6 +7,7 @@
 
 M_TITLE="Boot USB Storage"
 
+test "$USB_HOST_AVAILABLE" = "yes" || exit 0
 die() {
        echo "ERROR: $1" >/dev/tty0
        exec $SH_SHELL </dev/tty0 >/dev/tty0 2>&1
index 818a939..cf1d1da 100644 (file)
@@ -116,7 +116,7 @@ run_module() {
        
        # Use configured resolv.conf in the pivoted rootfs
        echo -n "Copying resolv.conf..."
-       cp /etc/resolv.conf /media/nfsroot/etc >/dev/null 2>&1 && echo ok || echo "FAILED"
+       cp /etc/resolv.conf /media/nfsroot/etc && echo ok || echo "FAILED"
        
        check_target "/media/nfsroot"
        
index acf148e..2ff3804 100644 (file)
@@ -2,10 +2,10 @@
 
 M_TITLE="Install RootFS from tar.gz"
 
-die() {
-       echo "ERROR: $1" >/dev/tty0
-       exec $SH_SHELL </dev/tty0 >/dev/tty0 2>&1
-}
+die() {
+#      echo "ERROR: $1" >/dev/tty0
+#      exec $SH_SHELL </dev/tty0 >/dev/tty0 2>&1
+}
 
 run_module(){
        test -e /etc/altboot.func && . /etc/altboot.func || die "ERROR: /etc/altboot.func not found. Check your installation!"  
@@ -56,9 +56,9 @@ run_module(){
                esac
        done
 
-       echo -e "\nPlease choose the method of this installation:\n"
+       echo -e "\nPlease choose the type of this installation:\n"
 
-       echo -e "\t [1] ImageFile (loopfile)"
+       echo -e "\t [1] Imagefile (loopfile)"
        echo -e "\t [2] Direct Install"
        
        echo ""
@@ -145,21 +145,40 @@ install_rootfs_image(){
                read junk
                
                if test -n "$junk"
-               then
-                       echo -n "Use [$junk] as name? [Y|n] "
-                       read junk2
-                       
-                       case "$junk2"  in
-                       "Y"|"y"|"")     rootfs_image_name="${junk}-rootfs.bin"
-                                       break ;;
-                       *)              echo "err ]$junk]";;
-                       esac
+               then                                    
+                       if test -e "$1/boot-images/${junk}-rootfs.bin"
+                       then                    
+                               echo -e "\nFile [$1/boot-images/${junk}-rootfs.bin] already exists."
+                               
+                               while true 
+                               do
+                                       echo -n "Overwrite? [N|y] "
+                                       read junk2
+                                       
+                                       case "$junk2" in
+                                       Y|y)    break;;
+                                       n|N|"") install_rootfs_image "$1"
+                                               exit 0;;
+                                       esac
+                               done
+                               rootfs_image_name="${junk}-rootfs.bin"
+                               break                                                                                                                   
+                       else                                            
+                                echo -n "Use [$junk] as name? [Y|n] "
+                                read junk2
+
+                                case "$junk2"  in
+                                "Y"|"y"|"")    rootfs_image_name="${junk}-rootfs.bin"
+                                                break ;;
+                                *)             echo "err ]$junk]";;
+                                esac
+                       fi
                fi
        done
        
        echo ""
        echo "Please enter the image size in MegaBytes"
-       echo "Must be at least 50Mb"
+       echo "Must be at least 30Mb"
        echo ""
        
        while true
@@ -194,7 +213,7 @@ install_rootfs_image(){
        echo "Please wait..."
        mkdir -p "$1/boot-images"
                
-       ! test -e "$1/boot-images/$rootfs_image_name" && dd if=/dev/zero of="$1/boot-images/$rootfs_image_name" bs=1024k count=$rootfs_image_size >/dev/null
+       dd if=/dev/zero of="$1/boot-images/$rootfs_image_name" bs=1024k count=$rootfs_image_size >/dev/null
        
        echo -n "Creating an ext2 filesystem on $rootfs_image_name..."
        losetup /dev/loop0 "$1/boot-images/$rootfs_image_name" || die "losetup /dev/loop0 \"$1/boot-images/$rootfs_image_name\" failed!"
index eb321ad..2ba6f65 100644 (file)
@@ -33,7 +33,11 @@ C_RESET="\033[0m"
 
 die() {
        echo "ERROR: $1" >/dev/tty0
-       exec $SH_SHELL </dev/tty0 >/dev/tty0 2>&1
+       #exec $SH_SHELL </dev/tty0 >/dev/tty0 2>&1
+       
+       echo -e "\nPress <ENTER> to launch the altboot menu"
+       read junk
+       exec /sbin/init.altboot -force</dev/tty0 >/dev/tty0 2>&1
 }
 
 
@@ -300,7 +304,7 @@ else
 
 
        # When started with -force, always print the menu
-       echo "$*" | grep -q "-force" && TIMEOUT=0
+       echo "$*" | grep -q -- "-force" && TIMEOUT=0
 
        
        # This timeout works by reading /proc/interrupts to see if the keyboard interrupt
index 7a161b7..3c8abc9 100644 (file)
@@ -14,6 +14,7 @@ FSCK_IMAGES="yes"
 SD_DEVICE="/dev/mmcda1"
 SD_KERNEL_MODULE="/media/hdd/lib/modules/2.4.20/kernel/drivers/block/sharp_mmcsd_m.o"
 
+USB_HOST_AVAILABLE="yes"
 USB_STORAGE_MODULES="usb_ohci_pxa27x usb-storage"
 USB_STORAGE_PARTITION="/dev/sda1"
 USB_STORAGE_WAIT="4"