@@ -41,17 +41,7 @@ if [ ! -d "$CUSTOMIZE_SCRIPT_PATH" ]; then
4141 exit 1
4242fi
4343
44- function copy_files() {
45- # move filesystem files
46- if [ -d " $1 " ]; then
47- echo " ::group::Copying $1 "
48- cp -vr --preserve=mode,timestamps " $1 " .
49- echo " ::endgroup::"
50- fi
51- }
52-
53- function execute_chroot_script() {
54-
44+ function prepare_environment() {
5545 # In docker, these extra commands are required to enable this black-magic
5646 if [ -f /.dockerenv ] && [ " $( arch) " != " armv7l" ] && [ " $( arch) " != " aarch64" ] ; then
5747 if [ " $EDITBASE_ARCH " == " armv7l" ]; then
@@ -70,18 +60,30 @@ function execute_chroot_script() {
7060 cp ` which qemu-aarch64-static` usr/bin/qemu-aarch64-static
7161 fi
7262 fi
73-
74- echo " ::group::Running $1 in chroot..."
75- cp $1 chroot_script
76- chmod 755 chroot_script
77- cp " $DIR /common.sh" common.sh
78- chmod 755 common.sh
79-
63+
8064 if [ " $EDITBASE_MOUNT_PROC " == " 1" ]; then
8165 echo " Mounting /proc of host..."
8266 mount -t proc /proc proc/
8367 fi
68+ }
69+
70+ function copy_files() {
71+ # move filesystem files
72+ if [ -d " $1 " ]; then
73+ echo " ::group::Copying $1 "
74+ cp -vr --preserve=mode,timestamps " $1 " .
75+ echo " ::endgroup::"
76+ fi
77+ }
78+
79+ function execute_chroot_script() {
80+ cp $1 chroot_script
81+ chmod 755 chroot_script
82+ cp " $DIR /common.sh" common.sh
83+ chmod 755 common.sh
8484
85+ echo " ::group::Running $1 in chroot..."
86+
8587 if [ " $( arch) " != " armv7l" ] && [ " $( arch) " != " aarch64" ] && [ " $( arch) " != " arm64" ] ; then
8688 if [ " $EDITBASE_ARCH " == " armv7l" ]; then
8789 echo " Building an armv7l system on a non-ARM host, using qemu-arm-static"
@@ -96,7 +98,7 @@ function execute_chroot_script() {
9698 fi
9799
98100 echo " ::endgroup::"
99-
101+
100102 # cleanup
101103 rm chroot_script
102104}
@@ -141,6 +143,8 @@ pushd $EDITBASE_WORKSPACE
141143 if [ " $EDITBASE_DISTRO " == " raspbian" ]; then
142144 fixLd
143145 fi
146+
147+ prepare_environment
144148
145149 # ## Execute chroot scripts ###
146150
0 commit comments