-
Notifications
You must be signed in to change notification settings - Fork 5
/
iso-mods.patch
247 lines (239 loc) · 9.83 KB
/
iso-mods.patch
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
diff -Naur rhel-server-7.1-x86_64-orig/EFI/BOOT/grub.cfg rhel-server-7.1-x86_64-customized/EFI/BOOT/grub.cfg
--- rhel-server-7.1-x86_64-orig/EFI/BOOT/grub.cfg 2015-02-19 07:42:07.000000000 -0800
+++ rhel-server-7.1-x86_64-customized/EFI/BOOT/grub.cfg 2015-08-05 12:01:32.651239677 -0700
@@ -14,18 +14,18 @@
insmod part_gpt
insmod ext2
-set timeout=60
+set timeout=5
### END /etc/grub.d/00_header ###
search --no-floppy --set=root -l 'RHEL-7.1 Server.x86_64'
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Install Red Hat Enterprise Linux 7.1' --class fedora --class gnu-linux --class gnu --class os {
- linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=RHEL-7.1\x20Server.x86_64 quiet
+ linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=RHEL-7.1\x20Server.x86_64
initrdefi /images/pxeboot/initrd.img
}
-menuentry 'Test this media & install Red Hat Enterprise Linux 7.1' --class fedora --class gnu-linux --class gnu --class os {
- linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=RHEL-7.1\x20Server.x86_64 rd.live.check quiet
+menuentry 'Automated Install of Red Hat Enterprise Linux 7.1' --class fedora --class gnu-linux --class gnu --class os {
+ linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=RHEL-7.1\x20Server.x86_64 inst.ks=hd:LABEL=RHEL-7.1\x20Server.x86_64:/kickstart/ks-uefi.cfg
initrdefi /images/pxeboot/initrd.img
}
submenu 'Troubleshooting -->' {
diff -Naur rhel-server-7.1-x86_64-orig/isolinux/isolinux.cfg rhel-server-7.1-x86_64-customized/isolinux/isolinux.cfg
--- rhel-server-7.1-x86_64-orig/isolinux/isolinux.cfg 2015-02-19 07:42:07.000000000 -0800
+++ rhel-server-7.1-x86_64-customized/isolinux/isolinux.cfg 2015-08-05 12:01:32.651239677 -0700
@@ -1,5 +1,5 @@
default vesamenu.c32
-timeout 600
+timeout 50
display boot.msg
@@ -61,13 +61,13 @@
label linux
menu label ^Install Red Hat Enterprise Linux 7.1
kernel vmlinuz
- append initrd=initrd.img inst.stage2=hd:LABEL=RHEL-7.1\x20Server.x86_64 quiet
+ append initrd=initrd.img inst.stage2=hd:LABEL=RHEL-7.1\x20Server.x86_64
-label check
- menu label Test this ^media & install Red Hat Enterprise Linux 7.1
+label unattended
+ menu label ^Automated Install of Red Hat Enterprise Linux 7.1
menu default
kernel vmlinuz
- append initrd=initrd.img inst.stage2=hd:LABEL=RHEL-7.1\x20Server.x86_64 rd.live.check quiet
+ append initrd=initrd.img inst.stage2=hd:LABEL=RHEL-7.1\x20Server.x86_64 ks=hd:LABEL=RHEL-7.1\x20Server.x86_64:/kickstart/ks-isolinux.cfg
menu separator # insert an empty line
diff -Naur rhel-server-7.1-x86_64-orig/kickstart/ks-isolinux.cfg rhel-server-7.1-x86_64-customized/kickstart/ks-isolinux.cfg
--- rhel-server-7.1-x86_64-orig/kickstart/ks-isolinux.cfg 1969-12-31 16:00:00.000000000 -0800
+++ rhel-server-7.1-x86_64-customized/kickstart/ks-isolinux.cfg 2015-08-06 07:49:19.126748978 -0700
@@ -0,0 +1,92 @@
+#version=RHEL7
+
+# install a fresh system
+install
+# Use CDROM installation media
+cdrom
+# Perform a text-based install
+text
+# System language
+lang en_US.UTF-8
+# Keyboard layouts
+keyboard --vckeymap=us --xlayouts='us'
+# Root password
+rootpw --iscrypted $6$8z2.xKRx6YdOvRDP$BwfVHPhTed9HtUA3oBJM.Y0tVppkzZLloOj5TkKojWgKsG4BJJaiM/bbQioqxUbuIaSKTMQ4aOvJG2FB9oVBS.
+# Network information
+network --hostname=localhost.localdomain
+# System authorization information
+auth --enableshadow --passalgo=sha512
+# System timezone
+timezone America/New_York --isUtc
+# System bootloader configuration
+bootloader --location=mbr --driveorder=sda --append=crashkernel=auto rhgb quiet
+# Ignore all but the first disk (sda) during the install
+ignoredisk --only-use=sda
+# Partition clearing information
+clearpart --drives=sda --all
+zerombr
+# Disk partitioning information
+part /boot/efi --fstype="efi" --ondisk=sda --size=200 --fsoptions="umask=0077,shortname=winnt"
+part /boot --fstype="xfs" --ondisk=sda --size=500
+part pv.343 --fstype="lvmpv" --ondisk=sda --size=1 --grow
+volgroup rhel --pesize=4096 pv.343
+logvol swap --fstype="swap" --size=8000 --name=swap --vgname=rhel
+logvol /home --fstype="xfs" --size=51200 --name=home --vgname=rhel
+logvol / --fstype="xfs" --size=1 --name=root --vgname=rhel --grow
+# define packages to install
+%packages
+@core
+kexec-tools
+%end
+# add 'kdump' add-on to the install
+%addon com_redhat_kdump --enable --reserve-mb='auto'
+%end
+# install epel-release, ansible and git and clone the kragle source repository
+%post --log=/root/ks-post.log
+/bin/sed -i 's/^ONBOOT=no$/ONBOOT=yes/' /etc/sysconfig/network-scripts/ifcfg-e*
+cat > /tmp/postinstall.sh << EOF
+#!/bin/bash
+
+# restart the network
+systemctl restart network
+# Wait for network to come up when using NetworkManager.
+if service NetworkManager status >/dev/null 2>&1 && type -P nm-online; then
+ nm-online -q --timeout=10 || nm-online -q -x --timeout=30
+ [ "$?" -eq 0 ] || exit 1
+fi
+# show the network config
+ip addr
+# register the node. Note that you should replace the following variables in this
+# command with valid RHN credentials:
+# RHN_USERNAME with the username of an account with a valid subscription
+# RHN_PASSWORD with the password for that account
+/usr/sbin/subscription-manager register --username RHN_USERNAME --password RHN_PASSWORD --autosubscribe
+# enable the rhel7-server-extras repository
+/usr/sbin/subscription-manager repos --enable=rhel-7-server-extras-rpms
+# install a few packages
+yum -y install https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
+yum -y install git ansible
+# setup localhost so that SSH will always succeed (without asking to verifyt he key)
+cat > ~/.ssh/config << EOF2
+Host localhost
+ Hostname localhost
+ StrictHostKeyChecking no
+EOF2
+chmod 400 ~/.ssh/config
+# clone the kragle repository
+cd /tmp
+git clone https://github.com/csc/kragle
+# run the main ansible playbook from the kragle project
+cd kragle
+ansible-playbook -i ansible/inventory/hosts.ini ansible/main.yml
+# and cleanup
+rm -f ~/.ssh/config
+sed -i --follow-symlinks '/postinstall/d' /etc/rc.local
+# and poweroff the system
+poweroff
+EOF
+echo bash /tmp/postinstall.sh >> /etc/rc.local
+chmod +x /tmp/postinstall.sh
+# This line needs to be added otherwise rc.local will not execute on boot
+chmod +x /etc/rc.d/rc.local
+%end
diff -Naur rhel-server-7.1-x86_64-orig/kickstart/ks-uefi.cfg rhel-server-7.1-x86_64-customized/kickstart/ks-uefi.cfg
--- rhel-server-7.1-x86_64-orig/kickstart/ks-uefi.cfg 1969-12-31 16:00:00.000000000 -0800
+++ rhel-server-7.1-x86_64-customized/kickstart/ks-uefi.cfg 2015-08-06 07:49:24.286557875 -0700
@@ -0,0 +1,93 @@
+#version=RHEL7
+
+# install a fresh system
+install
+# Use CDROM installation media
+cdrom
+# Perform a text-based install
+text
+# System language
+lang en_US.UTF-8
+# Keyboard layouts
+keyboard --vckeymap=us --xlayouts='us'
+# Root password
+rootpw --iscrypted $6$8z2.xKRx6YdOvRDP$BwfVHPhTed9HtUA3oBJM.Y0tVppkzZLloOj5TkKojWgKsG4BJJaiM/bbQioqxUbuIaSKTMQ4aOvJG2FB9oVBS.
+# Network information
+network --hostname=localhost.localdomain
+# System authorization information
+auth --enableshadow --passalgo=sha512
+# System timezone
+timezone America/New_York --isUtc
+# System bootloader configuration
+bootloader --location=mbr --driveorder=sda --append=crashkernel=auto rhgb quiet
+# Ignore all but the first disk (sda) during the install
+ignoredisk --only-use=sda
+# Partition clearing information
+clearpart --drives=sda --all
+zerombr
+# Disk partitioning information
+part biosboot --fstype=biosboot --size=1
+part /boot/efi --fstype="efi" --ondisk=sda --size=200 --fsoptions="umask=0077,shortname=winnt"
+part /boot --fstype="xfs" --ondisk=sda --size=500
+part pv.343 --fstype="lvmpv" --ondisk=sda --size=1 --grow
+volgroup rhel --pesize=4096 pv.343
+logvol swap --fstype="swap" --size=8000 --name=swap --vgname=rhel
+logvol /home --fstype="xfs" --size=51200 --name=home --vgname=rhel
+logvol / --fstype="xfs" --size=1 --name=root --vgname=rhel --grow
+# define packages to install
+%packages
+@core
+kexec-tools
+%end
+# add 'kdump' add-on to the install
+%addon com_redhat_kdump --enable --reserve-mb='auto'
+%end
+# install epel-release, ansible and git and clone the kragle source repository
+%post --log=/root/ks-post.log
+/bin/sed -i 's/^ONBOOT=no$/ONBOOT=yes/' /etc/sysconfig/network-scripts/ifcfg-e*
+cat > /tmp/postinstall.sh << EOF
+#!/bin/bash
+
+# restart the network
+systemctl restart network
+# Wait for network to come up when using NetworkManager.
+if service NetworkManager status >/dev/null 2>&1 && type -P nm-online; then
+ nm-online -q --timeout=10 || nm-online -q -x --timeout=30
+ [ "$?" -eq 0 ] || exit 1
+fi
+# show the network config
+ip addr
+# register the node. Note that you should replace the following variables in this
+# command with valid RHN credentials:
+# RHN_USERNAME with the username of an account with a valid subscription
+# RHN_PASSWORD with the password for that account
+/usr/sbin/subscription-manager register --username RHN_USERNAME --password RHN_PASSWORD --autosubscribe
+# enable the rhel7-server-extras repository
+/usr/sbin/subscription-manager repos --enable=rhel-7-server-extras-rpms
+# install a few packages
+yum -y install https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
+yum -y install git ansible
+# setup localhost so that SSH will always succeed (without asking to verifyt he key)
+cat > ~/.ssh/config << EOF2
+Host localhost
+ Hostname localhost
+ StrictHostKeyChecking no
+EOF2
+chmod 400 ~/.ssh/config
+# clone the kragle repository
+cd /tmp
+git clone https://github.com/csc/kragle
+# run the main ansible playbook from the kragle project
+cd kragle
+ansible-playbook -i ansible/inventory/hosts.ini ansible/main.yml
+# and cleanup
+rm -f ~/.ssh/config
+sed -i --follow-symlinks '/postinstall/d' /etc/rc.local
+# and poweroff the system
+poweroff
+EOF
+echo bash /tmp/postinstall.sh >> /etc/rc.local
+chmod +x /tmp/postinstall.sh
+# This line needs to be added otherwise rc.local will not execute on boot
+chmod +x /etc/rc.d/rc.local
+%end