diff options
| -rw-r--r-- | molecule/default/converge.yml | 2 | ||||
| -rw-r--r-- | roles/bootstrap/README.md | 5 | ||||
| -rw-r--r-- | roles/bootstrap/tasks/install-archlinux.yml | 28 |
3 files changed, 33 insertions, 2 deletions
diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index fe07d49..75790b7 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -15,7 +15,7 @@ fstype: "vfat" fstype_opts: "-F 32" dev: "{{ partition_disk }}p1" - mount_path: "/mnt/boot" + mount_path: "/mnt/boot/efi" fstab_opts: "defaults,nodev,nosuid,noexec,umask=0077" partition_swap: num: 2 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" |
