Advertisement
Guest User

anaconda

a guest
May 13th, 2015
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.35 KB | None | 0 0
  1. #version=RHEL7
  2. # System authorization information
  3. auth --useshadow --enablemd5
  4. # Install OS instead of upgrade
  5. install
  6.  
  7. # Use CDROM installation media
  8. cdrom
  9. # Use graphical install
  10. graphical
  11. # Firewall configuration
  12. firewall --disabled
  13. firstboot --disable
  14. ignoredisk --only-use=sda,sdb
  15. # Keyboard layouts
  16. # old format: keyboard us
  17. # new format:
  18. keyboard --vckeymap=us --xlayouts='fr'
  19. # System language
  20. lang en_US.UTF-8 --addsupport=fr_FR.UTF-8
  21.  
  22. # Network information
  23. network --bootproto=static --device=ens192 --gateway=10.100.100.33 --ip=10.100.100.33 --nameserver=10.100.100.7 --netmask=255.255.255.0 --noipv6 --activate
  24. network --bootproto=static --device=ens224 --ip=10.10.10.33 --netmask=255.255.255.0 --onboot=off --noipv6 --activate
  25. network --hostname=localhost.localdomain
  26. # Root password
  27. rootpw --plaintext blueonyx
  28. # SELinux configuration
  29. selinux --disabled
  30. # System services
  31. services --disabled="network,sshd,NetworkManager,firewalld"
  32. # Do not configure the X Window System
  33. skipx
  34. # System timezone
  35. timezone Europe/Paris --isUtc --nontp
  36. # System bootloader configuration
  37. bootloader --location=mbr --boot-drive=sda
  38. autopart --type=lvm
  39. # Clear the Master Boot Record
  40. zerombr
  41. # Partition clearing information
  42. clearpart --none --initlabel
  43.  
  44. %pre
  45.  
  46. #!/bin/sh
  47.  
  48. # prepare temporary file
  49. rm -f /tmp/include-parts
  50. touch /tmp/include-parts
  51.  
  52. # define sizes
  53. bootsize=800
  54. rootsize=8192
  55. varsize=8192
  56. tmpsize=4096
  57. swapsize=4096
  58.  
  59. # Explanation:
  60. # We check with fdisk if the drive exists.
  61. # If it reports the Disk size in MB, it's the CD-ROM with the install media on it. So we ignore that device.
  62. # If it reports "Disk /dev/", it's a usable HD that we then add for usage.
  63.  
  64. # This worked so well before, now on SL it doesn't:
  65. # disks="$(list-harddrives|cut -d \ -f1|sort)"
  66.  
  67. # Back to the old dirty method:
  68. disks="$(fdisk -l /dev/{s,h}d{a,b,c,d}|grep -v MB|grep "Disk /dev/"|cut -d \/ -f3 |cut -d : -f1 | sort | uniq)"
  69.  
  70. numdisks=0
  71. for disk in ${disks}; do
  72. let "numdisks=$numdisks + 1"
  73. done
  74.  
  75. echo "Disks: $numdisks" >> /tmp/numdisks
  76.  
  77. notfour_notone=""
  78.  
  79. if [ $numdisks == "4" ] ; then
  80.  
  81. # We know how many disks we now have.
  82. # Make sure the other parts don't kick in:
  83. notfour_notone="0"
  84.  
  85. # This kicks in if we have four disks:
  86.  
  87. # clear partitions
  88. echo "clearpart --drives=$(echo $disks | sed -e "s/ /,/g") --initlabel" >> /tmp/include-parts
  89.  
  90. # start counting partitions and disks
  91. partnum=1
  92. disknum=1
  93.  
  94. # setup raided boot partition
  95. bootparts=""
  96. numdisks="0"
  97.  
  98. for disk in ${disks}; do
  99. echo "part raid.0$disknum --ondisk=$disk --size=$bootsize --asprimary" >> /tmp/include-parts
  100. bootparts="$bootparts raid.0$disknum"
  101. let "disknum=$disknum + 1"
  102. done
  103.  
  104. # increment partition number
  105. let "partnum=$partnum + 1"
  106.  
  107. # now add the raid line
  108. echo "raid /boot --fstype ext4 --level=RAID1 --device md0 $bootparts" >> /tmp/include-parts
  109.  
  110. # create identical volume groups on all remaining disks to house root and swap (the sys vg)
  111. for disk in ${disks}; do
  112. echo "part raid.0$disknum --size=19000 --grow --ondisk=$disk --asprimary" >> /tmp/include-parts
  113. let "disknum=$disknum + 1"
  114. done
  115.  
  116. # now setup the sysvg
  117. # create large enough mirror spanning all disks
  118. # create logical volume in new mirror
  119. # create root, var, and swap in new logical volume
  120. cat >>/tmp/include-parts<<EOF
  121. raid pv.10 --level=RAID1 --device=md1 raid.05 raid.07
  122. raid pv.20 --level=RAID1 --device=md2 raid.06 raid.08
  123. volgroup VolGroup00 pv.10 pv.20
  124. logvol / --fstype ext4 --name=root --vgname=VolGroup00 --size=$rootsize
  125. logvol swap --fstype swap --name=swap --vgname=VolGroup00 --size=$swapsize
  126. logvol /tmp --fstype ext4 --name=tmp --vgname=VolGroup00 --size=$tmpsize
  127. logvol /var --fstype ext4 --name=var --vgname=VolGroup00 --size=$varsize
  128. logvol /home --fstype ext4 --name=home --vgname=VolGroup00 --size=2000 --grow
  129. EOF
  130.  
  131. else
  132.  
  133. # Found less than four disks:
  134. notfour_notone="1"
  135.  
  136. fi
  137.  
  138. if [ $numdisks == "1" ] ; then
  139.  
  140. # We know how many disks we now have.
  141. # Make sure the other parts don't kick in:
  142. notfour_notone="0"
  143.  
  144. # This kicks in if we only have one disk:
  145.  
  146. cat >>/tmp/include-parts<<EOF
  147. clearpart --all
  148. part /boot --fstype "ext4" --size=$bootsize
  149. part pv.9 --size=19000 --grow
  150. volgroup VolGroup00 pv.9
  151. logvol / --fstype ext4 --name=root --vgname=VolGroup00 --size=$rootsize
  152. logvol swap --fstype swap --name=swap --vgname=VolGroup00 --size=$swapsize
  153. logvol /tmp --fstype ext4 --name=tmp --vgname=VolGroup00 --size=$tmpsize
  154. logvol /var --fstype ext4 --name=var --vgname=VolGroup00 --size=$varsize
  155. logvol /home --fstype ext4 --name=home --vgname=VolGroup00 --size=2000 --grow
  156. EOF
  157.  
  158. else
  159.  
  160. # Found more than one disk:
  161. notfour_notone="1"
  162.  
  163. fi
  164.  
  165. if [ $notfour_notone == "1" ] && [ $numdisks != "0" ] ; then
  166.  
  167. # We know how many disks we now have.
  168. # Make sure the other parts don't kick in:
  169. notfour_notone="0"
  170.  
  171. # This kicks in if we have 2-3 disks, which then will be used for RAID:
  172.  
  173. # clear partitions
  174. echo "clearpart --drives=$(echo $disks | sed -e "s/ /,/g") --initlabel" >> /tmp/include-parts
  175.  
  176. # start counting partitions and disks
  177. partnum=1
  178. disknum=1
  179.  
  180. # setup raided boot partition
  181. bootparts=""
  182. numdisks="0"
  183.  
  184. for disk in ${disks}; do
  185. echo "part raid.$disknum$partnum --size=$bootsize --ondisk=$disk --asprimary" >> /tmp/include-parts
  186. bootparts="$bootparts raid.$disknum$partnum"
  187. let "disknum=$disknum + 1"
  188. done
  189.  
  190. # increment partition number
  191. let "partnum=$partnum + 1"
  192.  
  193. # now add the raid line
  194. echo "raid /boot --fstype ext4 --level=RAID1 --device md0 $bootparts" >> /tmp/include-parts
  195.  
  196. # create identical volume groups on all remaining disks to house root and swap (the sys vg)
  197. sysvgparts=""
  198. for disk in ${disks}; do
  199. echo "part raid.$disknum$partnum --size=19000 --grow --ondisk=$disk --asprimary" >> /tmp/include-parts
  200. sysvgparts="$sysvgparts raid.$disknum$partnum"
  201. let "disknum=$disknum + 1"
  202. done
  203.  
  204. # now setup the sysvg
  205. # create large enough mirror spanning all disks
  206. # create logical volume in new mirror
  207. # create root, var, and swap in new logical volume
  208. cat >>/tmp/include-parts<<EOF
  209. raid pv.01 --fstype LVM --level=RAID1 --device md1 $sysvgparts
  210. volgroup VolGroup00 pv.01
  211. logvol / --fstype ext4 --name=root --vgname=VolGroup00 --size=$rootsize
  212. logvol swap --fstype swap --name=swap --vgname=VolGroup00 --size=$swapsize
  213. logvol /tmp --fstype ext4 --name=tmp --vgname=VolGroup00 --size=$tmpsize
  214. logvol /var --fstype ext4 --name=var --vgname=VolGroup00 --size=$varsize
  215. logvol /home --fstype ext4 --name=home --vgname=VolGroup00 --size=2000 --grow
  216. EOF
  217.  
  218. fi
  219. %end
  220.  
  221. %post --logfile /root/bx-post-log
  222. # Run post install script
  223. /root/finish_install.sh
  224.  
  225. /bin/echo "# Added by kickstart:" > /root/.bashrc
  226. /bin/echo "# Source global definitions" >> /root/.bashrc
  227. /bin/echo "if [ -f /etc/bashrc ]; then" >> /root/.bashrc
  228. /bin/echo " . /etc/bashrc" >> /root/.bashrc
  229. /bin/echo "fi" >> /root/.bashrc
  230.  
  231. # Show login information in the "issue"
  232. /bin/echo "Welcome to your new server ... " > /etc/issue
  233. /bin/echo " To finish setup, simply login in as \"root\" with password \"blueonyx\"" >> /etc/issue
  234. /bin/echo "" >> /etc/issue
  235.  
  236. # Tell people how to reconfigure network via the CLI
  237. /bin/echo "/bin/echo \"\"" >> /root/.bashrc
  238. /bin/echo "/bin/echo \"To change your network settings from the command line, run\"" >> /root/.bashrc
  239. /bin/echo "/bin/echo \"the command /root/network_settings.sh\"" >> /root/.bashrc
  240. /bin/echo "/bin/echo \"\"" >> /root/.bashrc
  241. /bin/echo "/bin/echo \"To remove this notice, edit /root/.bashrc\"" >> /root/.bashrc
  242. /bin/echo "/bin/echo \"\"" >> /root/.bashrc
  243. /bin/echo "/root/setup.sh" >> /root/.bashrc
  244.  
  245. # Set grub to noisy and remove 'rhgb quiet':
  246. /bin/sed -i -e 's@ rhgb quiet@@' /etc/default/grub
  247. /bin/sed -i -e 's@ rhgb quiet@@' /boot/grub2/grub.cfg
  248. /bin/sed -i -e 's@ rhgb quiet@@' /etc/grub2.cfg
  249.  
  250. %end
  251.  
  252. %packages --nobase
  253. @blueonyx
  254. @core
  255. anaconda
  256. authconfig
  257. blueonyx-cd-installer
  258. blueonyx-logos
  259. chrony
  260. efibootmgr
  261. firewalld
  262. grub2
  263. grub2-efi
  264. memtest86+
  265. shim
  266. syslinux
  267. -kde-l10n-*
  268. -kde-runtime
  269. -postfix
  270.  
  271. %end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement