From e63535c7a678565b966c6cea96a8fb20aca59026 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Mon, 11 Aug 2025 00:33:30 +0200 Subject: Use /mnt/boot/efi because it's easier on debian --- roles/bootstrap/README.md | 5 ++++- roles/bootstrap/tasks/install-archlinux.yml | 28 ++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) (limited to 'roles/bootstrap') diff --git a/roles/bootstrap/README.md b/roles/bootstrap/README.md index bd75297..29bfd51 100644 --- a/roles/bootstrap/README.md +++ b/roles/bootstrap/README.md @@ -32,7 +32,7 @@ For example, the following `archiso.local` and `ubuntuiso.local` diff shows how fstype: "vfat" fstype_opts: "-F 32" dev: "{{ partition_disk }}1" - mount_path: "/mnt/boot" + mount_path: "/mnt/boot/efi" fstab_opts: "defaults,nodev,nosuid,noexec,umask=0077" partition_swap: num: 2 @@ -86,3 +86,6 @@ sets the `partition_wipe` parameter to `true` in order to wipe the hard drive an while the other systems (`ubuntu` in the previous example) sets the `partition_wipe` to `false`. Otherwise, the hard drive will be wiped and repartitioned again. + +For Debian distros, it's simpler to mount the boot on `/boot/efi` to avoid issues with Debian distros kernel setup +(as Debian kernel setup uses linking which isn't allowed on vFAT file systems) diff --git a/roles/bootstrap/tasks/install-archlinux.yml b/roles/bootstrap/tasks/install-archlinux.yml index 1e4771a..5c746a8 100644 --- a/roles/bootstrap/tasks/install-archlinux.yml +++ b/roles/bootstrap/tasks/install-archlinux.yml @@ -36,6 +36,34 @@ - src: "archlinux.conf.j2" dest: "{{ mnt_boot_path }}/loader/entries/archlinux.conf" +- name: "Copy kernel to efi partition" + ansible.builtin.copy: + src: "{{ item }}" + dest: "{{ mnt_boot_path }}" + remote_src: true + mode: "0644" + with_items: + - "{{ mnt_root_path }}/boot/vmlinuz-linux" + - "{{ mnt_root_path }}/boot/initramfs-linux.img" + - "{{ mnt_root_path }}/boot/initramfs-linux-fallback.img" + +- name: "Configure pacman hook for updating kernel" + ansible.builtin.copy: + dest: "{{ mnt_root_path }}/etc/pacman.d/100-systemd-boot.hook" + mode: "0644" + content: | + [Trigger] + Type = Package + Operation = Upgrade + Target = linux + + [Action] + Description = Updating systemd-boot + When = PostTransaction + Exec = /usr/bin/cp /boot/vmlinuz-linux /boot/efi/vmlinuz-linux + Exec = /usr/bin/cp /boot/initramfs-linux.img /boot/efi/initramfs-linux.img + Exec = /usr/bin/cp /boot/initramfs-linux-fallback.img /boot/efi/initramfs-linux-fallback.img + - name: "Configure hostname in chroot" ansible.builtin.copy: dest: "{{ mnt_root_path }}/etc/hostname" -- cgit v1.2.3