fix and some refactoring

This commit is contained in:
Daniel Langbein 2021-06-14 14:59:33 +02:00
parent f040b3d6c1
commit 4792a0b8a6

View File

@ -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 $?