1
0
forked from extern/nix-config
donovanglover-nix-config/.archlinux/install-scripts/install.sh
Donovan Glover f320b0c294
archlinux: Add single install script support
This commit makes it so that downloading the entire repository to run
the install scripts is no longer necessary.

It assumes that you have an active internet connection, which should be
a given since you need an internet connection to run pacstrap anyway.
2018-12-06 17:39:59 -05:00

58 lines
1.8 KiB
Bash
Executable File

#!/bin/sh
# Simple Arch Linux install scripts, tailored to my use case.
# End the script on any errors
set -e
# Change the working directory to this one
cd "$(dirname "$0")"
# Download the install scripts if they don't exist yet
URL="https://raw.githubusercontent.com/GloverDonovan/.files/master/.archlinux/install-scripts"
[ -f 001-preinstall ] || wget "$URL/001-preinstall"
[ -f 002-install ] || wget "$URL/002-install"
[ -f 003-configure ] || wget "$URL/003-configure"
[ -f 004-postinstall ] || wget "$URL/004-postinstall"
chmod 755 001-preinstall 002-install 003-configure 004-postinstall
# Prompt for the required information
echo -n "Enter the size (in GiB) to give the primary partition: "
read DISTSIZE
echo -n "Enter a username for the user with sudo rights: "
read USERNAME
echo -n "Enter a hostname for this machine ($USERNAME@_____): "
read HOSTNAME
echo -n "Type YES to enable HiDPI support in the virtual console: "
read HIDPI
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..."
# Run the install scripts
env DISTSIZE="$DISTSIZE" ./001-preinstall
./002-install
env HOSTNAME="$HOSTNAME" HIDPI="$HIDPI" ./003-configure
env USERNAME="$USERNAME" ./004-postinstall
echo "Enter a password for $USERNAME..."
arch-chroot /mnt passwd "$USERNAME"
echo "====================================================="
echo "Done. Now reboot into Arch Linux!"