@@ -30,6 +30,8 @@ Options:
3030 before repacking output ISO.
3131 Forces "--mode copy" to avoid fuse-overlay bug
3232 https://github.com/containers/fuse-overlayfs/issues/377
33+ -z [bzip2|gzip]
34+ Compression method used by install.img (default: bzip2)
3335 -V <volume-id> Use specified volume id instead of reusing the original one
3436EOF
3537}
@@ -56,30 +58,36 @@ command -v isoinfo >/dev/null || die "required tool not found: isoinfo (package
5658ISOPATCHER=" "
5759IMGPATCHER=" "
5860VOLID=" "
61+ COMPRESS=" bzip2"
5962while [ $# -ge 1 ]; do
6063 case " $1 " in
6164 --mode)
62- [ $# -ge 2 ] || die_usage " --mode needs an argument"
65+ [ $# -ge 2 ] || die_usage " $1 needs an argument"
6366 OPMODE=" $2 "
6467 shift
6568 ;;
6669 --iso-patcher|-s)
67- [ $# -ge 2 ] || die_usage " --iso-patcher needs an argument"
70+ [ $# -ge 2 ] || die_usage " $1 needs an argument"
6871 ISOPATCHER=" $2 "
6972 echo >&2 " NOTE: iso-patcher use, forcing 'copy' mode"
7073 OPMODE=copy
7174 shift
7275 ;;
7376 --install-patcher|-l)
74- [ $# -ge 2 ] || die_usage " --install-patcher needs an argument"
77+ [ $# -ge 2 ] || die_usage " $1 needs an argument"
7578 IMGPATCHER=" $2 "
7679 shift
7780 ;;
7881 -V)
79- [ $# -ge 2 ] || die_usage " -V needs an argument"
82+ [ $# -ge 2 ] || die_usage " $1 needs an argument"
8083 VOLID=" $2 "
8184 shift
8285 ;;
86+ -z)
87+ [ $# -ge 2 ] || die_usage " $1 needs an argument"
88+ COMPRESS=" $2 "
89+ shift
90+ ;;
8391 --help|-h)
8492 usage
8593 exit 0
@@ -94,6 +102,12 @@ while [ $# -ge 1 ]; do
94102 shift
95103done
96104
105+ case " $COMPRESS " in
106+ bzip2) ZCAT=bzcat; ZIP=bzip2 ;;
107+ gzip) ZCAT=zcat; ZIP=gzip ;;
108+ * ) die_usage " unsupported compression method" ;;
109+ esac
110+
97111[ $# = 2 ] || die_usage " need exactly 2 non-option arguments"
98112
99113INISO=" $1 "
209223# default value for volume id
210224: ${VOLID:= $(isoinfo -i " $INISO " -d | grep " Volume id" | sed " s/Volume id: //" )}
211225
226+ if [ -e " $RWISO /boot/efiboot.img" ]; then
227+ GENISOIMAGE_EXTRA_ARGS=(
228+ -eltorito-alt-boot
229+ -e boot/efiboot.img
230+ -no-emul-boot
231+ )
232+ ISOHYBRID_EXTRA_ARGS=(--uefi)
233+ is_efi=1
234+ else
235+ echo >&2 " WARNING: no UEFI boot support"
236+ GENISOIMAGE_EXTRA_ARGS=()
237+ ISOHYBRID_EXTRA_ARGS=()
238+ is_efi=0
239+ fi
240+
212241" ${FAKEROOT[@]} " genisoimage \
213242 -o " $OUTISO " \
214243 -v -r -J --joliet-long -V " $VOLID " -input-charset utf-8 \
215244 -c boot/isolinux/boot.cat -b boot/isolinux/isolinux.bin -no-emul-boot \
216245 -boot-load-size 4 -boot-info-table \
217246 \
218- -eltorito-alt-boot -e boot/efiboot.img \
219- -no-emul-boot \
247+ " ${GENISOIMAGE_EXTRA_ARGS[@]} " \
220248 \
221- $RWISO
222- isohybrid --uefi " $OUTISO "
249+ " $RWISO "
250+
251+ isohybrid " ${ISOHYBRID_EXTRA_ARGS[@]} " " $OUTISO "
0 commit comments