Restructure

This commit is contained in:
proledatarian 2024-08-19 15:38:48 +02:00
parent 42eccbdf95
commit 763df9f34a
1 changed files with 36 additions and 20 deletions

54
archiso.sh Normal file → Executable file
View File

@ -2,7 +2,7 @@
### https://wiki.archlinux.org/title/Archiso
set -eou pipefail
#set -eou pipefail
set -x
# Test if archiso is installed
@ -25,10 +25,26 @@ logfile="${logdir}/$(date +%Y-%m-%d_%H:%M).log"
exec >> >(tee -i "${logfile}")
exec 2>&1
# Ask password for ISO user
pw_hash=$(openssl passwd -6)
### Customization
# Profile to use
# 1. Username
#USER=""
# 2. Packages
declare -a pkgs=(
firefox
konsole
plasma-desktop
sddm
plasma-nm
networkmanager
)
# 3. Plasma session
session="plasmax11" # X11
#session="plasma" # Wayland
# 4. Profile to use
profile="releng"
#profile="baseline"
@ -38,18 +54,20 @@ profile="releng"
# baseline is a minimal configuration, that includes only the bare minimum
# packages required to boot the live environment from the medium.
# Ask password for ISO user
pw_hash=$(openssl passwd -6)
# Define directories
dir="/home/$USER/.archiso"
prof_dir="${dir}/${profile}"
pkgs_file="${prof_dir}/packages.x86_64"
#workdir="${dir}/.tmp"
workdir="/tmp/archiso"
root_etc="${prof_dir}/airootfs/etc"
# Delete old profile
sudo rm -rf ${prof_dir}
sudo rm -rf "${prof_dir}"
sudo rm -rf ${dir}/output/*
sudo rm -rf ${dir}/.tmp/*
sudo rm -rf ${workdir}/*
# Copy new profile template
# https://wiki.archlinux.org/title/Archiso#Prepare_a_custom_profile
@ -59,14 +77,6 @@ cp -r "/usr/share/archiso/configs/${profile}" "${dir}"
# https://wiki.archlinux.org/title/Archiso#Selecting_packages
touch "${pkgs_file}"
declare -a pkgs=(
firefox
konsole
plasma-desktop
sddm
sddm-kcm
)
for pkg in "${pkgs[@]}"; do
echo "${pkg}" >> "${pkgs_file}"
done
@ -76,14 +86,19 @@ done
ln -s /usr/lib/systemd/system/sddm.service \
"${root_etc}/systemd/system/display-manager.service"
# Enable NetworkManager
mkdir -p "${root_etc}/systemd/system/network-online.target.wants"
ln -s /usr/lib/systemd/system/NetworkManager.service \
"${root_etc}/systemd/system/network-online.target.wants/"
# Autologin config
# https://wiki.archlinux.org/title/Archiso#Changing_automatic_login
mkdir "${root_etc}/sddm.conf.d"
cat << EOF > "${root_etc}/sddm.conf.d/autologin.conf"
[Autologin]
Relogin=false
Session=plasmax11
User=$USER
Session=${session}
User=${USER}
[Theme]
Current=breeze
@ -117,8 +132,9 @@ echo "%wheel ALL=(ALL) ALL" > "${root_etc}/sudoers"
mkdir -p "${workdir}"
nice -n 19 ionice -c 3 sudo mkarchiso -w "${workdir}" -o "${dir}/output" "${prof_dir}"
notify-send -t 5000 'ArchISO' 'ISO created successfully.'
exit 0
# To-Dos
# - NetworkManager?
# - SDDM Loginscreen?
# - Locale DE