aboutsummaryrefslogtreecommitdiff
path: root/0-preinstall.sh
diff options
context:
space:
mode:
authorChris Titus <[email protected]>2021-10-25 00:29:55 -0500
committerGitHub <[email protected]>2021-10-25 00:29:55 -0500
commit4b6ad793e537726d99590ad93ff9f763fc4ea475 (patch)
tree8785a91f8499c6b137640be49a5c2b0423ebd5b8 /0-preinstall.sh
parentbf7332e38d6f7f0ac249c39c45300dc657d6c07c (diff)
parent3623487781cb98ed98993c00499079f6a5378239 (diff)
downloadArchTitus-4b6ad793e537726d99590ad93ff9f763fc4ea475.tar.xz
ArchTitus-4b6ad793e537726d99590ad93ff9f763fc4ea475.zip
Merge pull request #26 from ChrisTitusTech/test
Bug Fixes ArchTitus 1.1 Release
Diffstat (limited to '0-preinstall.sh')
-rwxr-xr-x0-preinstall.sh31
1 files changed, 29 insertions, 2 deletions
diff --git a/0-preinstall.sh b/0-preinstall.sh
index 0ac575e..18ba58c 100755
--- a/0-preinstall.sh
+++ b/0-preinstall.sh
@@ -7,7 +7,7 @@
# ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ██║ ██║ ╚██████╔╝███████║
# ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝
#-------------------------------------------------------------------------
-
+SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
echo "-------------------------------------------------"
echo "Setting up mirrors for optimal download "
echo "-------------------------------------------------"
@@ -26,6 +26,9 @@ echo -e " ██╔══██║██╔══██╗██║ ██�
echo -e " ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ██║ ██║ ╚██████╔╝███████║"
echo -e " ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝"
echo -e "-------------------------------------------------------------------------"
+echo -e "-Setting up $iso mirrors for faster downloads"
+echo -e "-------------------------------------------------------------------------"
+
reflector -a 48 -c $iso -f 5 -l 20 --sort rate --save /etc/pacman.d/mirrorlist
mkdir /mnt
@@ -80,6 +83,12 @@ ls /mnt | xargs btrfs subvolume delete
btrfs subvolume create /mnt/@
umount /mnt
;;
+*)
+echo "Rebooting in 3 Seconds ..." && sleep 1
+echo "Rebooting in 2 Seconds ..." && sleep 1
+echo "Rebooting in 1 Second ..." && sleep 1
+reboot now
+;;
esac
# mount target
@@ -88,6 +97,14 @@ mkdir /mnt/boot
mkdir /mnt/boot/efi
mount -t vfat -L UEFISYS /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 "--------------------------------------"
echo "-- Arch Install on Main Drive --"
echo "--------------------------------------"
@@ -105,8 +122,18 @@ linux /vmlinuz-linux
initrd /initramfs-linux.img
options root=LABEL=ROOT rw rootflags=subvol=@
EOF
-cp -R ~/ArchTitus /mnt/root/
+cp -R ${SCRIPT_DIR} /mnt/root/ArchTitus
cp /etc/pacman.d/mirrorlist /mnt/etc/pacman.d/mirrorlist
echo "--------------------------------------"
+echo "-- Check for low memory systems <8G --"
+echo "--------------------------------------"
+TOTALMEM=$(cat /proc/meminfo | grep -i 'memtotal' | grep -o '[[:digit:]]*')
+if [[ $TOTALMEM -lt 8000000 ]]; then
+ dd if=/dev/zero of=/swapfile bs=1M count=2048 status=progress
+ chmod 600 /swapfile
+ mkswap /swapfile
+ swapon /swapfile
+fi
+echo "--------------------------------------"
echo "-- SYSTEM READY FOR 0-setup --"
echo "--------------------------------------"