This commit is contained in:
Your Name 2024-02-24 20:53:43 -07:00
parent da50cdb3fe
commit 8257e62c42

View File

@ -68,9 +68,10 @@ MASKED_PACKAGES+=(media-video/obs-studio media-video/ffmpeg net-im/element-deskt
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)
SWAP=$(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)
#SWAP=$(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
create-os-snapshots() {
@ -422,7 +423,7 @@ locale() {
fstab() {
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 ${SWAP}) none swap 0 1" >>$TARGET/etc/fstab
#echo "UUID=$(/sbin/blkid -s UUID -o value ${SWAP}) none swap 0 1" >>$TARGET/etc/fstab
echo "UUID=$(/sbin/blkid -s UUID -o value ${BTRFS}) / btrfs noatime,nodiratime,autodefrag,$COMPRESSION,subvol=@$ROOT_NAME 0 1" >>$TARGET/etc/fstab
echo "UUID=$(/sbin/blkid -s UUID -o value ${BTRFS}) /.snapshots btrfs noatime,nodiratime,autodefrag,$COMPRESSION,subvol=@.snapshots 0 1" >>$TARGET/etc/fstab
echo "UUID=$(/sbin/blkid -s UUID -o value ${BTRFS}) /var/lib/libvirt btrfs noatime,nodiratime,autodefrag,$COMPRESSION,subvol=@libvirt 0 1" >>$TARGET/etc/fstab
@ -462,21 +463,21 @@ btrfs-tweaks() {
}
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)"
#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)"
parted /dev/$HARD_DISK mklabel gpt
parted -a optimal /dev/$HARD_DISK mkpart primary fat32 1MiB 200MiB
parted -a optimal /dev/$HARD_DISK mkpart swap ext3 200MiB ${SWAP_SIZE_END}GB
parted -a optimal /dev/$HARD_DISK mkpart root ext3 200MiB 100%
#parted -a optimal /dev/$HARD_DISK mkpart swap ext3 200MiB ${SWAP_SIZE_END}GB
parted -a optimal /dev/$HARD_DISK set 1 esp on
parted -a optimal /dev/$HARD_DISK mkpart root ext3 ${SWAP_SIZE_END}GB 100%
sleep 10
#parted -a optimal /dev/$HARD_DISK mkpart root ext3 ${SWAP_SIZE_END}GB 100%
partitionDetection
echo
echo "Formatting Root....."
echo y | mkfs.btrfs $BTRFS --force
echo "Formatting Swap"
mkswap -f $SWAP
#echo "Formatting Swap"
#mkswap -f $SWAP
echo "Formatting $EFI"
echo