From 58809a38cc999fc697bd3094f4575953c602ee2e Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Thu, 16 Sep 2021 00:40:31 +0200 Subject: improve compatibility with more bioses for debian usb installer --- roles/installer/debian/usb/tasks/main.yml | 28 ++++------------------ .../installer/debian/usb/templates/syslinux.cfg.j2 | 4 ++-- 2 files changed, 6 insertions(+), 26 deletions(-) (limited to 'roles/installer/debian/usb') diff --git a/roles/installer/debian/usb/tasks/main.yml b/roles/installer/debian/usb/tasks/main.yml index 491cde3d..ced56372 100644 --- a/roles/installer/debian/usb/tasks/main.yml +++ b/roles/installer/debian/usb/tasks/main.yml @@ -69,33 +69,11 @@ src: "{{ debian_installer_target_dir }}/linux" dest: "{{ usb_install_path }}/" -- name: create BIOS boot directory +- name: generate syslinux configuration 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: "../" - template: - src: syslinux.cfg.j2 - dest: "{{ usb_install_path }}/bios/syslinux.cfg" - -- name: create EFI boot directory - run_once: true - file: - path: "{{ usb_install_path }}/EFI/boot" - state: directory - -- name: generate syslinux configuration for UEFI boot - run_once: true - vars: - syslinux_base_path: "../../" template: src: syslinux.cfg.j2 - dest: "{{ usb_install_path }}/EFI/boot/syslinux.cfg" + dest: "{{ usb_install_path }}/syslinux.cfg" - name: make the USB disk bootable pause: @@ -106,6 +84,7 @@ $ sudo apt install mbr syslinux $ sudo install-mbr /dev/CHANGEME + $ mkdir -p {{ (usb_install_path, 'bios/') | path_join }} $ sudo syslinux -i /dev/CHANGEME1 -d bios $ sudo fdisk /dev/CHANGEME [Here, make sure partition 1 is marked bootable.] @@ -114,6 +93,7 @@ for UEFI these steps need to be done $ sudo apt install syslinux-efi + $ mkdir -p {{ (usb_install_path, 'EFI/boot/') | path_join }} $ cp /usr/lib/syslinux/modules/efi64/* {{ (usb_install_path, 'EFI/boot/') | path_join }} $ cp /usr/lib/SYSLINUX.EFI/efi64/syslinux.efi {{ (usb_install_path, 'EFI/boot/bootx64.efi') | path_join }} diff --git a/roles/installer/debian/usb/templates/syslinux.cfg.j2 b/roles/installer/debian/usb/templates/syslinux.cfg.j2 index 40c877d2..badb7e81 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 {{ syslinux_base_path }}linux - INITRD {{ syslinux_base_path }}initrd.{{ host }}.gz + KERNEL linux + INITRD initrd.{{ host }}.gz APPEND auto fb=false {{ (hostvars[host].install_cooked.kernel_cmdline | default([])) | join(' ') }} {% endfor %} -- cgit v1.2.3