Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #version=RHEL7
- # System authorization information
- auth --useshadow --enablemd5
- # Install OS instead of upgrade
- install
- # Use CDROM installation media
- cdrom
- # Use graphical install
- graphical
- # Firewall configuration
- firewall --disabled
- firstboot --disable
- ignoredisk --only-use=sda,sdb
- # Keyboard layouts
- # old format: keyboard us
- # new format:
- keyboard --vckeymap=us --xlayouts='fr'
- # System language
- lang en_US.UTF-8 --addsupport=fr_FR.UTF-8
- # Network information
- 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
- network --bootproto=static --device=ens224 --ip=10.10.10.33 --netmask=255.255.255.0 --onboot=off --noipv6 --activate
- network --hostname=localhost.localdomain
- # Root password
- rootpw --plaintext blueonyx
- # SELinux configuration
- selinux --disabled
- # System services
- services --disabled="network,sshd,NetworkManager,firewalld"
- # Do not configure the X Window System
- skipx
- # System timezone
- timezone Europe/Paris --isUtc --nontp
- # System bootloader configuration
- bootloader --location=mbr --boot-drive=sda
- autopart --type=lvm
- # Clear the Master Boot Record
- zerombr
- # Partition clearing information
- clearpart --none --initlabel
- %pre
- #!/bin/sh
- # prepare temporary file
- rm -f /tmp/include-parts
- touch /tmp/include-parts
- # define sizes
- bootsize=800
- rootsize=8192
- varsize=8192
- tmpsize=4096
- swapsize=4096
- # Explanation:
- # We check with fdisk if the drive exists.
- # If it reports the Disk size in MB, it's the CD-ROM with the install media on it. So we ignore that device.
- # If it reports "Disk /dev/", it's a usable HD that we then add for usage.
- # This worked so well before, now on SL it doesn't:
- # disks="$(list-harddrives|cut -d \ -f1|sort)"
- # Back to the old dirty method:
- 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)"
- numdisks=0
- for disk in ${disks}; do
- let "numdisks=$numdisks + 1"
- done
- echo "Disks: $numdisks" >> /tmp/numdisks
- notfour_notone=""
- if [ $numdisks == "4" ] ; then
- # We know how many disks we now have.
- # Make sure the other parts don't kick in:
- notfour_notone="0"
- # This kicks in if we have four disks:
- # clear partitions
- echo "clearpart --drives=$(echo $disks | sed -e "s/ /,/g") --initlabel" >> /tmp/include-parts
- # start counting partitions and disks
- partnum=1
- disknum=1
- # setup raided boot partition
- bootparts=""
- numdisks="0"
- for disk in ${disks}; do
- echo "part raid.0$disknum --ondisk=$disk --size=$bootsize --asprimary" >> /tmp/include-parts
- bootparts="$bootparts raid.0$disknum"
- let "disknum=$disknum + 1"
- done
- # increment partition number
- let "partnum=$partnum + 1"
- # now add the raid line
- echo "raid /boot --fstype ext4 --level=RAID1 --device md0 $bootparts" >> /tmp/include-parts
- # create identical volume groups on all remaining disks to house root and swap (the sys vg)
- for disk in ${disks}; do
- echo "part raid.0$disknum --size=19000 --grow --ondisk=$disk --asprimary" >> /tmp/include-parts
- let "disknum=$disknum + 1"
- done
- # now setup the sysvg
- # create large enough mirror spanning all disks
- # create logical volume in new mirror
- # create root, var, and swap in new logical volume
- cat >>/tmp/include-parts<<EOF
- raid pv.10 --level=RAID1 --device=md1 raid.05 raid.07
- raid pv.20 --level=RAID1 --device=md2 raid.06 raid.08
- volgroup VolGroup00 pv.10 pv.20
- logvol / --fstype ext4 --name=root --vgname=VolGroup00 --size=$rootsize
- logvol swap --fstype swap --name=swap --vgname=VolGroup00 --size=$swapsize
- logvol /tmp --fstype ext4 --name=tmp --vgname=VolGroup00 --size=$tmpsize
- logvol /var --fstype ext4 --name=var --vgname=VolGroup00 --size=$varsize
- logvol /home --fstype ext4 --name=home --vgname=VolGroup00 --size=2000 --grow
- EOF
- else
- # Found less than four disks:
- notfour_notone="1"
- fi
- if [ $numdisks == "1" ] ; then
- # We know how many disks we now have.
- # Make sure the other parts don't kick in:
- notfour_notone="0"
- # This kicks in if we only have one disk:
- cat >>/tmp/include-parts<<EOF
- clearpart --all
- part /boot --fstype "ext4" --size=$bootsize
- part pv.9 --size=19000 --grow
- volgroup VolGroup00 pv.9
- logvol / --fstype ext4 --name=root --vgname=VolGroup00 --size=$rootsize
- logvol swap --fstype swap --name=swap --vgname=VolGroup00 --size=$swapsize
- logvol /tmp --fstype ext4 --name=tmp --vgname=VolGroup00 --size=$tmpsize
- logvol /var --fstype ext4 --name=var --vgname=VolGroup00 --size=$varsize
- logvol /home --fstype ext4 --name=home --vgname=VolGroup00 --size=2000 --grow
- EOF
- else
- # Found more than one disk:
- notfour_notone="1"
- fi
- if [ $notfour_notone == "1" ] && [ $numdisks != "0" ] ; then
- # We know how many disks we now have.
- # Make sure the other parts don't kick in:
- notfour_notone="0"
- # This kicks in if we have 2-3 disks, which then will be used for RAID:
- # clear partitions
- echo "clearpart --drives=$(echo $disks | sed -e "s/ /,/g") --initlabel" >> /tmp/include-parts
- # start counting partitions and disks
- partnum=1
- disknum=1
- # setup raided boot partition
- bootparts=""
- numdisks="0"
- for disk in ${disks}; do
- echo "part raid.$disknum$partnum --size=$bootsize --ondisk=$disk --asprimary" >> /tmp/include-parts
- bootparts="$bootparts raid.$disknum$partnum"
- let "disknum=$disknum + 1"
- done
- # increment partition number
- let "partnum=$partnum + 1"
- # now add the raid line
- echo "raid /boot --fstype ext4 --level=RAID1 --device md0 $bootparts" >> /tmp/include-parts
- # create identical volume groups on all remaining disks to house root and swap (the sys vg)
- sysvgparts=""
- for disk in ${disks}; do
- echo "part raid.$disknum$partnum --size=19000 --grow --ondisk=$disk --asprimary" >> /tmp/include-parts
- sysvgparts="$sysvgparts raid.$disknum$partnum"
- let "disknum=$disknum + 1"
- done
- # now setup the sysvg
- # create large enough mirror spanning all disks
- # create logical volume in new mirror
- # create root, var, and swap in new logical volume
- cat >>/tmp/include-parts<<EOF
- raid pv.01 --fstype LVM --level=RAID1 --device md1 $sysvgparts
- volgroup VolGroup00 pv.01
- logvol / --fstype ext4 --name=root --vgname=VolGroup00 --size=$rootsize
- logvol swap --fstype swap --name=swap --vgname=VolGroup00 --size=$swapsize
- logvol /tmp --fstype ext4 --name=tmp --vgname=VolGroup00 --size=$tmpsize
- logvol /var --fstype ext4 --name=var --vgname=VolGroup00 --size=$varsize
- logvol /home --fstype ext4 --name=home --vgname=VolGroup00 --size=2000 --grow
- EOF
- fi
- %end
- %post --logfile /root/bx-post-log
- # Run post install script
- /root/finish_install.sh
- /bin/echo "# Added by kickstart:" > /root/.bashrc
- /bin/echo "# Source global definitions" >> /root/.bashrc
- /bin/echo "if [ -f /etc/bashrc ]; then" >> /root/.bashrc
- /bin/echo " . /etc/bashrc" >> /root/.bashrc
- /bin/echo "fi" >> /root/.bashrc
- # Show login information in the "issue"
- /bin/echo "Welcome to your new server ... " > /etc/issue
- /bin/echo " To finish setup, simply login in as \"root\" with password \"blueonyx\"" >> /etc/issue
- /bin/echo "" >> /etc/issue
- # Tell people how to reconfigure network via the CLI
- /bin/echo "/bin/echo \"\"" >> /root/.bashrc
- /bin/echo "/bin/echo \"To change your network settings from the command line, run\"" >> /root/.bashrc
- /bin/echo "/bin/echo \"the command /root/network_settings.sh\"" >> /root/.bashrc
- /bin/echo "/bin/echo \"\"" >> /root/.bashrc
- /bin/echo "/bin/echo \"To remove this notice, edit /root/.bashrc\"" >> /root/.bashrc
- /bin/echo "/bin/echo \"\"" >> /root/.bashrc
- /bin/echo "/root/setup.sh" >> /root/.bashrc
- # Set grub to noisy and remove 'rhgb quiet':
- /bin/sed -i -e 's@ rhgb quiet@@' /etc/default/grub
- /bin/sed -i -e 's@ rhgb quiet@@' /boot/grub2/grub.cfg
- /bin/sed -i -e 's@ rhgb quiet@@' /etc/grub2.cfg
- %end
- %packages --nobase
- @blueonyx
- @core
- anaconda
- authconfig
- blueonyx-cd-installer
- blueonyx-logos
- chrony
- efibootmgr
- firewalld
- grub2
- grub2-efi
- memtest86+
- shim
- syslinux
- -kde-l10n-*
- -kde-runtime
- -postfix
- %end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement