From 11b35cdf388dd74d68377db117f4290e42d9318b Mon Sep 17 00:00:00 2001 From: ange Date: Sat, 25 May 2024 18:01:11 +0200 Subject: [PATCH] fix: flatpak not installing + services fails --- modules/base.sh | 21 ++++++++++----------- modules/chroot/00-bootstrap.sh | 2 +- modules/chroot/20-users.sh | 2 +- modules/chroot/30-services.sh | 15 +++++++-------- modules/chroot/40-flatpak.sh | 2 +- modules/desktop.sh | 2 +- modules/postchroot/99-done.sh | 1 - modules/prechroot/20-pkg.sh | 8 ++++---- 8 files changed, 25 insertions(+), 28 deletions(-) diff --git a/modules/base.sh b/modules/base.sh index 5b7e241..e52aca6 100644 --- a/modules/base.sh +++ b/modules/base.sh @@ -1,22 +1,21 @@ #!/bin/bash #shellcheck disable=SC2154 -for i in ./modules/prechroot/*.sh; do +for i in modules/prechroot/*.sh; do bash -x "$i" done -cp -r ./modules/chroot/ /mnt/ -(cd ./modules/ || exit - for i in ./chroot/*.sh; do - arch-chroot /mnt/ bash -x "/$i" - done +cp -r modules/chroot/ /mnt/ - for i in ./chroot/user/*.sh; do - arch-chroot /mnt/ su - "$username" -c "bash -x '/$i'" - done -) +for i in modules/chroot/*.sh; do + arch-chroot /mnt bash -x "${i/modules/}" +done -for i in ./modules/postchroot/*.sh; do +for i in modules/chroot/user/*.sh; do + arch-chroot /mnt su - "$username" -c "bash -x '${i/modules/}'" +done + +for i in modules/postchroot/*.sh; do bash -x "$i" done diff --git a/modules/chroot/00-bootstrap.sh b/modules/chroot/00-bootstrap.sh index a93ea0d..7a0e284 100644 --- a/modules/chroot/00-bootstrap.sh +++ b/modules/chroot/00-bootstrap.sh @@ -6,7 +6,7 @@ hwclock --systohc while read -r l; do sed -i "/^#\s*$l.UTF-8/s/^#\s*//" /etc/locale.gen -done < <(sed 's/,/\n/g' "$locales") +done <<< "${locales//,/$'\n'}" locale-gen echo "LANG=$lang.UTF-8" > /etc/locale.conf diff --git a/modules/chroot/20-users.sh b/modules/chroot/20-users.sh index a119502..89844d7 100644 --- a/modules/chroot/20-users.sh +++ b/modules/chroot/20-users.sh @@ -4,5 +4,5 @@ shell="$(sed -n "/$shell/{p;q}" /etc/shells)" useradd -mG wheel,video "$username" -s "${shell:-/bin/bash}" -echo "root:$rootpasswd" | chpasswd +echo "root:$rootpasswd" | chpasswd echo "$username:$userpasswd" | chpasswd diff --git a/modules/chroot/30-services.sh b/modules/chroot/30-services.sh index f8ff234..196724a 100644 --- a/modules/chroot/30-services.sh +++ b/modules/chroot/30-services.sh @@ -1,11 +1,10 @@ #!/bin/bash #shellcheck disable=SC2154 -systemctl enable \ - iwd.service \ - nftables.service \ - reflector.timer \ - systemd-networkd.service \ - systemd-resolved.service \ - systemd-timesyncd.service \ - tlp.service +systemctl enable iwd.service +systemctl enable nftables.service +systemctl enable reflector.timer +systemctl enable systemd-networkd.service +systemctl enable systemd-resolved.service +systemctl enable systemd-timesyncd.service +systemctl enable tlp.service diff --git a/modules/chroot/40-flatpak.sh b/modules/chroot/40-flatpak.sh index f3f6a96..2c9a367 100644 --- a/modules/chroot/40-flatpak.sh +++ b/modules/chroot/40-flatpak.sh @@ -1,4 +1,4 @@ #!/bin/bash #shellcheck disable=SC2154 -[ -s flatpak.txt ] && xargs flatpak install -y < flatpak.txt +[ -s /chroot/flatpak.txt ] && xargs flatpak install -y < /chroot/flatpak.txt diff --git a/modules/desktop.sh b/modules/desktop.sh index b0cf1e3..8d3f373 100644 --- a/modules/desktop.sh +++ b/modules/desktop.sh @@ -31,7 +31,7 @@ printf '%s\n' \ org.gimp.GIMP \ org.gtk.Gtk3theme.Materia-dark \ org.mozilla.firefox \ - >> flatpak.txt + >> modules/chroot/flatpak.txt case "$(lspci | grep 'VGA\|3D')" in *AMD*) echo vulkan-radeon >> pkglist.txt ;; diff --git a/modules/postchroot/99-done.sh b/modules/postchroot/99-done.sh index a2569b1..511b5e8 100644 --- a/modules/postchroot/99-done.sh +++ b/modules/postchroot/99-done.sh @@ -6,7 +6,6 @@ GREEN=$'\e[32m' NORMAL=$'\e[0m' echo "${BOLD}${GREEN}DONE. Umount? [Y/n]${NORMAL} " && read -r ANS - case "$ANS" in ''|[Yy]*) ;; *) exit ;; diff --git a/modules/prechroot/20-pkg.sh b/modules/prechroot/20-pkg.sh index c1cb733..e91dff6 100644 --- a/modules/prechroot/20-pkg.sh +++ b/modules/prechroot/20-pkg.sh @@ -2,17 +2,17 @@ #shellcheck disable=SC2154 case "$(lscpu)" in - *AMD*) echo amd-ucode >> pkglist.txt ;; + *AMD*) echo amd-ucode >> pkglist.txt ;; *Intel*) echo intel-ucode >> pkglist.txt ;; *) ;; esac -[ -s "$flatpakpkg" ] \ +[ -s modules/chroot/flatpak.txt ] \ && printf '%s\n' flatpak xdg-desktop-portal-gtk >> pkglist.txt [ -f /sys/class/power_supply/BAT0 ] && echo tlp >> pkglist.txt -pacstrap -C rootfs/etc/pacman.conf -K /mnt/ \ +pacstrap -C rootfs/etc/pacman.conf -K /mnt \ base linux{,-lts,-firmware} "$shell" - < pkglist.txt -find /mnt/etc -name '*.pacnew' -delete +find /mnt/etc/ -name '*.pacnew' -delete