OSDN Git Service

1-install: disallow to install read-write mode on ntfs
[android-x86/bootable-newinstaller.git] / install / scripts / 1-install
index a9607ce..590c5ad 100644 (file)
@@ -1,6 +1,6 @@
 #
 # By Chih-Wei Huang <cwhuang@linux.org.tw>
-# Last updated 2011/01/09
+# Last updated 2012/07/07
 #
 # License: GNU Public License
 # We explicitely grant the right to use the scripts
@@ -93,16 +93,13 @@ create_menulst()
 {
        menulst=/hd/grub/menu.lst
        [ -n "$VESA" ] && vga=" vga=788 modeset=0"
-       echo -e "default=0\ntimeout=6\nroot (hd0,$1)\nsplashimage=/grub/android-x86.xpm.gz\n" > $menulst
+       echo -e "${GRUB_OPTIONS:-default=0\ntimeout=6\nsplashimage=/grub/android-x86.xpm.gz\n}root (hd0,$1)\n" > $menulst
        cmdline=`cat /proc/cmdline | sed "s|\(initrd.*img\s*\)||; s|quiet\s*||; s|\(vga=\w\+\?\s*\)||; s|\(DPI=\w\+\?\s*\)||; s|\(INSTALL=\w\+\?\s*\)||; s|\(SRC=\S\+\?\s*\)||; s|\(DEBUG=\w\+\?\s*\)||; s|\(BOOT_IMAGE.*\)||"`
 
-       if grep -q ^ro.sf.lcd_density /android/default.prop /android/system/build.prop; then
-               create_entry "Android-x86 $VER" quiet $cmdline
-       else
-               create_entry "Android-x86 $VER (HDPI)" quiet $cmdline DPI=240
-               create_entry "Android-x86 $VER (MDPI)" quiet $cmdline DPI=160
-       fi
-       create_entry "Android-x86 $VER (Debug mode)" $cmdline DEBUG=1
+       create_entry "Android-x86 $VER" quiet $cmdline
+       create_entry "Android-x86 $VER (Debug mode)" $cmdline DEBUG=2
+       create_entry "Android-x86 $VER (Debug nomodeset)" nomodeset $cmdline DEBUG=2
+       create_entry "Android-x86 $VER (Debug video=LVDS-1:d)" video=LVDS-1:d $cmdline DEBUG=2
 }
 
 create_winitem()
@@ -124,7 +121,7 @@ create_img()
 {
        bname=`basename $2`
        if [ -e $2 ]; then
-               dialog --title " Confirm " --yesno \
+               dialog --title " Confirm " --defaultno --yesno \
                        "\n $bname exists. Overwrite it?" 7 38
                [ $? -ne 0 ] && return 255
                rm -f $2
@@ -154,32 +151,6 @@ create_data_img()
        fi
 }
 
-create_sdcard_img()
-{
-       case "$fs" in
-               vfat|fuseblk)
-                       mkdir sd
-                       sdcard=sd/sdcard.img
-                       ;;
-               *)
-                       sdcard=data/sdcard.img
-                       ;;
-       esac
-
-       if create_img 2047 $sdcard; then
-               losetup /dev/loop7 $sdcard
-               newfs_msdos -L sdcard /dev/loop7 > /dev/tty7 2>&1
-       fi
-       if [ $? -eq 0 ]; then
-               sed -i "s|\(SDCARD=\S\+\?\s*\)||; s|\(SRC=\S\+\?\s*\)|\1 SDCARD=/$sdcard|" $menulst
-               msg="The fake SD card is created successfully"
-       else
-               msg="Failed to create a fake SD card"
-       fi
-       cd /
-       dialog --ok-label Reboot --msgbox "\n $msg." 7 47
-}
-
 install_to()
 {
        cd /
@@ -195,7 +166,7 @@ install_to()
        fs=`cat /proc/mounts | grep /dev/$1 | awk '{ print $3 }'`
 
        asrc=android-$VER
-       dialog --title " Confirm " --no-label Skip --yesno \
+       dialog --title " Confirm " --no-label Skip --defaultno --yesno \
                "\n Do you want to install boot loader GRUB?" 7 47
        if [ $? -eq 0 ]; then
                cp -af /grub /hd
@@ -213,8 +184,8 @@ install_to()
                [ $? -ne 0 ] && return 255
        fi
 
-       [ "$fs" != "vfat" ] && dialog --title " Question " --defaultno --yesno \
-               "\nDo you want to install /system directory as read-write?\n\nLet /system be read-write make it easier to debug, but it needs more disk space and longer installation time." 10 61
+       [ "$fs" != "vfat" -a "$fs" != "fuseblk" ] && dialog --title " Question " --yesno \
+               "\nDo you want to install /system directory as read-write?\n\nMaking /system be read-write is easier for debugging, but it needs more disk space and longer installation time." 10 61
        instal_rw=$?
 
        files="mnt/$SRC/kernel mnt/$SRC/initrd.img mnt/$SRC/ramdisk.img"
@@ -253,7 +224,6 @@ install_to()
 
 install_hd()
 {
-       mdev -s
        select_dev || rebooting
        retval=1
        case "$choice" in
@@ -283,8 +253,8 @@ do_install()
 
        [ -n "$VESA" ] || runit="Run Android-x86"
        dialog --clear --title ' Congratulations! ' \
-               --menu "\n Android-x86 is installed successfully.\n " 12 51 13 \
-               "$runit" "" "Create a fake SD card" "" "Reboot" "" 2> $tempfile
+               --menu "\n Android-x86 is installed successfully.\n " 11 51 13 \
+               "$runit" "" "Reboot" "" 2> $tempfile
        case "`cat $tempfile`" in
                Run*)
                        cd /android
@@ -302,10 +272,6 @@ do_install()
                                mount -o loop /hd/$asrc/data.img data
                        fi
                        ;;
-               Create*)
-                       create_sdcard_img
-                       rebooting
-                       ;;
                *)
                        rebooting
                        ;;