-
Notifications
You must be signed in to change notification settings - Fork 0
/
rw-install.sh
executable file
·37 lines (33 loc) · 1.38 KB
/
rw-install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
set -e
bash ${SCRIPT_DIR}/0-preinstall.sh
# Copy repo to root
# rm -R -f /mnt/root/install-script && cp -R ../rw /mnt/root/install-script && arch-chroot /mnt /root/install-script/1-setup.sh
rm -R -f /mnt/root/install-script
cp -R ${SCRIPT_DIR} /mnt/root/install-script
arch-chroot /mnt /root/install-script/1-setup.sh
# Copy repo to user and give perms for it
source /mnt/root/install-script/install.conf
arch-chroot /mnt rm -R -f /home/$username/install-script
arch-chroot /mnt cp -R /root/install-script /home/$username/install-script
rm -f -r /mnt/root/install-script
arch-chroot /mnt chown -R $username /home/$username/install-script
echo "System is now bootable"
echo "Next step: running 2-software.sh and 3-dotfiles.sh"
echo "They can also be run after booting, from the dir ~/install-script"
echo "If installation was successful consider:"
echo " - snapper -c root create --description \"Fresh Install\""
echo " - snapper -c home create --description \"Fresh Install\""
read -p "Install now? (y/N):" installNow
case $installNow in
y|Y|yes|Yes|YES)
arch-chroot /mnt /usr/bin/runuser -u $username -- /home/$username/install-script/2-software.sh
arch-chroot /mnt /usr/bin/runuser -u $username -- /home/$username/install-script/3-dotfiles.sh
;;
*)
echo "Exiting..."
exit 0
;;
esac
#