From fdf9c73ada1be76e0cec40621f4656da33471373 Mon Sep 17 00:00:00 2001 From: Chih-Wei Huang Date: Thu, 8 Jan 2015 15:45:45 +0800 Subject: [PATCH] 1-install: support formatting ext4 partition Note our legacy grub can't support booting from an ext4 partition. You need to install a bootloader supporting ext4 manually. --- install/scripts/1-install | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/install/scripts/1-install b/install/scripts/1-install index b2e7edf..978b591 100644 --- a/install/scripts/1-install +++ b/install/scripts/1-install @@ -93,9 +93,13 @@ progress_bar() format_fs() { local cmd - echo -e '"Do not format" ""\next3 ""\next2 ""\nntfs ""\nfat32 ""' > $menufile + echo -e '"Do not format" ""\next4 ""\next3 ""\next2 ""\nntfs ""\nfat32 ""' > $menufile choose "Choose filesystem" "Please select a filesystem to format $1:" case "$choice" in + ext4) + dialog --title " Notice " --msgbox "\nAndroid-x86 bootloader can't support booting from ext4. You need to install a bootloader supporting ext4 manually, e.g., grub2." 9 49 + cmd="make_ext4fs -L" + ;; ext3) cmd="mke2fs -jL" ;; @@ -183,7 +187,7 @@ create_data_img() if [ $? -eq 0 ]; then if create_img 512 data.img; then losetup /dev/loop6 data.img - mke2fs -jL /data /dev/loop6 > /dev/tty6 + make_ext4fs -L /data /dev/loop6 > /dev/tty6 fi [ $? -ne 0 ] && dialog --msgbox "\n Failed to create data.img." 7 33 else @@ -226,7 +230,7 @@ install_to() fs=`cat /proc/mounts | grep /dev/$1 | awk '{ print $3 }'` asrc=android-$VER - dialog --title " Confirm " --no-label Skip --defaultno --yesno \ + [ "$fs" != "ext4" ] && 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 -- 2.11.0