feat: full rewrite in modules

This commit is contained in:
ange 2024-05-24 20:46:28 +02:00
parent 33725b0188
commit 5cc6a0dd08
Signed by: ange
GPG key ID: 9E0C4157BB7BEB1D
31 changed files with 283 additions and 215 deletions

View file

@ -1,34 +1,7 @@
#!/bin/bash
cd -- "$(dirname "$0")"
set -a
. ./config
. ./src/lib.sh
set +a
set -x
(
case "$swapfile" in
[0-9]*)
size="$swapfile"
;;
auto)
ram="$(free -m | awk '/^Mem:/ {print $2}')"
size="$(python -c "from math import ceil,log; print(2**ceil((log($ram)/log(2))))")"
;;
*)
exit
;;
esac
dd if=/dev/zero of=/mnt/swapfile bs=1M count="$size" status=progress
chmod 600 /mnt/swapfile
mkswap /mnt/swapfile
swapon /mnt/swapfile
)
pacstrap -C rootfs/etc/pacman.conf -K /mnt/ --needed "${pkg[@]}"
cp -rfTv rootfs/ /mnt/
genfstab -U /mnt/ >> /mnt/etc/fstab
swapoff /mnt/swapfile
cat config src/lib.sh src/install.sh | arch-chroot /mnt/ bash
echo "${BOLD}${GREEN}DONE${NORMAL}"
./modules/"$install_type".sh