summaryrefslogtreecommitdiff
path: root/roles/installer/debian
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2022-10-29 02:00:58 +0200
committerChristian Pointner <equinox@spreadspace.org>2022-10-29 02:00:58 +0200
commita16da9b55b796a4d2246314fb056f358f9baef15 (patch)
tree2baeaf880ebcf26b9e2fb396ac7aa489cdbf1ea1 /roles/installer/debian
parentMerge branch 'topic/kali-linux' (diff)
debian-installer: proper support hd-media varant for usb
Diffstat (limited to 'roles/installer/debian')
-rw-r--r--roles/installer/debian/fetch/vars/main.yml10
-rw-r--r--roles/installer/debian/usb/tasks/main.yml9
-rw-r--r--roles/installer/debian/usb/templates/syslinux.cfg.j22
-rw-r--r--roles/installer/debian/usb/vars/main.yml2
4 files changed, 19 insertions, 4 deletions
diff --git a/roles/installer/debian/fetch/vars/main.yml b/roles/installer/debian/fetch/vars/main.yml
index af02ac4b..bab96029 100644
--- a/roles/installer/debian/fetch/vars/main.yml
+++ b/roles/installer/debian/fetch/vars/main.yml
@@ -6,16 +6,22 @@ _debian_installer_variant_path_:
hd-media: "hd-media"
mini-iso: "netboot"
+_debian_installer_kernel_image_:
+ netboot: linux
+ hd-media: vmlinuz
+ mini-iso: linux
+
_debian_installer_variant_files_:
netboot:
- - linux
+ - "{{ _debian_installer_kernel_image_['netboot'] }}"
- initrd.gz
hd-media:
- - vmlinuz
+ - "{{ _debian_installer_kernel_image_['hd-media'] }}"
- initrd.gz
mini-iso:
- mini.iso
debian_installer_variant_path: "{{ _debian_installer_variant_path_[debian_installer_variant] }}"
+debian_installer_kernel_image: "{{ _debian_installer_kernel_image_[debian_installer_variant] }}"
debian_installer_variant_files: "{{ _debian_installer_variant_files_[debian_installer_variant] }}"
debian_installer_target_dir: "{{ installer_base_path }}/{{ debian_installer_distro }}-{{ debian_installer_codename }}/{{ debian_installer_arch }}-{{ debian_installer_variant }}"
diff --git a/roles/installer/debian/usb/tasks/main.yml b/roles/installer/debian/usb/tasks/main.yml
index 6beb0121..13219b8c 100644
--- a/roles/installer/debian/usb/tasks/main.yml
+++ b/roles/installer/debian/usb/tasks/main.yml
@@ -63,10 +63,17 @@
path: "{{ tmpdir.path }}"
state: absent
+- name: remove stale linux kernel image files
+ loop: "{{ debian_installer_usb_kernel_images_stale }}"
+ run_once: true
+ file:
+ path: "{{ usb_install_path }}/{{ item }}"
+ state: absent
+
- name: copy linux kernel image to the USB drive
run_once: true
copy:
- src: "{{ debian_installer_target_dir }}/linux"
+ src: "{{ debian_installer_target_dir }}/{{ debian_installer_kernel_image }}"
dest: "{{ usb_install_path }}/"
- name: generate syslinux configuration
diff --git a/roles/installer/debian/usb/templates/syslinux.cfg.j2 b/roles/installer/debian/usb/templates/syslinux.cfg.j2
index 79c9d78e..ec6ddcb6 100644
--- a/roles/installer/debian/usb/templates/syslinux.cfg.j2
+++ b/roles/installer/debian/usb/templates/syslinux.cfg.j2
@@ -19,7 +19,7 @@ MENU TITLE {{ install_distro }} / {{ install_codename }}
LABEL {{ host }}
MENU LABEL automated installer for {{ host }}
- KERNEL linux
+ KERNEL {{ debian_installer_kernel_image }}
INITRD initrd.{{ host }}.gz
APPEND auto fb=false {{ (hostvars[host].install.kernel_cmdline | default([])) | join(' ') }}
{% endfor %}
diff --git a/roles/installer/debian/usb/vars/main.yml b/roles/installer/debian/usb/vars/main.yml
new file mode 100644
index 00000000..de222269
--- /dev/null
+++ b/roles/installer/debian/usb/vars/main.yml
@@ -0,0 +1,2 @@
+---
+debian_installer_usb_kernel_images_stale: "{{ _debian_installer_kernel_image_ | dict2items | map(attribute='value') | unique | difference(debian_installer_kernel_image) | list }}"