System Configuration

  1. Generate fstab:

    mkdir -p /mnt/etc/
    for i in ${DISK}; do
       echo UUID=$(blkid -s UUID -o value ${i}-part1) /boot/efis/${i##*/}-part1 vfat \
       umask=0022,fmask=0022,dmask=0022 0 1 >> /mnt/etc/fstab
    done
    echo $(echo $DISK | cut -f1 -d\ )-part1 /boot/efi vfat \
       noauto,umask=0022,fmask=0022,dmask=0022 0 1 >> /mnt/etc/fstab
    
  2. Configure dracut:

    echo 'add_dracutmodules+=" zfs "' > /mnt/etc/dracut.conf.d/zfs.conf
    
  3. Force load mpt3sas module if used:

    if grep mpt3sas /proc/modules; then
      echo 'forced_drivers+=" mpt3sas "'  >> /mnt/etc/dracut.conf.d/zfs.conf
    fi
    
  4. Set locale, keymap, timezone, hostname and root password:

    rm -f /mnt/etc/localtime
    systemd-firstboot --root=/mnt --prompt --root-password=PASSWORD --force
    
  5. Generate host id:

    zgenhostid -f -o /mnt/etc/hostid
    
  6. Install locale package, example for English locale:

    dnf --installroot=/mnt install -y glibc-minimal-langpack glibc-langpack-en
    
  7. Enable ZFS services:

    systemctl enable zfs-import-scan.service zfs-mount zfs-import.target zfs-zed zfs.target --root=/mnt
    
  8. By default SSH server is enabled, allowing root login by password, disable SSH server:

    systemctl disable sshd --root=/mnt
    systemctl enable firewalld --root=/mnt
    
  9. Chroot:

    m='/dev /proc /sys'
    for i in $m; do mount --rbind $i /mnt/$i; done
    
    history -w /mnt/home/sys-install-pre-chroot.txt
    chroot /mnt /usr/bin/env DISK="$DISK" bash --login
    
  10. For SELinux, relabel filesystem on reboot:

    fixfiles -F onboot
    
  11. Set root password, the password set earlier does not work due to SELinux:

    passwd