From cf24e81b55c1e038f17d795ac103c58b7bd9b12c Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Sun, 21 Sep 2025 01:47:31 +0200 Subject: 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 --- roles/bootstrap/tasks/install-ubuntu.yml | 50 -------------------------------- roles/bootstrap/templates/ubuntu.conf.j2 | 4 --- 2 files changed, 54 deletions(-) delete mode 100644 roles/bootstrap/templates/ubuntu.conf.j2 (limited to 'roles') 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 -- cgit v1.2.3