Skip to content

Commit

Permalink
Prevent multi-line inferred CMDLINE_ROOTFSTYPE (closes #21)
Browse files Browse the repository at this point in the history
With btrfs, findmnt can output multiple entries (one per line).
(Which in turn will then break KERNEL_CMD_LINE.)

Thanks to leezu for reporting.
  • Loading branch information
sakaki- committed Oct 13, 2018
1 parent ede8b9f commit c5af580
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion buildkernel
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ shopt -s nullglob
# ********************** variables *********************
PROGNAME="$(basename "${0}")"
CONFFILE="/etc/${PROGNAME}.conf"
VERSION="1.0.31"
VERSION="1.0.32"
ETCPROFILE="/etc/profile"
DEFAULTEFIBOOTFILE="bootx64.efi"
EFIBOOTFILE="${DEFAULTEFIBOOTFILE}"
Expand Down Expand Up @@ -481,6 +481,7 @@ setup_final_variables() {
# falling back to ext4 if the findmnt-based lookup fails
if [[ ! -v CMDLINE_ROOTFSTYPE ]]; then
CMDLINE_ROOTFSTYPE="$(/bin/findmnt -n -o FSTYPE -S ${CMDLINE_REAL_ROOT} 2>/dev/null || echo ext4)"
CMDLINE_ROOTFSTYPE="$(head -n 1 <<<"${CMDLINE_ROOTFSTYPE}")"
fi
# we use path syntax rather than "=PARTUUID=" syntax, as more reliable
KERNEL_CMD_LINE="root=${CMDLINE_ROOT} crypt_root=${CRYPTPATHMAP} dolvm "
Expand Down
2 changes: 1 addition & 1 deletion buildkernel.8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH BUILDKERNEL 8 "Version 1.0.31: October 2018"
.TH BUILDKERNEL 8 "Version 1.0.32: October 2018"
.SH NAME
buildkernel \- build secure boot kernel, save to EFI system partition
.SH SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion buildkernel.conf.5
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH BUILDKERNEL 5 "Version 1.0.31: October 2018"
.TH BUILDKERNEL 5 "Version 1.0.32: October 2018"
.SH NAME
buildkernel.conf \- a configuration file for \fBbuildkernel\fR(8)
.SH SYNOPSIS
Expand Down

0 comments on commit c5af580

Please sign in to comment.