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

Commit

Permalink
Fix 29 with SYSLINUX_LIB_ROOT envvar
Browse files Browse the repository at this point in the history
  • Loading branch information
jsamr committed Jan 27, 2019
1 parent 93de071 commit 28ff54f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
10 changes: 8 additions & 2 deletions bootiso
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ typeset -Ar userFlagsCompatibilityMatrix=(
)

# internal variables
typeset syslinuxLibRoot=${SYSLINUX_LIB_ROOT:-'/usr/lib/syslinux'}
typeset ticketsurl="https://github.com/jsamr/bootiso/issues"
typeset mountRoot=/mnt
typeset tempRoot=/var/tmp/bootiso
Expand Down Expand Up @@ -212,6 +213,10 @@ OPTION FLAGS
-- POSIX end of options.
ENVIRONMENT VARIABLES
- SYSLINUX_LIB_ROOT : set the root of syslinux assets, defaults to /usr/lib/syslinux
INFO
Bootiso v$version. Author: Jules Samuel Randolph
Expand Down Expand Up @@ -1002,6 +1007,7 @@ copyWithRsync() {
fi
fi
(
# shellcheck disable=SC2086
rsync -r -q -I --no-links --no-perms --no-owner --no-group $rsyncOptions "$isoMountPoint"/. "$usbMountPoint"
local status=$?
if [ -f "$wimFile" ] && [ "$disableWimsplit" == 'false' ]; then
Expand Down Expand Up @@ -1533,8 +1539,8 @@ checkSyslinuxInstall() {
if ! command -v extlinux > /dev/null; then
failAndExit "Your distribution doesn't ship \`extlinux' binary with \`syslinux' package.\\nPlease install \`extlinux' and try again."
fi
foundSyslinuxBiosFolder=$(find /usr/lib/syslinux/ -type d -path '*/bios' -print -quit)
foundSyslinuxMbrBinary=$(findFileFromPatterns /usr/lib/syslinux 'bios/mbr.bin' 'mbr.bin')
foundSyslinuxBiosFolder=$(find "$syslinuxLibRoot" -type d -path '*/bios' -print -quit)
foundSyslinuxMbrBinary=$(findFileFromPatterns "$syslinuxLibRoot" 'bios/mbr.bin' 'mbr.bin')
if [ -z "$foundSyslinuxBiosFolder" ]; then
failAndExit "Could not find a SYSLINUX bios folder containing c32 bios module files on this system."
fi
Expand Down
3 changes: 2 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

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

**Bugfixes**

Expand Down
13 changes: 13 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ Optionally, move the script to a bin path

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

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

### Help the community

Expand Down Expand Up @@ -299,6 +300,18 @@ This is perfectly appropriate when the ISO file is aimed both at disk drives and
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.
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.

### Environment variables and distro-specific tweaks

#### Variables

- `SYSLINUX_LIB_ROOT`: set syslinux assets root, where mbr will be searched.

<a name="distro-tweaks">

#### Distros tweaks

- On Fedora, set `SYSLINUX_LIB_ROOT` env to `/usr/share/syslinux`

### Credits

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 comments on commit 28ff54f

Please sign in to comment.