2018-12-02 06:57:34 +01:00
|
|
|
#!/bin/sh
|
2018-12-03 00:46:52 +01:00
|
|
|
# Simple Arch Linux install scripts, tailored to my use case.
|
2018-12-02 06:57:34 +01:00
|
|
|
|
2018-12-03 00:46:52 +01:00
|
|
|
# End the script on any errors
|
2018-12-02 06:57:34 +01:00
|
|
|
set -e
|
|
|
|
|
2018-12-03 00:46:52 +01:00
|
|
|
# Change the working directory to this one
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
|
|
|
|
# Prompt for the required information
|
|
|
|
|
2018-12-02 23:15:11 +01:00
|
|
|
echo -n "Enter the size (in GiB) to give the primary partition: "
|
|
|
|
read DISTSIZE
|
|
|
|
|
2018-12-04 02:59:30 +01:00
|
|
|
echo -n "Enter a username for the user with sudo rights: "
|
2018-12-02 06:57:34 +01:00
|
|
|
read USERNAME
|
|
|
|
|
2018-12-04 02:59:30 +01:00
|
|
|
echo -n "Enter a hostname for this machine ($USERNAME@_____): "
|
2018-12-03 17:28:20 +01:00
|
|
|
read HOSTNAME
|
|
|
|
|
2018-12-03 18:13:05 +01:00
|
|
|
echo -n "Type YES to enable HiDPI support in the virtual console: "
|
|
|
|
read HIDPI
|
|
|
|
|
2018-12-02 23:32:25 +01:00
|
|
|
echo "-----------------------------------------------------"
|
|
|
|
echo "Arch Linux will be installed with the settings above."
|
|
|
|
echo "NOTE: You should not run this script if you do not"
|
|
|
|
echo " understand what it does. Bad things may happen."
|
|
|
|
echo -n "Type YES to continue, or Ctrl+C to abort. "
|
|
|
|
read CONFIRM
|
|
|
|
|
|
|
|
if [ "$CONFIRM" != "YES" ]; then
|
|
|
|
echo "YES was not given, exiting..."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "====================================================="
|
|
|
|
echo "Running install scripts..."
|
|
|
|
|
2018-12-03 00:46:52 +01:00
|
|
|
# Run the install scripts
|
2018-12-03 18:13:05 +01:00
|
|
|
env DISTSIZE="$DISTSIZE" ./001-preinstall
|
|
|
|
./002-install
|
|
|
|
env HOSTNAME="$HOSTNAME" HIDPI="$HIDPI" ./003-configure
|
|
|
|
env USERNAME="$USERNAME" ./004-postinstall
|
2018-12-03 00:42:34 +01:00
|
|
|
|
|
|
|
echo "Enter a password for $USERNAME..."
|
|
|
|
arch-chroot /mnt passwd "$USERNAME"
|
2018-12-03 00:46:52 +01:00
|
|
|
|
|
|
|
echo "====================================================="
|
|
|
|
echo "Done. Now reboot into Arch Linux!"
|