Skip to content

Commit

Permalink
Merge pull request #14 from LanderU/fix-shellcheck-round2
Browse files Browse the repository at this point in the history
Fix shellcheck round2
  • Loading branch information
LanderU authored Feb 21, 2022
2 parents f859a01 + a5d5322 commit 894d177
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
11 changes: 9 additions & 2 deletions builder/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,23 @@ if [ ! -f "$VARS_SH" ]; then
fi

# CACHE_DIR is exported so the user-defined phase1/2 scripts can use it.
export CACHE_DIR=$(readlink -f "$CURDIR/../cache")
export CACHE_DIR
CACHE_DIR=$(readlink -f "$CURDIR/../cache")
# shellcheck disable=SC2034
SESSION_FILE=${CACHE_DIR}/session.txt
# shellcheck disable=SC2034
SESSION_LOOP_DEVICE_FILE=${CACHE_DIR}/session-loop-device.txt

# shellcheck disable=SC1090
source ${CURDIR}/utils.sh
# shellcheck disable=SC1090
source ${CURDIR}/core.sh
# shellcheck disable=SC1090
source ${VARS_SH}

# CHROOT_PATH is exported so the user-defined phase1/2 scripts can use it.
export CHROOT_PATH=${CHROOT_PATH:-/tmp/rpi4-image-build} # TODO: change this path to something more generic
# shellcheck disable=SC2034
DOWNLOAD_CACHE_PATH="$CACHE_DIR/$(basename ${IMAGE_URL})"
NAMESERVER=${NAMESERVER:-1.1.1.1}

Expand Down Expand Up @@ -58,4 +65,4 @@ run_step umount_everything

end_session_file

log "Built image at $OUTPUT_FILENAME"
log "Built image at $OUTPUT_FILENAME"
10 changes: 6 additions & 4 deletions focal-rt-ros2/vars.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/bin/bash
# shellcheck disable=SC2034

# pwd should always be the root of this repository when builder/main.sh is called.
curdir=$(pwd)/focal-rt-ros2

Expand Down Expand Up @@ -108,14 +111,13 @@ QEMU_USER_STATIC_PATH=/usr/bin/qemu-aarch64-static
#
# Verification can be optionally performed, such as with sha256sum.
custom_extract_image() {
xzcat --decompress $1
xzcat --decompress "$1"
}

# Each image may be slightly different, but maybe we can put this code directly in core.sh.
custom_loop_device_setup() {
local loop_device=$1

e2fsck -y -f ${loop_device}p2
resize2fs ${loop_device}p2
e2fsck -y -f "${loop_device}"p2
resize2fs "${loop_device}"p2
}

0 comments on commit 894d177

Please sign in to comment.