-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathcreate-iso
executable file
·97 lines (85 loc) · 2.07 KB
/
create-iso
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/sh
#
# SPDX-License-Identifier: CDDL-1.0
#
# {{{ CDDL HEADER
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
# }}}
#
# Copyright 2023 Peter Tribble
#
THOME=${THOME:-/packages/localsrc/Tribblix}
DESTDIR=/export/tribblix/dist
ISODIR=/var/tmp
ISOROOT="tribtest"
RELEASE="beta"
#
# flags
# -D destdir -> DESTDIR
# -I isodir -> ISODIR
# -N iso root name -> ISOROOT
# -R release string -> RELEASE
#
while getopts "D:I:N:R:" opt; do
case $opt in
D)
DESTDIR="$OPTARG"
;;
I)
ISODIR="$OPTARG"
;;
N)
ISOROOT="$OPTARG"
;;
R)
RELEASE="$OPTARG"
;;
esac
done
shift $((OPTIND-1))
case `uname -p` in
sparc)
ISOROOT="${ISOROOT}-sparc"
;;
esac
ISONAME=${ISOROOT}-${RELEASE}.iso
case $# in
1)
DESTDIR=${DESTDIR}.$1
ISONAME=${ISOROOT}-${RELEASE}-${1}.iso
;;
esac
#
CDBOOT="boot/cdboot"
UEFIBOOT="boot/efiboot.img"
case `uname -p` in
sparc)
/usr/bin/dd if="${DESTDIR}/platform/sun4v/lib/fs/hsfs/bootblk" \
of="${DESTDIR}/boot/hsfs.bootblock" \
bs=1b oseek=1 count=15 conv=sync 2> /dev/null
/usr/bin/mkisofs -o ${ISODIR}/${ISONAME} -G "${DESTDIR}/boot/hsfs.bootblock" \
-B ... -N -l -ldots -R -D -volset `cat ${DESTDIR}/.volsetid` \
-V "Tribblix${RELEASE}" ${DESTDIR}
;;
i386)
/usr/bin/mkisofs -N -l -R -U -d -D -o ${ISODIR}/${ISONAME} \
-V "Tribblix${RELEASE}" \
-allow-multidot -no-iso-translate -cache-inodes \
-c .catalog -volset `cat ${DESTDIR}/.volsetid` \
-b ${CDBOOT} -no-emul-boot -boot-load-size 4 -boot-info-table \
-eltorito-alt-boot -eltorito-platform efi \
-eltorito-boot ${UEFIBOOT} -no-emul-boot \
${DESTDIR}
${THOME}/tribblix-build/hybridize-iso ${ISODIR}/${ISONAME} ${DESTDIR}
;;
esac
/bin/ls -lh ${ISODIR}/${ISONAME}