Update gentoo.sh

This commit is contained in:
verita84 2023-11-04 23:41:45 +00:00
parent 7548862f6a
commit 4de38795b1

View File

@ -39,6 +39,7 @@ COMPRESSION='compress=zstd:10'
FLATPAKS+=(io.exodus.Exodus us.zoom.Zoom app/net.lutris.Lutris)
SERVICES+=(smartd cronie avahi-daemon cups grub-btrfsd sddm NetworkManager dev-zram0.swap)
DESKTOP="KDE"
KERNEL="gentoo-kernel-bin"
MAKEOPTS="-j$(cat /proc/cpuinfo | grep -i processor | grep -vi 'model' | wc -l)"
USE_FLAGS=" -gpm proprietary-codecs screencast systemd x264 pulseaudio firmware nfsv4 caps zeroconf dbus sound-server X -browser-integration desktop-portal minimal -gnome qt5 kde dvd alsa gui -wayland device-mapper efiemu themes truetype btrfs seccomp cgroup-hybrid geoclue -webengine boot browser keeshare network opengl"
TMPFS_SIZE="32G"
@ -104,9 +105,9 @@ os-restore() {
partitions
rm -rf $TARGET/usr $TARGET/sbin $TARGET/lib32 $TARGET/libx32 $TARGET/lib $TARGET/vmlinuz* $TARGET/initrd* $TARGET/bin $TARGET/var $TARGET/root $TARGET/opt $TARGET/etc $TARGET/run
clear
echo "[Restoring OS tarfile from $4/$2.tgz]"
echo "[Restoring OS tarfile from $2]"
echo
tar xfvp $4/$2.tgz -C $TARGET/
tar xfvp $2 -C $TARGET/
if [ "$3" = "home" ]; then
echo "[Restoring /home]"
@ -192,9 +193,13 @@ buildGentoo() {
chroot $TARGET etc-update -q --automode -5
chroot $TARGET /usr/bin/emerge --verbose --update --deep --newuse @world
locale
chroot $TARGET /usr/bin/emerge =sys-kernel/gentoo-sources-$(ls $TARGET/var/db/repos/gentoo/sys-kernel/gentoo-sources/gentoo-sources-6.* | cut -d '-' -f5-6 | grep -vi r | head -1 | sed 's/.ebuild//') sys-kernel/genkernel sys-kernel/linux-firmware
chroot $TARGET eselect kernel set 1
chroot $TARGET genkernel --cachedir=/var/tmp/portage --tmpdir=/var/tmp/portage --install all
if [ "$KERNEL" = "gentoo-kernel-bin" ]; then
chroot $TARGET /usr/bin/emerge =sys-kernel/$(ls $TARGET/var/db/repos/gentoo/sys-kernel/gentoo-kernel-bin/gentoo-kernel-bin-6.* | cut -d '/' -f9 | sed 's/.ebuild//' | head -1) sys-kernel/linux-firmware
else
chroot $TARGET /usr/bin/emerge =sys-kernel/gentoo-sources-$(ls $TARGET/var/db/repos/gentoo/sys-kernel/gentoo-sources/gentoo-sources-6.* | cut -d '-' -f5-6 | grep -vi r | head -1 | sed 's/.ebuild//') sys-kernel/genkernel sys-kernel/linux-firmware
chroot $TARGET eselect kernel set 1
chroot $TARGET genkernel --cachedir=/var/tmp/portage --tmpdir=/var/tmp/portage --install all
fi
chroot $TARGET /usr/bin/emerge $BASE_PACKAGES --autounmask-write
chroot $TARGET etc-update -q --automode -5
chroot $TARGET /usr/bin/emerge $BASE_PACKAGES
@ -311,12 +316,6 @@ installSteam() {
}
installBrowser() {
if [ "$BROWSER" = "brave" ]; then
installBrave
fi
}
mounts() {
echo
echo "Mounting......."
@ -329,6 +328,7 @@ mounts() {
#CONFIGURE DATA DIRS (HOME)
mkdir $TARGET/home
mount -o subvol=@home $BTRFS $TARGET/home
mkdir $TARGET/home/$USER
}
unmount() {
@ -418,8 +418,8 @@ initialize-disk() {
parted -a optimal /dev/$HARD_DISK mkpart primary fat32 1MiB 200MiB
parted -a optimal /dev/$HARD_DISK mkpart primary ext3 200MiB 700MiB
parted -a optimal /dev/$HARD_DISK set 1 esp on
parted -a optimal /dev/$HARD_DISK mkpart P2 ext3 700MiB 98%
parted -a optimal /dev/$HARD_DISK mkpart P2 ext3 98% 100%
parted -a optimal /dev/$HARD_DISK mkpart P2 ext3 700MiB 100%
#parted -a optimal /dev/$HARD_DISK mkpart P2 ext3 98% 100%
partitionDetection
echo
echo "Formatting....."
@ -509,6 +509,7 @@ menu() {
echo
echo
set-devices
read -p 'Hostname for Restore: ' -e -i "gentoo" HOSTNAME
read -p 'Restore Directory Image Source: ' -e -i "/mnt" restore_directory
FILE_SCAN=$(ls $restore_directory/gentoo-$HOSTNAME-* | tail -1)
read -p 'Restore Home Directory? : ' -e -i 'n' home_restore