Change systemd mkinitcpio hook back to udev if using the encrypt hook.

This commit is contained in:
myve 2026-08-06 08:48:01 +00:00
commit 5c400f42ad
2 changed files with 18 additions and 3 deletions

19
arch.sh
View file

@ -359,7 +359,13 @@ function encryptHook
# Pacman hook
install /dev/stdin /mnt/opt/local/hooks/mkinitcpio.conf <<- hook
#!/usr/bin/env bash
grep '^HOOKS' /etc/mkinitcpio.conf | sed -e "s/filesystems/zfs &/" -e "s/ fsck//" -e "s/block/& ${1}/" >/etc/mkinitcpio.conf.d/zz-hooks.conf
grep '^HOOKS' /etc/mkinitcpio.conf |\\
sed -e "s/filesystems/zfs &/" \\
-e "s/ fsck//" \\
-e "s/block/& ${1}/" \\
-e "s/systemd/udev/" \\
-e "s/sd-vconsole/consolefont/" \\
>/etc/mkinitcpio.conf.d/zz-hooks.conf
sed -e "s|%PKGBASE%|${linux_kernel}|g" \\
-e "s/^fallback/#&/g" \\
@ -372,7 +378,11 @@ function encryptHook
# Pacman hook
install /dev/stdin /mnt/opt/local/hooks/mkinitcpio.conf <<- hook
#!/usr/bin/env bash
grep '^HOOKS' /etc/mkinitcpio.conf | sed "s/block/& ${1}/" >/etc/mkinitcpio.conf.d/zz-hooks.conf
grep '^HOOKS' /etc/mkinitcpio.conf |\\
sed -e "s/block/& ${1}/" \\
-e "s/systemd/udev/" \\
-e "s/sd-vconsole/consolefont/" \\
>/etc/mkinitcpio.conf.d/zz-hooks.conf
sed -e "s|%PKGBASE%|${linux_kernel}|g" \\
-e "s/^fallback/#&/g" \\
@ -382,6 +392,11 @@ function encryptHook
;;
esac
# Remove systemd hook
sed -e "s/systemd/udev/" \
-e "s/sd-vconsole/consolefont/" \
-i /mnt/etc/mkinitcpio.conf.d/zz-hooks.conf
cat >/mnt/etc/pacman.d/hooks/85-mkinitcpio.hook <<- mkinitcpio
[Trigger]
Operation = Install

View file

@ -550,7 +550,7 @@ case ${desktop_choice} in
swayidle
# Config
curl --silent --fail https://raw.githubusercontent.com/hyprwm/Hyprland/refs/heads/main/example/hyprland.conf |\
curl --silent --fail https://raw.githubusercontent.com/hyprwm/Hyprland/refs/heads/main/example/hyprland.lua |\
sed -e '/Autostart/i exec-once = /usr/lib/polkit-kde-authentication-agent-1' \
-e '/Autostart/i exec-once = waybar -c ~/.config/waybar/waybar.conf' \
-e '/Autostart/i exec-once = ~/.config/hypr/scripts/sleep.sh' \