Skip to content

Commit 0c97e2d

Browse files
committed
fix(convert): fix shellcheck SC2154 and SC2034 warnings
- Add function-level shellcheck disable=SC2154 on step:update_initrd and step::prepare_output_and_snapshots (variables set in main() and used in these step functions) - Remove unused output_boot_part_num variable
1 parent cf82b38 commit 0c97e2d

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

cryptpilot-convert.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ disk::nbd_connect() {
178178
local image_file=$1
179179
local var_name=$2
180180
shift 2
181-
local qemu_nbd_opts=(--connect="PLACEHOLDER" "$image_file" "$@")
182181

183182
local nbd_dev
184183
nbd_dev="$(disk::get_available_nbd)" || proc::fatal "no free NBD device for ${var_name}"
@@ -1041,6 +1040,7 @@ EOF
10411040

10421041
}
10431042

1043+
# shellcheck disable=SC2154
10441044
step:update_initrd() {
10451045
local efi_part=$1
10461046
local boot_file_path=$2
@@ -1165,8 +1165,6 @@ step::shrink_rootfs() {
11651165
tune2fs -O read-only "${rootfs_orig_part}"
11661166

11671167
# Adjust file system content, all move to front
1168-
local before_shrink_size_in_bytes
1169-
before_shrink_size_in_bytes=$(blockdev --getsize64 "${rootfs_orig_part}")
11701168
log::info "Checking and shrinking rootfs filesystem"
11711169

11721170
if e2fsck -y -f "${rootfs_orig_part}"; then
@@ -1197,6 +1195,7 @@ step::shrink_rootfs() {
11971195
echo " Size in Sector: $after_shrink_size_in_sector"
11981196
}
11991197

1198+
# shellcheck disable=SC2154
12001199
step::prepare_output_and_snapshots() {
12011200
log::step "[ 5 ] Preparing output file and snapshots"
12021201

@@ -1286,7 +1285,6 @@ step::prepare_output_and_snapshots() {
12861285

12871286
# Track output boot partition number separately from the original source detection.
12881287
# boot_part_exist reflects whether the SOURCE had a boot partition.
1289-
output_boot_part_num="${boot_part_num}"
12901288
else
12911289
partprobe "${output_device}"
12921290
udevadm settle --timeout=10

0 commit comments

Comments
 (0)