summaryrefslogtreecommitdiff
path: root/rootfs/etc/initramfs-tools/scripts
diff options
context:
space:
mode:
authorDiederik de Haas <didi.debian@cknow.org>2022-11-12 03:24:37 +0100
committerDiederik de Haas <didi.debian@cknow.org>2022-11-14 22:38:47 +0100
commit9bb048809659f6e5537a59d0fbaa3edd14b4b206 (patch)
treef63d2d47b3601127549b7dc489514b8aecb72ca7 /rootfs/etc/initramfs-tools/scripts
parentcf2eb655d9f1a2b8c0e7ccc46ee05cdf371d2bba (diff)
Fix shellcheck issue SC2154
SC2154: var is referenced but not assigned. The 'rootmnt' variable is set in /usr/share/initramfs-tools/init and if it's not available, that would be bad. According to SC2154 you can fix that issue by using '${var:?}' so it would fail if unset or empty. So apply that and reference that SC item in the comments. Also remove it from the exclude list in the CI config file.
Diffstat (limited to 'rootfs/etc/initramfs-tools/scripts')
-rwxr-xr-xrootfs/etc/initramfs-tools/scripts/local-bottom/rpi-resizerootfs4
1 files changed, 2 insertions, 2 deletions
diff --git a/rootfs/etc/initramfs-tools/scripts/local-bottom/rpi-resizerootfs b/rootfs/etc/initramfs-tools/scripts/local-bottom/rpi-resizerootfs
index 09bf36f..a426a3f 100755
--- a/rootfs/etc/initramfs-tools/scripts/local-bottom/rpi-resizerootfs
+++ b/rootfs/etc/initramfs-tools/scripts/local-bottom/rpi-resizerootfs
@@ -33,8 +33,8 @@ fi
log_begin_msg "$0 resizing $ROOT"
-# Unmount for safety
-umount "${rootmnt}"
+# Unmount for safety; fail if unset or empty (shellcheck SC2154)
+umount "${rootmnt:?}"
# Expand the partition size to fill the entire device
parted -s $rootdev resizepart $rootpart_nr 100%