Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit 28ff54f

Browse files
committed
Fix 29 with SYSLINUX_LIB_ROOT envvar
1 parent 93de071 commit 28ff54f

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

bootiso

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ typeset -Ar userFlagsCompatibilityMatrix=(
5959
)
6060

6161
# internal variables
62+
typeset syslinuxLibRoot=${SYSLINUX_LIB_ROOT:-'/usr/lib/syslinux'}
6263
typeset ticketsurl="https://github.com/jsamr/bootiso/issues"
6364
typeset mountRoot=/mnt
6465
typeset tempRoot=/var/tmp/bootiso
@@ -212,6 +213,10 @@ OPTION FLAGS
212213
-- POSIX end of options.
213214
214215
216+
ENVIRONMENT VARIABLES
217+
218+
- SYSLINUX_LIB_ROOT : set the root of syslinux assets, defaults to /usr/lib/syslinux
219+
215220
INFO
216221
217222
Bootiso v$version. Author: Jules Samuel Randolph
@@ -1002,6 +1007,7 @@ copyWithRsync() {
10021007
fi
10031008
fi
10041009
(
1010+
# shellcheck disable=SC2086
10051011
rsync -r -q -I --no-links --no-perms --no-owner --no-group $rsyncOptions "$isoMountPoint"/. "$usbMountPoint"
10061012
local status=$?
10071013
if [ -f "$wimFile" ] && [ "$disableWimsplit" == 'false' ]; then
@@ -1533,8 +1539,8 @@ checkSyslinuxInstall() {
15331539
if ! command -v extlinux > /dev/null; then
15341540
failAndExit "Your distribution doesn't ship \`extlinux' binary with \`syslinux' package.\\nPlease install \`extlinux' and try again."
15351541
fi
1536-
foundSyslinuxBiosFolder=$(find /usr/lib/syslinux/ -type d -path '*/bios' -print -quit)
1537-
foundSyslinuxMbrBinary=$(findFileFromPatterns /usr/lib/syslinux 'bios/mbr.bin' 'mbr.bin')
1542+
foundSyslinuxBiosFolder=$(find "$syslinuxLibRoot" -type d -path '*/bios' -print -quit)
1543+
foundSyslinuxMbrBinary=$(findFileFromPatterns "$syslinuxLibRoot" 'bios/mbr.bin' 'mbr.bin')
15381544
if [ -z "$foundSyslinuxBiosFolder" ]; then
15391545
failAndExit "Could not find a SYSLINUX bios folder containing c32 bios module files on this system."
15401546
fi

changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
- image size is checked to be smaller than device size, PR #30 (@SibrenVasse)
66
- image size check can be disabled with `--no-size-check` option, PR #30 (@SibrenVasse)
7-
- automatically split `sources/install.wim` files in windows ISO's, which would otherwise cause rsync to fail on file too large error; #32
7+
- automatically split `sources/install.wim` files in windows ISO's, which would otherwise cause rsync to fail with file too large error; #32
88
- automatic splitting can be disabled with `--no-wimsplit` option
9+
- added `SYSLINUX_LIB_ROOT` environment variable to set syslinux library root manually, #29
910

1011
**Bugfixes**
1112

readme.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ Optionally, move the script to a bin path
6868

6969
Where `bin-path` is any folder in the `$PATH` environment, preferably for superuser utilities such as `/usr/local/sbin/`.
7070

71+
Make sure to [follow our distro-dependent tweaks](#distro-tweaks) to have bootiso settled.
7172

7273
### Help the community
7374

@@ -299,6 +300,18 @@ This is perfectly appropriate when the ISO file is aimed both at disk drives and
299300
In mount+rsync mode (enforcable with `[install-mount-rsync]` action, `--mrsync` flag), `bootiso` creates one partition with MBR table in the USB drive and copy files from mounted ISO.
300301
It will also install SYSLINUX bootlaoder if configuration files are found, which will allow legacy BIOS boot. When local version doesn't match ISO version, it will attempt to download the closest version available in [kernel.org](https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/Testing) if `--local-bootloader` flag is not set.
301302

303+
### Environment variables and distro-specific tweaks
304+
305+
#### Variables
306+
307+
- `SYSLINUX_LIB_ROOT`: set syslinux assets root, where mbr will be searched.
308+
309+
<a name="distro-tweaks">
310+
311+
#### Distros tweaks
312+
313+
- On Fedora, set `SYSLINUX_LIB_ROOT` env to `/usr/share/syslinux`
314+
302315
### Credits
303316

304317
This script was made after [this askubuntu post answer from Avinash Raj](https://askubuntu.com/a/376430/276357) to automate the described steps in a robust, secured way ([see the security section for more details](#security)).

0 commit comments

Comments
 (0)