summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--alis-recovery.conf6
-rw-r--r--alis-recovery.sh114
-rw-r--r--alis.conf14
-rw-r--r--alis.sh121
4 files changed, 190 insertions, 65 deletions
diff --git a/alis-recovery.conf b/alis-recovery.conf
index de13328..6fd32e7 100644
--- a/alis-recovery.conf
+++ b/alis-recovery.conf
@@ -2,9 +2,11 @@
KEYS="es"
# partition
-DEVICE="/dev/sda"
+DEVICE="/dev/sda !/dev/nvme0n1" # sata nvme
+DEVICE_TRIM="true"
LVM="true"
-PARTITION_ROOT_ENCRYPTION_PASSWORD="archlinux"
+PARTITION_ROOT_ENCRYPTION_PASSWORD="archlinux" # Warning: change it!
+PARTITION_ROOT_ENCRYPTION_PASSWORD_RETYPE="archlinux"
# network_install
WIFI_INTERFACE=""
diff --git a/alis-recovery.sh b/alis-recovery.sh
index 4c231e0..fc29cff 100644
--- a/alis-recovery.sh
+++ b/alis-recovery.sh
@@ -44,30 +44,30 @@ set -e
# # ./alis-recovery.sh
# global variables (no configuration, don't edit)
+ASCIINEMA=""
BIOS_TYPE=""
PARTITION_BIOS=""
PARTITION_BOOT=""
PARTITION_ROOT=""
DEVICE_ROOT=""
-LVM_PHISICAL_VOLUME="lvm"
+LVM_VOLUME_PHISICAL="lvm"
LVM_VOLUME_GROUP="vg"
LVM_VOLUME_LOGICAL="root"
BOOT_DIRECTORY=""
ESP_DIRECTORY=""
-PARTITION_BOOT_NUMBER=0
+#PARTITION_BOOT_NUMBER=0
UUID_BOOT=""
UUID_ROOT=""
PARTUUID_BOOT=""
PARTUUID_ROOT=""
-DEVICE_TRIM=""
-ALLOW_DISCARDS=""
+DEVICE_SATA=""
+DEVICE_NVME=""
CPU_INTEL=""
VIRTUALBOX=""
CMDLINE_LINUX_ROOT=""
CMDLINE_LINUX=""
ADDITIONAL_USER_NAMES_ARRAY=()
ADDITIONAL_USER_PASSWORDS_ARRAY=()
-MODULES=""
RED='\033[0;31m'
GREEN='\033[0;32m'
@@ -78,10 +78,24 @@ function configuration_install() {
source alis-recovery.conf
}
+function sanitize_variables() {
+ DEVICE=$(sanitize_variable "$DEVICE")
+}
+
+function sanitize_variable() {
+ VARIABLE=$1
+ VARIABLE=$(echo $VARIABLE | sed "s/![^ ]*//g") # remove disabled
+ VARIABLE=$(echo $VARIABLE | sed "s/ {2,}/ /g") # remove unnecessary white spaces
+ VARIABLE=$(echo $VARIABLE | sed 's/^[[:space:]]*//') # trim leading
+ VARIABLE=$(echo $VARIABLE | sed 's/[[:space:]]*$//') # trim trailing
+ echo "$VARIABLE"
+}
+
function check_variables() {
check_variables_value "KEYS" "$KEYS"
check_variables_value "DEVICE" "$DEVICE"
check_variables_boolean "LVM" "$LVM"
+ check_variables_equals "PARTITION_ROOT_ENCRYPTION_PASSWORD" "PARTITION_ROOT_ENCRYPTION_PASSWORD_RETYPE" "$PARTITION_ROOT_ENCRYPTION_PASSWORD" "$PARTITION_ROOT_ENCRYPTION_PASSWORD_RETYPE"
check_variables_value "PING_HOSTNAME" "$PING_HOSTNAME"
}
@@ -115,6 +129,17 @@ function check_variables_list() {
fi
}
+function check_variables_equals() {
+ NAME1=$1
+ NAME2=$2
+ VALUE1=$3
+ VALUE2=$4
+ if [ "$VALUE1" != "$VALUE2" ]; then
+ echo "$NAME1 and $NAME2 must be equal [$VALUE1, $VALUE2]."
+ exit
+ fi
+}
+
function check_variables_size() {
NAME=$1
SIZE_EXPECT=$2
@@ -130,7 +155,7 @@ function warning() {
echo ""
echo "Once finalized recovery tasks execute following commands: exit, umount -R /mnt, reboot."
echo ""
- read -p "Do you want to continue? [y/n] " yn
+ read -p "Do you want to continue? [y/N] " yn
case $yn in
[Yy]* )
;;
@@ -144,9 +169,14 @@ function warning() {
}
function init() {
+ init_log
loadkeys $KEYS
}
+function init_log() {
+ set -o xtrace
+}
+
function facts() {
if [ -d /sys/firmware/efi ]; then
BIOS_TYPE="uefi"
@@ -154,10 +184,12 @@ function facts() {
BIOS_TYPE="bios"
fi
- if [ -n "$(hdparm -I $DEVICE | grep TRIM)" ]; then
- DEVICE_TRIM="true"
- else
- DEVICE_TRIM="false"
+ DEVICE_SATA="false"
+ DEVICE_NVME="false"
+ if [ -n "$(echo $DEVICE | grep "^/dev/sda")" ]; then
+ DEVICE_SATA="true"
+ elif [ -n "$(echo $DEVICE | grep "^/dev/nvme")" ]; then
+ DEVICE_NVME="true"
fi
if [ -n "$(lscpu | grep GenuineIntel)" ]; then
@@ -183,9 +215,9 @@ function prepare_partition() {
cryptsetup close $LVM_VOLUME_LOGICAL
fi
fi
- if [ -e "/dev/mapper/$LVM_PHISICAL_VOLUME" ]; then
+ if [ -e "/dev/mapper/$LVM_VOLUME_PHISICAL" ]; then
if [ -n "$PARTITION_ROOT_ENCRYPTION_PASSWORD" ]; then
- cryptsetup close $LVM_PHISICAL_VOLUME
+ cryptsetup close $LVM_VOLUME_PHISICAL
fi
fi
}
@@ -213,46 +245,57 @@ function configure_network() {
function partition() {
if [ "$BIOS_TYPE" == "uefi" ]; then
- PARTITION_BOOT="/dev/sda1"
- PARTITION_ROOT="/dev/sda2"
- PARTITION_BOOT_NUMBER=1
- DEVICE_ROOT="/dev/sda2"
- DEVICE_ROOT_MAPPER="root"
+ if [ "$DEVICE_SATA" == "true" ]; then
+ PARTITION_BOOT="${DEVICE}1"
+ PARTITION_ROOT="${DEVICE}2"
+ #PARTITION_BOOT_NUMBER=1
+ DEVICE_ROOT="${DEVICE}2"
+ fi
+
+ if [ "$DEVICE_NVME" == "true" ]; then
+ PARTITION_BOOT="${DEVICE}p1"
+ PARTITION_ROOT="${DEVICE}p2"
+ #PARTITION_BOOT_NUMBER=1
+ DEVICE_ROOT="${DEVICE}p2"
+ fi
fi
if [ "$BIOS_TYPE" == "bios" ]; then
- PARTITION_BIOS="/dev/sda1"
- PARTITION_BOOT="/dev/sda2"
- PARTITION_ROOT="/dev/sda3"
- PARTITION_BOOT_NUMBER=2
- DEVICE_ROOT="/dev/sda3"
- DEVICE_ROOT_MAPPER="root"
- fi
-
- if [ "$LVM" == "true" ]; then
- DEVICE_ROOT_MAPPER="lvm"
+ if [ "$DEVICE_SATA" == "true" ]; then
+ PARTITION_BIOS="${DEVICE}1"
+ PARTITION_BOOT="${DEVICE}2"
+ PARTITION_ROOT="${DEVICE}3"
+ #PARTITION_BOOT_NUMBER=2
+ DEVICE_ROOT="${DEVICE}3"
+ fi
+
+ if [ "$DEVICE_NVME" == "true" ]; then
+ PARTITION_BIOS="${DEVICE}p1"
+ PARTITION_BOOT="${DEVICE}p2"
+ PARTITION_ROOT="${DEVICE}p3"
+ #PARTITION_BOOT_NUMBER=2
+ DEVICE_ROOT="${DEVICE}p3"
+ fi
fi
if [ -n "$PARTITION_ROOT_ENCRYPTION_PASSWORD" ]; then
- echo -n "$PARTITION_ROOT_ENCRYPTION_PASSWORD" | cryptsetup --key-file=- open $PARTITION_ROOT $DEVICE_ROOT_MAPPER
+ echo -n "$PARTITION_ROOT_ENCRYPTION_PASSWORD" | cryptsetup --key-file=- open $PARTITION_ROOT $LVM_VOLUME_PHISICAL
sleep 5
-
- DEVICE_ROOT="/dev/mapper/$DEVICE_ROOT_MAPPER"
fi
if [ "$LVM" == "true" ]; then
- DEVICE_ROOT_MAPPER="lvm-lvroot"
+ DEVICE_ROOT_MAPPER="$LVM_VOLUME_GROUP-$LVM_VOLUME_LOGICAL"
DEVICE_ROOT="/dev/mapper/$DEVICE_ROOT_MAPPER"
fi
- MOUNT_OPTIONS=""
+ PARTITION_OPTIONS=""
if [ "$DEVICE_TRIM" == "true" ]; then
- MOUNT_OPTIONS="defaults,noatime,discard"
+ PARTITION_OPTIONS="defaults,noatime"
fi
- mount -o "$MOUNT_OPTIONS" $DEVICE_ROOT /mnt
- mount -o "$MOUNT_OPTIONS" $PARTITION_BOOT /mnt/boot
+ mount -o "$PARTITION_OPTIONS" $DEVICE_ROOT /mnt
+ mount -o "$PARTITION_OPTIONS" $PARTITION_BOOT /mnt/boot
}
function recovery() {
@@ -261,6 +304,7 @@ function recovery() {
function main() {
configuration_install
+ sanitize_variables
check_variables
warning
init
diff --git a/alis.conf b/alis.conf
index faf3ce1..086f885 100644
--- a/alis.conf
+++ b/alis.conf
@@ -4,10 +4,12 @@ LOG="false"
# partition
DEVICE="/dev/sda !/dev/nvme0n1" # sata nvme
+DEVICE_TRIM="true"
LVM="true"
-PARTITION_ROOT_ENCRYPTION_PASSWORD="archlinux"
-FILE_SYSTEM_TYPE="ext4" # ext4 btrfs xfs
-SWAP_SIZE="" # 2GiB 4GiB 8GiB (not supported in btrfs)
+PARTITION_ROOT_ENCRYPTION_PASSWORD="archlinux" # Warning: change it!
+PARTITION_ROOT_ENCRYPTION_PASSWORD_RETYPE="archlinux"
+FILE_SYSTEM_TYPE="ext4 !btrfs !xfs"
+SWAP_SIZE="!2GiB !4GiB !8GiB" # 2GiB 4GiB 8GiB (not supported in btrfs)
# network_install
WIFI_INTERFACE=""
@@ -31,10 +33,12 @@ FONT=""
FONT_MAP=""
HOSTNAME="archlinux"
ROOT_PASSWORD="archlinux" # Warning: change it!
+ROOT_PASSWORD_RETYPE="archlinux"
# user
USER_NAME="picodotdev"
-USER_PASSWORD="archlinux"
+USER_PASSWORD="archlinux" # Warning: change it!
+USER_PASSWORD_RETYPE="archlinux"
ADDITIONAL_USER_NAMES="" # list separated by space
ADDITIONAL_USER_PASSWORDS="" # list separated by space
@@ -53,7 +57,7 @@ DISPLAY_DRIVER_HARDWARE_ACCELERATION_INTEL="!intel-media-driver !libva-intel-dri
# packages (precede package name with ! for not install)
PACKAGES_PACMAN_INTERNET="!firefox !chromium !apache !nginx !curl !wget !filezilla !sshfs !openssh !transmission-gtk !transmission-qt !amule !geary !thunderbird !empathy !kopete !polari !konversation !liferea !hugo !gnome-boxes"
PACKAGES_PACMAN_MULTIMEDIA="!gthumb !gimp !imagemagick !krita !inkscape !blender !cmus !vlc !easytag !ardour !audacity !ffmpeg !gnome-phone-manager !kdeconnect !gstreamer !gst-plugins-good !gst-plugins-bad !gst-plugins-ugly !bluez !bluez-utils"
-PACKAGES_PACMAN_UTILITIES="!code !eclipse-java !intellij-idea-community-edition !gradle !maven lz4 !meld !dosfstools !ntfs-3g !exfat-utils"
+PACKAGES_PACMAN_UTILITIES="!gnome-initial-setup !code !eclipse-java !intellij-idea-community-edition !gradle !maven !lz4 !meld !dosfstools !ntfs-3g !exfat-utils"
PACKAGES_PACMAN_DOCUMENTS_AND_TEXT="!libreoffice-fresh !calligra !discount !lyx !vim !calibre"
PACKAGES_PACMAN_SECURITY="!rsync !gnupg !keepassxc"
PACKAGES_PACMAN_SCIENCE="!geogebra !octave"
diff --git a/alis.sh b/alis.sh
index 422b54d..9b5348b 100644
--- a/alis.sh
+++ b/alis.sh
@@ -58,7 +58,6 @@ PARTUUID_BOOT=""
PARTUUID_ROOT=""
DEVICE_SATA=""
DEVICE_NVME=""
-DEVICE_TRIM=""
CPU_INTEL=""
VIRTUALBOX=""
CMDLINE_LINUX_ROOT=""
@@ -80,6 +79,8 @@ function configuration_install() {
function sanitize_variables() {
DEVICE=$(sanitize_variable "$DEVICE")
+ FILE_SYSTEM_TYPE=$(sanitize_variable "$FILE_SYSTEM_TYPE")
+ SWAP_SIZE=$(sanitize_variable "$SWAP_SIZE")
KERNELS=$(sanitize_variable "$KERNELS")
KERNELS_COMPRESSION=$(sanitize_variable "$KERNELS_COMPRESSION")
DESKTOP_ENVIRONMENT=$(sanitize_variable "$DESKTOP_ENVIRONMENT")
@@ -104,6 +105,7 @@ function check_variables() {
check_variables_boolean "LOG" "$LOG"
check_variables_value "DEVICE" "$DEVICE"
check_variables_boolean "LVM" "$LVM"
+ check_variables_equals "PARTITION_ROOT_ENCRYPTION_PASSWORD" "PARTITION_ROOT_ENCRYPTION_PASSWORD_RETYPE" "$PARTITION_ROOT_ENCRYPTION_PASSWORD" "$PARTITION_ROOT_ENCRYPTION_PASSWORD_RETYPE"
check_variables_list "FILE_SYSTEM_TYPE" "$FILE_SYSTEM_TYPE" "ext4 btrfs xfs"
check_variables_value "PING_HOSTNAME" "$PING_HOSTNAME"
check_variables_value "PACMAN_MIRROR" "$PACMAN_MIRROR"
@@ -116,6 +118,8 @@ function check_variables() {
check_variables_value "HOSTNAME" "$HOSTNAME"
check_variables_value "USER_NAME" "$USER_NAME"
check_variables_value "USER_PASSWORD" "$USER_PASSWORD"
+ check_variables_equals "ROOT_PASSWORD" "ROOT_PASSWORD_RETYPE" "$ROOT_PASSWORD" "$ROOT_PASSWORD_RETYPE"
+ check_variables_equals "USER_PASSWORD" "USER_PASSWORD_RETYPE" "$USER_PASSWORD" "$USER_PASSWORD_RETYPE"
check_variables_size "ADDITIONAL_USER_PASSWORDS" "${#ADDITIONAL_USER_NAMES_ARRAY[@]}" "${#ADDITIONAL_USER_PASSWORDS_ARRAY[@]}"
check_variables_list "BOOTLOADER" "$BOOTLOADER" "grub refind systemd"
check_variables_list "AUR" "$AUR" "aurman yay"
@@ -158,6 +162,17 @@ function check_variables_list() {
fi
}
+function check_variables_equals() {
+ NAME1=$1
+ NAME2=$2
+ VALUE1=$3
+ VALUE2=$4
+ if [ "$VALUE1" != "$VALUE2" ]; then
+ echo "$NAME1 and $NAME2 must be equal [$VALUE1, $VALUE2]."
+ exit
+ fi
+}
+
function check_variables_size() {
NAME=$1
SIZE_EXPECT=$2
@@ -175,7 +190,7 @@ function warning() {
echo -e "${RED}This script deletes all partitions of the persistent${NC}"
echo -e "${RED}storage and continuing all your data in it will be lost.${NC}"
echo ""
- read -p "Do you want to continue? [y/n] " yn
+ read -p "Do you want to continue? [y/N] " yn
case $yn in
[Yy]* )
;;
@@ -189,6 +204,10 @@ function warning() {
}
function init() {
+ echo ""
+ echo -e "${LIGHT_BLUE}# init() step${NC}"
+ echo ""
+
init_log
loadkeys $KEYS
}
@@ -202,6 +221,10 @@ function init_log() {
}
function facts() {
+ echo ""
+ echo -e "${LIGHT_BLUE}# facts() step${NC}"
+ echo ""
+
if [ -d /sys/firmware/efi ]; then
BIOS_TYPE="uefi"
else
@@ -214,12 +237,6 @@ function facts() {
ASCIINEMA="false"
fi
- if [ -n "$(hdparm -I $DEVICE | grep TRIM)" ]; then
- DEVICE_TRIM="true"
- else
- DEVICE_TRIM="false"
- fi
-
DEVICE_SATA="false"
DEVICE_NVME="false"
if [ -n "$(echo $DEVICE | grep "^/dev/sda")" ]; then
@@ -247,8 +264,12 @@ function check_facts() {
}
function prepare() {
- prepare_partition
+ echo ""
+ echo -e "${LIGHT_BLUE}# prepare() step${NC}"
+ echo ""
+
configure_time
+ prepare_partition
configure_network
}
@@ -300,6 +321,10 @@ function configure_network() {
}
function partition() {
+ echo ""
+ echo -e "${LIGHT_BLUE}# partition() step${NC}"
+ echo ""
+
sgdisk --zap-all $DEVICE
wipefs -a $DEVICE
@@ -309,7 +334,9 @@ function partition() {
PARTITION_ROOT="${DEVICE}2"
#PARTITION_BOOT_NUMBER=1
DEVICE_ROOT="${DEVICE}2"
- elif [ "$DEVICE_NVME" == "true" ]; then
+ fi
+
+ if [ "$DEVICE_NVME" == "true" ]; then
PARTITION_BOOT="${DEVICE}p1"
PARTITION_ROOT="${DEVICE}p2"
#PARTITION_BOOT_NUMBER=1
@@ -330,7 +357,9 @@ function partition() {
PARTITION_ROOT="${DEVICE}3"
#PARTITION_BOOT_NUMBER=2
DEVICE_ROOT="${DEVICE}3"
- elif [ "$DEVICE_NVME" == "true" ]; then
+ fi
+
+ if [ "$DEVICE_NVME" == "true" ]; then
PARTITION_BIOS="${DEVICE}p1"
PARTITION_BOOT="${DEVICE}p2"
PARTITION_ROOT="${DEVICE}p3"
@@ -346,7 +375,7 @@ function partition() {
fi
if [ -n "$PARTITION_ROOT_ENCRYPTION_PASSWORD" ]; then
- echo -n "$PARTITION_ROOT_ENCRYPTION_PASSWORD" | cryptsetup --key-size=512 --key-file=- luksFormat $PARTITION_ROOT
+ echo -n "$PARTITION_ROOT_ENCRYPTION_PASSWORD" | cryptsetup --key-size=512 --key-file=- luksFormat --type luks2 $PARTITION_ROOT
echo -n "$PARTITION_ROOT_ENCRYPTION_PASSWORD" | cryptsetup --key-file=- open $PARTITION_ROOT $LVM_VOLUME_PHISICAL
sleep 5
fi
@@ -401,6 +430,10 @@ function partition() {
}
function install() {
+ echo ""
+ echo -e "${LIGHT_BLUE}# install() step${NC}"
+ echo ""
+
if [ -n "$PACMAN_MIRROR" ]; then
echo "Server=$PACMAN_MIRROR" > /etc/pacman.d/mirrorlist
fi
@@ -418,6 +451,10 @@ function install() {
}
function kernels() {
+ echo ""
+ echo -e "${LIGHT_BLUE}# kernels() step${NC}"
+ echo ""
+
pacman_install "linux-headers"
if [ -n "$KERNELS" ]; then
pacman_install "$KERNELS"
@@ -425,6 +462,10 @@ function kernels() {
}
function configuration() {
+ echo ""
+ echo -e "${LIGHT_BLUE}# configuration() step${NC}"
+ echo ""
+
genfstab -U /mnt >> /mnt/etc/fstab
if [ -n "$SWAP_SIZE" -a "$FILE_SYSTEM_TYPE" != "btrfs" ]; then
@@ -454,11 +495,19 @@ function configuration() {
}
function network() {
+ echo ""
+ echo -e "${LIGHT_BLUE}# network() step${NC}"
+ echo ""
+
pacman_install "networkmanager"
arch-chroot /mnt systemctl enable NetworkManager.service
}
function virtualbox() {
+ echo ""
+ echo -e "${LIGHT_BLUE}# virtualbox() step${NC}"
+ echo ""
+
if [ -z "$KERNELS" ]; then
pacman_install "virtualbox-guest-utils virtualbox-guest-modules-arch"
else
@@ -467,8 +516,12 @@ function virtualbox() {
}
function mkinitcpio() {
- MODULES=""
+ echo ""
+ echo -e "${LIGHT_BLUE}# mkinitcpio() step${NC}"
+ echo ""
+
if [ "$KMS" == "true" ]; then
+ MODULES=""
case "$DISPLAY_DRIVER" in
"intel" )
MODULES="i915"
@@ -490,12 +543,12 @@ function mkinitcpio() {
fi
if [ "$LVM" == "true" -a -n "$PARTITION_ROOT_ENCRYPTION_PASSWORD" ]; then
- arch-chroot /mnt sed -i 's/ block / keyboard keymap block /' /etc/mkinitcpio.conf
+ arch-chroot /mnt sed -i 's/ block / block keyboard keymap /' /etc/mkinitcpio.conf
arch-chroot /mnt sed -i 's/ filesystems keyboard / encrypt lvm2 filesystems /' /etc/mkinitcpio.conf
elif [ "$LVM" == "true" ]; then
arch-chroot /mnt sed -i 's/ filesystems / lvm2 filesystems /' /etc/mkinitcpio.conf
elif [ -n "$PARTITION_ROOT_ENCRYPTION_PASSWORD" ]; then
- arch-chroot /mnt sed -i 's/ block / keyboard keymap block /' /etc/mkinitcpio.conf
+ arch-chroot /mnt sed -i 's/ block / block keyboard keymap /' /etc/mkinitcpio.conf
arch-chroot /mnt sed -i 's/ filesystems keyboard / encrypt filesystems /' /etc/mkinitcpio.conf
fi
@@ -507,6 +560,10 @@ function mkinitcpio() {
}
function bootloader() {
+ echo ""
+ echo -e "${LIGHT_BLUE}# bootloader() step${NC}"
+ echo ""
+
BOOTLOADER_ALLOW_DISCARDS=""
if [ "$CPU_INTEL" == "true" -a "$VIRTUALBOX" != "true" ]; then
@@ -680,18 +737,23 @@ function systemd() {
echo "Exec = /usr/bin/bootctl update" >> /mnt/etc/pacman.d/hooks/systemd-boot.hook
SYSTEMD_MICROCODE=""
+ SYSTEMD_OPTIONS=""
if [ "$CPU_INTEL" == "true" -a "$VIRTUALBOX" != "true" ]; then
SYSTEMD_MICROCODE="/intel-ucode.img"
fi
+ if [ -n "$PARTITION_ROOT_ENCRYPTION_PASSWORD" ]; then
+ SYSTEMD_OPTIONS="rd.luks.options=discard"
+ fi
+
echo "title Arch Linux" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux.conf"
echo "efi /vmlinuz-linux" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux.conf"
if [ -n "$SYSTEMD_MICROCODE" ]; then
echo "initrd $SYSTEMD_MICROCODE" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux.conf"
fi
echo "initrd /initramfs-linux.img" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux.conf"
- echo "options initrd=initramfs-linux.img $CMDLINE_LINUX_ROOT rw $CMDLINE_LINUX" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux.conf"
+ echo "options initrd=initramfs-linux.img $CMDLINE_LINUX_ROOT rw $CMDLINE_LINUX $SYSTEMD_OPTIONS" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux.conf"
echo "title Arch Linux (fallback)" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-fallback.conf"
echo "efi /vmlinuz-linux" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-fallback.conf"
@@ -699,7 +761,7 @@ function systemd() {
echo "initrd $SYSTEMD_MICROCODE" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-fallback.conf"
fi
echo "initrd /initramfs-linux-fallback.img" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-fallback.conf"
- echo "options initrd=initramfs-linux-fallback.img $CMDLINE_LINUX_ROOT rw $CMDLINE_LINUX" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-fallback.conf"
+ echo "options initrd=initramfs-linux-fallback.img $CMDLINE_LINUX_ROOT rw $CMDLINE_LINUX $SYSTEMD_OPTIONS" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-fallback.conf"
if [[ $KERNELS =~ .*linux-lts.* ]]; then
echo "title Arch Linux (lts)" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-lts.conf"
@@ -708,7 +770,7 @@ function systemd() {
echo "initrd $SYSTEMD_MICROCODE" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux.conf"
fi
echo "initrd /initramfs-linux-lts.img" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-lts.conf"
- echo "options initrd=initramfs-linux-lts.img $CMDLINE_LINUX_ROOT rw $CMDLINE_LINUX" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-lts.conf"
+ echo "options initrd=initramfs-linux-lts.img $CMDLINE_LINUX_ROOT rw $CMDLINE_LINUX $SYSTEMD_OPTIONS" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-lts.conf"
echo "title Arch Linux (lts-fallback)" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-lts-fallback.conf"
echo "efi /vmlinuz-linux-lts" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-lts-fallback.conf"
@@ -716,7 +778,7 @@ function systemd() {
echo "initrd $SYSTEMD_MICROCODE" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-lts-fallback.conf"
fi
echo "initrd /initramfs-linux-lts-fallback.img" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-lts-fallback.conf"
- echo "options initrd=initramfs-linux-lts-fallback.img $CMDLINE_LINUX_ROOT rw $CMDLINE_LINUX" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-lts-fallback.conf"
+ echo "options initrd=initramfs-linux-lts-fallback.img $CMDLINE_LINUX_ROOT rw $CMDLINE_LINUX $SYSTEMD_OPTIONS" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-lts-fallback.conf"
fi
if [[ $KERNELS =~ .*linux-hardened.* ]]; then
@@ -726,7 +788,7 @@ function systemd() {
echo "initrd $SYSTEMD_MICROCODE" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux.conf"
fi
echo "initrd /initramfs-linux-hardened.img" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-hardened.conf"
- echo "options initrd=initramfs-linux-hardened.img $CMDLINE_LINUX_ROOT rw $CMDLINE_LINUX" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-hardened.conf"
+ echo "options initrd=initramfs-linux-hardened.img $CMDLINE_LINUX_ROOT rw $CMDLINE_LINUX $SYSTEMD_OPTIONS" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-hardened.conf"
echo "title Arch Linux (hardened-fallback)" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-hardened-fallback.conf"
echo "efi /vmlinuz-linux-hardened" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-hardened-fallback.conf"
@@ -734,7 +796,7 @@ function systemd() {
echo "initrd $SYSTEMD_MICROCODE" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-hardened-fallback.conf"
fi
echo "initrd /initramfs-linux-hardened-fallback.img" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-hardened-fallback.conf"
- echo "options initrd=initramfs-linux-hardened-fallback.img $CMDLINE_LINUX_ROOT rw $CMDLINE_LINUX" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-hardened-fallback.conf"
+ echo "options initrd=initramfs-linux-hardened-fallback.img $CMDLINE_LINUX_ROOT rw $CMDLINE_LINUX $SYSTEMD_OPTIONS" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-hardened-fallback.conf"
fi
if [[ $KERNELS =~ .*linux-zen.* ]]; then
@@ -744,7 +806,7 @@ function systemd() {
echo "initrd $SYSTEMD_MICROCODE" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux.conf"
fi
echo "initrd /initramfs-linux-zen.img" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-zen.conf"
- echo "options initrd=initramfs-linux-zen.img $CMDLINE_LINUX_ROOT rw $CMDLINE_LINUX" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-zen.conf"
+ echo "options initrd=initramfs-linux-zen.img $CMDLINE_LINUX_ROOT rw $CMDLINE_LINUX $SYSTEMD_OPTIONS" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-zen.conf"
echo "title Arch Linux (zen-fallback)" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-zen-fallback.conf"
echo "efi /vmlinuz-linux-zen" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-zen-fallback.conf"
@@ -752,7 +814,7 @@ function systemd() {
echo "initrd $SYSTEMD_MICROCODE" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-zen-fallback.conf"
fi
echo "initrd /initramfs-linux-zen-fallback.img" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-zen-fallback.conf"
- echo "options initrd=initramfs-linux-zen-fallback.img $CMDLINE_LINUX_ROOT rw $CMDLINE_LINUX" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-zen-fallback.conf"
+ echo "options initrd=initramfs-linux-zen-fallback.img $CMDLINE_LINUX_ROOT rw $CMDLINE_LINUX $SYSTEMD_OPTIONS" >> "/mnt$ESP_DIRECTORY/loader/entries/archlinux-zen-fallback.conf"
fi
if [ "$VIRTUALBOX" == "true" ]; then
@@ -771,6 +833,10 @@ function users() {
}
function create_user() {
+ echo ""
+ echo -e "${LIGHT_BLUE}# create_user() step${NC}"
+ echo ""
+
USER_NAME=$1
USER_PASSWORD=$2
arch-chroot /mnt useradd -m -G wheel,storage,optical -s /bin/bash $USER_NAME
@@ -778,6 +844,10 @@ function create_user() {
}
function desktop_environment() {
+ echo ""
+ echo -e "${LIGHT_BLUE}# desktop_environment() step${NC}"
+ echo ""
+
PACKAGES_DRIVER=""
PACKAGES_DDX=""
PACKAGES_VULKAN=""
@@ -909,6 +979,10 @@ function desktop_environment_lxde() {
}
function packages() {
+ echo ""
+ echo -e "${LIGHT_BLUE}# packages() step${NC}"
+ echo ""
+
if [ "$FILE_SYSTEM_TYPE" == "btrfs" ]; then
pacman_install "btrfs-progs"
fi
@@ -950,6 +1024,7 @@ function terminate() {
function end() {
if [ "$REBOOT" == "true" ]; then
+ echo ""
echo -e "${GREEN}Arch Linux installed successfully"'!'"${NC}"
echo ""