diff options
| author | Diederik de Haas <didi.debian@cknow.org> | 2022-11-15 14:37:08 +0100 |
|---|---|---|
| committer | Diederik de Haas <didi.debian@cknow.org> | 2022-11-15 15:17:40 +0100 |
| commit | 1b194afcc95b418330555a9b1de44f58aa79b505 (patch) | |
| tree | 66059c84d36ee294e60d7807013a728468ec31f8 /rootfs/etc/initramfs-tools/scripts | |
| parent | 422832740be2973ee1639cddb13d73b2cc863e1d (diff) | |
Fix bug introduced when 'fixing' SC2086 (quotes)
The 'ROOTFLAGS' parameter should NOT be quoted as it then introduces an
(empty) extra argument to 'mount', causing a boot failure.
Thanks to 'mjt' for the help and identifying the issue.
Lessons learned:
1) Don't blindly follow the *suggestions* that shellcheck makes
2) Test your changes (properly) before submitting/merging them
ad 1) I find shellcheck a very useful tool, but it doesn't (and likely
can't) understand the full context. The developer does (or should) and
should evaluate each suggestion whether it's applicable in this case.
ad 2) This should've been obvious and certainly for me.
I'm normally very dilligent and test all my changes, but I got sloppy
this time and did not. With logical consequences.
Diffstat (limited to 'rootfs/etc/initramfs-tools/scripts')
| -rwxr-xr-x | rootfs/etc/initramfs-tools/scripts/local-bottom/rpi-resizerootfs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/rootfs/etc/initramfs-tools/scripts/local-bottom/rpi-resizerootfs b/rootfs/etc/initramfs-tools/scripts/local-bottom/rpi-resizerootfs index 680e133..64b4dee 100755 --- a/rootfs/etc/initramfs-tools/scripts/local-bottom/rpi-resizerootfs +++ b/rootfs/etc/initramfs-tools/scripts/local-bottom/rpi-resizerootfs @@ -46,7 +46,10 @@ partprobe "$rootdev" resize2fs "$rootpart" # Remount root -if ! mount -r ${FSTYPE:+-t "${FSTYPE}"} "${ROOTFLAGS}" "${ROOT}" "${rootmnt?}"; then +# Don't quote ${ROOTFLAGS} as that results in an extra (empty) argument +# to 'mount', which in turn causes a boot failure +# shellcheck disable=SC2086 +if ! mount -r ${FSTYPE:+-t "${FSTYPE}"} ${ROOTFLAGS} "${ROOT}" "${rootmnt?}"; then panic "Failed to mount ${ROOT} as root file system." fi |
