-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmake-lx-dist
executable file
·118 lines (108 loc) · 2.02 KB
/
make-lx-dist
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/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 2025 Peter Tribble
#
THOME=${THOME:-/packages/localsrc/Tribblix}
DESTTOP=/export/tribblix
DESTDIR=${DESTTOP}/dist
RELEASE=36lx.1
NFLAG=""
QFLAG=""
OVFLAG="-O base-iso"
MRSIZE="360m"
#
# flags
# -D desttop -> DESTTOP
# -M size -> MRSIZE, size of ramdisk
# -N -> no install, dry run
# -Q -> quiet, less output
# -R release string -> RELEASE
#
while getopts "D:M:NQR:" opt; do
case $opt in
D)
DESTTOP="$OPTARG"
DESTDIR=${DESTTOP}/dist
;;
M)
MRSIZE="$OPTARG"
;;
N)
NFLAG="-N"
;;
Q)
QFLAG="-Q"
;;
R)
RELEASE="$OPTARG"
;;
esac
done
shift $((OPTIND-1))
case $RELEASE in
*lx*)
:
;;
*)
echo "ERROR: use make-dist for vanilla tribblix."
exit 1
;;
esac
case $# in
1)
DESTDIR="${DESTDIR}.$1"
case $1 in
minimal)
OVFLAG="-O base-server"
;;
ec2)
OVFLAG="-O base-cloud"
;;
esac
;;
esac
TDIR=${THOME}/tribblix-build
case `uname -p` in
i386)
$TDIR/install-lx-pkgs -D $DESTTOP $NFLAG $OVFLAG $QFLAG -R $RELEASE $*
;;
*)
echo "ERROR: unrecognized architecture for LX"
exit 1
;;
esac
if [ -z "${NFLAG}" ]; then
if [ ! -f ${DESTDIR}/usr/bin/ls ]; then
echo "ERROR: Package install failed!"
exit 1
fi
fi
case `uname -p` in
i386)
$TDIR/mk-lx-pkgs-zap -D $DESTTOP $NFLAG $QFLAG -R $RELEASE $*
;;
esac
if [ -n "${NFLAG}" ]; then
echo "Dry run finished"
exit 0
fi
if [ ! -f ${DESTDIR}/pkgs/catalog ]; then
echo "ERROR: Extra packages failed!"
exit 1
fi
$TDIR/build_iso -T lx -D $DESTTOP -R ${RELEASE} -M "${MRSIZE}" $*