feat: cleanup

This commit is contained in:
ange 2025-06-21 06:30:06 +00:00
parent 92f562a03e
commit 649806d52d
Signed by: ange
GPG key ID: 9E0C4157BB7BEB1D
11 changed files with 212 additions and 64 deletions

View file

@ -9,11 +9,11 @@ sgdisk -Z \
esp=/dev/disk/by-partlabel/esp
root=/dev/disk/by-partlabel/root
[ -n "$disk_passwd" ] && {
if [ -n "$disk_passwd" ]; then
echo -n "$disk_passwd" | cryptsetup luksFormat "$root" -
cryptsetup open "$root" cryptroot - <<< "$disk_passwd"
root=/dev/mapper/cryptroot
}
fi
sleep 5 # wait /dev/disk/by-partlabel/
@ -26,13 +26,13 @@ UUID=$(blkid "$root" -ovalue -sUUID) / ext4 rw,relatime 0 1
UUID=$(blkid "$esp" -ovalue -sUUID) /efi vfat rw,fmask=0077,dmask=0077,noauto 0 2
EOF
[ -n "$swapfile" ] && {
if [ -n "$swapfile" ]; then
dd if=/dev/zero of=/mnt/swapfile bs=1M count="$swapfile" status=progress
chmod 600 /mnt/swapfile
mkswap /mnt/swapfile
swapon /mnt/swapfile
echo "/swapfile none swap defaults 0 0" >> /mnt/etc/fstab
}
fi
cp -rfTv rootfs/ /mnt/

View file

@ -7,10 +7,9 @@ case "$(lscpu)" in
*) ;;
esac
[ -s modules/chroot/flatpak.txt ] \
&& printf '%s\n' flatpak xdg-desktop-portal-gtk >> pkglist.txt
[ -d /sys/class/power_supply/BAT0 ] && echo tlp >> pkglist.txt
if [ -d /sys/class/power_supply/BAT0 ]; then
echo tlp >> pkglist.txt
fi
echo "$shell" >> pkglist.txt
pacstrap -C rootfs/etc/pacman.conf -K /mnt \

View file

@ -5,10 +5,10 @@ root="$(findmnt -n -osource /)"
boot="$(lsblk -ls -oname /dev/disk/by-partlabel/boot | tail -n1)"
cryptdev="$(cryptsetup status "$root" | awk '/device/ {print $2}')"
[ -n "$cryptdev" ] && {
if [ -n "$cryptdev" ]; then
uuid="$(blkid | grep "$cryptdev" | awk '{print $2}')"
options="cryptdevice=$uuid:${root##*/} "
}
fi
options="${options}root=$root rw"

View file

@ -4,5 +4,7 @@
shell="$(sed -n "/$shell/{p;q}" /etc/shells)"
useradd -mG wheel,video "$username" -s "${shell:-/bin/bash}"
[ -n "$rootpasswd" ] && echo "root:$rootpasswd" | chpasswd
if [ -n "$rootpasswd" ]; then
echo "root:$rootpasswd" | chpasswd
fi
echo "$username:$userpasswd" | chpasswd

View file

@ -1,5 +0,0 @@
#!/bin/bash
#shellcheck disable=SC2154
[ -s /chroot/flatpak.txt ] \
&& xargs flatpak install -y --noninteractive < /chroot/flatpak.txt

View file

@ -5,10 +5,9 @@ BOLD=$'\e[1m'
GREEN=$'\e[32m'
NORMAL=$'\e[0m'
echo "${BOLD}${GREEN}DONE. Umount? [Y/n]${NORMAL} " && read -r ANS
case "$ANS" in
''|[Yy]*) ;;
*) exit ;;
esac
read -rp "${BOLD}${GREEN}DONE. Umount? [Y/n]${NORMAL} " ANS
if ! [[ "${ANS,}" =~ ^$|^y ]]; then
exit
fi
umount -R /mnt/

View file

@ -7,31 +7,24 @@ printf '%s\n' \
alacritty \
bluez{,-utils} \
feh \
firefox{,-ublock-origin} \
gammastep \
imagemagick ghostscript \
materia-gtk-theme papirus-icon-theme \
materia-gtk-theme \
monero \
mpv \
noto-fonts{,-cjk,-emoji} otf-font-awesome \
pass{,-otp} gcr \
pcmanfm-gtk3 \
pipewire{,-pulse,-jack} pavucontrol playerctl \
pass-otp gcr \
pipewire{-pulse,-jack} playerctl \
polkit-gnome \
qemu-{base,audio-pipewire,hw-usb-host,hw-display-virtio-{gpu,vga},ui-gtk} dnsmasq \
qemu-{base,audio-pipewire,hw-usb-host,hw-display-virtio-{gpu,vga},ui-gtk} dnsmasq usbutils \
udisks2 \
xdg-user-dirs \
xdg-utils xdg-user-dirs \
yt-dlp \
zathura{,-pdf-poppler} \
zathura-pdf-poppler \
zenity \
>> pkglist.txt
printf '%s\n' \
com.valvesoftware.Steam \
org.gimp.GIMP \
org.gtk.Gtk3theme.Materia-dark \
org.mozilla.firefox \
>> modules/chroot/flatpak.txt
case "$(lspci | grep 'VGA\|3D')" in
*AMD*) echo vulkan-radeon mesa >> pkglist.txt ;;
*Intel*) echo vulkan-intel intel-media-driver >> pkglist.txt ;;