Merge "Smaller non-HA virtual deployment template"
[fuel.git] / build / f_isoroot / f_kscfg / ks.cfg
1 install
2 text
3 %include /tmp/source.ks
4 reboot --eject
5 lang en_US.UTF-8
6 keyboard us
7 rootpw r00tme
8 timezone --utc Etc/UTC
9 firewall --disabled
10 selinux --disabled
11 # ignore unsupported hardware warning
12 unsupported_hardware
13 # SKIP CONFIGURING X
14 skipx
15 # NEVER ever place zerombr here, it breaks automated installation
16 %include /tmp/bootloader.ks
17 %include /tmp/partition.ks
18
19 # PREINSTALL SECTION
20 # HERE ARE COMMANDS THAT WILL BE LAUNCHED BEFORE
21 # INSTALLATION PROCESS ITSELF
22 %pre
23 #!/bin/sh
24
25 # hard drives
26 drives=""
27 removable_drives=""
28 for drv in `ls -1 /sys/block | grep "sd\|hd\|vd\|cciss"`; do
29     if !(blkid | grep -q "${drv}.*Fuel"); then
30       if (grep -q 0 /sys/block/${drv}/removable); then
31           drives="${drives} ${drv}"
32       else
33           removable_drives="${removable_drives} ${drv}"
34       fi
35     fi
36 done
37 default_drive=`echo ${drives} ${removable_drives} | awk '{print $1}'`
38
39 installdrive="undefined"
40 forceformat="no"
41 for I in `cat /proc/cmdline`; do case "$I" in *=*) eval $I;; esac ; done
42
43 set ${drives} ${removable_drives}
44 numdrives=`echo $#`
45
46 tgtdrive="${installdrive}"
47
48 function confirm_format {
49   check_drive="$1"
50   local confirm_format="no"
51
52   if [[ "$forceformat" == "yes" ]] ; then
53     return 0
54   fi
55
56   if parted -s /dev/$check_drive print &>/dev/null ; then
57     echo
58     echo "$check_drive drive contains partition table:"
59     parted -s /dev/$check_drive print
60     echo
61     read -p "Are you sure you want to erase ALL data on disk $check_drive? (y/N)" confirm_format
62     if [[ "$confirm_format" == "y" ]] || [[ "$confirm_format" == "Y" ]] || [[ "$forceformat" == "yes" ]]; then
63       return 0
64     else
65       return 1
66     fi
67   else
68     return 0
69   fi
70 }
71
72 format_confirmed="no"
73
74 if [ $numdrives -lt 1 ]; then
75     exec < /dev/tty3 > /dev/tty3 2>&1
76     chvt 3
77     clear
78     echo
79     echo '********************************************************************'
80     echo '*                            E R R O R                             *'
81     echo '*                                                                  *'
82     echo '*      There is no suitable media available for installation.      *'
83     echo '*                Please attach a drive and try again.              *'
84     echo '*                                                                  *'
85     echo '********************************************************************'
86     echo
87     read -p "Press Enter to shut down the system: " _
88     poweroff
89 fi
90
91 if [ ${numdrives} -gt 1 ] || [ `echo ${drives} | wc -w` -eq 0 ] ; then
92     exec < /dev/tty3 > /dev/tty3 2>&1
93     chvt 3
94     while [ "${tgtdrive}" = "undefined" ]; do
95         clear
96         echo
97         echo '********************************************************************************'
98         echo '*                                 W A R N I N G                                *'
99         echo '*                                                                              *'
100         echo '*  Which of the detected hard drives do you want to be used as                 *'
101         echo '*  the installation target?                                                    *'
102         echo '*                                                                              *'
103         echo '********************************************************************************'
104         echo
105         echo "Possible choices"
106         echo "Persistent drives: ${drives}"
107         echo "Removable drives: ${removable_drives}"
108         echo
109         if [ `echo ${drives} | wc -w` -eq 1 ] ; then
110             read -t 30 -p "Choose hard drive: " tgtdrive || tgtdrive=$default_drive
111         else
112             read -p "Choose hard drive: " tgtdrive
113         fi
114         match="no"
115         for drive in ${drives[@]} ${removable_drives[@]}; do
116           if [[ "$drive" == "$tgtdrive" ]] && match="yes" ; then
117             if confirm_format $tgtdrive ; then
118               format_confirmed="yes"
119               break
120             else
121               tgtdrive="undefined"
122               read -p "You may select another disk. Press Enter to continue." _
123             fi
124           fi
125         done
126         if [[ "$match" == "no" ]]; then
127           tgtdrive="undefined"
128           read -p "Invalid choice. Press Enter to continue." _
129         fi
130     done
131     clear
132     chvt 1
133 else
134     tgtdrive=`echo ${drives} | sed -e "s/^\s*//" -e "s/\s*$//"`
135 fi
136
137 if [ "$format_confirmed" != "yes" ] ; then
138   exec < /dev/tty3 > /dev/tty3 2>&1
139   chvt 3
140   if ! confirm_format $tgtdrive ; then
141       clear
142       echo
143       echo '********************************************************************'
144       echo '*                            E R R O R                             *'
145       echo '*                                                                  *'
146       echo '*           Disk $tgtdrive contains active partition(s).           *'
147       echo '*        Installation cannot continue without confirmation.        *'
148       echo '*                                                                  *'
149       echo '********************************************************************'
150       echo
151       read -p "Press Enter to restart: " _
152       reboot
153   fi
154   chvt 1
155 fi
156
157 # verify tgtdrive is at least 41GB
158 tgtdrivesize=$(( $(cat "/sys/class/block/${tgtdrive}/size") / 2 / 1024 ))
159 if [ $tgtdrivesize -lt 41984 ]; then
160     exec < /dev/tty3 > /dev/tty3 2>&1
161     chvt 3
162     clear
163     echo
164     echo '********************************************************************'
165     echo '*                            E R R O R                             *'
166     echo '*                                                                  *'
167     echo '*  Your disk is under 41GB in size. Installation cannot continue.  *'
168     echo '*             Restart installation with a larger disk.             *'
169     echo '*                                                                  *'
170     echo '********************************************************************'
171     echo
172     read -p "Press Enter to restart: " _
173     reboot
174 fi
175
176 # paths in /dev have "/" instead of "!" for cciss devices
177 tgtdrive=$(echo $tgtdrive | sed -e 's/!/\//')
178
179 # source
180 if test -e /dev/disk/by-label/"OpenStack_Fuel"; then
181     echo "harddrive --partition=LABEL="OpenStack_Fuel" --dir=/" > /tmp/source.ks
182 elif test -e /dev/disk/by-uuid/will_be_substituted_with_actual_uuid; then
183     echo "harddrive --partition=UUID=will_be_substituted_with_actual_uuid --dir=/" > /tmp/source.ks
184 else
185     echo "cdrom" > /tmp/source.ks
186 fi
187
188 vgremove -ff os
189 dd if=/dev/zero of=/dev/${tgtdrive} bs=10M count=10
190 sleep 3
191 hdparm -z /dev/${tgtdrive}
192 parted -s /dev/${tgtdrive} mklabel gpt
193 parted -a none -s /dev/${tgtdrive} unit MiB mkpart primary 0 24
194 parted -s /dev/${tgtdrive} set 1 bios_grub on
195 parted -a none -s /dev/${tgtdrive} unit MiB mkpart primary fat16 24 224
196 parted -s /dev/${tgtdrive} set 2 boot on
197 parted -a none -s /dev/${tgtdrive} unit MiB mkpart primary 224 424
198 sleep 3
199 hdparm -z /dev/${tgtdrive}
200
201 # partition
202
203 # This adds support for the p seperator required for cciss devices
204 if echo ${tgtdrive} | grep -q -e cciss ; then
205     bootdev=${tgtdrive}p
206 else
207     bootdev=${tgtdrive}
208 fi
209 echo > /tmp/partition.ks
210 echo "partition /boot --onpart=/dev/${bootdev}3" >> /tmp/partition.ks
211 echo "partition /boot/efi --onpart=/dev/${bootdev}2" >> /tmp/partition.ks
212 echo "partition pv.001 --ondisk=${tgtdrive} --size=41000 --grow" >> /tmp/partition.ks
213 echo "volgroup os pv.001" >> /tmp/partition.ks
214 echo "logvol swap --vgname=os --recommended --name=swap" >> /tmp/partition.ks
215 echo "logvol / --vgname=os --size=10000 --name=root --fstype=ext4" >> /tmp/partition.ks
216 echo "logvol /var --vgname=os --size=10000 --percent 30 --grow --name=var --fstype=ext4" >> /tmp/partition.ks
217 echo "logvol /var/lib/docker --vgname=os --size=17000  --percent 20 --grow --name=varlibdocker --fstype=ext4" >> /tmp/partition.ks
218 echo "logvol /var/log --vgname=os --size=4096 --percent 50 --grow --name=varlog --fstype=ext4" >> /tmp/partition.ks
219
220
221 # bootloader
222 echo "bootloader --location=partition --driveorder=${tgtdrive} --append=' biosdevname=0 crashkernel=none'" > /tmp/bootloader.ks
223
224 # Anaconda can not install grub 0.97 on disks which are >4T.
225 # The reason is that grub does not support such large geometries
226 # and it simply thinks that the cylinder number has negative value.
227 # Here we just set geometry manually so that grub thinks that disk
228 # size is equal to 1G.
229 # 130 cylinders * (16065 * 512 = 8225280 bytes) = 1G
230 echo "%post --nochroot --log=/mnt/sysimage/root/anaconda-post-partition.log" > /tmp/post_partition.ks
231 echo "echo \"device (hd0) /dev/${tgtdrive}\" >> /tmp/grub.script" >> /tmp/post_partition.ks
232 echo "echo \"geometry (hd0) 130 255 63\" >> /tmp/grub.script" >> /tmp/post_partition.ks
233 echo "echo \"root (hd0,2)\" >> /tmp/grub.script" >> /tmp/post_partition.ks
234 echo "echo \"install /grub/stage1 (hd0) /grub/stage2 p /grub/grub.conf\" >> /tmp/grub.script" >> /tmp/post_partition.ks
235 echo "echo quit >> /tmp/grub.script" >> /tmp/post_partition.ks
236 echo "cat /tmp/grub.script | chroot /mnt/sysimage /sbin/grub --no-floppy --batch" >> /tmp/post_partition.ks
237
238 %end
239
240 %packages --nobase --excludedocs
241 @Core
242 fuel
243 fuel-library >= 7.0
244 fuel-dockerctl
245 authconfig
246 bind-utils
247 cronie
248 crontabs
249 curl
250 daemonize
251 dhcp
252 docker-io
253 fuel-bootstrap-image
254 fuel-bootstrap-image-builder
255 fuel-createmirror
256 fuel-target-centos-images6.6
257 fuel-package-updates
258 fuelmenu
259 fuel-docker-images
260 gdisk
261 lrzip
262 lsof
263 man
264 mlocate
265 nmap-ncat
266 ntp
267 ntpdate
268 openssh-clients
269 policycoreutils
270 python-daemon
271 rsync
272 ruby21-puppet
273 ruby21-rubygem-netaddr
274 ruby21-rubygem-openstack
275 selinux-policy-targeted
276 strace
277 subscription-manager
278 sysstat
279 system-config-firewall-base
280 tcpdump
281 telnet
282 vim-enhanced
283 virt-what
284 wget
285 yum
286 yum-plugin-priorities
287
288 %include /tmp/post_partition.ks
289
290 # POSTINSTALL SECTION
291 # HERE ARE COMMANDS THAT WILL BE LAUNCHED JUST AFTER
292 # INSTALLATION ITSELF COMPLETED
293 %post
294 echo -e "modprobe nf_conntrack_ipv4\nmodprobe nf_conntrack_ipv6\nmodprobe nf_conntrack_tftp\nmodprobe nf_nat_tftp" >> /etc/rc.modules
295 chmod +x /etc/rc.modules
296 echo -e "net.nf_conntrack_max=1048576" >> /etc/sysctl.conf
297 mkdir -p /var/log/coredump
298 echo -e "kernel.core_pattern=/var/log/coredump/core.%e.%p.%h.%t" >> /etc/sysctl.conf
299 chmod 777 /var/log/coredump
300 echo -e "* soft core unlimited\n* hard core unlimited" >> /etc/security/limits.conf
301
302 # Mount installation media in chroot
303 %post --nochroot --log=/mnt/sysimage/root/anaconda-post-before-chroot.log
304 #!/bin/sh
305
306 set -x
307
308 SOURCE="/mnt/sysimage/tmp/source"
309
310 for I in `cat /proc/cmdline`; do case "$I" in *=*) eval $I;; esac ; done
311
312 mkdir -p "${SOURCE}"
313
314 case "${repo}" in
315   nfs:*)
316     nfs_url="${repo#nfs:}"
317     mount -t nfs "${nfs_url}" "${SOURCE}"
318   ;;
319   *)
320     if [ -d "/mnt/source" ]; then
321       mount -o bind "/mnt/source" "${SOURCE}"
322     fi
323   ;;
324 esac
325
326 %post --log=/root/anaconda-post-after-chroot.log
327 #!/bin/bash
328
329 set -x
330
331 function save_cfg {
332     scrFile="/etc/sysconfig/network-scripts/ifcfg-$admin_interface"
333     search="domain $domain\nsearch $domain"
334     sed -i -e 's#^\(HOSTNAME=\).*$#\1'"$hostname"'#' /etc/sysconfig/network
335     grep -q "^\s*$ip\s+$hostname" /etc/hosts || echo "$ip $hostname" >> /etc/hosts
336     echo "${search}\nnameserver 127.0.0.1" > /etc/resolv.conf
337     [ $dns1 ] && echo -e "${search}\nnameserver $dns1" > /etc/resolv.conf
338     [ $dns1 ] && echo -e "${search}\nnameserver $dns1" > /etc/dnsmasq.upstream
339     [ $dns2 ] && echo "nameserver $dns2" >> /etc/resolv.conf
340     [ $dns2 ] && echo "nameserver $dns2" >> /etc/dnsmasq.upstream
341
342     echo DEVICE=$admin_interface > $scrFile
343     echo ONBOOT=yes >> $scrFile
344     echo NM_CONTROLLED=no >> $scrFile
345     echo HWADDR=$hwaddr >> $scrFile
346     echo USERCTL=no >> $scrFile
347     echo PEERDNS=no >> $scrFile
348     if [ $ip ]; then
349         echo BOOTPROTO=static >> $scrFile
350         echo IPADDR=$ip >> $scrFile
351         echo NETMASK=$netmask >> $scrFile
352     else
353         echo BOOTPROTO=dhcp >> $scrFile
354     fi
355     scrDHCPFile="/etc/sysconfig/network-scripts/ifcfg-$dhcp_interface"
356     #Ignore gateway and set up DHCP if it is used, otherwise apply it
357     if [ $dhcp_interface ] && [ "$dhcp_interface" != "$admin_interface" ]; then
358         echo "DEVICE=$dhcp_interface" > $scrDHCPFile
359         echo "BOOTPROTO=dhcp" >> $scrDHCPFile
360         echo "ONBOOT=yes" >> $scrDHCPFile
361         echo "USERCTL=no" >> $scrDHCPFile
362     else
363         echo GATEWAY=$gw >> /etc/sysconfig/network
364     fi
365     [ -n "$build_images" -a "$build_images" != "0" ] && echo -e "$build_images" > /root/.build_images
366 }
367
368 # Default FQDN
369 hostname="nailgun.mirantis.com"
370
371 for I in `cat /proc/cmdline`; do case "$I" in *=*) eval $I;; esac ; done
372 hostname=$hostname
373 domain=${hostname#*.}
374 ip=$ip
375 netmask=$netmask
376 gw=$gw
377 admin_interface=${admin_interface:-"eth0"}
378 hwaddr=`ifconfig $admin_interface | grep -i hwaddr | sed -e 's#^.*hwaddr[[:space:]]*##I'`
379 dhcp_interface=$dhcp_interface
380 build_images=$build_images
381 wait_for_external_config=$wait_for_external_config
382 save_cfg
383
384 # Mounting installation source
385 SOURCE=/tmp/source
386 FS=/tmp/fs
387
388 echo
389 mkdir -p ${SOURCE}
390 mkdir -p ${FS}
391
392 if test -e /dev/disk/by-label/"OpenStack_Fuel"; then
393     mount /dev/disk/by-label/"OpenStack_Fuel" ${SOURCE}
394 elif test -e /dev/disk/by-uuid/will_be_substituted_with_actual_uuid; then
395     mount /dev/disk/by-uuid/will_be_substituted_with_actual_uuid ${FS}
396     mount -o loop ${FS}/nailgun.iso ${SOURCE}
397 fi
398
399 OPENSTACK_VERSION=`cat ${SOURCE}/openstack_version`
400
401 # ----------------------
402 # UNPACKING REPOSITORIES
403 # ----------------------
404
405 wwwdir="/var/www/nailgun"
406 repodir="${wwwdir}/${OPENSTACK_VERSION}"
407
408 # Copying Centos files
409 mkdir -p ${repodir}/centos/x86_64
410 cp -r ${SOURCE}/images ${repodir}/centos/x86_64
411 cp -r ${SOURCE}/isolinux ${repodir}/centos/x86_64
412 cp -r ${SOURCE}/repodata ${repodir}/centos/x86_64
413 cp -r ${SOURCE}/Packages ${repodir}/centos/x86_64
414 cp ${SOURCE}/.treeinfo ${repodir}/centos/x86_64
415
416 # Copying Ubuntu files
417 mkdir -p ${repodir}/ubuntu/x86_64/images
418 cp -r ${SOURCE}/ubuntu/dists ${repodir}/ubuntu/x86_64
419 cp -r ${SOURCE}/ubuntu/pool ${repodir}/ubuntu/x86_64
420
421 # We do not ship debian-installer kernel and initrd on ISO.
422 # But we still need to be able to create ubuntu cobbler distro
423 # which requires kernel and initrd to be available. So, we
424 # just touch these files to work around cobbler's limitation.
425 touch ${repodir}/ubuntu/x86_64/images/linux
426 touch ${repodir}/ubuntu/x86_64/images/initrd.gz
427
428 # make links for backward compatibility
429 ln -s ${repodir}/centos ${wwwdir}/centos
430 ln -s ${repodir}/ubuntu ${wwwdir}/ubuntu
431
432 # --------------------------
433 # UNPACKING PUPPET MANIFESTS
434 # --------------------------
435
436 # create folders
437 #mkdir -p /etc/puppet/${OPENSTACK_VERSION}/manifests/
438 #mkdir -p /etc/puppet/${OPENSTACK_VERSION}/modules/
439 #rm -rf /etc/puppet/modules/
440
441 # TODO(ikalnitsky): investigate why we need this
442 #cp ${SOURCE}/puppet-slave.tgz ${wwwdir}/
443
444 # place modules and manifests
445 #tar zxf ${SOURCE}/puppet-slave.tgz -C /etc/puppet/${OPENSTACK_VERSION}/modules
446 #cp /etc/puppet/${OPENSTACK_VERSION}/modules/osnailyfacter/examples/site.pp /etc/puppet/${OPENSTACK_VERSION}/manifests/site.pp
447 cp ${SOURCE}/centos-versions.yaml ${SOURCE}/ubuntu-versions.yaml /etc/puppet/${OPENSTACK_VERSION}/manifests/
448
449 # make links for backward compatibility
450 #pushd /etc/puppet
451 #ln -s ${OPENSTACK_VERSION}/manifests/ /etc/puppet/manifests
452 #ln -s ${OPENSTACK_VERSION}/modules/ /etc/puppet/modules
453 #popd
454
455 cp ${SOURCE}/send2syslog.py /bin/send2syslog.py
456 mkdir -p /var/lib/hiera
457 touch /var/lib/hiera/common.yaml /etc/puppet/hiera.yaml
458
459 # Prepare local repository specification
460 rm /etc/yum.repos.d/CentOS*.repo
461 cat > /etc/yum.repos.d/nailgun.repo << EOF
462 [nailgun]
463 name=Nailgun Local Repo
464 baseurl=file:/var/www/nailgun/${OPENSTACK_VERSION}/centos/x86_64
465 gpgcheck=0
466 EOF
467
468 # Disable subscription-manager plugins
469 sed -i 's/^enabled.*/enabled=0/' /etc/yum/pluginconf.d/product-id.conf || :
470 sed -i 's/^enabled.*/enabled=0/' /etc/yum/pluginconf.d/subscription-manager.conf || :
471
472 # Disable GSSAPI in ssh server config
473 sed -i -e "/^\s*GSSAPICleanupCredentials yes/d" -e "/^\s*GSSAPIAuthentication yes/d" /etc/ssh/sshd_config
474
475 # Enable MOTD banner in sshd
476 sed -i -e "s/^\s*PrintMotd no/PrintMotd yes/g" /etc/ssh/sshd_config
477
478 # Add note regarding local repos creation to MOTD
479 cat >> /etc/motd << EOF
480
481 All environments use online repositories by default.
482 Use the following commands to create local repositories
483 on master node and change default repository settings:
484
485 * CentOS: fuel-package-updates (see --help for options)
486 * Ubuntu: fuel-createmirror (see --help for options)
487
488 Please refer to the following guide for more information:
489 https://docs.mirantis.com/openstack/fuel/fuel-7.0/reference-architecture.html#fuel-rep-mirror
490
491 EOF
492
493 # Copying bootstrap_admin_node.sh, chmod it and
494 # adding /etc/init/bootstrap_admin_node.conf
495 cp ${SOURCE}/bootstrap_admin_node.sh /usr/local/sbin/bootstrap_admin_node.sh
496 chmod 0777 /usr/local/sbin/bootstrap_admin_node.sh
497 cp ${SOURCE}/bootstrap_admin_node.conf /etc/init/bootstrap_admin_node.conf
498 echo "ENABLED=1" > /etc/sysconfig/bootstrap_admin_node
499
500 # Copying version.yaml file. It contains COMMIT_SHA of last commit.
501 RELEASE=$(awk '/release/{gsub(/"/, "");print $2}' ${SOURCE}/version.yaml)
502 mkdir -p /etc/nailgun /etc/fuel/${RELEASE} /etc/fuel/release_versions
503 cp ${SOURCE}/version.yaml /etc/nailgun/version.yaml
504 cp ${SOURCE}/version.yaml /etc/fuel/${RELEASE}/version.yaml
505 ln -s /etc/fuel/${RELEASE}/version.yaml /etc/fuel/version.yaml
506 cp ${SOURCE}/version.yaml /etc/fuel/release_versions/`cat  ${SOURCE}/openstack_version`.yaml
507
508 # Generete Fuel UUID
509 uuidgen > /etc/fuel/fuel-uuid
510
511 # Run fuel menu 
512 [ -z "$showmenu" ] && showmenu="no"
513
514 # Pause during bootstrap_admin_node to wait for external config
515 [ -z "$wait_for_external_config" ] && wait_for_external_config="no"
516
517
518 # Prepare bootstrap_admin_node config
519 cat > /etc/fuel/bootstrap_admin_node.conf << EOF
520 #Set to yes to run Fuel Setup
521 #Set to no to accept default settings
522 ADMIN_INTERFACE=${admin_interface}
523 showmenu=${showmenu}
524 wait_for_external_config=${wait_for_external_config}
525 EOF
526
527 # Prepare custom /etc/issue logon banner and script for changing IP in it
528 cat > /etc/issue << EOF
529 #########################################
530 #       Welcome to the Fuel server      #
531 #########################################
532 Server is running on \m platform
533
534 Fuel UI is available on:
535 https://:8443
536
537 Default administrator login:    root
538 Default administrator password: r00tme
539
540 Default Fuel UI login: admin
541 Default Fuel UI password: admin
542
543 Please change root password on first login.
544
545 EOF
546
547
548 cat >> '/etc/rc.local' << EOF
549 first=yes
550 for ip in \$(ip -o -4 addr | grep "eth." | awk '{print \$4 }' | cut -d/ -f1); do
551 if [ "\$first" = "yes" ]; then
552   ipstr="Fuel UI is available on: https://\$ip:8443"
553   first=no
554 else
555   ipstr=\$(printf "%s\n%25s%s" "\$ipstr" " " "https://\$ip:8443")
556 fi
557 done
558 tmpissue=\$(mktemp)
559 while read -r line; do
560   if [[ "\$line" =~ "Fuel UI is available on" ]]; then
561     echo -e "\$ipstr" >> \$tmpissue
562   elif [[ "\$line" =~ :8443$ ]]; then
563     :
564   else
565     echo -e "\$line" >> \$tmpissue
566   fi
567 done < /etc/issue
568 mv "\$tmpissue" /etc/issue
569
570 EOF
571
572 ######### OPNFV addition BEGIN ############
573 # Copy data into /opt/opnfv
574 # TODO: This ought to be a package instead!
575 mkdir -p /opt/opnfv
576 cp -r ${SOURCE}/opnfv /opt
577 cp ${SOURCE}/gitinfo.txt /
578 ######### OPNFV addition END ############
579
580 # Unmounting source
581 umount -f ${SOURCE}
582 rm -rf ${SOURCE}
583
584 umount -f ${FS} || true
585 rm -rf ${FS}
586
587 echo "tos orphan 7" >> /etc/ntp.conf
588
589 # Do not show error message on ntpdate failure. Customers should not be confused
590 # if admin node does not have access to the internet time servers.
591 sed -i /etc/rc.d/init.d/ntpdate -e 's/\([ $RETVAL -eq 0 ] && success || \)failure/\1success/'
592
593 # Disabling splash
594 sed -i --follow-symlinks -e '/^\skernel/ s/rhgb//' /etc/grub.conf
595 sed -i --follow-symlinks -e '/^\skernel/ s/quiet//' /etc/grub.conf
596
597 # Disabling console clearing
598 sed -i 's/getty/getty --noclear/' /etc/init/tty.conf
599
600 # Disabling starting first console from start-ttys service
601 sed -i --follow-symlinks -e 's/ACTIVE_CONSOLES=.*/ACTIVE_CONSOLES=\/dev\/tty\[2-6\]/' /etc/sysconfig/init
602
603 # Copying default bash settings to the root directory
604 cp -f /etc/skel/.bash* /root/
605
606 # Blacklist i2c_piix4 module for VirtualBox so it does not create kernel errors
607 [[ $(virt-what) = "virtualbox" ]] && echo "blacklist i2c_piix4" > /etc/modprobe.d/blacklist-i2c-piix4.conf
608
609 %end