Update gentoo-kde.sh

This commit is contained in:
verita84 2024-02-15 19:55:15 -07:00
parent f223fc47d7
commit 85776986da

View File

@ -60,15 +60,12 @@ DISTCC_LISTEN="192.168.0.0/24"
DISTCC_CORES="30" DISTCC_CORES="30"
#Add Masked Packages to the Array #Add Masked Packages to the Array
MASKED_PACKAGES+=(media-video/ffmpeg www-client/vivaldi-snapshot net-im/element-desktop-bin games-util/game-device-udev-rules games-util/lutris games-util/steam-launcher net-im/telegram-desktop-bin) MASKED_PACKAGES+=(media-video/ffmpeg www-client/vivaldi-snapshot net-im/element-desktop-bin games-util/game-device-udev-rules games-util/lutris games-util/steam-launcher net-im/telegram-desktop-bin)
partitionDetection() { partitionDetection() {
#This is used for the installer to do script-based actions #This is used for the installer to do script-based actions
EFI=$(blkid | grep $HARD_DISK | sort | cut -d ":" -f1 | head -1 | tail -1) EFI=$(blkid | grep $HARD_DISK | sort | cut -d ":" -f1 | head -1 | tail -1)
BTRFS=$(blkid | grep $HARD_DISK | sort | cut -d ":" -f1 | head -2 | tail -1) BTRFS=$(blkid | grep $HARD_DISK | sort | cut -d ":" -f1 | head -2 | tail -1)
} }
partitionDetection partitionDetection
create-os-snapshots() { create-os-snapshots() {
echo echo
mkdir $2 mkdir $2
@ -80,31 +77,25 @@ create-os-snapshots() {
echo echo
time tar cvpzf $1/gentoo-$HOSTNAME-$DATE.tgz $NEW_TAR_EXCLUDES / time tar cvpzf $1/gentoo-$HOSTNAME-$DATE.tgz $NEW_TAR_EXCLUDES /
} }
homeBackup() { homeBackup() {
echo echo
echo "[Copying USER data from /home to $TARGET/@home]" echo "[Copying USER data from /home to $TARGET/@home]"
echo echo
rsync -a --delete /home/ --exclude=.cache --exclude=.local/share/flatpak --exclude=.local/share/containers $TARGET/\@home/ rsync -a --delete /home/ --exclude=.cache --exclude=.local/share/flatpak --exclude=.local/share/containers $TARGET/\@home/
} }
os-backup() { os-backup() {
umount $TARGET umount $TARGET
echo echo
echo "[Mounting.....]" echo "[Mounting.....]"
echo echo
mount -o $COMPRESSION $BTRFS $TARGET mount -o $COMPRESSION $BTRFS $TARGET
if [ "$1" = "home" ]; then if [ "$1" = "home" ]; then
homeBackup homeBackup
fi fi
create-os-snapshots "$2" "$3" create-os-snapshots "$2" "$3"
ls $TARGET/ ls $TARGET/
umount $TARGET umount $TARGET
} }
os-restore() { os-restore() {
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 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 clear
@ -112,13 +103,11 @@ os-restore() {
echo "[Restoring OS tarfile from $2]" echo "[Restoring OS tarfile from $2]"
echo echo
tar xfvp $2 -C $TARGET/ tar xfvp $2 -C $TARGET/
if [ "$3" = "home" ]; then if [ "$3" = "home" ]; then
echo "[Restoring /home]" echo "[Restoring /home]"
echo echo
rsync -a --delete /home/ $TARGET/home/ rsync -a --delete /home/ $TARGET/home/
fi fi
cp -f gentoo-kde.sh $TARGET/ cp -f gentoo-kde.sh $TARGET/
fstab fstab
chmod +x $TARGET/gentoo-kde.sh chmod +x $TARGET/gentoo-kde.sh
@ -128,11 +117,9 @@ os-restore() {
chown -R $USER:$USER $TARGET/home/$USER chown -R $USER:$USER $TARGET/home/$USER
rm -f $TARGET/gentoo-kde.sh rm -f $TARGET/gentoo-kde.sh
} }
systemMounts() { systemMounts() {
echo echo
echo "[Checking for BTRFS Partition]" echo "[Checking for BTRFS Partition]"
if [[ -e "$BTRFS" ]]; then if [[ -e "$BTRFS" ]]; then
echo "BTRFS device found" echo "BTRFS device found"
echo echo
@ -146,12 +133,10 @@ systemMounts() {
mkdir $TARGET/home mkdir $TARGET/home
mount -o subvol=@home $BTRFS $TARGET/home mount -o subvol=@home $BTRFS $TARGET/home
mkdir $TARGET/home/$USER mkdir $TARGET/home/$USER
mkdir $TARGET/dev mkdir $TARGET/dev
mkdir $TARGET/proc mkdir $TARGET/proc
mkdir $TARGET/sys mkdir $TARGET/sys
mkdir -p $TARGET/var/tmp/portage mkdir -p $TARGET/var/tmp/portage
mount -o rbind /dev $TARGET/dev mount -o rbind /dev $TARGET/dev
mount -o rbind /dev/pts $TARGET/dev/pts mount -o rbind /dev/pts $TARGET/dev/pts
mount -o rbind /proc $TARGET/proc mount -o rbind /proc $TARGET/proc
@ -166,15 +151,12 @@ systemMounts() {
exit 1 exit 1
fi fi
} }
unmaskPackages() { unmaskPackages() {
echo "" >$TARGET/etc/portage/package.accept_keywords echo "" >$TARGET/etc/portage/package.accept_keywords
for i in "${MASKED_PACKAGES[@]}"; do for i in "${MASKED_PACKAGES[@]}"; do
echo "$i ~amd64" >>$TARGET/etc/portage/package.accept_keywords echo "$i ~amd64" >>$TARGET/etc/portage/package.accept_keywords
done done
} }
distccConfigure() { distccConfigure() {
if [ -z "$DISTCC_LISTEN" ]; then if [ -z "$DISTCC_LISTEN" ]; then
echo echo
@ -208,7 +190,6 @@ distccConfigure() {
echo echo
fi fi
} }
installCockpit() { installCockpit() {
COCKPIT_PACKAGES+=(app-admin/cockpit-navigator app-admin/cockpit app-crypt/sscg) COCKPIT_PACKAGES+=(app-admin/cockpit-navigator app-admin/cockpit app-crypt/sscg)
for i in "${COCKPIT_PACKAGES[@]}"; do for i in "${COCKPIT_PACKAGES[@]}"; do
@ -218,27 +199,22 @@ installCockpit() {
eselect repository enable gig eselect repository enable gig
emerge --sync inode64-overlay emerge --sync inode64-overlay
emerge --sync gig emerge --sync gig
emerge $COCKPIT_PACKAGES --autounmask-write emerge $COCKPIT_PACKAGES --autounmask-write
etc-update -q --automode -5 etc-update -q --automode -5
emerge $COCKPIT_PACKAGES emerge $COCKPIT_PACKAGES
} }
installNvidia() { installNvidia() {
ACCEPT_KEYWORDS="~amd64" emerge x11-drivers/nvidia-drivers nvidia-cuda-toolkit www-apps/jellyfin net-im/coturn --autounmask-write ACCEPT_KEYWORDS="~amd64" emerge x11-drivers/nvidia-drivers nvidia-cuda-toolkit www-apps/jellyfin net-im/coturn --autounmask-write
etc-update -q --automode -5 etc-update -q --automode -5
ACCEPT_KEYWORDS="~amd64" emerge x11-drivers/nvidia-drivers nvidia-cuda-toolkit www-apps/jellyfin net-im/coturn ACCEPT_KEYWORDS="~amd64" emerge x11-drivers/nvidia-drivers nvidia-cuda-toolkit www-apps/jellyfin net-im/coturn
} }
configurePortage() { configurePortage() {
sed -i "s/-O2/-march=$CPU_TYPE -O2/i" $TARGET/etc/portage/make.conf sed -i "s/-O2/-march=$CPU_TYPE -O2/i" $TARGET/etc/portage/make.conf
echo 'ACCEPT_KEYWORDS="amd64"' >>$TARGET/etc/portage/make.conf echo 'ACCEPT_KEYWORDS="amd64"' >>$TARGET/etc/portage/make.conf
echo "FEATURES=\"$FEATURES\"" >>$TARGET/etc/portage/make.conf echo "FEATURES=\"$FEATURES\"" >>$TARGET/etc/portage/make.conf
echo "EMERGE_DEFAULT_OPTS=\"$EMERGE_DEFAULT_OPTS\"" >>$TARGET/etc/portage/make.conf echo "EMERGE_DEFAULT_OPTS=\"$EMERGE_DEFAULT_OPTS\"" >>$TARGET/etc/portage/make.conf
echo "L10N=\"en en-US\"" >>$TARGET/etc/portage/make.conf echo "L10N=\"en en-US\"" >>$TARGET/etc/portage/make.conf
mkdir -p $TARGET/var/tmp/portage mkdir -p $TARGET/var/tmp/portage
if [ -f "./repos.conf" ]; then if [ -f "./repos.conf" ]; then
echo echo
echo "Found Local Gentoo Repo" echo "Found Local Gentoo Repo"
@ -250,18 +226,13 @@ configurePortage() {
echo echo
echo echo
fi fi
chroot $TARGET /usr/bin/emerge --sync chroot $TARGET /usr/bin/emerge --sync
echo echo
echo "Configuring Binary Package GPG keys" echo "Configuring Binary Package GPG keys"
echo echo
chroot $TARGET /usr/bin/getuto chroot $TARGET /usr/bin/getuto
distccConfigure distccConfigure
`` echo "USE=\"$USE_FLAGS\"" >>$TARGET/etc/portage/make.conf `` echo "USE=\"$USE_FLAGS\"" >>$TARGET/etc/portage/make.conf
if [ -z "$DISTCC_LISTEN" ]; then if [ -z "$DISTCC_LISTEN" ]; then
echo echo
echo "Not using DistCC" echo "Not using DistCC"
@ -274,7 +245,6 @@ configurePortage() {
MAKEOPTS="-j30 -l$(cat /proc/cpuinfo | grep -i processor | grep -vi 'model' | wc -l)" MAKEOPTS="-j30 -l$(cat /proc/cpuinfo | grep -i processor | grep -vi 'model' | wc -l)"
echo "MAKEOPTS=\"$MAKEOPTS\"" >>$TARGET/etc/portage/make.conf echo "MAKEOPTS=\"$MAKEOPTS\"" >>$TARGET/etc/portage/make.conf
fi fi
echo echo
echo echo
echo echo
@ -284,20 +254,16 @@ configurePortage() {
echo echo
GENTOO_PROFILE=$(chroot $TARGET /usr/bin/eselect profile list | grep -i desktop | grep -Evi 'gnome' | grep systemd | grep -i merged | head -1 | cut -d '[' -f2 | cut -d ']' -f1) GENTOO_PROFILE=$(chroot $TARGET /usr/bin/eselect profile list | grep -i desktop | grep -Evi 'gnome' | grep systemd | grep -i merged | head -1 | cut -d '[' -f2 | cut -d ']' -f1)
chroot $TARGET /usr/bin/eselect profile set $GENTOO_PROFILE chroot $TARGET /usr/bin/eselect profile set $GENTOO_PROFILE
mkdir -p $TARGET/etc/portage/package.license mkdir -p $TARGET/etc/portage/package.license
echo "*/* *" >$TARGET/etc/portage/package.license/license echo "*/* *" >$TARGET/etc/portage/package.license/license
rm -rf $TARGET/etc/portage/package.accept_keywords rm -rf $TARGET/etc/portage/package.accept_keywords
mkdir -p $TARGET/etc/portage/package.mask mkdir -p $TARGET/etc/portage/package.mask
echo "dev-lang/rust" >$TARGET/etc/portage/package.mask/rust echo "dev-lang/rust" >$TARGET/etc/portage/package.mask/rust
} }
buildGentoo() { buildGentoo() {
echo "[Install Base System]" echo "[Install Base System]"
echo echo
echo echo
echo echo
echo echo
echo echo
@ -308,10 +274,7 @@ buildGentoo() {
chroot $TARGET etc-update -q --automode -5 chroot $TARGET etc-update -q --automode -5
chroot $TARGET /usr/bin/emerge --update --deep --newuse @world chroot $TARGET /usr/bin/emerge --update --deep --newuse @world
locale locale
chroot $TARGET /usr/sbin/systemd-machine-id-setup chroot $TARGET /usr/sbin/systemd-machine-id-setup
echo echo
echo echo
echo echo
@ -321,9 +284,7 @@ buildGentoo() {
chroot $TARGET /usr/bin/emerge -uDN dracut gentoo-kernel-bin sys-kernel/linux-firmware --autounmask-write chroot $TARGET /usr/bin/emerge -uDN dracut gentoo-kernel-bin sys-kernel/linux-firmware --autounmask-write
chroot $TARGET etc-update -q --automode -5 chroot $TARGET etc-update -q --automode -5
chroot $TARGET /usr/bin/emerge -uDN dracut gentoo-kernel-bin sys-kernel/linux-firmware chroot $TARGET /usr/bin/emerge -uDN dracut gentoo-kernel-bin sys-kernel/linux-firmware
unmaskPackages unmaskPackages
echo echo
echo echo
echo echo
@ -332,7 +293,6 @@ buildGentoo() {
echo echo
cp -f gentoo-kde.sh $TARGET/usr/bin/gentoo-kde.sh cp -f gentoo-kde.sh $TARGET/usr/bin/gentoo-kde.sh
chroot $TARGET /usr/bin/bash /usr/bin/gentoo-kde.sh install-packages chroot $TARGET /usr/bin/bash /usr/bin/gentoo-kde.sh install-packages
echo echo
echo echo
echo echo
@ -340,13 +300,11 @@ buildGentoo() {
echo echo
echo echo
chroot $TARGET /usr/bin/bash /usr/bin/gentoo-kde.sh bootloader $1 $ROOT_NAME $BTRFS chroot $TARGET /usr/bin/bash /usr/bin/gentoo-kde.sh bootloader $1 $ROOT_NAME $BTRFS
echo echo
echo echo
echo "[Configuring Accounts and post-setup tasks]" echo "[Configuring Accounts and post-setup tasks]"
echo echo
echo echo
echo 'bash /usr/bin/gentoo-kde.sh accounts' >>$TARGET/setup.sh echo 'bash /usr/bin/gentoo-kde.sh accounts' >>$TARGET/setup.sh
echo 'bash /usr/bin/gentoo-kde.sh desktop' >>$TARGET/setup.sh echo 'bash /usr/bin/gentoo-kde.sh desktop' >>$TARGET/setup.sh
echo 'bash /usr/bin/gentoo-kde.sh btrfs-tweaks' >>$TARGET/setup.sh echo 'bash /usr/bin/gentoo-kde.sh btrfs-tweaks' >>$TARGET/setup.sh
@ -356,13 +314,11 @@ buildGentoo() {
chroot $TARGET /setup.sh chroot $TARGET /setup.sh
rm -f $TARGET/setup.sh rm -f $TARGET/setup.sh
} }
installPackages(){ installPackages(){
/usr/bin/emerge -uDN $PACKAGES --autounmask-write /usr/bin/emerge -uDN $PACKAGES --autounmask-write
/usr/sbin/etc-update -q --automode -5 /usr/sbin/etc-update -q --automode -5
/usr/bin/emerge -uDN $PACKAGES /usr/bin/emerge -uDN $PACKAGES
} }
snapshots() { snapshots() {
echo echo
echo "Creating Snapshots....." echo "Creating Snapshots....."
@ -370,12 +326,10 @@ snapshots() {
DATE=$(echo $(date +%Y-%m-%d-%H-%M-%S)) DATE=$(echo $(date +%Y-%m-%d-%H-%M-%S))
btrfs sub snapshot / /.snapshots/root-${DATE} btrfs sub snapshot / /.snapshots/root-${DATE}
} }
remove-snapshots() { remove-snapshots() {
btrfs sub delete /.snapshots/* btrfs sub delete /.snapshots/*
rm -f /boot/loader/entries/root-* rm -f /boot/loader/entries/root-*
} }
btrfs_filesytem() { btrfs_filesytem() {
btrfs sub create $TARGET/@$ROOT_NAME btrfs sub create $TARGET/@$ROOT_NAME
btrfs sub create $TARGET/@.snapshots btrfs sub create $TARGET/@.snapshots
@ -388,24 +342,19 @@ btrfs_filesytem() {
umount $TARGET umount $TARGET
mount -o $COMPRESSION,subvol=@$ROOT_NAME $BTRFS $TARGET mount -o $COMPRESSION,subvol=@$ROOT_NAME $BTRFS $TARGET
} }
services() { services() {
echo '[zram0]' >/etc/systemd/zram-generator.conf echo '[zram0]' >/etc/systemd/zram-generator.conf
echo 'zram-size = ram * 2' >>/etc/systemd/zram-generator.conf echo 'zram-size = ram * 2' >>/etc/systemd/zram-generator.conf
for i in "${SERVICES[@]}"; do for i in "${SERVICES[@]}"; do
systemctl enable --now $i systemctl enable --now $i
done done
#Required for Audio to work #Required for Audio to work
systemctl --user enable --now pipewire.socket pipewire-pulse.socket wireplumber.service systemctl --user enable --now pipewire.socket pipewire-pulse.socket wireplumber.service
systemctl --user enable --now pipewire.service systemctl --user enable --now pipewire.service
} }
desktop() { desktop() {
services services
} }
installSteam() { installSteam() {
eselect repository enable steam-overlay eselect repository enable steam-overlay
emerge --sync steam-overlay emerge --sync steam-overlay
@ -414,14 +363,12 @@ installSteam() {
emerge -uDN @world emerge -uDN @world
emerge -uDN games-util/steam-launcher app-emulation/wine-vanilla games-util/lutris emerge -uDN games-util/steam-launcher app-emulation/wine-vanilla games-util/lutris
} }
locale() { locale() {
echo "ln -sf /usr/share/zoneinfo/US/Mountain /etc/localtime" >>$TARGET/setup.sh echo "ln -sf /usr/share/zoneinfo/US/Mountain /etc/localtime" >>$TARGET/setup.sh
echo "hwclock --systohc" >>$TARGET/setup.sh echo "hwclock --systohc" >>$TARGET/setup.sh
echo "en_US.UTF-8 UTF-8" >$TARGET/etc/locale.gen echo "en_US.UTF-8 UTF-8" >$TARGET/etc/locale.gen
echo "locale-gen" >>$TARGET/setup.sh echo "locale-gen" >>$TARGET/setup.sh
} }
fstab() { fstab() {
mkdir $TARGET/etc mkdir $TARGET/etc
echo "UUID=$(/sbin/blkid -s UUID -o value ${EFI}) /efi vfat umask=0077 0 1" >>$TARGET/etc/fstab echo "UUID=$(/sbin/blkid -s UUID -o value ${EFI}) /efi vfat umask=0077 0 1" >>$TARGET/etc/fstab
@ -434,7 +381,6 @@ fstab() {
#echo "$BTRFS /home btrfs noatime,nodiratime,autodefrag,$COMPRESSION,subvol=@home 0 1" >>$TARGET/etc/fstab #echo "$BTRFS /home btrfs noatime,nodiratime,autodefrag,$COMPRESSION,subvol=@home 0 1" >>$TARGET/etc/fstab
echo "$BTRFS /root btrfs noatime,nodiratime,autodefrag,$COMPRESSION,subvol=@root 0 1" >>$TARGET/etc/fstab echo "$BTRFS /root btrfs noatime,nodiratime,autodefrag,$COMPRESSION,subvol=@root 0 1" >>$TARGET/etc/fstab
} }
accounts() { accounts() {
echo echo
echo "Set Password for $USER" echo "Set Password for $USER"
@ -454,15 +400,12 @@ accounts() {
echo "root:$ROOT_PASSWORD" | chpasswd echo "root:$ROOT_PASSWORD" | chpasswd
/usr/bin/hostnamectl set-hostname $ROOT_NAME /usr/bin/hostnamectl set-hostname $ROOT_NAME
} }
btrfs-tweaks() { btrfs-tweaks() {
DISABLE_COW=("/var/lib/docker" "/volumes" "/var/lib/mysql" "/var/lib/libvirt") DISABLE_COW=("/var/lib/docker" "/volumes" "/var/lib/mysql" "/var/lib/libvirt")
for i in "${DISABLE_COW[@]}"; do for i in "${DISABLE_COW[@]}"; do
chattr -R +C $i chattr -R +C $i
done done
} }
initialize-disk() { initialize-disk() {
SWAP_SIZE=$(expr $(cat /proc/meminfo | head -1 | cut -d ':' -f2 | sed 's/ //g' | sed 's/kB//') / 1000 / 1000) 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)" SWAP_SIZE_END="$(expr $SWAP_SIZE + $ROOT_PARTITION_SIZE)"
@ -484,11 +427,9 @@ initialize-disk() {
echo "Initialize Complete. Please reboot your machine to avoid any issues" echo "Initialize Complete. Please reboot your machine to avoid any issues"
echo echo
} }
wifi() { wifi() {
iwctl --passphrase $WIRELESS_PASSWORD station $WIRELESS_INTERFACE connect $SSID iwctl --passphrase $WIRELESS_PASSWORD station $WIRELESS_INTERFACE connect $SSID
} }
show-help() { show-help() {
clear clear
echo echo
@ -503,7 +444,6 @@ show-help() {
echo "./gentoo-kde.sh btrfs-tweaks" echo "./gentoo-kde.sh btrfs-tweaks"
echo echo
} }
tweaks() { tweaks() {
clear clear
echo echo
@ -539,7 +479,6 @@ tweaks() {
tweaks tweaks
fi fi
} }
download-setup() { download-setup() {
clear clear
echo "[Choose Deployment Type]" echo "[Choose Deployment Type]"
@ -555,7 +494,6 @@ download-setup() {
else else
wget -O /tmp/stage3.tar.xz "$STAGE3_URL" wget -O /tmp/stage3.tar.xz "$STAGE3_URL"
fi fi
if [ -f "$STAGE3_FILE" ]; then if [ -f "$STAGE3_FILE" ]; then
echo echo
echo echo
@ -573,7 +511,6 @@ download-setup() {
cp -f gentoo-kde.sh $TARGET/usr/bin/ cp -f gentoo-kde.sh $TARGET/usr/bin/
fi fi
} }
menu() { menu() {
clear clear
echo echo
@ -589,7 +526,6 @@ menu() {
echo "[8] Initialize Disk" echo "[8] Initialize Disk"
echo echo
read -p 'Your Choice: ' choice read -p 'Your Choice: ' choice
if [[ $choice = 1 ]]; then if [[ $choice = 1 ]]; then
set-devices set-devices
read -p "Press enter key to Continue" read -p "Press enter key to Continue"
@ -631,7 +567,6 @@ menu() {
FILE_SCAN=$(ls $restore_directory/gentoo-$HOSTNAME-* | tail -1) FILE_SCAN=$(ls $restore_directory/gentoo-$HOSTNAME-* | tail -1)
read -p 'Restore Home Directory? : ' -e -i 'n' home_restore read -p 'Restore Home Directory? : ' -e -i 'n' home_restore
read -p 'Backup file name to restore: ' -e -i "$FILE_SCAN" backup_name read -p 'Backup file name to restore: ' -e -i "$FILE_SCAN" backup_name
if [[ $home_restore = *n* ]]; then if [[ $home_restore = *n* ]]; then
os-restore "$HARD_DISK" "$backup_name" "none" "$restore_directory" "$BTRFS" os-restore "$HARD_DISK" "$backup_name" "none" "$restore_directory" "$BTRFS"
else else
@ -652,7 +587,6 @@ menu() {
menu menu
fi fi
} }
set-devices() { set-devices() {
if [ -f "/tmp/disk" ]; then if [ -f "/tmp/disk" ]; then
HARD_DISK=$(cat /tmp/disk | head -1) HARD_DISK=$(cat /tmp/disk | head -1)
@ -674,7 +608,6 @@ set-devices() {
i="n" i="n"
fi fi
done done
read -p 'BTRFS Root Volume name: ' -e -i "gentoo" root_name read -p 'BTRFS Root Volume name: ' -e -i "gentoo" root_name
HARD_DISK=$device HARD_DISK=$device
ROOT_NAME=$root_name ROOT_NAME=$root_name
@ -683,7 +616,6 @@ set-devices() {
fi fi
partitionDetection partitionDetection
} }
bootloader() { bootloader() {
echo echo
echo "Configuring Bootloader......." echo "Configuring Bootloader......."
@ -696,7 +628,6 @@ bootloader() {
ROOT_NAME=$1 ROOT_NAME=$1
BTRFS=$2 BTRFS=$2
LOADER_FILE="/efi/loader/entries/$MACHINE_ID-$KERNEL_VERSION.conf" LOADER_FILE="/efi/loader/entries/$MACHINE_ID-$KERNEL_VERSION.conf"
echo "MachineID=$MACHINE_ID" echo "MachineID=$MACHINE_ID"
echo "KERNEL IS $KERNEL" echo "KERNEL IS $KERNEL"
echo "Root_Name=$ROOT_NAME" echo "Root_Name=$ROOT_NAME"
@ -712,10 +643,8 @@ bootloader() {
echo "machine-id $MACHINE_ID" >>$LOADER_FILE echo "machine-id $MACHINE_ID" >>$LOADER_FILE
echo "linux /$MACHINE_ID/$KERNEL_VERSION/linux" >>$LOADER_FILE echo "linux /$MACHINE_ID/$KERNEL_VERSION/linux" >>$LOADER_FILE
echo "initrd /$MACHINE_ID/$KERNEL_VERSION/initrd" >>$LOADER_FILE echo "initrd /$MACHINE_ID/$KERNEL_VERSION/initrd" >>$LOADER_FILE
bootctl install bootctl install
} }
compile-kernel() { compile-kernel() {
cd /usr/src cd /usr/src
eselect kernel set 1 eselect kernel set 1
@ -725,12 +654,10 @@ compile-kernel() {
else else
make allyesconfig make allyesconfig
fi fi
time make -j30 CC="distcc gcc" time make -j30 CC="distcc gcc"
time make -j30 CC="distcc gcc" modules_install time make -j30 CC="distcc gcc" modules_install
time make install time make install
} }
if [ "$1" = "desktop" ]; then if [ "$1" = "desktop" ]; then
desktop desktop
elif [ "$1" = "tar" ]; then elif [ "$1" = "tar" ]; then