diff options
-rw-r--r-- | archinstall.sh | 2 | ||||
-rw-r--r-- | stages/first_stage.sh | 35 |
2 files changed, 31 insertions, 6 deletions
diff --git a/archinstall.sh b/archinstall.sh index 37b4118..732fdd6 100644 --- a/archinstall.sh +++ b/archinstall.sh @@ -98,6 +98,7 @@ export -f print_ok function print_failed () { # ref. https://en.wikipedia.org/wiki/ANSI_escape_code printf "\033[m[ \033[31mFAILED\033[m ] $1\n" + exit 7 } export -f print_failed @@ -108,7 +109,6 @@ if ping -w $INTERNET_TEST_PING_TIMEOUT -c 1 $INTERNET_TEST_SERVER; then print_ok "Internet connection is ready" else print_failed "Could not reach INTERNET_TEST_SERVER '$INTERNET_TEST_SERVER'" - exit 1 fi diff --git a/stages/first_stage.sh b/stages/first_stage.sh index b7a45b1..302192b 100644 --- a/stages/first_stage.sh +++ b/stages/first_stage.sh @@ -44,7 +44,6 @@ fi if [ "$path_to_disk" == "/dev/null" ]; then # check if a disk is selected print_failed "path_to_disk variable has still default value '/dev/null'" - exit 1 fi if [ "$boot_mode" == "uefi" ]; then @@ -142,15 +141,41 @@ elif [ "$luks_encryption" == "yes" ];then print_ok "Formatting for disk encryption and bios/mbr ..." - print_failed "Sorry, encryption is not ready to use" - exit 1 ### + # root partition + echo -n "$DEFAULT_PASSWORD" | cryptsetup luksFormat ${path_to_disk}2 - + echo -n "$DEFAULT_PASSWORD" | cryptsetup open ${path_to_disk}2 main - + mkfs.ext4 /dev/mapper/main + e2label /dev/mapper/main "root" + mount /dev/mapper/main /mnt + + # boot partition + mkfs.ext4 ${path_to_disk}1 + e2label ${path_to_disk}1 "boot" + mkdir /mnt/boot + mount ${path_to_disk}1 /mnt/boot elif [ "$boot_mode" == "uefi" ];then print_ok "Formatting for disk encryption and uefi/gpt ..." - print_failed "Sorry, encryption is not ready to use" - exit 1 ### + # root partition + echo -n "$DEFAULT_PASSWORD" | cryptsetup luksFormat ${path_to_disk}3 - + echo -n "$DEFAULT_PASSWORD" | cryptsetup open ${path_to_disk}3 main - + mkfs.ext4 /dev/mapper/main + e2label /dev/mapper/main "root" + mount /dev/mapper/main /mnt + + # boot partition + mkfs.ext4 ${path_to_disk}2 + e2label ${path_to_disk}2 "boot" + mkdir /mnt/boot + mount ${path_to_disk}2 /mnt/boot + + # efi partition + mkfs.fat -F32 ${path_to_disk}1 + fatlabel ${path_to_disk}1 "efi" + mkdir /mnt/mnt + mount ${path_to_disk}1 /mnt/mnt fi |