From 4792a0b8a6146e96092d342f49ccfe05c8ca3bf1 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Mon, 14 Jun 2021 14:59:33 +0200 Subject: [PATCH] fix and some refactoring --- build-iso/run.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/build-iso/run.sh b/build-iso/run.sh index 709e591..04205a0 100755 --- a/build-iso/run.sh +++ b/build-iso/run.sh @@ -34,7 +34,6 @@ function isEmptyDir() { fi } - if [ -d "${BUILD_DIR}" ]; then if ! isEmptyDir "${BUILD_DIR}"; then if [ "$1" = "clean" ]; then @@ -50,16 +49,18 @@ elif ! mkdir -p "${BUILD_DIR}"; then exit 1; fi - +# Create work and out directories +mkdir "${BUILD_DIR}"/work_dir && mkdir "${BUILD_DIR}"/out_dir || exit $? +# Then copy a profile as starting point. # The releng profile is used to create the official monthly installation ISO PROFILE=/usr/share/archiso/configs/releng/ if [ ! -d "${PROFILE}" ]; then echo "Dependency 'archiso' is missing. Please install this first!" exit 1 fi - cp -r "$PROFILE" "$BUILD_DIR"/profile || exit $? + # Extend the builder's pacman.conf (add de-p1st mirrors) # so that packages from [de-p1st] can be installed into the ISO # https://wiki.archlinux.org/index.php/Archiso#Custom_local_repository @@ -134,7 +135,7 @@ Subsystem sftp /usr/lib/ssh/sftp-server' > "${BUILD_DIR}"/profile/airootfs/etc/s # Save ssh host fingerprints next to the ISO file for f in "${BUILD_DIR}"/profile/airootfs/etc/ssh/ssh_host_*_key; do - ssh-keygen -l -f "$f" >> "${BUILD_DIR}/out_dir/ssh-host-fingerprints" || exit $? + ssh-keygen -l -f "$f" >> "${BUILD_DIR}"/out_dir/ssh-host-fingerprints || exit $? done # Enable sshd.service @@ -152,9 +153,7 @@ sed -i "s|^iso_name=.*\$|iso_name=\"${ISO_NAME}\"|" "${BUILD_DIR} ################################ -mkdir "${BUILD_DIR}/work_dir" && mkdir "${BUILD_DIR}/out_dir" || exit $? - echo "running 'sudo mkarchiso' ..." -sudo mkarchiso -v -w "${BUILD_DIR}/work_dir" -o "${BUILD_DIR}/out_dir" "${BUILD_DIR}/profile" || exit $? +sudo mkarchiso -v -w "${BUILD_DIR}"/work_dir -o "${BUILD_DIR}"/out_dir "${BUILD_DIR}"/profile || exit $? -sudo chown -R "build:wheel" "${BUILD_DIR}/out_dir" || exit $? +sudo chown -R "build:wheel" "${BUILD_DIR}"/out_dir || exit $?