summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md1
-rw-r--r--archinstall.sh16
-rw-r--r--stages/first_stage.sh44
-rw-r--r--stages/second_stage.sh2
4 files changed, 31 insertions, 32 deletions
diff --git a/README.md b/README.md
index 64a11fa..8db3e79 100644
--- a/README.md
+++ b/README.md
@@ -49,6 +49,7 @@ Execute 'loadkeys de-latin1' after booting to live environment, if you want to s
(Last finished task first)
+- [x] Support coloured output
- [x] Support BIOS systems
- [x] Automatic abort in case of errors
- [x] Switch to Cinnamon desktop
diff --git a/archinstall.sh b/archinstall.sh
index 3a89d5b..7caa6dd 100644
--- a/archinstall.sh
+++ b/archinstall.sh
@@ -62,8 +62,8 @@ export FIRST_STAGE_LINK="https://raw.githubusercontent.com/xengineering/archinst
export SECOND_STAGE_LINK="https://raw.githubusercontent.com/xengineering/archinstall/$BRANCH/stages/second_stage.sh"
export PACKAGE_LIST="base linux linux-firmware grub networkmanager nano" # maybe this is requiered: efibootmgr
export DEFAULT_PASSWORD="archinstall"
-export OK="\033[m[ \033[32mOK\033[m ]"
-export ERROR="\033[m[ \033[32mERROR\033[m ]"
+export OK="\033[m[ \033[32mOK\033[m ]"
+export ERROR="\033[m[ \033[31mERROR\033[m ]"
# Variables
@@ -82,26 +82,23 @@ export hostname="archlinux" # will be set to a user-chosen hostname
if ping -w $INTERNET_TEST_PING_TIMEOUT -c 1 $INTERNET_TEST_SERVER; then
printf "$OK Internet connection is ready\n"
- printf "$ERROR An error would look like this\n"
- echo ""
else
- echo "Could not reach INTERNET_TEST_SERVER '$INTERNET_TEST_SERVER' - FAILED"
- exit
+ printf "$ERROR Could not reach INTERNET_TEST_SERVER '$INTERNET_TEST_SERVER'\n"
+ exit 1
fi
-exit 99
-
-
# Update the system clock
timedatectl set-ntp true
+printf "$OK Updated system clock\n"
# Download and run first stage
curl $FIRST_STAGE_LINK > /root/first_stage.sh
bash /root/first_stage.sh
+printf "$OK first_stage.sh finished\n"
# Download, run and delete second stage
@@ -109,3 +106,4 @@ bash /root/first_stage.sh
curl $SECOND_STAGE_LINK > /mnt/root/second_stage.sh
echo "bash /root/second_stage.sh" | arch-chroot /mnt
rm /mnt/root/second_stage.sh
+printf "$OK second_stage.sh finished\n"
diff --git a/stages/first_stage.sh b/stages/first_stage.sh
index e30b927..c8101b7 100644
--- a/stages/first_stage.sh
+++ b/stages/first_stage.sh
@@ -25,35 +25,35 @@ set -e
# Debug output
-echo "Entering first_stage.sh - OK"
+printf "$OK Entering first_stage.sh\n"
# Check bootmode
if [ -d "/sys/firmware/efi/efivars" ]; then
export boot_mode="uefi"
- echo "Booted with UEFI"
+ printf "$OK Booted with UEFI\n"
else
export boot_mode="bios"
- echo "Booted with legacy boot / BIOS"
+ printf "$OK Booted with legacy boot / BIOS\n"
fi
# Partition the disk
if [ "$boot_mode" == "unknown" ]; then
- echo "boot_mode unknown! - FAILED"
+ printf "$ERROR Bootmode unknown\n"
exit 1
fi
if [ "$path_to_disk" == "/dev/null" ]; then
- echo "path_to_disk has still default value! - FAILED"
+ printf "$ERROR path_to_disk has still default value\n"
exit 1
fi
if [ "$boot_mode" == "uefi" ]; then
- echo "Partitioning for UEFI mode."
- echo "Sorry, this is still untested and you should not try it ..."
+ printf "$OK Partitioning for UEFI mode\n"
+ printf "$ERROR 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
@@ -75,9 +75,9 @@ p
w
EOF
- echo "Partitioned disk for UEFI/GPT- OK"
+ printf "$OK Partitioned disk for UEFI/GPT\n"
elif [ "$boot_mode" == "bios" ]; then
- echo "Partitioning for BIOS mode."
+ printf "$OK Partitioning for BIOS mode\n"
wipefs -a $path_to_disk # make sure that fdisk does not ask for removing
# signatures which breaks the script
fdisk $path_to_disk << EOF
@@ -96,9 +96,9 @@ p
w
EOF
- echo "Partitioned disk for BIOS/MBR - OK"
+ printf "$OK Partitioned disk for BIOS/MBR\n"
else
- echo "Unknown boot_mode! - FAILED"
+ printf "$ERROR Unknown boot_mode\n"
fi
@@ -106,7 +106,7 @@ fi
if [ "$luks_encryption" == "no" ];then
if [ "$boot_mode" == "bios" ];then
- echo "Formatting for no disk encryption and bios/mbr"
+ printf "$OK Formatting for no disk encryption and bios/mbr\n"
mkfs.ext4 ${path_to_disk}1
e2label ${path_to_disk}1 "boot"
mkfs.ext4 ${path_to_disk}2
@@ -115,31 +115,31 @@ if [ "$luks_encryption" == "no" ];then
mkdir /mnt/boot
mount ${path_to_disk}1 /mnt/boot
elif [ "$boot_mode" == "uefi" ];then
- echo "Formatting for no disk encryption and uefi/gpt"
+ printf "$OK Formatting for no disk encryption and uefi/gpt\n"
###
- echo "Sorry, UEFI is not ready to use ..."
+ printf "$ERROR Sorry, UEFI is not ready to use ...\n"
exit 1
else
- echo "Unknown boot_mode! - FAILED"
+ printf "$ERROR Unknown boot_mode\n"
exit 1
fi
elif [ "$luks_encryption" == "yes" ];then
if [ "$boot_mode" == "bios" ];then
- echo "Formatting for disk encryption and bios/mbr"
+ printf "$OK Formatting for disk encryption and bios/mbr\n"
###
- echo "Sorry, encryption is not ready to use ..."
+ printf "$ERROR Sorry, encryption is not ready to use ...\n"
exit 1
elif [ "$boot_mode" == "uefi" ];then
- echo "Formatting for disk encryption and uefi/gpt"
+ printf "$OK Formatting for disk encryption and uefi/gpt\n"
###
- echo "Sorry, encryption is not ready to use ..."
+ printf "$ERROR Sorry, encryption is not ready to use ...\n"
exit 1
else
- echo "Unknown boot_mode! - FAILED"
+ printf "$ERROR Unknown boot_mode\n"
exit 1
fi
else
- echo "luks_encryption not 'yes' or 'no'! - FAILED"
+ printf "$ERROR luks_encryption not 'yes' or 'no'\n"
exit 1
fi
@@ -147,7 +147,7 @@ fi
# Install packages with pacstrap
pacstrap /mnt $PACKAGE_LIST
-echo "Installed packages - OK"
+printf "$OK Installed packages\n"
# Generate /etc/fstab
diff --git a/stages/second_stage.sh b/stages/second_stage.sh
index ea623a7..faedde1 100644
--- a/stages/second_stage.sh
+++ b/stages/second_stage.sh
@@ -25,7 +25,7 @@ set -e
# Debug output
-echo "Entering second_stage.sh - OK"
+printf "$OK Entering second_stage.sh\n"
# Set timezone