#!/bin/bash set -euo pipefail baseDir="$(realpath "$(dirname "${0}")")" source \ /etc/os-release source \ "${baseDir}/system.conf" if [[ "${1}" == '--live' ]]; then if [[ "${VERSION_ID}" -lt '41' ]]; then dnf config-manager \ --disable \ updates else dnf config-manager \ setopt \ updates.enabled=0 fi dnf install \ -y \ https://zfsonlinux.org/fedora/zfs-release-${zolFedoraVer}$(rpm --eval "%{dist}").noarch.rpm dnf install \ -y \ https://dl.fedoraproject.org/pub/fedora/linux/releases/${VERSION_ID}/Everything/x86_64/os/Packages/k/kernel-devel-$(uname -r).rpm dnf install \ -y \ zfs \ gdisk modprobe \ zfs elif [[ "${1}" == '--rsync' ]]; then mkdir -p /run/install if [[ "${VERSION_ID}" -lt '41' ]]; then mount /dev/mapper/live-base /run/install else mount /dev/live-base /run/install fi rsync -pogAXtlHrDx \ --stats \ --exclude=/boot/efi/* \ --exclude=/etc/machine-id \ --info=progress2 \ /run/install/ /mnt elif [[ "${1}" == '--resolv-conf' ]]; then mv /mnt/etc/resolv.conf \ /mnt/etc/resolv.conf.orig cp -L \ /etc/resolv.conf \ /mnt/etc elif [[ "${1}" == '--dracut' ]]; then dracut \ --force \ --regenerate-all fi