summaryrefslogtreecommitdiff
path: root/stages
diff options
context:
space:
mode:
Diffstat (limited to 'stages')
-rw-r--r--stages/first_stage.sh37
-rw-r--r--stages/second_stage.sh16
2 files changed, 24 insertions, 29 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
diff --git a/stages/second_stage.sh b/stages/second_stage.sh
index faedde1..a649fc6 100644
--- a/stages/second_stage.sh
+++ b/stages/second_stage.sh
@@ -18,23 +18,23 @@
# 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 second_stage.sh\n"
-# Set timezone
+# set timezone
ln -sf $path_to_timezone /etc/localtime
hwclock --systohc
-# Localization
+# localization
echo "$locales_to_generate" >> /etc/locale.gen
locale-gen
@@ -44,7 +44,7 @@ touch /etc/vconsole.conf
echo "KEYMAP=$keymap" >> /etc/vconsole.conf
-# Network configuration
+# network configuration
touch /etc/hostname
echo "$hostname" > /etc/hostname
@@ -53,17 +53,17 @@ echo "127.0.0.1 localhost" >> /etc/hosts
echo "::1 localhost" >> /etc/hosts
-# Initramfs
+# initramfs
### to be implemented
-# Setting root password
+# setting root password
echo "root:${DEFAULT_PASSWORD}" | chpasswd
-# Install bootloader
+# install bootloader
grub-install --target=i386-pc $path_to_disk
grub-mkconfig -o /boot/grub/grub.cfg