arch-maride-flavour/install.sh

91 lines
2.2 KiB
Bash
Raw Permalink Normal View History

2017-07-30 19:58:31 +00:00
#!/bin/sh
echo "HOI, this is the 'Arch w/ maride flavour' install script (chainloader)"
echo "Hope you used TLS..."
echo -e "=-=-=-=-=-=-=-=-=-=-=\n"
echo "=> Things you should've set up already:"
echo " * Your keyboard layout (consider passwords!)"
echo " * Any RAID setup that you are planning to set up"
echo " * An internet connection (DHCP or static, idc...)"
echo -n "=> Did you set that up? (y/N) "
read answer
2017-08-07 16:02:57 +00:00
if [ "$answer" != "y" ] && [ "$answer" != "Y" ]; then
2017-07-30 19:58:31 +00:00
echo "OK, then do necessary steps and see you soon."
exit 1
fi
2017-08-12 14:01:00 +00:00
echo -n "=> Do you want to install on EFI or BIOS? BIOS is required for VirtalBox hosts (E/b) "
read answer
if [ "$answer" != "e" ] && [ "$answer" != "E" ]; then
export bootloader="BIOS";
else
export bootloader="EFI";
fi
echo "=> Please enter the full path to the block device the installation should take place on: (e.g. /dev/sda)"
echo " Make sure to choose a drive, not a partition."
echo " Hint: here's a list of devices that may be the right:"
ls /dev/sd* /dev/mmc* 2>/dev/null
echo -n "Install to: "
read blockdevice
2017-07-30 22:02:49 +00:00
export blockdevice
2017-07-30 20:19:24 +00:00
for check in checks/*.check
do
echo "=> Running check '$check'..."
2017-09-04 19:33:05 +00:00
source $check
if [ "$amf_return" -ne 0 ]; then
2017-07-30 20:19:24 +00:00
echo "=> Check failed. Fix it, maybe."
exit
fi
done
for step in steps/*.step
do
echo "=> Running step '$step'..."
source $step
if [ "$amf_return" -ne 0 ]; then
echo "=> Step failed. That is weird. Sorry. Check logs maybe."
exit
fi
done
2017-08-06 10:07:46 +00:00
for flavour in flavours/*.flavour
do
2017-09-03 14:52:51 +00:00
# in any case, run it once
rerun=1
2017-09-03 15:07:55 +00:00
while [ $rerun -eq 1 ]; do
2017-09-03 14:52:51 +00:00
echo -n "=> Do you want to run flavour '$flavour'? (y/N) "
read answer
2017-09-03 15:07:55 +00:00
rerun=0;
2017-09-03 14:52:51 +00:00
if [ "$answer" == "y" ] || [ "$answer" == "Y" ]; then
echo "=> Running flavour '$flavour'..."
pushd $flavour
source ./install.sh
if [ "$amf_return" -ne 0 ]; then
echo "=> Flavour failed. :( Rerun? (Y/n) "
read answer
if [ "$answer" == "y" ] || [ "$answer" == "Y" ]; then
rerun=1;
fi
fi
popd
fi
done
2017-08-06 10:07:46 +00:00
done
echo -n "=> Finished \o/ reboot now? (Y/n) "
read answer
2017-08-07 16:02:57 +00:00
if [ "$answer" == "n" ] || [ "$answer" == "N" ]; then
exit
fi
reboot