This commit is contained in:
Your Name 2024-02-20 09:06:57 -07:00
parent 51bcf81106
commit 5a9f1f084b

View File

@ -64,6 +64,7 @@ DISTCC_LISTEN="192.168.0.0/24"
DISTCC_CORES="30"
#Add Masked Packages to the Array
MASKED_PACKAGES+=(media-video/obs-studio media-video/ffmpeg net-im/element-desktop-bin games-util/game-device-udev-rules games-util/lutris games-util/steam-launcher net-im/telegram-desktop-bin)
partitionDetection() {
#This is used for the installer to do script-based actions
EFI=$(blkid | grep $HARD_DISK | sort | cut -d ":" -f1 | head -1 | tail -1)
@ -71,6 +72,7 @@ partitionDetection() {
BTRFS=$(blkid | grep $HARD_DISK | sort | cut -d ":" -f1 | head -3 | tail -1)
}
partitionDetection
create-os-snapshots() {
echo
mkdir $2
@ -82,12 +84,14 @@ create-os-snapshots() {
echo
time tar cvpzf $1/gentoo-$HOSTNAME-$DATE.tgz $NEW_TAR_EXCLUDES /
}
homeBackup() {
echo
echo "[Copying USER data from /home to $TARGET/@home]"
echo
rsync -a --delete /home/ --exclude=.cache --exclude=.local/share/flatpak --exclude=.local/share/containers $TARGET/\@home/
}
os-backup() {
umount $TARGET
echo
@ -158,12 +162,14 @@ systemMounts() {
exit 1
fi
}
unmaskPackages() {
echo "" >$TARGET/etc/portage/package.accept_keywords
for i in "${MASKED_PACKAGES[@]}"; do
echo "$i ~amd64" >>$TARGET/etc/portage/package.accept_keywords
done
}
distccConfigure() {
if [ -z "$DISTCC_LISTEN" ]; then
echo
@ -203,6 +209,7 @@ installNvidia() {
etc-update -q --automode -5
ACCEPT_KEYWORDS="~amd64" emerge x11-drivers/nvidia-drivers www-apps/jellyfin net-im/coturn
}
configurePortage() {
sed -i "s/-O2/-march=$CPU_TYPE -O2/i" $TARGET/etc/portage/make.conf
echo 'ACCEPT_KEYWORDS="amd64"' >>$TARGET/etc/portage/make.conf
@ -255,6 +262,7 @@ configurePortage() {
mkdir -p $TARGET/etc/portage/package.mask
echo "dev-lang/rust" >$TARGET/etc/portage/package.mask/rust
}
buildGentoo() {
echo "[Install Base System]"
echo
@ -309,6 +317,7 @@ buildGentoo() {
chroot $TARGET /setup.sh
rm -f $TARGET/setup.sh
}
installPackages() {
/usr/bin/emerge -uDN $PACKAGES --autounmask-write
/usr/sbin/etc-update -q --automode -5
@ -348,6 +357,7 @@ btrfs_filesytem() {
umount $TARGET
mount -o $COMPRESSION,subvol=@$ROOT_NAME $BTRFS $TARGET
}
services() {
echo '[zram0]' >/etc/systemd/zram-generator.conf
echo 'zram-size = ram * 2' >>/etc/systemd/zram-generator.conf
@ -401,12 +411,14 @@ installSteam() {
emerge -uDN @world
emerge -uDN games-util/steam-launcher app-emulation/wine-vanilla
}
locale() {
echo "ln -sf /usr/share/zoneinfo/US/Mountain /etc/localtime" >>$TARGET/setup.sh
echo "hwclock --systohc" >>$TARGET/setup.sh
echo "en_US.UTF-8 UTF-8" >$TARGET/etc/locale.gen
echo "locale-gen" >>$TARGET/setup.sh
}
fstab() {
mkdir $TARGET/etc
echo "UUID=$(/sbin/blkid -s UUID -o value ${EFI}) /efi vfat umask=0077 0 1" >$TARGET/etc/fstab
@ -448,6 +460,7 @@ btrfs-tweaks() {
chattr -R +C $i
done
}
initialize-disk() {
SWAP_SIZE=$(expr $(cat /proc/meminfo | head -1 | cut -d ':' -f2 | sed 's/ //g' | sed 's/kB//') / 1000 / 1000)
SWAP_SIZE_END="$(expr $SWAP_SIZE + $ROOT_PARTITION_SIZE)"
@ -543,6 +556,7 @@ tweaks() {
menu
fi
}
download-setup() {
clear
echo "[Choose Deployment Type]"
@ -575,6 +589,7 @@ download-setup() {
cp -f gentoo-kde.sh $TARGET/usr/bin/
fi
}
menu() {
clear
echo