diff options
author | xengineering <mail2xengineering@protonmail.com> | 2020-03-21 14:32:33 +0100 |
---|---|---|
committer | xengineering <mail2xengineering@protonmail.com> | 2020-03-21 14:32:33 +0100 |
commit | f9aea0323111aec7d8b1e828b003bd6210534f43 (patch) | |
tree | 3d36c726004d6ead0e4f94285220f4645eef5d16 /stages | |
parent | fb56b70fd757fb3c40b2b181a54b70b2deabe6f8 (diff) | |
download | archinstall-f9aea0323111aec7d8b1e828b003bd6210534f43.tar archinstall-f9aea0323111aec7d8b1e828b003bd6210534f43.tar.zst archinstall-f9aea0323111aec7d8b1e828b003bd6210534f43.zip |
Rearrange Code
Diffstat (limited to 'stages')
-rw-r--r-- | stages/first_stage.sh | 49 |
1 files changed, 36 insertions, 13 deletions
diff --git a/stages/first_stage.sh b/stages/first_stage.sh index 49e402f..1581fce 100644 --- a/stages/first_stage.sh +++ b/stages/first_stage.sh @@ -41,7 +41,7 @@ fi # partition the disk -if [ "$path_to_disk" == "/dev/null" ]; then +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 @@ -92,53 +92,76 @@ EOF else print_failed "Unknown boot_mode" + exit 1 fi # format and mount partitions if [ "$luks_encryption" == "no" ];then + if [ "$boot_mode" == "bios" ];then + print_ok "Formatting for no disk encryption and bios/mbr" - mkfs.ext4 ${path_to_disk}1 - e2label ${path_to_disk}1 "boot" + + # root partition mkfs.ext4 ${path_to_disk}2 e2label ${path_to_disk}2 "root" mount ${path_to_disk}2 /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 no disk encryption and uefi/gpt" - mkfs.fat -F32 ${path_to_disk}1 - fatlabel ${path_to_disk}1 "efi" - mkfs.ext4 ${path_to_disk}2 - e2label ${path_to_disk}2 "boot" + + # root partition mkfs.ext4 ${path_to_disk}3 e2label ${path_to_disk}3 "root" mount ${path_to_disk}3 /mnt - mkdir /mnt/mnt - mount ${path_to_disk}1 /mnt/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 + else print_failed "Unknown boot_mode" exit 1 fi + elif [ "$luks_encryption" == "yes" ];then + if [ "$boot_mode" == "bios" ];then + print_ok "Formatting for disk encryption and bios/mbr" - ### + print_failed "Sorry, encryption is not ready to use ..." - exit 1 + exit 1 ### + 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 + exit 1 ### + else print_failed "Unknown boot_mode" exit 1 fi + else print_failed "luks_encryption not 'yes' or 'no'" exit 1 |