f
This commit is contained in:
parent
8e857a8beb
commit
7de9b41292
@ -63,9 +63,7 @@ MASKED_PACKAGES+=(media-video/ffmpeg www-client/vivaldi-snapshot net-im/element-
|
||||
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)
|
||||
echo $EFI
|
||||
BOOT=$(blkid | grep $HARD_DISK | sort | cut -d ":" -f1 | head -2 | tail -1)
|
||||
BTRFS=$(blkid | grep $HARD_DISK | sort | cut -d ":" -f1 | head -3 | tail -1)
|
||||
BTRFS=$(blkid | grep $HARD_DISK | sort | cut -d ":" -f1 | head -2 | tail -1)
|
||||
}
|
||||
|
||||
partitionDetection
|
||||
@ -141,10 +139,8 @@ systemMounts() {
|
||||
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
|
||||
mkdir -p $TARGET/efi
|
||||
mount $EFI $TARGET/efi
|
||||
#CONFIGURE DATA DIRS (HOME)
|
||||
mkdir $TARGET/home
|
||||
mount -o subvol=@home $BTRFS $TARGET/home
|
||||
@ -427,8 +423,7 @@ locale() {
|
||||
|
||||
fstab() {
|
||||
mkdir $TARGET/etc
|
||||
echo "UUID=$(/sbin/blkid -s UUID -o value ${BOOT}) /boot ext4 defaults 0 1" >$TARGET/etc/fstab
|
||||
echo "UUID=$(/sbin/blkid -s UUID -o value ${EFI}) /boot/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
|
||||
echo "$BTRFS / btrfs noatime,nodiratime,autodefrag,$COMPRESSION,subvol=@$ROOT_NAME 0 1" >>$TARGET/etc/fstab
|
||||
echo "$BTRFS /.snapshots btrfs noatime,nodiratime,autodefrag,$COMPRESSION,subvol=@.snapshots 0 1" >>$TARGET/etc/fstab
|
||||
echo "$BTRFS /var/lib/libvirt btrfs noatime,nodiratime,autodefrag,$COMPRESSION,subvol=@libvirt 0 1" >>$TARGET/etc/fstab
|
||||
@ -470,10 +465,10 @@ btrfs-tweaks() {
|
||||
initialize-disk() {
|
||||
parted /dev/$HARD_DISK mklabel gpt
|
||||
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 mkpart primary ext3 200MiB $ROOT_PARTITION_SIZE
|
||||
parted -a optimal /dev/$HARD_DISK set 1 esp on
|
||||
parted -a optimal /dev/$HARD_DISK mkpart P2 ext3 700MiB $ROOT_PARTITION_SIZE
|
||||
parted -a optimal /dev/$HARD_DISK mkpart P2 ext3 $ROOT_PARTITION_SIZE 100%
|
||||
parted -a optimal /dev/$HARD_DISK mkpart P2 ext3 $ROOT_PARTITION_SIZE 16GiB
|
||||
parted -a optimal /dev/$HARD_DISK mkpart P2 ext3 16GiB 100%
|
||||
partitionDetection
|
||||
echo
|
||||
echo "Formatting....."
|
||||
@ -481,8 +476,6 @@ initialize-disk() {
|
||||
echo "Formatting $EFI"
|
||||
echo
|
||||
echo y | mkfs.vfat $EFI
|
||||
echo "Formatting $BOOT"
|
||||
echo y | mkfs.ext4 $BOOT
|
||||
echo
|
||||
echo "Initialize Complete. Please reboot your machine to avoid any issues"
|
||||
echo
|
||||
@ -693,12 +686,12 @@ bootloader() {
|
||||
echo
|
||||
echo
|
||||
#MACHINE_ID=$(cat /etc/machine-id)
|
||||
MACHINE_ID=$(ls /boot/efi | grep -Evi 'loader|efi')
|
||||
MACHINE_ID=$(ls /efi | grep -Evi 'loader|efi')
|
||||
KERNEL=$(eselect kernel list | cut -d ']' -f2 | cut -d "*" -f1 | cut -d "-" -f2 | tail -1)
|
||||
KERNEL_VERSION=$(ls /boot/efi/$MACHINE_ID)
|
||||
KERNEL_VERSION=$(ls /efi/$MACHINE_ID)
|
||||
ROOT_NAME=$1
|
||||
BTRFS=$2
|
||||
LOADER_FILE="/boot/efi/loader/entries/$MACHINE_ID-$KERNEL_VERSION.conf"
|
||||
LOADER_FILE="/efi/loader/entries/$MACHINE_ID-$KERNEL_VERSION.conf"
|
||||
|
||||
echo "MachineID=$MACHINE_ID"
|
||||
echo "KERNEL IS $KERNEL"
|
||||
@ -706,8 +699,8 @@ bootloader() {
|
||||
echo "BTRFS=$BTRFS"
|
||||
echo "UEFI Kernel: $KERNEL_VERSION"
|
||||
sleep 5
|
||||
echo "default $MACHINE_ID" >/boot/efi/loader/loader.conf
|
||||
echo "timeout 3" >>/boot/efi/loader/loader.conf
|
||||
echo "default $MACHINE_ID" >/efi/loader/loader.conf
|
||||
echo "timeout 3" >>/efi/loader/loader.conf
|
||||
echo "title Gentoo Linux" >$LOADER_FILE
|
||||
echo "version $KERNEL_VERSION" >>$LOADER_FILE
|
||||
echo "sort-key ${ROOT_NAME}" >>$LOADER_FILE
|
||||
|
Loading…
Reference in New Issue
Block a user