# default keyboard and language #keyboard 'us' #lang en_US.UTF-8 # We do not want SELinux selinux --disabled # Services to activate services --disabled=lm_sensors # Default root pass, will be changed in post-install process anyway rootpw --lock user --name=installer --uid=9999 # Accept EULA eula --agreed # don't install X skipx # Partitioning from pre section %include /tmp/part-include # Disable kdump %addon com_redhat_kdump --disable %end # Install type and location information %include /tmp/install_include # Packages to install %packages --nocore %include /tmp/packages-include %end # Modular %include /tmp/modular-include # Partitioning in pre-install %pre --interpreter=/bin/bash --log=/var/log/sme-partitioning.log # Default values DEFAULT_INSTALL="ISO" DEFAULT_CONTRIBS="" DEFAULT_ADDONS="" DEFAULT_FILESYSTEM="xfs" DEFAULT_USE_LVM="yes" DEFAULT_USE_RAID="yes" # Read command line arguments if grep sme.netinstall "/proc/cmdline" ; then DEFAULT_INSTALL="netinstall" ; fi if grep sme.contribs "/proc/cmdline" ; then DEFAULT_CONTRIBS=true ; fi if grep sme.addons "/proc/cmdline" ; then DEFAULT_ADDONS=true ; fi if grep nolvm "/proc/cmdline" ; then NOLVM=true ; DEFAULT_USE_LVM="no" ; fi if grep noraid "/proc/cmdline" ; then NORAID=true ; DEFAULT_USE_RAID="no" ; fi if grep noxfs "/proc/cmdline" ; then FSTYPE="ext4" ; else FSTYPE="xfs" ; fi echo "Command line arguments:" cat /proc/cmdline echo "[$(date '+%Y-%m-%d %H:%M:%S')] === Starting Install Configuration ===" # create the common part of the packages section cat > /tmp/packages-include < /tmp/modular-include < /tmp/install_include < /tmp/install_include <> /tmp/install_include <> /tmp/install_include <> /tmp/install_include <> /tmp/install_include <> /tmp/packages-include <> /tmp/modular-include < /tmp/part-include < /tmp/part-include <> /tmp/part-include elif [ $BASESIZE -gt 2048000 ] ; then printf "part biosboot --fstype=biosboot --size=1 --ondisk=%s\n" "${DRIVES[0]}" >> /tmp/part-include fi # Create boot partition printf "part /boot --fstype=%s --size=512 --label=BOOT --ondisk=%s\n" "$FSTYPE" "${DRIVES[0]}" >> /tmp/part-include # Default to LVM unless specified at command line if [ $NOLVM ] ; then cat >> /tmp/part-include <> /tmp/part-include <> /tmp/part-include elif [ $BASESIZE -gt 2048000 ] ; then printf "part biosboot --fstype=biosboot --size=1 --ondisk=%s\n" "${DRIVES[$i]}" >> /tmp/part-include fi printf "part raid.%s1 --size=512 --ondisk=%s\n" "$i" "${DRIVES[$i]}" >> /tmp/part-include # Default to LVM unless specified if [ $NOLVM ] ; then printf "part raid.%s2 --size=3000 --grow --ondisk=%s\n" "$i" "${DRIVES[$i]}" >> /tmp/part-include printf "part raid.%s3 --size=%s --ondisk=%s\n" "$i" "$SWAP_SIZE" "${DRIVES[$i]}" >> /tmp/part-include else printf "part raid.%s2 --size=4300 --grow --ondisk=%s\n" "$i" "${DRIVES[$i]}" >> /tmp/part-include fi done # Compute RAID level # from https://wiki.contribs.org/Raid # 2 Drives - Software RAID 1 # 3 Drives - Software RAID 1 + 1 Hot-spare # 4 Drives - Software RAID 6 # 5+ Drives - Software RAID 6 + 1 Hot-spare if [ ${#DRIVES[@]} == 2 ] ; then RAID_LEVEL=1 SPARE=0 elif [ ${#DRIVES[@]} == 3 ] ; then RAID_LEVEL=1 SPARE=1 elif [ ${#DRIVES[@]} == 4 ] ; then RAID_LEVEL=6 SPARE=0 else RAID_LEVEL=6 SPARE=1 fi # Set up RAID devices printf -v EFIDEVS "raid.%s0 " "${!DRIVES[@]}" printf -v BOOTDEVS "raid.%s1 " "${!DRIVES[@]}" printf -v ROOTDEVS "raid.%s2 " "${!DRIVES[@]}" printf -v SWAPDEVS "raid.%s3 " "${!DRIVES[@]}" # Include the EFI partition if necessary if [ -d /sys/firmware/efi ] ; then printf "raid /boot/efi --fstype=efi --level=1 --spares=0 --device=md9 %s\n" "$EFIDEVS" >> /tmp/part-include fi # Boot partition printf "raid /boot --fstype=%s --level=1 --spares=0 --device=md0 %s\n" "$FSTYPE" "$BOOTDEVS" >> /tmp/part-include # Default to LVM unless specified if [ $NOLVM ] ; then cat >> /tmp/part-include <> /tmp/part-include <