Skip to content

Commit

Permalink
fewer chroot calls
Browse files Browse the repository at this point in the history
  • Loading branch information
punoko committed Aug 4, 2024
1 parent 4121133 commit 594a07a
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ SERVICES=(

paccache.timer
)
MASK=(
systemd-nsresourced.socket
systemd-userdbd.socket
)

# Cleanup
cleanup() {
Expand Down Expand Up @@ -103,7 +107,8 @@ pacstrap -cGM "$MOUNT" "${PACKAGES[@]}"
# compress & noatime are set by cmdline
# Not specifying `rw` in cmdline breaks boot
CMDLINE="rootflags=$ROOT_FLAGS rw"
arch-chroot "$MOUNT" systemd-firstboot \
systemd-firstboot \
--root="$MOUNT" \
--force \
--keymap=us \
--locale=C.UTF-8 \
Expand All @@ -113,7 +118,7 @@ arch-chroot "$MOUNT" systemd-firstboot \
;

# Bootloader
arch-chroot "$MOUNT" bootctl install --no-variables
bootctl install --root "$MOUNT" --no-variables

rm -f "$MOUNT"/boot/initramfs-linux{,-fallback}.img
mv "$MOUNT/etc/mkinitcpio.d/linux."{preset,original}
Expand Down Expand Up @@ -211,8 +216,10 @@ ln -sf /usr/bin/nvim "$MOUNT/usr/local/bin/vim"
ln -sf /usr/bin/nvim "$MOUNT/usr/local/bin/vi"

# Services
arch-chroot "$MOUNT" /usr/bin/systemctl enable "${SERVICES[@]}"
arch-chroot "$MOUNT" /usr/bin/systemctl mask systemd-nsresourced.socket systemd-userdbd.socket
arch-chroot "$MOUNT" <<EOF
systemctl enable "${SERVICES[@]}"
systemctl mask "${MASK[@]}"
EOF
ln -sf /run/systemd/resolve/stub-resolv.conf "$MOUNT/etc/resolv.conf"

# Pacman config
Expand Down

0 comments on commit 594a07a

Please sign in to comment.