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