diff options
author | xengineering <mail2xengineering@protonmail.com> | 2019-11-14 19:36:03 +0100 |
---|---|---|
committer | xengineering <mail2xengineering@protonmail.com> | 2019-11-14 19:36:03 +0100 |
commit | 6716e1b213d8108dac86d688f17016faa7f03c1a (patch) | |
tree | c47e8bb29235dfc39c01de802b467c2d3f053c07 /bin | |
parent | b872b3eba4209f7a3c7c554a020eb6b4af606d80 (diff) | |
download | archinstall-6716e1b213d8108dac86d688f17016faa7f03c1a.tar archinstall-6716e1b213d8108dac86d688f17016faa7f03c1a.tar.zst archinstall-6716e1b213d8108dac86d688f17016faa7f03c1a.zip |
Improved code readability and avoided output redirect to /dev/null.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/first_stage.sh | 30 | ||||
-rw-r--r-- | bin/install_bootloader.sh | 9 | ||||
-rw-r--r-- | bin/second_stage.sh | 9 |
3 files changed, 19 insertions, 29 deletions
diff --git a/bin/first_stage.sh b/bin/first_stage.sh index 0970049..a27641a 100644 --- a/bin/first_stage.sh +++ b/bin/first_stage.sh @@ -98,24 +98,11 @@ else fi -# Update the system clock - -timedatectl set-ntp true -if [ $? -eq 0 ]; then - echo "Updated system clock - OK" - echo "" - sleep $DELAY -else - echo "Could not update system clock - FAILED" - exit -fi - - # Partitioning -wipefs -a $disk_path > /dev/null # make sure that fdisk does not ask for - # removing signatures which breaks the script -fdisk $disk_path > /dev/null 2> /dev/null << EOF +wipefs -a $disk_path # make sure that fdisk does not ask for removing + # signatures which breaks the script +fdisk $disk_path << EOF g n 1 @@ -137,10 +124,10 @@ echo "" # Create Filesystems -mkfs.fat -F32 $boot_partition_path > /dev/null 2> /dev/null -mkfs.ext4 $root_partition_path > /dev/null 2> /dev/null -fatlabel $boot_partition_path "BOOT" > /dev/null -e2label $root_partition_path "ROOT" > /dev/null +mkfs.fat -F32 $boot_partition_path +mkfs.ext4 $root_partition_path +fatlabel $boot_partition_path "BOOT" +e2label $root_partition_path "ROOT" echo "Created filesystems - OK" sleep $DELAY echo "" @@ -181,7 +168,8 @@ echo "" # Launch second stage in chroot -echo "bash $REPOSITORY_PATH/bin/second_stage.sh $hostname ${disk_path}1 $REPOSITORY_PATH" | arch-chroot /mnt +echo "bash $REPOSITORY_PATH/bin/second_stage.sh $hostname \ +${disk_path}1 $REPOSITORY_PATH" | arch-chroot /mnt # Copy log from live image to root partition diff --git a/bin/install_bootloader.sh b/bin/install_bootloader.sh index 2f19ca3..7967a54 100644 --- a/bin/install_bootloader.sh +++ b/bin/install_bootloader.sh @@ -26,14 +26,11 @@ # Install Grub pacman --noconfirm -Syu grub efibootmgr -mount $1 /mnt # $1 = boot_partition_path -grub-install --target=x86_64-efi --efi-directory=/mnt --bootloader-id=GRUB --removable +mount $1 /mnt +grub-install --target=x86_64-efi --efi-directory=/mnt --bootloader-id=GRUB \ +--removable grub-mkconfig -o /boot/grub/grub.cfg umount $1 echo "Grub bootloader installed - OK" echo "" sleep 1 - -echo "Leaving chroot environment - OK" -echo "" -sleep 1 diff --git a/bin/second_stage.sh b/bin/second_stage.sh index f3353d3..f2fe43a 100644 --- a/bin/second_stage.sh +++ b/bin/second_stage.sh @@ -28,8 +28,6 @@ hostname=$1 boot_partition_path=$2 REPOSITORY_PATH=$3 -echo "hostname: $hostname" -echo "boot_partition_path: $boot_partition_path" # Localization @@ -58,3 +56,10 @@ sleep 1 # Bootloader Installation bash $REPOSITORY_PATH/bin/install_bootloader.sh $boot_partition_path + + +# Good bye chroot + +echo "Leaving chroot environment - OK" +echo "" +sleep 1 |