-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmakeiso
executable file
·97 lines (85 loc) · 2.31 KB
/
makeiso
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/bash
export LANG=C
# Global options
buildroot="$(pwd)"
configpath="${buildroot}/kickstarts"
logfile="${buildroot}/build-$(date +%Y%m%d%H%M).log"
cache_dir="/var/cache/live"
product="StotinkaOS"
release="7"
upstream_release="4.1708"
usage() {
cat << EOF
Usage: $0 [option]
Create StotinkaOS Live images using livecd-creator
Options:
-g, --gnome Build GNOME LiveCD
-c, --cinnamon Build CINNAMON LiveCD
-m, --mate Build MATE LiveCD
-x, --xfce Build XFCE LiveCD
EOF
exit 1
}
# Check if root permissions
if [[ "$EUID" -ne "0" ]]; then
printf "%s\n" "This script must be run as root"
exit 1;
fi
# Check for livecd-tools
which livecd-creator >/dev/null 2>&1
if [[ "$?" -eq "1" ]]; then
printf "%s\n" "The package livecd-tools is not installed!"
fi
# Check for config path
if [[ ! -d "$configpath" ]]; then
printf "%s\n" "No config path found. Abort..."
exit 1
fi
case "$1" in
-g|--gnome)
# GNOME ENV
kscfg=("${configpath}/sos-${release}-live-gnome.cfg")
fslabel=("${product}-${release}.${upstream_release}-LiveGNOME")
banner=("Creating ${product}-${release}.${upstream_release} Gnome live image")
;;
-c|--cinnamon)
# CINNAMON ENV
kscfg=("${configpath}/sos-${release}-live-cinnamon.cfg")
fslabel=("${product}-${release}.${upstream_release}-LiveCINNAMON")
banner=("Creating ${product}-${release}.${upstream_release} Cinnamon live image")
;;
-x|--xfce)
# XFCE ENV
kscfg=("${configpath}/sos-${release}-live-xfce4.cfg")
fslabel=("${product}-${release}.${upstream_release}-LiveXFCE")
banner=("Creating ${product}-${release}.${upstream_release} Xfce live image")
;;
-m|--mate)
# MATE ENV
kscfg=("${configpath}/sos-${release}-live-mate.cfg")
fslabel=("${product}-${release}.${upstream_release}-LiveMATE")
banner=("Creating ${product}-${release}.${upstream_release} Mate live image")
;;
*)
usage
;;
esac
# Disable SELinux
setenforce 0
# Create the ISO
printf "%s\n" "* ${banner}"
livecd-creator \
--verbose \
--config="${kscfg}" \
--fslabel="${fslabel}" \
--product="${product}" \
--cache="${cache_dir}" >> "${logfile}" 2>&1
ret="$?"
if [[ "$ret" -eq "0" ]]; then
printf "%s\n" "$0 completed successfully"
else
printf "%s\n" "$0 Failed!"
printf "%s\n" "View ${logfile} for details"
fi
# Enable SELinux
setenforce 1