diff options
author | xengineering <mail2xengineering@protonmail.com> | 2020-03-19 10:15:50 +0100 |
---|---|---|
committer | xengineering <mail2xengineering@protonmail.com> | 2020-03-19 10:15:50 +0100 |
commit | 7e60434c8390b6fa9941cedd3bb572a4e105a4cc (patch) | |
tree | 48a78e38169076eb57da89908c570cda1a3de378 /stages/first_stage.sh | |
parent | f7b814cf07d3b4adeda18cbd783dc7b6f7af8250 (diff) | |
download | archinstall-7e60434c8390b6fa9941cedd3bb572a4e105a4cc.tar archinstall-7e60434c8390b6fa9941cedd3bb572a4e105a4cc.tar.zst archinstall-7e60434c8390b6fa9941cedd3bb572a4e105a4cc.zip |
Improve Readability
Diffstat (limited to 'stages/first_stage.sh')
-rw-r--r-- | stages/first_stage.sh | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/stages/first_stage.sh b/stages/first_stage.sh index c8101b7..0643671 100644 --- a/stages/first_stage.sh +++ b/stages/first_stage.sh @@ -18,17 +18,17 @@ # along with this program. If not, see <https://www.gnu.org/licenses/>. -# Stop at any error to optimize debugging: +# stop at any error to optimize debugging: set -e -# Debug output +# debug output printf "$OK Entering first_stage.sh\n" -# Check bootmode +# check bootmode if [ -d "/sys/firmware/efi/efivars" ]; then export boot_mode="uefi" @@ -39,21 +39,16 @@ else fi -# Partition the disk - -if [ "$boot_mode" == "unknown" ]; then - printf "$ERROR Bootmode unknown\n" - exit 1 -fi +# partition the disk if [ "$path_to_disk" == "/dev/null" ]; then - printf "$ERROR path_to_disk has still default value\n" + printf "$FAILED path_to_disk variable has still default value '/dev/null'\n" exit 1 fi if [ "$boot_mode" == "uefi" ]; then printf "$OK Partitioning for UEFI mode\n" - printf "$ERROR Sorry, this is still untested and you should not try it ...\n" + printf "$FAILED Sorry, this is still untested and you should not try it ...\n" exit 1 wipefs -a $path_to_disk # make sure that fdisk does not ask for removing # signatures which breaks the script @@ -98,11 +93,11 @@ EOF printf "$OK Partitioned disk for BIOS/MBR\n" else - printf "$ERROR Unknown boot_mode\n" + printf "$FAILED Unknown boot_mode\n" fi -# Format and mount partitions +# format and mount partitions if [ "$luks_encryption" == "no" ];then if [ "$boot_mode" == "bios" ];then @@ -117,39 +112,39 @@ if [ "$luks_encryption" == "no" ];then elif [ "$boot_mode" == "uefi" ];then printf "$OK Formatting for no disk encryption and uefi/gpt\n" ### - printf "$ERROR Sorry, UEFI is not ready to use ...\n" + printf "$FAILED Sorry, UEFI is not ready to use ...\n" exit 1 else - printf "$ERROR Unknown boot_mode\n" + printf "$FAILED Unknown boot_mode\n" exit 1 fi elif [ "$luks_encryption" == "yes" ];then if [ "$boot_mode" == "bios" ];then printf "$OK Formatting for disk encryption and bios/mbr\n" ### - printf "$ERROR Sorry, encryption is not ready to use ...\n" + printf "$FAILED Sorry, encryption is not ready to use ...\n" exit 1 elif [ "$boot_mode" == "uefi" ];then printf "$OK Formatting for disk encryption and uefi/gpt\n" ### - printf "$ERROR Sorry, encryption is not ready to use ...\n" + printf "$FAILED Sorry, encryption is not ready to use ...\n" exit 1 else - printf "$ERROR Unknown boot_mode\n" + printf "$FAILED Unknown boot_mode\n" exit 1 fi else - printf "$ERROR luks_encryption not 'yes' or 'no'\n" + printf "$FAILED luks_encryption not 'yes' or 'no'\n" exit 1 fi -# Install packages with pacstrap +# install packages with pacstrap pacstrap /mnt $PACKAGE_LIST printf "$OK Installed packages\n" -# Generate /etc/fstab +# generate /etc/fstab genfstab -U /mnt >> /mnt/etc/fstab |