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 | |
parent | fb56b70fd757fb3c40b2b181a54b70b2deabe6f8 (diff) | |
download | archinstall-f9aea0323111aec7d8b1e828b003bd6210534f43.tar archinstall-f9aea0323111aec7d8b1e828b003bd6210534f43.tar.zst archinstall-f9aea0323111aec7d8b1e828b003bd6210534f43.zip |
Rearrange Code
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | archinstall.sh | 10 | ||||
-rw-r--r-- | stages/first_stage.sh | 49 |
3 files changed, 42 insertions, 18 deletions
@@ -36,6 +36,7 @@ Execute 'loadkeys de-latin1' after booting to live environment, if you want to s - [ ] Launch archconfig project for post-installation tasks like desktop, user setup, etc. - [ ] Support installation with WiFi (instead of cable connection) - [ ] Automate testing +- [ ] Implement 'settings_checker.sh' for better security - [ ] Implement 'guided_archinstall.py' for better usability diff --git a/archinstall.sh b/archinstall.sh index 1b4d6af..37b4118 100644 --- a/archinstall.sh +++ b/archinstall.sh @@ -60,13 +60,13 @@ EOF # But make sure to EDIT 'path_to_disk'! Run "lsblk" if you are unsure, which # is the right one for your machine. -export path_to_disk="/dev/sda" # e.g. "/dev/sda" -export luks_encryption="no" # alternative: "yes" -export path_to_timezone="/usr/share/zoneinfo/Europe/Berlin" +export path_to_disk="/dev/sda" # select the disk for installation like "/dev/sda" +export hostname="archlinux" # select the hostname for your installation +export luks_encryption="no" # "yes" for full disk encryption, "no" for normal installation +export path_to_timezone="/usr/share/zoneinfo/Europe/Berlin" # choose your timezone export locales_to_generate="de_DE.UTF-8 UTF-8" # currently just one option export language="de_DE.UTF-8" -export keymap="de-latin1" -export hostname="archlinux" # will be set to a user-chosen hostname +export keymap="de-latin1" # the keyboard layout for the installation ############################################################################## 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 |