This commit is contained in:
proledatarian 2024-08-23 16:25:42 +02:00
parent 1c6dfb1b3a
commit d4a33ac16f
1 changed files with 28 additions and 13 deletions

View File

@ -2,8 +2,7 @@
### https://wiki.archlinux.org/title/Archiso
#set -eou pipefail
set -x
set -eou pipefail
# Test if archiso is installed
if ! pacman -Qs archiso > /dev/null; then
@ -65,9 +64,9 @@ workdir="/tmp/archiso"
root_etc="${prof_dir}/airootfs/etc"
# Delete old profile
sudo rm -rf "${prof_dir}"
sudo rm -rf ${dir}/output/*
sudo rm -rf ${workdir}/*
err sudo rm -rf "${prof_dir}"
err sudo rm -rf ${dir}/output/*
err sudo rm -rf ${workdir}
# Copy new profile template
# https://wiki.archlinux.org/title/Archiso#Prepare_a_custom_profile
@ -123,18 +122,34 @@ echo "${USER}":x:1000: >> "${root_etc}/group"
echo root:!*::root > "${root_etc}/gshadow"
echo "${USER}":!*:: >> "${root_etc}/gshadow"
sed -i '27s/.*/ ["\/etc\/gshadow"]="0:0:0400"/' "$HOME/.archiso/releng/profiledef.sh"
echo ")" >> "$HOME/.archiso/releng/profiledef.sh"
sed -i '27s/.*/ ["\/etc\/gshadow"]="0:0:0400"/' "${HOME}/.archiso/releng/profiledef.sh"
echo ")" >> "${HOME}/.archiso/releng/profiledef.sh"
echo "%wheel ALL=(ALL) ALL" > "${root_etc}/sudoers"
# Change keyboard layout to German
echo "KEYMAP=de-latin1" > "${root_etc}/vconsole.conf"
mkdir -p "${root_etc}/X11/xorg.conf.d"
cat << EOF > "${root_etc}/X11/xorg.conf.d/00-keyboard.conf"
# Written by systemd-localed(8), read by systemd-localed and Xorg. It's
# probably wise not to edit this file manually. Use localectl(1) to
# instruct systemd-localed to update it.
Section "InputClass"
Identifier "system-keyboard"
MatchIsKeyboard "on"
Option "XkbLayout" "de"
EndSection
EOF
# Create image
mkdir -p "${workdir}"
nice -n 19 ionice -c 3 sudo mkarchiso -w "${workdir}" -o "${dir}/output" "${prof_dir}"
sudo mkarchiso -w "${workdir}" -o "${dir}/output" "${prof_dir}"
notify-send -t 5000 'ArchISO' 'ISO created successfully.'
# Notification
notify-send -t 5000 'ArchISO' 'ISO created successfully.' &&
if [[ -f /usr/share/sounds/ocean/stereo/dialog-information.oga ]]; then
pw-play /usr/share/sounds/ocean/stereo/dialog-information.oga
fi
exit 0
# To-Dos
# - Locale DE
exit 0