From ab59d4594202172caf6d2ba05cf27712f84e8a94 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sun, 3 Jul 2022 02:44:36 +0700 Subject: all: use predefined files to configure boot loader --- build-arch-gce | 32 ++++++++--------------------- sys/efi/loader/entries/arch.conf | 4 ++++ sys/efi/loader/loader.conf | 2 ++ sys/etc/pacman.d/hooks/00-systemd-boot.hook | 9 ++++++++ 4 files changed, 23 insertions(+), 24 deletions(-) create mode 100644 sys/efi/loader/entries/arch.conf create mode 100644 sys/efi/loader/loader.conf create mode 100644 sys/etc/pacman.d/hooks/00-systemd-boot.hook diff --git a/build-arch-gce b/build-arch-gce index 8881ed7..f0922ff 100755 --- a/build-arch-gce +++ b/build-arch-gce @@ -177,32 +177,16 @@ arch-chroot -- "$mount_dir" /bin/bash -s <<-'EOS' echo '-- Running boot loader.' bootctl install --no-variables --quiet - - echo '-- Configuring boot loader.' - cat <<-'EOF' > /boot/loader/loader.conf - default arch.conf - editor no - EOF - cat <<-'EOF' > /boot/loader/entries/arch.conf - title Arch Linux - linux /vmlinuz-linux - initrd /initramfs-linux.img - options rw console=ttyS0,38400n8 net.ifnames=0 scsi_mod.use_blk_mq=Y - EOF - mkdir -p -- "/etc/pacman.d/hooks" - cat <<-'EOF' > /etc/pacman.d/hooks/00-systemd-boot.hook - [Trigger] - Type = Package - Operation = Upgrade - Target = systemd - - [Action] - Description = Gracefully upgrading systemd-boot... - When = PostTransaction - Exec = /usr/bin/systemctl restart systemd-boot-update.service - EOF EOS +echo '- Configuring boot loader.' +cp ./sys/efi/loader/loader.conf $mount_dir/boot/loader/ +cp ./sys/efi/loader/entries/arch.conf $mount_dir/boot/loader/entries/ + +echo '- Configuring pacman hooks.' +mkdir -p -- "$mount_dir/etc/pacman.d/hooks" +cp ./sys/etc/pacman.d/hooks/00-systemd-boot.hook $mount_dir/etc/pacman.d/hooks/ + echo '- Cleaning up and finalizing the image.' > "$mount_dir/etc/machine-id" rm -- "$mount_dir/var/log/pacman.log" diff --git a/sys/efi/loader/entries/arch.conf b/sys/efi/loader/entries/arch.conf new file mode 100644 index 0000000..3f36b44 --- /dev/null +++ b/sys/efi/loader/entries/arch.conf @@ -0,0 +1,4 @@ +title Arch Linux +linux /vmlinuz-linux +initrd /initramfs-linux.img +options rw console=ttyS0,38400n8 net.ifnames=0 scsi_mod.use_blk_mq=Y diff --git a/sys/efi/loader/loader.conf b/sys/efi/loader/loader.conf new file mode 100644 index 0000000..6c5641d --- /dev/null +++ b/sys/efi/loader/loader.conf @@ -0,0 +1,2 @@ +default arch.conf +editor no diff --git a/sys/etc/pacman.d/hooks/00-systemd-boot.hook b/sys/etc/pacman.d/hooks/00-systemd-boot.hook new file mode 100644 index 0000000..d65c027 --- /dev/null +++ b/sys/etc/pacman.d/hooks/00-systemd-boot.hook @@ -0,0 +1,9 @@ +[Trigger] +Type = Package +Operation = Upgrade +Target = systemd + +[Action] +Description = Gracefully upgrading systemd-boot... +When = PostTransaction +Exec = /usr/bin/systemctl restart systemd-boot-update.service -- cgit v1.3