Skip to content
This repository was archived by the owner on Jul 15, 2025. It is now read-only.

Commit 67640b0

Browse files
committed
simplify stuff
1 parent 4860ddd commit 67640b0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

make-image

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -xe
44

5-
mkdir -p dist /dist
5+
mkdir -p dist
66

77
OUTPUT_IMG="/dist/target.img"
88

@@ -66,10 +66,10 @@ ROOT_MIN_SIZE=$(resize2fs -P "$ROOT_DEV" | cut -d ':' -f 2 | tr -d ' ')
6666

6767
# shrink fs
6868
e2fsck -f -p "$ROOT_DEV"
69-
resize2fs -p "$ROOT_DEV" $ROOT_MIN_SIZE
69+
resize2fs -p "$ROOT_DEV" "$ROOT_MIN_SIZE"
7070

7171
# shrink partition
72-
PART_END=$(($ROOT_PART_START + ($ROOT_MIN_SIZE * $ROOT_BLOCK_SIZE)))
72+
PART_END=$((ROOT_PART_START + (ROOT_MIN_SIZE * ROOT_BLOCK_SIZE)))
7373
parted ---pretend-input-tty "$OUTPUT_IMG" <<EOF
7474
unit B
7575
resizepart 2 $PART_END
@@ -81,7 +81,7 @@ losetup -d "$LOOP_DEV"
8181

8282
# truncate free space
8383
FREE_START=$(parted -ms "$OUTPUT_IMG" unit B print free | tail -1 | cut -d ':' -f 2 | tr -d 'B')
84-
truncate -s $FREE_START "$OUTPUT_IMG"
84+
truncate -s "$FREE_START" "$OUTPUT_IMG"
8585

8686
gzip -c "$OUTPUT_IMG" > "dist/alpine-rpi-$ALPINE_BRANCH-$ARCH.img.gz"
8787

0 commit comments

Comments
 (0)