From f721e9226c6da86b47b2188adedad82567ee0f03 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 22 Jul 2020 15:34:17 +0200 Subject: installer/usb: fix multi-install menu --- roles/installer/debian/usb/tasks/main.yml | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) (limited to 'roles/installer/debian/usb/tasks') diff --git a/roles/installer/debian/usb/tasks/main.yml b/roles/installer/debian/usb/tasks/main.yml index 7e603ed6..b9969677 100644 --- a/roles/installer/debian/usb/tasks/main.yml +++ b/roles/installer/debian/usb/tasks/main.yml @@ -12,15 +12,31 @@ msg: the path to the usb drive does not exist - name: download installer + run_once: true vars: debian_installer_distro: "{{ install_distro }}" debian_installer_codename: "{{ install_codename }}" debian_installer_arch: "{{ install.arch | default('amd64') }}" debian_installer_variant: netboot - run_once: true import_role: role: installer/debian/fetch +- name: find old initramfs images on usb drive + run_once: true + find: + path: "{{ usb_install_path }}" + pattern: "initrd.*.gz" + register: usb_install_old_intrd + +- name: remove old intramfs images from usb drive + run_once: true + loop: "{{ usb_install_old_intrd.files }}" + loop_control: + label: "{{ item.path }}" + file: + path: "{{ item.path }}" + state: absent + - block: - name: create temporary workdir tempfile: @@ -53,13 +69,19 @@ src: "{{ debian_installer_target_dir }}/linux" dest: "{{ usb_install_path }}/" +- name: create BIOS boot directory + run_once: true + file: + path: "{{ usb_install_path }}/bios" + state: directory + - name: generate syslinux configuration for BIOS boot run_once: true vars: - syslinux_base_path: "" + syslinux_base_path: "../" template: src: syslinux.cfg.j2 - dest: "{{ usb_install_path }}/syslinux.cfg" + dest: "{{ usb_install_path }}/bios/syslinux.cfg" - name: create EFI boot directory run_once: true @@ -84,9 +106,10 @@ $ sudo apt install mbr syslinux $ sudo install-mbr /dev/CHANGEME - $ sudo syslinux -i /dev/CHANGEME1 + $ sudo syslinux -i /dev/CHANGEME1 -d bios $ sudo fdisk /dev/CHANGEME [Here, make sure partition 1 is marked bootable.] + $ cp /usr/lib/syslinux/modules/bios/* {{ usb_install_path }}/bios/ for UEFI these steps need to be done -- cgit v1.2.3