summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2025-09-21 01:47:31 +0200
committerAhmed Abdelhalim <[email protected]>2025-09-21 01:47:31 +0200
commitcf24e81b55c1e038f17d795ac103c58b7bd9b12c (patch)
tree97aa08aa166903c3a98a734e6519a9af97cb3609
parentf8201926ac38b2105601ab3759dd5e4089997b88 (diff)
Remove systemd-boot setup from ubuntu and leave it to the bootctl
Because installing gnome or other packages that updates the kernel ends up adding the same machine id boot, it's simpler to delegate the boot setup to the debian/ubuntu and don't clean it up or modify it
-rw-r--r--roles/bootstrap/tasks/install-ubuntu.yml50
-rw-r--r--roles/bootstrap/templates/ubuntu.conf.j24
2 files changed, 0 insertions, 54 deletions
diff --git a/roles/bootstrap/tasks/install-ubuntu.yml b/roles/bootstrap/tasks/install-ubuntu.yml
index f1c28d7..1b22c69 100644
--- a/roles/bootstrap/tasks/install-ubuntu.yml
+++ b/roles/bootstrap/tasks/install-ubuntu.yml
@@ -48,53 +48,3 @@
ansible.builtin.command:
cmd: "arch-chroot {{ mnt_root_path }} bootctl install"
changed_when: true
-
-- name: "Get machine-id"
- ansible.builtin.command:
- cmd: "cat {{ mnt_root_path }}/etc/machine-id"
- changed_when: false
- register: bootstrap_machine_id
-
-- name: "Get Kernel version"
- ansible.builtin.shell: |
- set -eo pipefail
- ls {{ mnt_root_path }}/boot/vmlinuz-* | sed 's/.*vmlinuz-//'
- args:
- executable: /usr/bin/bash
- changed_when: false
- register: bootstrap_kernel_version
-
-- name: "Create distro kernel directory"
- ansible.builtin.file:
- path: "{{ mnt_boot_path }}/{{ ansible_distribution | lower }}"
- state: "directory"
- mode: "0700"
-
-- name: "Copy kernel to efi partition"
- ansible.builtin.copy:
- src: "{{ item }}"
- dest: "{{ mnt_boot_path }}/{{ ansible_distribution | lower }}"
- remote_src: true
- mode: "0644"
- with_items:
- - "{{ mnt_root_path }}/boot/vmlinuz-{{ bootstrap_kernel_version.stdout }}"
- - "{{ mnt_root_path }}/boot/initrd.img-{{ bootstrap_kernel_version.stdout }}"
-
-- name: "Template systemd-boot files"
- ansible.builtin.template:
- src: "{{ item.src }}"
- dest: "{{ item.dest }}"
- mode: "0644"
- with_items:
- - src: "loader.conf.j2"
- dest: "{{ mnt_boot_path }}/loader/loader.conf"
- - src: "{{ ansible_distribution | lower }}.conf.j2"
- dest: "{{ mnt_boot_path }}/loader/entries/{{ ansible_distribution | lower }}.conf"
-
-- name: "Clean up debian kernel install"
- ansible.builtin.file:
- path: "{{ item }}"
- state: "absent"
- with_items:
- - "{{ mnt_boot_path }}/{{ bootstrap_machine_id.stdout }}"
- - "{{ mnt_boot_path }}/loader/entries/{{ bootstrap_machine_id.stdout }}-{{ bootstrap_kernel_version.stdout }}.conf"
diff --git a/roles/bootstrap/templates/ubuntu.conf.j2 b/roles/bootstrap/templates/ubuntu.conf.j2
deleted file mode 100644
index 4c8afa8..0000000
--- a/roles/bootstrap/templates/ubuntu.conf.j2
+++ /dev/null
@@ -1,4 +0,0 @@
-title Ubuntu 24.04
-linux /ubuntu/vmlinuz-{{ bootstrap_kernel_version.stdout }}
-initrd /ubuntu/initrd.img-{{ bootstrap_kernel_version.stdout }}
-options root=PARTLABEL={{ partition_root.name }} rw queit splash