diff options
| author | Diederik de Haas <didi.debian@cknow.org> | 2022-11-12 03:45:29 +0100 |
|---|---|---|
| committer | Diederik de Haas <didi.debian@cknow.org> | 2022-11-14 22:38:56 +0100 |
| commit | 422832740be2973ee1639cddb13d73b2cc863e1d (patch) | |
| tree | 31d5bd92b868130ace15c648feecc4ec1057d7f5 | |
| parent | 9bb048809659f6e5537a59d0fbaa3edd14b4b206 (diff) | |
Fix shellcheck issue SC2086 (quotes)
SC2086: Double quote to prevent globbing and word splitting.
Also remove it from the exclude list in the CI config file.
| -rw-r--r-- | debian/salsa-ci.yml | 2 | ||||
| -rwxr-xr-x | rootfs/etc/initramfs-tools/scripts/local-bottom/rpi-resizerootfs | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/debian/salsa-ci.yml b/debian/salsa-ci.yml index 8e6803b..a06e922 100644 --- a/debian/salsa-ci.yml +++ b/debian/salsa-ci.yml @@ -26,7 +26,7 @@ shellcheck: script: - apt-get update && apt-get upgrade -y - apt-get install -y shellcheck - - shellcheck -e SC1090,SC1091,SC2086 -s dash $(find rootfs/etc/initramfs-tools -type f -executable | xargs grep -l '^#!/bin/sh') + - shellcheck -e SC1090,SC1091 -s dash $(find rootfs/etc/initramfs-tools -type f -executable | xargs grep -l '^#!/bin/sh') build yamls: stage: build diff --git a/rootfs/etc/initramfs-tools/scripts/local-bottom/rpi-resizerootfs b/rootfs/etc/initramfs-tools/scripts/local-bottom/rpi-resizerootfs index a426a3f..680e133 100755 --- a/rootfs/etc/initramfs-tools/scripts/local-bottom/rpi-resizerootfs +++ b/rootfs/etc/initramfs-tools/scripts/local-bottom/rpi-resizerootfs @@ -14,18 +14,18 @@ esac . /scripts/functions # Given the root partition, get the underlying device and partition number -rootpart=$(realpath $ROOT) -rootpart_nr=$(blkid -sPART_ENTRY_NUMBER -o value -p $rootpart) +rootpart=$(realpath "$ROOT") +rootpart_nr=$(blkid -sPART_ENTRY_NUMBER -o value -p "$rootpart") rootdev="/dev/$(lsblk -no pkname "$rootpart")" # Parted will detect if the GPT label is messed up and fix it # automatically, we just need to tell it to do so. -parted -s $rootdev print 2>&1 | grep -z "fix the GPT" && { - echo "Fix" | parted ---pretend-input-tty $rootdev print +parted -s "$rootdev" print 2>&1 | grep -z "fix the GPT" && { + echo "Fix" | parted ---pretend-input-tty "$rootdev" print } # Check if there's free space at the end of the device -free_space="$(parted -m -s $rootdev print free | tail -n1 | grep free)" +free_space="$(parted -m -s "$rootdev" print free | tail -n1 | grep free)" if test -z "$free_space"; then # Great, we already resized; nothing left to do! exit 0 @@ -37,16 +37,16 @@ log_begin_msg "$0 resizing $ROOT" umount "${rootmnt:?}" # Expand the partition size to fill the entire device -parted -s $rootdev resizepart $rootpart_nr 100% +parted -s "$rootdev" resizepart "$rootpart_nr" 100% wait_for_udev 5 # Now resize the filesystem -partprobe $rootdev -resize2fs $rootpart +partprobe "$rootdev" +resize2fs "$rootpart" # Remount root -if ! mount -r ${FSTYPE:+-t "${FSTYPE}"} ${ROOTFLAGS} "${ROOT}" "${rootmnt?}"; then +if ! mount -r ${FSTYPE:+-t "${FSTYPE}"} "${ROOTFLAGS}" "${ROOT}" "${rootmnt?}"; then panic "Failed to mount ${ROOT} as root file system." fi |
