Skip to content

Commit 9ef0a95

Browse files
committed
fix(convert): silence shellcheck SC2154 and SC2034 warnings
- Add file-level shellcheck disable for SC2154 (cross-function variables set in main() and used in step functions) - Remove unused output_boot_part_num variable
1 parent cf82b38 commit 9ef0a95

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

cryptpilot-convert.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
# shellcheck disable=SC2154
23

34
set -e # Exit on error
45
set -u # Exit on undefined variable
@@ -178,7 +179,6 @@ disk::nbd_connect() {
178179
local image_file=$1
179180
local var_name=$2
180181
shift 2
181-
local qemu_nbd_opts=(--connect="PLACEHOLDER" "$image_file" "$@")
182182

183183
local nbd_dev
184184
nbd_dev="$(disk::get_available_nbd)" || proc::fatal "no free NBD device for ${var_name}"
@@ -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
@@ -1286,7 +1284,6 @@ step::prepare_output_and_snapshots() {
12861284

12871285
# Track output boot partition number separately from the original source detection.
12881286
# boot_part_exist reflects whether the SOURCE had a boot partition.
1289-
output_boot_part_num="${boot_part_num}"
12901287
else
12911288
partprobe "${output_device}"
12921289
udevadm settle --timeout=10

0 commit comments

Comments
 (0)