Keep all SYSLINUX files in /syslinux

This gets rid of the duplicate ldlinux.c32 and the useless isolinux.cfg which only points to syslinux.cfg.

Implements https://gitlab.archlinux.org/archlinux/archiso/-/issues/46 .
This commit is contained in:
nl6720 2020-11-17 14:10:21 +02:00
parent 183ae52792
commit 863247d0a6
No known key found for this signature in database
GPG Key ID: 5CE88535E188D369
14 changed files with 64 additions and 130 deletions

View File

@ -9,7 +9,6 @@ An archiso profile consists of several configuration files and a directory for f
profile profile
|- airootfs/ |- airootfs/
|- efiboot/ |- efiboot/
|- isolinux/
|- syslinux/ |- syslinux/
|- packages.arch |- packages.arch
|- pacman.conf |- pacman.conf
@ -133,21 +132,13 @@ selected in **profiledef.sh**. It contains configuration for `systemd-boot
The *custom template identifiers* are **only** understood in the boot loader entry `.conf` files (i.e. **not** in The *custom template identifiers* are **only** understood in the boot loader entry `.conf` files (i.e. **not** in
`loader.conf`). `loader.conf`).
isolinux
--------
This directory is mandatory when the `bios.syslinux.eltorito` bootmode is selected in **profiledef.sh**.
It contains configuration for `isolinux <https://wiki.syslinux.org/wiki/index.php?title=ISOLINUX>`_ used in the resuling
image.
The *custom template identifiers* are understood in all `.cfg` files in this directory.
syslinux syslinux
-------- --------
This directory is mandatory when the `bios.syslinux.mbr` or the `bios.syslinux.eltorito` bootmodes are selected in This directory is mandatory when the `bios.syslinux.mbr` or the `bios.syslinux.eltorito` bootmodes are selected in
**profiledef.sh**. **profiledef.sh**.
It contains configuration files for `syslinux <https://wiki.syslinux.org/wiki/index.php?title=SYSLINUX>`_ or `pxelinux It contains configuration files for `syslinux <https://wiki.syslinux.org/wiki/index.php?title=SYSLINUX>`_ or `isolinux
<https://wiki.syslinux.org/wiki/index.php?title=ISOLINUX>`_ , or `pxelinux
<https://wiki.syslinux.org/wiki/index.php?title=PXELINUX>`_ used in the resuling image. <https://wiki.syslinux.org/wiki/index.php?title=PXELINUX>`_ used in the resuling image.
The *custom template identifiers* are understood in all `.cfg` files in this directory. The *custom template identifiers* are understood in all `.cfg` files in this directory.

View File

@ -372,33 +372,33 @@ _make_boot_on_iso9660() {
_msg_info "Done!" _msg_info "Done!"
} }
# Prepare /${install_dir}/boot/syslinux # Prepare /syslinux for booting from MBR
_make_bootmode_bios.syslinux.mbr() { _make_bootmode_bios.syslinux.mbr() {
_msg_info "Setting up SYSLINUX for BIOS booting from a disk..." _msg_info "Setting up SYSLINUX for BIOS booting from a disk..."
install -d -m 0755 -- "${isofs_dir}/${install_dir}/boot/syslinux" install -d -m 0755 -- "${isofs_dir}/syslinux"
for _cfg in "${profile}/syslinux/"*.cfg; do for _cfg in "${profile}/syslinux/"*.cfg; do
sed "s|%ARCHISO_LABEL%|${iso_label}|g; sed "s|%ARCHISO_LABEL%|${iso_label}|g;
s|%INSTALL_DIR%|${install_dir}|g; s|%INSTALL_DIR%|${install_dir}|g;
s|%ARCH%|${arch}|g" \ s|%ARCH%|${arch}|g" \
"${_cfg}" > "${isofs_dir}/${install_dir}/boot/syslinux/${_cfg##*/}" "${_cfg}" > "${isofs_dir}/syslinux/${_cfg##*/}"
done done
if [[ -e "${profile}/syslinux/splash.png" ]]; then if [[ -e "${profile}/syslinux/splash.png" ]]; then
install -m 0644 -- "${profile}/syslinux/splash.png" "${isofs_dir}/${install_dir}/boot/syslinux/" install -m 0644 -- "${profile}/syslinux/splash.png" "${isofs_dir}/syslinux/"
fi fi
install -m 0644 -- "${airootfs_dir}/usr/lib/syslinux/bios/"*.c32 "${isofs_dir}/${install_dir}/boot/syslinux/" install -m 0644 -- "${airootfs_dir}/usr/lib/syslinux/bios/"*.c32 "${isofs_dir}/syslinux/"
install -m 0644 -- "${airootfs_dir}/usr/lib/syslinux/bios/lpxelinux.0" "${isofs_dir}/${install_dir}/boot/syslinux/" install -m 0644 -- "${airootfs_dir}/usr/lib/syslinux/bios/lpxelinux.0" "${isofs_dir}/syslinux/"
install -m 0644 -- "${airootfs_dir}/usr/lib/syslinux/bios/memdisk" "${isofs_dir}/${install_dir}/boot/syslinux/" install -m 0644 -- "${airootfs_dir}/usr/lib/syslinux/bios/memdisk" "${isofs_dir}/syslinux/"
_run_once _make_boot_on_iso9660 _run_once _make_boot_on_iso9660
if [[ -e "${isofs_dir}/${install_dir}/boot/syslinux/hdt.c32" ]]; then if [[ -e "${isofs_dir}/syslinux/hdt.c32" ]]; then
install -d -m 0755 -- "${isofs_dir}/${install_dir}/boot/syslinux/hdt" install -d -m 0755 -- "${isofs_dir}/syslinux/hdt"
if [[ -e "${airootfs_dir}/usr/share/hwdata/pci.ids" ]]; then if [[ -e "${airootfs_dir}/usr/share/hwdata/pci.ids" ]]; then
gzip -c -9 "${airootfs_dir}/usr/share/hwdata/pci.ids" > \ gzip -c -9 "${airootfs_dir}/usr/share/hwdata/pci.ids" > \
"${isofs_dir}/${install_dir}/boot/syslinux/hdt/pciids.gz" "${isofs_dir}/syslinux/hdt/pciids.gz"
fi fi
find "${airootfs_dir}/usr/lib/modules" -name 'modules.alias' -print -exec gzip -c -9 '{}' ';' -quit > \ find "${airootfs_dir}/usr/lib/modules" -name 'modules.alias' -print -exec gzip -c -9 '{}' ';' -quit > \
"${isofs_dir}/${install_dir}/boot/syslinux/hdt/modalias.gz" "${isofs_dir}/syslinux/hdt/modalias.gz"
fi fi
# Add other aditional/extra files to ${install_dir}/boot/ # Add other aditional/extra files to ${install_dir}/boot/
@ -412,21 +412,14 @@ _make_bootmode_bios.syslinux.mbr() {
_msg_info "Done! SYSLINUX set up for BIOS booting from a disk successfully." _msg_info "Done! SYSLINUX set up for BIOS booting from a disk successfully."
} }
# Prepare /isolinux # Prepare /syslinux for El-Torito booting
_make_bootmode_bios.syslinux.eltorito() { _make_bootmode_bios.syslinux.eltorito() {
_msg_info "Setting up SYSLINUX for BIOS booting from an optical disc..." _msg_info "Setting up SYSLINUX for BIOS booting from an optical disc..."
install -d -m 0755 -- "${isofs_dir}/isolinux" install -d -m 0755 -- "${isofs_dir}/syslinux"
for _cfg in "${profile}/isolinux/"*".cfg"; do install -m 0644 -- "${airootfs_dir}/usr/lib/syslinux/bios/isolinux.bin" "${isofs_dir}/syslinux/"
sed "s|%ARCHISO_LABEL%|${iso_label}|g; install -m 0644 -- "${airootfs_dir}/usr/lib/syslinux/bios/isohdpfx.bin" "${isofs_dir}/syslinux/"
s|%INSTALL_DIR%|${install_dir}|g;
s|%ARCH%|${arch}|g" \
"${_cfg}" > "${isofs_dir}/isolinux/${_cfg##*/}"
done
install -m 0644 -- "${airootfs_dir}/usr/lib/syslinux/bios/isolinux.bin" "${isofs_dir}/isolinux/"
install -m 0644 -- "${airootfs_dir}/usr/lib/syslinux/bios/isohdpfx.bin" "${isofs_dir}/isolinux/"
install -m 0644 -- "${airootfs_dir}/usr/lib/syslinux/bios/ldlinux.c32" "${isofs_dir}/isolinux/"
# isolinux.cfg loads syslinux.cfg # ISOLINUX and SYSLINUX installation is shared
_run_once _make_bootmode_bios.syslinux.mbr _run_once _make_bootmode_bios.syslinux.mbr
_msg_info "Done! SYSLINUX set up for BIOS booting from an optical disc successfully." _msg_info "Done! SYSLINUX set up for BIOS booting from an optical disc successfully."
@ -573,34 +566,7 @@ _validate_requirements_bootmode_bios.syslinux.mbr() {
} }
_validate_requirements_bootmode_bios.syslinux.eltorito() { _validate_requirements_bootmode_bios.syslinux.eltorito() {
# Check if the syslinux package is in the package list _validate_requirements_bootmode_bios.syslinux.mbr
# shellcheck disable=SC2076
if [[ ! " ${pkg_list[*]} " =~ ' syslinux ' ]]; then
(( validation_error=validation_error+1 ))
_msg_error "Validating '${bootmode}': The 'syslinux' package is missing from the package list!" 0
fi
# Check if isolinux configuration files exist
if [[ ! -d "${profile}/isolinux" ]]; then
(( validation_error=validation_error+1 ))
_msg_error "Validating '${bootmode}': The '${profile}/isolinux' directory is missing!" 0
else
local cfgfile
for cfgfile in "${profile}/isolinux/"*'.cfg'; do
if [[ -e "${cfgfile}" ]]; then
break
else
(( validation_error=validation_error+1 ))
_msg_error "Validating '${bootmode}': No configuration file found in '${profile}/isolinux/'!" 0
fi
done
fi
# Check for optional packages
# shellcheck disable=SC2076
if [[ ! " ${pkg_list[*]} " =~ ' memtest86+ ' ]]; then
_msg_info "Validating '${bootmode}': 'memtest86+' is not in the package list. Memory testing will not be available from syslinux."
fi
} }
_validate_requirements_bootmode_uefi-x64.systemd-boot.esp() { _validate_requirements_bootmode_uefi-x64.systemd-boot.esp() {
@ -675,9 +641,9 @@ _validate_requirements_airootfs_image_type_ext4+squashfs() {
_add_xorrisofs_options_bios.syslinux.eltorito() { _add_xorrisofs_options_bios.syslinux.eltorito() {
xorrisofs_options+=( xorrisofs_options+=(
# El Torito boot image for x86 BIOS # El Torito boot image for x86 BIOS
'-eltorito-boot' 'isolinux/isolinux.bin' '-eltorito-boot' 'syslinux/isolinux.bin'
# El Torito boot catalog file # El Torito boot catalog file
'-eltorito-catalog' 'isolinux/boot.cat' '-eltorito-catalog' 'syslinux/boot.cat'
# Required options to boot with ISOLINUX # Required options to boot with ISOLINUX
'-no-emul-boot' '-boot-load-size' '4' '-boot-info-table' '-no-emul-boot' '-boot-load-size' '4' '-boot-info-table'
) )
@ -686,8 +652,8 @@ _add_xorrisofs_options_bios.syslinux.eltorito() {
# SYSLINUX MBR # SYSLINUX MBR
_add_xorrisofs_options_bios.syslinux.mbr() { _add_xorrisofs_options_bios.syslinux.mbr() {
xorrisofs_options+=( xorrisofs_options+=(
# SYSLINUX MBR bootstrap code; does not work without "-eltorito-boot isolinux/isolinux.bin" # SYSLINUX MBR bootstrap code; does not work without "-eltorito-boot syslinux/isolinux.bin"
'-isohybrid-mbr' "${isofs_dir}/isolinux/isohdpfx.bin" '-isohybrid-mbr' "${isofs_dir}/syslinux/isohdpfx.bin"
# When GPT is used, create an additional partition in the MBR (besides 0xEE) for sectors 01 (MBR # When GPT is used, create an additional partition in the MBR (besides 0xEE) for sectors 01 (MBR
# bootstrap code area) and mark it as bootable # bootstrap code area) and mark it as bootable
# This violates the UEFI specification, but may allow booting on some systems # This violates the UEFI specification, but may allow booting on some systems

View File

@ -1,9 +0,0 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
PATH /%INSTALL_DIR%/boot/syslinux/
DEFAULT loadconfig
LABEL loadconfig
CONFIG /%INSTALL_DIR%/boot/syslinux/syslinux.cfg
APPEND /%INSTALL_DIR%/

View File

@ -3,6 +3,6 @@
LABEL arch LABEL arch
MENU LABEL Arch Linux (x86_64, BIOS) MENU LABEL Arch Linux (x86_64, BIOS)
LINUX boot/%ARCH%/vmlinuz-linux LINUX /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-linux
INITRD boot/%ARCH%/initramfs-linux.img INITRD /%INSTALL_DIR%/boot/%ARCH%/initramfs-linux.img
APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL%

View File

@ -1,11 +1,11 @@
# #
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
UI boot/syslinux/menu.c32 UI menu.c32
MENU TITLE Arch Linux MENU TITLE Arch Linux
MENU CLEAR MENU CLEAR
DEFAULT arch DEFAULT arch
TIMEOUT 30 TIMEOUT 30
INCLUDE boot/syslinux/syslinux-linux.cfg INCLUDE syslinux-linux.cfg

View File

@ -1,9 +0,0 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
PATH /%INSTALL_DIR%/boot/syslinux/
DEFAULT loadconfig
LABEL loadconfig
CONFIG /%INSTALL_DIR%/boot/syslinux/archiso.cfg
APPEND /%INSTALL_DIR%/

View File

@ -1,14 +0,0 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
DEFAULT select
LABEL select
COM32 boot/syslinux/whichsys.c32
APPEND -pxe- pxe -sys- sys -iso- sys
LABEL pxe
CONFIG boot/syslinux/archiso_pxe.cfg
LABEL sys
CONFIG boot/syslinux/archiso_sys.cfg

View File

@ -2,9 +2,9 @@
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
SERIAL 0 38400 SERIAL 0 38400
UI boot/syslinux/vesamenu.c32 UI vesamenu.c32
MENU TITLE Arch Linux MENU TITLE Arch Linux
MENU BACKGROUND boot/syslinux/splash.png MENU BACKGROUND splash.png
MENU WIDTH 78 MENU WIDTH 78
MENU MARGIN 4 MENU MARGIN 4

View File

@ -7,8 +7,8 @@ Boot the Arch Linux install medium using NBD.
It allows you to install Arch Linux or perform system maintenance. It allows you to install Arch Linux or perform system maintenance.
ENDTEXT ENDTEXT
MENU LABEL Arch Linux install medium (x86_64, NBD) MENU LABEL Arch Linux install medium (x86_64, NBD)
LINUX boot/x86_64/vmlinuz-linux LINUX /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux
INITRD boot/intel-ucode.img,boot/amd-ucode.img,boot/x86_64/initramfs-linux.img INITRD /%INSTALL_DIR%/boot/intel-ucode.img,/%INSTALL_DIR%/boot/amd-ucode.img,/%INSTALL_DIR%/boot/x86_64/initramfs-linux.img
APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% archiso_nbd_srv=${pxeserver} checksum verify APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% archiso_nbd_srv=${pxeserver} checksum verify
SYSAPPEND 3 SYSAPPEND 3
@ -18,8 +18,8 @@ Boot the Arch Linux live medium using NFS.
It allows you to install Arch Linux or perform system maintenance. It allows you to install Arch Linux or perform system maintenance.
ENDTEXT ENDTEXT
MENU LABEL Arch Linux install medium (x86_64, NFS) MENU LABEL Arch Linux install medium (x86_64, NFS)
LINUX boot/x86_64/vmlinuz-linux LINUX /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux
INITRD boot/intel-ucode.img,boot/amd-ucode.img,boot/x86_64/initramfs-linux.img INITRD /%INSTALL_DIR%/boot/intel-ucode.img,/%INSTALL_DIR%/amd-ucode.img,/%INSTALL_DIR%/boot/x86_64/initramfs-linux.img
APPEND archisobasedir=%INSTALL_DIR% archiso_nfs_srv=${pxeserver}:/run/archiso/bootmnt checksum verify APPEND archisobasedir=%INSTALL_DIR% archiso_nfs_srv=${pxeserver}:/run/archiso/bootmnt checksum verify
SYSAPPEND 3 SYSAPPEND 3
@ -29,7 +29,7 @@ Boot the Arch Linux live medium using HTTP.
It allows you to install Arch Linux or perform system maintenance. It allows you to install Arch Linux or perform system maintenance.
ENDTEXT ENDTEXT
MENU LABEL Arch Linux install medium (x86_64, HTTP) MENU LABEL Arch Linux install medium (x86_64, HTTP)
LINUX boot/x86_64/vmlinuz-linux LINUX /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux
INITRD boot/intel-ucode.img,boot/amd-ucode.img,boot/x86_64/initramfs-linux.img INITRD /%INSTALL_DIR%/boot/intel-ucode.img,/%INSTALL_DIR%/boot/amd-ucode.img,/%INSTALL_DIR%/boot/x86_64/initramfs-linux.img
APPEND archisobasedir=%INSTALL_DIR% archiso_http_srv=http://${pxeserver}/ checksum verify APPEND archisobasedir=%INSTALL_DIR% archiso_http_srv=http://${pxeserver}/ checksum verify
SYSAPPEND 3 SYSAPPEND 3

View File

@ -1,8 +1,8 @@
# #
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
INCLUDE boot/syslinux/archiso_head.cfg INCLUDE archiso_head.cfg
INCLUDE boot/syslinux/archiso_pxe-linux.cfg INCLUDE archiso_pxe-linux.cfg
INCLUDE boot/syslinux/archiso_tail.cfg INCLUDE archiso_tail.cfg

View File

@ -7,8 +7,8 @@ Boot the Arch Linux install medium on BIOS.
It allows you to install Arch Linux or perform system maintenance. It allows you to install Arch Linux or perform system maintenance.
ENDTEXT ENDTEXT
MENU LABEL Arch Linux install medium (x86_64, BIOS) MENU LABEL Arch Linux install medium (x86_64, BIOS)
LINUX boot/x86_64/vmlinuz-linux LINUX /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux
INITRD boot/intel-ucode.img,boot/amd-ucode.img,boot/x86_64/initramfs-linux.img INITRD /%INSTALL_DIR%/boot/intel-ucode.img,/%INSTALL_DIR%/boot/amd-ucode.img,/%INSTALL_DIR%/boot/x86_64/initramfs-linux.img
APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL%
# Accessibility boot option # Accessibility boot option
@ -18,6 +18,6 @@ Boot the Arch Linux install medium on BIOS with speakup screen reader.
It allows you to install Arch Linux or perform system maintenance with speech feedback. It allows you to install Arch Linux or perform system maintenance with speech feedback.
ENDTEXT ENDTEXT
MENU LABEL Arch Linux install medium (x86_64, BIOS) with ^speech MENU LABEL Arch Linux install medium (x86_64, BIOS) with ^speech
LINUX boot/x86_64/vmlinuz-linux LINUX /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux
INITRD boot/intel-ucode.img,boot/amd-ucode.img,boot/x86_64/initramfs-linux.img INITRD /%INSTALL_DIR%/boot/intel-ucode.img,/%INSTALL_DIR%/boot/amd-ucode.img,/%INSTALL_DIR%/boot/x86_64/initramfs-linux.img
APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% accessibility=on APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% accessibility=on

View File

@ -1,11 +1,11 @@
# #
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
INCLUDE boot/syslinux/archiso_head.cfg INCLUDE archiso_head.cfg
DEFAULT arch64 DEFAULT arch64
TIMEOUT 150 TIMEOUT 150
INCLUDE boot/syslinux/archiso_sys-linux.cfg INCLUDE archiso_sys-linux.cfg
INCLUDE boot/syslinux/archiso_tail.cfg INCLUDE archiso_tail.cfg

View File

@ -7,19 +7,19 @@ Boot an existing operating system.
Press TAB to edit the disk and partition number to boot. Press TAB to edit the disk and partition number to boot.
ENDTEXT ENDTEXT
MENU LABEL Boot existing OS MENU LABEL Boot existing OS
COM32 boot/syslinux/chain.c32 COM32 chain.c32
APPEND hd0 0 APPEND hd0 0
# http://www.memtest.org/ # http://www.memtest.org/
LABEL memtest LABEL memtest
MENU LABEL Run Memtest86+ (RAM test) MENU LABEL Run Memtest86+ (RAM test)
LINUX boot/memtest LINUX /%INSTALL_DIR%/boot/memtest
# http://hdt-project.org/ # http://hdt-project.org/
LABEL hdt LABEL hdt
MENU LABEL Hardware Information (HDT) MENU LABEL Hardware Information (HDT)
COM32 boot/syslinux/hdt.c32 COM32 hdt.c32
APPEND modules_alias=boot/syslinux/hdt/modalias.gz pciids=boot/syslinux/hdt/pciids.gz APPEND modules_alias=hdt/modalias.gz pciids=hdt/pciids.gz
LABEL reboot LABEL reboot
TEXT HELP TEXT HELP
@ -27,7 +27,7 @@ Reboot computer.
The computer's firmware must support APM. The computer's firmware must support APM.
ENDTEXT ENDTEXT
MENU LABEL Reboot MENU LABEL Reboot
COM32 boot/syslinux/reboot.c32 COM32 reboot.c32
LABEL poweroff LABEL poweroff
TEXT HELP TEXT HELP
@ -35,4 +35,4 @@ Power off computer.
The computer's firmware must support APM. The computer's firmware must support APM.
ENDTEXT ENDTEXT
MENU LABEL Power Off MENU LABEL Power Off
COM32 boot/syslinux/poweroff.c32 COM32 poweroff.c32

View File

@ -1,5 +1,14 @@
DEFAULT loadconfig #
# SPDX-License-Identifier: GPL-3.0-or-later
LABEL loadconfig DEFAULT select
CONFIG archiso.cfg
APPEND ../../ LABEL select
COM32 whichsys.c32
APPEND -pxe- pxe -sys- sys -iso- sys
LABEL pxe
CONFIG archiso_pxe.cfg
LABEL sys
CONFIG archiso_sys.cfg