forked from dataprolet/ArchISO
Compare commits
6 Commits
Author | SHA1 | Date |
---|---|---|
proledatarian | d4a33ac16f | |
proledatarian | 1c6dfb1b3a | |
proledatarian | 763df9f34a | |
dataprolet | f6f36503cf | |
dataprolet | 45a72353b0 | |
dataprolet | 4d002ebf47 |
|
@ -0,0 +1,28 @@
|
||||||
|
## Custom Arch Linux ISO Creator
|
||||||
|
|
||||||
|
This script creates a custom Arch Linux ISO using _archiso_.
|
||||||
|
|
||||||
|
### Features
|
||||||
|
- installs _archiso_ if not installed
|
||||||
|
- creates working directory _~/.archiso_
|
||||||
|
- cleans working directory before
|
||||||
|
- writes output into logfile
|
||||||
|
- creates non-root user using your systems global $USER variable
|
||||||
|
- creates a password for the user
|
||||||
|
- adds user to sudoers and wheel group
|
||||||
|
- boots into KDE Plasma using SDDM and auto-logins your user (X11)
|
||||||
|
- contains Firefox and Konsole
|
||||||
|
-
|
||||||
|
|
||||||
|
### Customizablility
|
||||||
|
- add packages to the $pkgs array
|
||||||
|
- change between releng and baseline profile
|
||||||
|
- change username
|
||||||
|
-
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
Just execute the script:
|
||||||
|
|
||||||
|
```
|
||||||
|
./archiso.sh
|
||||||
|
```
|
|
@ -3,7 +3,6 @@
|
||||||
### https://wiki.archlinux.org/title/Archiso
|
### https://wiki.archlinux.org/title/Archiso
|
||||||
|
|
||||||
set -eou pipefail
|
set -eou pipefail
|
||||||
set -x
|
|
||||||
|
|
||||||
# Test if archiso is installed
|
# Test if archiso is installed
|
||||||
if ! pacman -Qs archiso > /dev/null; then
|
if ! pacman -Qs archiso > /dev/null; then
|
||||||
|
@ -25,10 +24,26 @@ logfile="${logdir}/$(date +%Y-%m-%d_%H:%M).log"
|
||||||
exec >> >(tee -i "${logfile}")
|
exec >> >(tee -i "${logfile}")
|
||||||
exec 2>&1
|
exec 2>&1
|
||||||
|
|
||||||
# Ask password for ISO user
|
### Customization
|
||||||
pw_hash=$(openssl passwd -6)
|
|
||||||
|
|
||||||
# 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="releng"
|
||||||
#profile="baseline"
|
#profile="baseline"
|
||||||
|
|
||||||
|
@ -38,18 +53,20 @@ profile="releng"
|
||||||
# baseline is a minimal configuration, that includes only the bare minimum
|
# baseline is a minimal configuration, that includes only the bare minimum
|
||||||
# packages required to boot the live environment from the medium.
|
# packages required to boot the live environment from the medium.
|
||||||
|
|
||||||
|
# Ask password for ISO user
|
||||||
|
pw_hash=$(openssl passwd -6)
|
||||||
|
|
||||||
# Define directories
|
# Define directories
|
||||||
dir="/home/$USER/.archiso"
|
dir="/home/$USER/.archiso"
|
||||||
prof_dir="${dir}/${profile}"
|
prof_dir="${dir}/${profile}"
|
||||||
pkgs_file="${prof_dir}/packages.x86_64"
|
pkgs_file="${prof_dir}/packages.x86_64"
|
||||||
#workdir="${dir}/.tmp"
|
|
||||||
workdir="/tmp/archiso"
|
workdir="/tmp/archiso"
|
||||||
root_etc="${prof_dir}/airootfs/etc"
|
root_etc="${prof_dir}/airootfs/etc"
|
||||||
|
|
||||||
# Delete old profile
|
# Delete old profile
|
||||||
sudo rm -rf ${prof_dir}
|
err sudo rm -rf "${prof_dir}"
|
||||||
sudo rm -rf ${dir}/output/*
|
err sudo rm -rf ${dir}/output/*
|
||||||
sudo rm -rf ${dir}/.tmp/*
|
err sudo rm -rf ${workdir}
|
||||||
|
|
||||||
# Copy new profile template
|
# Copy new profile template
|
||||||
# https://wiki.archlinux.org/title/Archiso#Prepare_a_custom_profile
|
# https://wiki.archlinux.org/title/Archiso#Prepare_a_custom_profile
|
||||||
|
@ -59,14 +76,6 @@ cp -r "/usr/share/archiso/configs/${profile}" "${dir}"
|
||||||
# https://wiki.archlinux.org/title/Archiso#Selecting_packages
|
# https://wiki.archlinux.org/title/Archiso#Selecting_packages
|
||||||
touch "${pkgs_file}"
|
touch "${pkgs_file}"
|
||||||
|
|
||||||
declare -a pkgs=(
|
|
||||||
firefox
|
|
||||||
konsole
|
|
||||||
plasma-desktop
|
|
||||||
sddm
|
|
||||||
sddm-kcm
|
|
||||||
)
|
|
||||||
|
|
||||||
for pkg in "${pkgs[@]}"; do
|
for pkg in "${pkgs[@]}"; do
|
||||||
echo "${pkg}" >> "${pkgs_file}"
|
echo "${pkg}" >> "${pkgs_file}"
|
||||||
done
|
done
|
||||||
|
@ -76,15 +85,20 @@ done
|
||||||
ln -s /usr/lib/systemd/system/sddm.service \
|
ln -s /usr/lib/systemd/system/sddm.service \
|
||||||
"${root_etc}/systemd/system/display-manager.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
|
# Autologin config
|
||||||
# https://wiki.archlinux.org/title/Archiso#Changing_automatic_login
|
# https://wiki.archlinux.org/title/Archiso#Changing_automatic_login
|
||||||
mkdir "${root_etc}/sddm.conf.d"
|
mkdir "${root_etc}/sddm.conf.d"
|
||||||
cat << EOF > "${root_etc}/sddm.conf.d/autologin.conf"
|
cat << EOF > "${root_etc}/sddm.conf.d/autologin.conf"
|
||||||
[Autologin]
|
[Autologin]
|
||||||
Relogin=false
|
Relogin=false
|
||||||
Session=plasmax11
|
Session=${session}
|
||||||
User=$USER
|
User=${USER}
|
||||||
|
|
||||||
[Theme]
|
[Theme]
|
||||||
Current=breeze
|
Current=breeze
|
||||||
CursorTheme=Breeze_Light
|
CursorTheme=Breeze_Light
|
||||||
|
@ -108,17 +122,34 @@ echo "${USER}":x:1000: >> "${root_etc}/group"
|
||||||
echo root:!*::root > "${root_etc}/gshadow"
|
echo root:!*::root > "${root_etc}/gshadow"
|
||||||
echo "${USER}":!*:: >> "${root_etc}/gshadow"
|
echo "${USER}":!*:: >> "${root_etc}/gshadow"
|
||||||
|
|
||||||
sed -i '27s/.*/ ["\/etc\/gshadow"]="0:0:0400"/' "$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 ")" >> "${HOME}/.archiso/releng/profiledef.sh"
|
||||||
|
|
||||||
echo "%wheel ALL=(ALL) ALL" > "${root_etc}/sudoers"
|
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
|
# Create image
|
||||||
mkdir -p "${workdir}"
|
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}"
|
||||||
|
|
||||||
exit 0
|
# 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
|
||||||
|
|
||||||
# To-Dos
|
exit 0
|
||||||
# - NetworkManager?
|
|
||||||
# - SDDM Loginscreen?
|
|
Loading…
Reference in New Issue