-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild_iso.sh
More file actions
executable file
·89 lines (77 loc) · 1.57 KB
/
Copy pathbuild_iso.sh
File metadata and controls
executable file
·89 lines (77 loc) · 1.57 KB
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
#!/bin/sh
# build_iso.sh
#
# (C) Copyright 2010-2014 Fred Gleason <fredg@paravelsystems.com>
#
# Build a custom CentOS ISO
#
# The following CentOS 7 packages are required:
# createrepo
# isomd5sum
#
USAGE="build_iso.sh <target-iso> [burn]"
if [ -z $1 ] ; then
echo $USAGE
exit 256
fi
#
# Arguments
#
TARGET_ISO=$1
BURN_FLAG=$2
#
# Site Defines
#
APPLIANCE_ROOT=/root/ba/centos7/x86_64
APPLICATION_ID="Rivendell"
PUBLISHER_ID="ParavelSystems"
#
# Check Manifest
#
./check_manifest.sh
if test $? -ne 0 ; then
echo "Failed manifest check, exiting..."
echo
exit 127
fi
#
# Clean Tree
#
find $APPLIANCE_ROOT -name \*~ -exec rm \{\} \;
find $APPLIANCE_ROOT -name TRANS.TBL -exec rm \{\} \;
rm -rf $APPLIANCE_ROOT/isolinux/repodata
#
# Display CD Burn Status
#
if [ -z $BURN_FLAG ] ; then
echo "CD burn stage will be skipped!"
else
echo "CD will be burned, ensure that blank CD media is in drive"
fi
echo
#
# Create Repository Data
#
echo "Creating repository data."
createrepo -g $APPLIANCE_ROOT/comps.xml $APPLIANCE_ROOT/isolinux/
echo
#
# Create ISO
#
echo "Generating ISO data."
mkisofs -o $TARGET_ISO -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -V 'CentOS 7 x86_64' -A $APPLICATION_ID -publisher $PUBLISHER_ID -R -J -v -T $APPLIANCE_ROOT/isolinux/
implantisomd5 $TARGET_ISO
echo
#
# Burn CD
#
if [ -z $BURN_FLAG ] ; then
echo "ISO complete!"
exit 0
fi
echo "Starting CD burn."
wodim -v -eject $TARGET_ISO
#cdrecord dev=1,0,0 $TARGET_ISO
#growisofs -dvd-compat -Z /dev/dvd=$TARGET_ISO
echo
echo "ISO and CD burn complete!"