Update gentoo.sh

This commit is contained in:
verita84 2023-11-15 16:07:47 +00:00
parent a14a4a7b78
commit 194a859624

View File

@ -110,7 +110,6 @@ os-backup() {
}
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 $2]"
@ -136,26 +135,43 @@ os-restore() {
}
systemMounts() {
mount -o rbind /dev $TARGET/dev
mount -o rbind /dev/pts $TARGET/dev/pts
mount -o rbind /proc $TARGET/proc
mount -o rbind /sys $TARGET/sys
mount -t efivarfs none $TARGET/sys/firmware/efi/efivars
mount -t tmpfs -o size=$TMPFS_SIZE tmpfs $TARGET/var/tmp/portage
echo
echo "[Checking for BTRFS Partition]"
echo
echo "Mounting Boot,EFI,HOME"
echo
mount $BTRFS $TARGET
btrfs_filesytem
mkdir -p $TARGET/boot
mount -t ext4 $BOOT $TARGET/boot
mkdir -p $TARGET/boot/efi
mount $EFI $TARGET/boot/efi
#CONFIGURE DATA DIRS (HOME)
mkdir $TARGET/home
mount -o subvol=@home $BTRFS $TARGET/home
mkdir $TARGET/home/$USER
if [[ -e "$BTRFS" ]]; then
echo "BTRFS device found"
echo
echo "Mounting Boot,EFI,HOME"
echo
mount $BTRFS $TARGET
btrfs_filesytem
mkdir -p $TARGET/boot
mount -t ext4 $BOOT $TARGET/boot
mkdir -p $TARGET/boot/efi
mount $EFI $TARGET/boot/efi
#CONFIGURE DATA DIRS (HOME)
mkdir $TARGET/home
mount -o subvol=@home $BTRFS $TARGET/home
mkdir $TARGET/home/$USER
mkdir $TARGET/dev
mkdir $TARGET/proc
mkdir $TARGET/sys
mkdir -p $TARGET/var/tmp/portage
mount -o rbind /dev $TARGET/dev
mount -o rbind /dev/pts $TARGET/dev/pts
mount -o rbind /proc $TARGET/proc
mount -o rbind /sys $TARGET/sys
mount -t efivarfs none $TARGET/sys/firmware/efi/efivars
mount -t tmpfs -o size=$TMPFS_SIZE tmpfs $TARGET/var/tmp/portage
else
echo
echo "Aborting Install, $BTRFS not found!"
echo
echo
exit 1
fi
}
unmaskPackages() {
@ -371,21 +387,6 @@ locale() {
echo "locale-gen" >>$TARGET/setup.sh
}
partitions() {
echo
echo "Setting Up Partitions....."
if [[ -e "$BTRFS" ]]; then
echo "BTRFS device found"
else
echo
echo "Aborting Install, $BTRFS not found!"
echo
echo
exit 1
fi
}
fstab() {
mkdir $TARGET/etc
echo "UUID=$(/sbin/blkid | grep ${BOOT} | cut -d '"' -f2) /boot ext4 defaults 0 1" >$TARGET/etc/fstab
@ -486,7 +487,6 @@ tweaks() {
bootloader $HARD_DISK $ROOT_NAME $BTRFS
elif [[ $choice = 2 ]]; then
set-devices
partitions
systemMounts
/usr/bin/chroot $TARGET /bin/bash
fi
@ -497,7 +497,7 @@ menu() {
echo
echo "[Welcome to the Poster.place Gentoo Installer System]"
echo
echo "[1] Setup Chroot Mounts"
echo "[1] Setup Disk"
echo "[2] Download Gentoo Installation Files"
echo "[3] Install Base System"
echo "[4] Install OS Packages"
@ -511,8 +511,6 @@ menu() {
if [[ $choice = 1 ]]; then
set-devices
partitions
sleep 5
read -p "Press enter key to Continue"
menu
elif [[ $choice = 2 ]]; then
@ -592,7 +590,10 @@ menu() {
elif [[ $choice = 4 ]]; then
set-devices
finishInstall "$HARD_DISK"
read -p "Press enter key to Continue"
menu
elif [[ $choice = 5 ]]; then
set-devices
cp -f gentoo.sh $TARGET/usr/bin/gentoo.sh
if [ ! -f "$TARGET/usr/bin/gentoo.sh" ]; then
echo