Skip to content

Commit 15370fe

Browse files
committed
Fix chroot_correct_qemu execution
1 parent 45d797f commit 15370fe

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/common.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,8 @@ function load_module_config() {
599599
function chroot_correct_qemu() {
600600
local host_arch="$1"
601601
local target_arch="$2"
602+
local chroot_script="$3"
603+
local custom_pi_os_path="$4"
602604

603605
# Validate inputs
604606
if [[ -z "$host_arch" ]] || [[ -z "$target_arch" ]]; then

src/custompios

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -e
77

88
export LC_ALL=C
99

10-
source ${CUSTOM_PI_OS_PATH}/common.sh
10+
source "${CUSTOM_PI_OS_PATH}"/common.sh
1111

1212
echo_green -e "\nBUILD STARTED @ $(date)!\n"
1313

@@ -51,7 +51,6 @@ function execute_chroot_script() {
5151
chmod 755 chroot_script
5252
cp "${CUSTOM_PI_OS_PATH}"/common.sh common.sh
5353
chmod 755 common.sh
54-
5554
chroot_correct_qemu "$(uname -m)" "$BASE_ARCH" "$2" "${CUSTOM_PI_OS_PATH}"
5655

5756
# Handle exported items
@@ -100,7 +99,7 @@ install_cleanup_trap
10099
install_fail_on_error_trap
101100
unmount_image $BASE_MOUNT_PATH force || true
102101

103-
pushd $BASE_WORKSPACE
102+
pushd "${BASE_WORKSPACE}"
104103
if [ -e *.img ]; then
105104
rm *.img
106105
fi
@@ -179,6 +178,8 @@ pushd $BASE_WORKSPACE
179178
echo "No remote and submodules config detected"
180179
fi
181180
echo $ARMBIAN_CONFIG_TXT_FILE
181+
# if you need anything from common running in execute_chroot_script, export it here
182+
export -f chroot_correct_qemu
182183
export -f execute_chroot_script
183184
bash -x "${CHROOT_SCRIPT}"
184185

0 commit comments

Comments
 (0)