forked from dataprolet/Arch-Linux-Installer
Add trap, fix systemd-firstboot
This commit is contained in:
+17
-3
@@ -6,6 +6,14 @@ set -euo pipefail
|
||||
exec >> >(tee -i /tmp/install.log)
|
||||
exec 2>&1
|
||||
|
||||
function cleanup() {
|
||||
umount /mnt/boot
|
||||
umount /mnt/home
|
||||
umount /mnt
|
||||
cryptsetup close /dev/mapper/main
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
clear
|
||||
|
||||
# Friendly introduction
|
||||
@@ -333,12 +341,18 @@ arch-chroot "/mnt" hwclock --systohc # Set the Hardware Clock to the current Sy
|
||||
|
||||
# Set keymap, locale, timezone and hostname
|
||||
# https://wiki.archlinux.org/title/Systemd-firstboot
|
||||
rm /etc/{machine-id,localtime,hostname,shadow,locale.conf}
|
||||
service_dir="/mnt/etc/systemd/system/systemd-firstboot.service.d"
|
||||
mkdir "${service_dir}"
|
||||
|
||||
cat << EOF > /etc/systemd/system/systemd-firstboot.service.d/install.conf
|
||||
rootdir="/mnt"
|
||||
keymap="de-latin1-nodeadkeys"
|
||||
locale="en_US.UTF-8"
|
||||
timezone="Europe/Berlin"
|
||||
|
||||
cat << EOF > "${service_dir}/install.conf"
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=/usr/bin/systemd-firstboot --root=/mnt --keymap=de-latin1-nodeadkeys --locale=en_US.UTF-8 --timezone=Europe/Berlin --hostname="${host}"
|
||||
ExecStart=/usr/bin/systemd-firstboot --root="${rootdir}" --keymap="${keymap}" --locale="${locale}" --timezone="${timezone}" --hostname="${host}"
|
||||
|
||||
[Install]
|
||||
WantedBy=sysinit.target
|
||||
|
||||
Reference in New Issue
Block a user