-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathcompile.sh
executable file
·43 lines (34 loc) · 1.12 KB
/
compile.sh
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
#!/bin/bash
NAME="Corbin Davenport"
PUBLISHER="Cobalt"
TITLE="Cobalt Live CD"
FILE="COBALT.ISO"
DIR="$(dirname "$0")"
# detect platform and set proper mkisofs binary
cd $DIR
if [ "$(uname)" == "Darwin" ]; then # Mac OS X
MKISOFS="./mkisofs-mac"
echo "[ OK ] Platform set to Mac OS X, using $MKISOFS"
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then # Linux
MKISOFS="./mkisofs-linux"
echo "[ OK ] Platform set to Linux, using $MKISOFS"
else
MKISOFS="/usr/bin/mkisofs"
echo "[WARN] Platform could not be detected, trying binary at $MKISOFS"
echo "If this causes issues, you may need to install mkisofs manually to that directory."
fi
# make sure mkisofs is executable
if ! [ -x "$MKISOFS" ]; then
chmod +x "$MKISOFS"
echo "[ OK ] $MKISOFS not marked as executable, fixed"
fi
# check for files
if [ -f "$FILE" ]; then
rm "$FILE"
echo "[ OK ] Deleting existing $FILE file."
fi
# compile
echo "[ OK ] Now compiling..."
"$MKISOFS" -quiet -o "$FILE" -p "$NAME" -publisher "$PUBLISHER" -V "$TITLE" -b ISOLINUX/ISOLINUX.BIN -no-emul-boot -boot-load-size 4 -boot-info-table -c boot.cat CDROOT
echo "[ OK ] Compile finished"
exit 0