@@ -11,34 +11,40 @@ if [[ ! -d "${OUTPUT_DIR}" ]]; then
1111 echo " Build dir does not exist."
1212 exit 1
1313fi
14- if [[ ! -f " ${OUTPUT_DIR} /image.img" ]]; then
14+
15+ export DOCKER_CONTEXT=default
16+ IMAGE_NAME=" ${IMAGE_NAME:- " installer" } "
17+ INSTALLER=" ${OUTPUT_DIR} /${IMAGE_NAME} .iso"
18+ IMAGE=" ${OUTPUT_DIR} /${IMAGE_NAME} .img"
19+
20+ if [[ ! -f " ${IMAGE} " ]]; then
1521 echo " Image file does not exist."
1622 exit 1
1723fi
1824
19- export DOCKER_CONTEXT=default
25+ rm -f " ${INSTALLER} "
2026
21- rm -f " ${OUTPUT_DIR} /installer.iso "
27+ export CONFIG_PATH= " ${OUTPUT_DIR} /${IMAGE_NAME} .json "
2228
2329# compress image using zstd (multi-threaded, level 9) and copy to the ISO dir
2430# choose level 9 as a balance between compression ratio and build time; adjust as desired
25- zstd -T0 -9 -c " ${OUTPUT_DIR} /image.img " > " ${ISO_DIR} /image.img.zst"
31+ zstd -T0 -9 -c " ${IMAGE} " > " ${ISO_DIR} /image.img.zst"
2632
27- if [[ -f " ${OUTPUT_DIR} /system.json " ]]; then
28- cp " ${OUTPUT_DIR} /system.json " " ${ISO_DIR} "
33+ if [[ -f " ${CONFIG_PATH} " ]]; then
34+ cp " ${CONFIG_PATH} " " ${ISO_DIR} /system.json "
2935
30- if jq -e ' .installer_auto_overwrite_disk == true' " ${OUTPUT_DIR} /system.json " > /dev/null; then
36+ if jq -e ' .installer_auto_overwrite_disk == true' " ${CONFIG_PATH} " > /dev/null; then
3137 touch " ${ISO_DIR} /installer_auto_overwrite_disk.txt"
3238 fi
3339
3440fi
3541
3642grub-mkrescue \
37- -o " ${OUTPUT_DIR} /installer.iso " \
43+ -o " ${INSTALLER} " \
3844 -V " ${VOLID} " \
3945 -iso-level 3 \
4046 -full-iso9660-filenames \
4147 " ${ISO_DIR} " || exit 1
4248
4349echo " ISO creation complete."
44- echo " Installer written to ${OUTPUT_DIR / \/ / } /installer.iso "
50+ echo " Installer written to ${INSTALLER / \/ / } "
0 commit comments