Skip to content

Commit 5aefccf

Browse files
authored
Merge pull request #675 from xcp-ng/ydi/iso-remaster
iso-remaster updates, notably for xs6
2 parents 9c5f623 + 2105c10 commit 5aefccf

File tree

2 files changed

+38
-9
lines changed

2 files changed

+38
-9
lines changed

scripts/iso-remaster/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ apt-get install fakeroot genisoimage syslinux-utils p7zip-full
2626
```
2727

2828
```
29-
dnf install fakeroot genisoimage syslinux cdrkit-isotools p7zip-plugins
29+
dnf install --enablerepo=epel fakeroot genisoimage syslinux cdrkit-isotools p7zip-plugins
3030
```

scripts/iso-remaster/iso-remaster.sh

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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
3436
EOF
3537
}
@@ -56,30 +58,36 @@ command -v isoinfo >/dev/null || die "required tool not found: isoinfo (package
5658
ISOPATCHER=""
5759
IMGPATCHER=""
5860
VOLID=""
61+
COMPRESS="bzip2"
5962
while [ $# -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
95103
done
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

99113
INISO="$1"
@@ -209,14 +223,29 @@ fi
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

Comments
 (0)