test new addition

This commit is contained in:
mfgbhatti 2022-01-28 16:19:11 +00:00
parent a1cc053985
commit 93f0edda79
1 changed files with 49 additions and 42 deletions

View File

@ -38,6 +38,7 @@ if [[ "$LAYOUT" ]]; then
PART2=${DISK}2 PART2=${DISK}2
PART3=${DISK}3 PART3=${DISK}3
fi fi
title "Creating Filesystems"
mkfs.vfat -F32 -n "EFIBOOT" "$PART2" mkfs.vfat -F32 -n "EFIBOOT" "$PART2"
mkfs.btrfs -L "ROOT" "$PART3" -f mkfs.btrfs -L "ROOT" "$PART3" -f
mount -t btrfs "$PART3" /mnt mount -t btrfs "$PART3" /mnt
@ -45,11 +46,14 @@ if [[ "$LAYOUT" ]]; then
for x in "${SUBVOLUMES[@]}"; do for x in "${SUBVOLUMES[@]}"; do
btrfs subvolume create /mnt/"${x}" btrfs subvolume create /mnt/"${x}"
done done
umount /mnt umount /mnt
mount -o "$MOUNTOPTION",subvol=@ "$PART3" /mnt mount -o "$MOUNTOPTION",subvol=@ "$PART3" /mnt
for y in "${SUBVOLUMES[@]:1}"; do for y in "${SUBVOLUMES[@]:1}"; do
mkdir /mnt/"${y}" mkdir /mnt/"${y}"
done done
for z in "${SUBVOLUMES[@]:1}"; do for z in "${SUBVOLUMES[@]:1}"; do
mount -o "$MOUNTOPTION",subvol="${z}" "$PART3" /mnt/"${z}" mount -o "$MOUNTOPTION",subvol="${z}" "$PART3" /mnt/"${z}"
done done
@ -60,6 +64,27 @@ else
fi fi
# mount target
mkdir /mnt/boot
mkdir /mnt/boot/efi
mount -t vfat -L EFIBOOT /mnt/boot/
if ! grep -qs '/mnt' /proc/mounts; then
echo "Drive is not mounted can not continue"
echo "Rebooting in 3 Seconds ..." && sleep 1
echo "Rebooting in 2 Seconds ..." && sleep 1
echo "Rebooting in 1 Second ..." && sleep 1
reboot now
fi
title "Arch Install on Main Drive"
pacstrap /mnt base base-devel linux linux-firmware vim nano sudo archlinux-keyring wget libnewt --noconfirm --needed
echo "keyserver hkp://keyserver.ubuntu.com" >> /mnt/etc/pacman.d/gnupg/gpg.conf
genfstab -U /mnt >> /mnt/etc/fstab
cp -R "${SCRIPT_DIR}" /mnt/root/ArchTitus
cp /etc/pacman.d/mirrorlist /mnt/etc/pacman.d/mirrorlist
# check if layout is default # check if layout is default
# if [[ "$LAYOUT" == "default" ]]; then # if [[ "$LAYOUT" == "default" ]]; then
@ -112,11 +137,7 @@ fi
# sgdisk -A 1:set:2 ${DISK} # sgdisk -A 1:set:2 ${DISK}
# fi # fi
# make filesystems # make filesystems
echo -ne "
-------------------------------------------------------------------------
Creating Filesystems
-------------------------------------------------------------------------
"
# createsubvolumes () { # createsubvolumes () {
# btrfs subvolume create /mnt/@ # btrfs subvolume create /mnt/@
# btrfs subvolume create /mnt/@home # btrfs subvolume create /mnt/@home
@ -178,18 +199,9 @@ echo -ne "
# mount -t btrfs -o subvol=@ -L ROOT /mnt # mount -t btrfs -o subvol=@ -L ROOT /mnt
# fi # fi
# mount target
mkdir /mnt/boot
mkdir /mnt/boot/efi
mount -t vfat -L EFIBOOT /mnt/boot/
# if ! grep -qs '/mnt' /proc/mounts; then
# echo "Drive is not mounted can not continue"
# echo "Rebooting in 3 Seconds ..." && sleep 1
# echo "Rebooting in 2 Seconds ..." && sleep 1
# echo "Rebooting in 1 Second ..." && sleep 1
# reboot now
# fi
# echo -ne " # echo -ne "
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
# Arch Install on Main Drive # Arch Install on Main Drive
@ -199,8 +211,7 @@ mount -t vfat -L EFIBOOT /mnt/boot/
# echo "keyserver hkp://keyserver.ubuntu.com" >> /mnt/etc/pacman.d/gnupg/gpg.conf # echo "keyserver hkp://keyserver.ubuntu.com" >> /mnt/etc/pacman.d/gnupg/gpg.conf
# # check pacstrap installed or not # # check pacstrap installed or not
# cp -R "${SCRIPT_DIR}" /mnt/root/ArchTitus
# cp /etc/pacman.d/mirrorlist /mnt/etc/pacman.d/mirrorlist
# echo -ne " # echo -ne "
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
# GRUB BIOS Bootloader Install & Check # GRUB BIOS Bootloader Install & Check
@ -209,27 +220,23 @@ mount -t vfat -L EFIBOOT /mnt/boot/
# # if [[ ! -d "/sys/firmware/efi" ]]; then # # if [[ ! -d "/sys/firmware/efi" ]]; then
# # grub-install --boot-directory=/mnt/boot "${DISK}" # # grub-install --boot-directory=/mnt/boot "${DISK}"
# # fi # # fi
# echo -ne "
# ------------------------------------------------------------------------- title "Checking for low memory systems <8G "
# Checking for low memory systems <8G
# ------------------------------------------------------------------------- # TOTALMEM=$(cat /proc/meminfo | grep -i 'memtotal' | grep -o '[[:digit:]]*')
# " TOTALMEM=$(grep -i "memtotal" "/proc/meminfo" | grep -o '[[:digit:]]*')
# # TOTALMEM=$(cat /proc/meminfo | grep -i 'memtotal' | grep -o '[[:digit:]]*') if [[ $TOTALMEM -lt 8000000 ]]; then
# TOTALMEM=$(grep -i "memtotal" "/proc/meminfo" | grep -o '[[:digit:]]*') # Put swap into the actual system, not into RAM disk, otherwise there is no point in it, it'll cache RAM into RAM. So, /mnt/ everything.
# if [[ $TOTALMEM -lt 8000000 ]]; then mkdir /mnt/opt/swap # make a dir that we can apply NOCOW to to make it btrfs-friendly.
# # Put swap into the actual system, not into RAM disk, otherwise there is no point in it, it'll cache RAM into RAM. So, /mnt/ everything. chattr +C /mnt/opt/swap # apply NOCOW, btrfs needs that.
# mkdir /mnt/opt/swap # make a dir that we can apply NOCOW to to make it btrfs-friendly. dd if=/dev/zero of=/mnt/opt/swap/swapfile bs=1M count=2048 status=progress
# chattr +C /mnt/opt/swap # apply NOCOW, btrfs needs that. chmod 600 /mnt/opt/swap/swapfile # set permissions.
# dd if=/dev/zero of=/mnt/opt/swap/swapfile bs=1M count=2048 status=progress chown root /mnt/opt/swap/swapfile
# chmod 600 /mnt/opt/swap/swapfile # set permissions. mkswap /mnt/opt/swap/swapfile
# chown root /mnt/opt/swap/swapfile swapon /mnt/opt/swap/swapfile
# mkswap /mnt/opt/swap/swapfile # The line below is written to /mnt/ but doesn't contain /mnt/, since it's just / for the system itself.
# swapon /mnt/opt/swap/swapfile echo "/opt/swap/swapfile none swap sw 0 0" >> /mnt/etc/fstab # Add swap to fstab, so it KEEPS working after installation.
# # The line below is written to /mnt/ but doesn't contain /mnt/, since it's just / for the system itself. fi
# echo "/opt/swap/swapfile none swap sw 0 0" >> /mnt/etc/fstab # Add swap to fstab, so it KEEPS working after installation.
# fi title "SYSTEM READY FOR 1-setup.sh"
echo -ne "
-------------------------------------------------------------------------
SYSTEM READY FOR 1-setup.sh
-------------------------------------------------------------------------
"