summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2025-08-11 00:33:30 +0200
committerAhmed Abdelhalim <[email protected]>2025-08-11 00:33:30 +0200
commite63535c7a678565b966c6cea96a8fb20aca59026 (patch)
treeaf87eed9402b44b09e1be86f95ece2ece6082a43
parentd56f81f6d043cb6df7eb9fa01acae2678ff084ec (diff)
Use /mnt/boot/efi because it's easier on debian
-rw-r--r--molecule/default/converge.yml2
-rw-r--r--roles/bootstrap/README.md5
-rw-r--r--roles/bootstrap/tasks/install-archlinux.yml28
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"