Files
ZFSBootMenu-Root-Install/install.sh

101 lines
1.8 KiB
Bash
Executable File

#!/bin/bash
set -euo pipefail
baseDir="$(realpath "$(dirname "${0}")")"
printf \
'\033[?47l\012'
cat << EOF
#######################################
## ##
## $(cat "${baseDir}/title") Script ##
## ##
## Jean <jean@easthighnerd.net> ##
## ##
#######################################
###############
## ##
## Install ##
## ##
###############
EOF
source \
/etc/os-release
source \
"${baseDir}/system.conf"
if [[ ! -f "/etc/mtab" ]]; then
"${baseDir}/mtab.sh"
fi
if [[ "${ID}" == 'fedora' ]]; then
"${baseDir}/fedora.sh" --zfs-install
fi
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
"${baseDir}/debian.sh" --dpkg-reconfigure
fi
"${baseDir}/partition.sh" --efi
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
"${baseDir}/debian.sh" --purge-os-prober
fi
if [[ "${ID}" == 'elementary' ]]; then
"${baseDir}/elementary.sh" --desktop
"${baseDir}/elementary.sh" --purge
"${baseDir}/elementary.sh" --apps
fi
printf \
'\033[?47h\033[2J\033[H'
cat << EOF
Enter a password for the root account:
EOF
passwd
printf \
'\033[?47l'
"${baseDir}/swap.sh"
if [[ "${ID}" == 'debian' ]]; then
"${baseDir}/debian.sh" --network-manager
fi
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
"${baseDir}/debian.sh" --initramfs
elif [[ "${ID}" == 'fedora' ]]; then
"${baseDir}/fedora.sh" --dracut
fi
"${baseDir}/zfs.sh" --splash
if [[ ! -z "$(zfs list | grep 'keystore')" ]]; then
"${baseDir}/zfs.sh" --keystore
fi
"${baseDir}/efi.sh"
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
"${baseDir}/debian.sh" --systemctl-enable
fi
zfs \
snapshot \
${hostname,,}/ROOT/${ID}@install
"${baseDir}/post-inst.sh"