mirror of
https://github.com/donovanglover/nix-config.git
synced 2025-06-24 19:51:30 +02:00
archlinux: Remove install scripts
Although writing my own install scripts was a valuable learning experience, Arch Linux now has an official archinstall utility, which should be easier to use than having to edit a bash script.
This commit is contained in:
parent
f5fcf8962d
commit
3005a7ce51
@ -1,28 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Make partitions
|
||||
#
|
||||
# https://wiki.archlinux.org/index.php/Installation_guide
|
||||
|
||||
set -xe
|
||||
|
||||
# Sync the time with one online before doing anything
|
||||
timedatectl set-ntp true
|
||||
|
||||
# Make a DOS partition table with one primary ext4 partition and
|
||||
# enable boot for it. Then, create a primary swap partition with
|
||||
# the remaining disk space.
|
||||
parted /dev/sda mklabel msdos
|
||||
parted /dev/sda mkpart primary ext4 1MiB "$DISTSIZE"GiB
|
||||
parted /dev/sda set 1 boot on
|
||||
parted /dev/sda mkpart primary linux-swap "$DISTSIZE"GiB 100%
|
||||
|
||||
# Format sda1 with ext4 and sda2 with swap
|
||||
mkfs -t ext4 /dev/sda1
|
||||
mkswap /dev/sda2
|
||||
|
||||
# Enable the swap partition
|
||||
swapon /dev/sda2
|
||||
|
||||
# Mount the newly created file system (/dev/sda1) to /mnt.
|
||||
mount /dev/sda1 /mnt
|
@ -1,9 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Install packages to new filesystem
|
||||
#
|
||||
# https://wiki.archlinux.org/index.php/Installation_guide
|
||||
|
||||
set -xe
|
||||
|
||||
pacstrap /mnt base linux linux-firmware grub fish git polkit rng-tools vim dhcpcd
|
@ -1,50 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Core system configs
|
||||
#
|
||||
# https://wiki.archlinux.org/index.php/Installation_guide
|
||||
|
||||
set -xe
|
||||
|
||||
# Generate the fstab file (so the filesystem is mounted on boot)
|
||||
genfstab -U /mnt > /mnt/etc/fstab
|
||||
|
||||
# Set the timezone
|
||||
arch-chroot /mnt ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
|
||||
|
||||
# Generate /etc/adjtime
|
||||
arch-chroot /mnt hwclock --systohc
|
||||
|
||||
# Set the hostname
|
||||
echo "$HOSTNAME" > /mnt/etc/hostname
|
||||
|
||||
# Configure the hosts file (if your system has a permanent IP address, use that instead of 127.0.1.1)
|
||||
echo "127.0.0.1 localhost" >> /mnt/etc/hosts
|
||||
echo "::1 localhost" >> /mnt/etc/hosts
|
||||
echo "127.0.1.1 $HOSTNAME.localdomain $HOSTNAME" >> /mnt/etc/hosts
|
||||
|
||||
# Declare which locales we want to generate and generate them
|
||||
sed -i '/#en_US.UTF-8 UTF-8/s/^#//g' /mnt/etc/locale.gen
|
||||
sed -i '/#fr_FR.UTF-8 UTF-8/s/^#//g' /mnt/etc/locale.gen
|
||||
sed -i '/#ja_JP.UTF-8 UTF-8/s/^#//g' /mnt/etc/locale.gen
|
||||
arch-chroot /mnt locale-gen
|
||||
|
||||
# Set the system locale to the generated en_US.UTF-8
|
||||
echo "LANG=en_US.UTF-8" > /mnt/etc/locale.conf
|
||||
|
||||
# Set the tty font to a larger one (same as the default setfont, but larger)
|
||||
if [ "$HIDPI" == "YES" ]; then
|
||||
echo "FONT=latarcyrheb-sun32" > /mnt/etc/vconsole.conf
|
||||
fi
|
||||
|
||||
# Install grub to the primary partition.
|
||||
arch-chroot /mnt grub-install /dev/sda
|
||||
|
||||
# Prevent the GRUB window from showing at boot, ideal for single OS machines (undo with chroot and mkconfig)
|
||||
sed -i '/GRUB_TIMEOUT/c\GRUB_TIMEOUT=0' /mnt/etc/default/grub
|
||||
|
||||
# Make the configuration file for grub.
|
||||
arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg
|
||||
|
||||
# Change the shell of the root account to fish.
|
||||
arch-chroot /mnt chsh -s /usr/bin/fish
|
@ -1,41 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Higher-level configs
|
||||
#
|
||||
# https://wiki.archlinux.org/index.php/General_recommendations
|
||||
|
||||
set -xe
|
||||
|
||||
# Create the output directories if they don't exist yet
|
||||
arch-chroot /mnt mkdir -p /etc/systemd/system/multi-user.target.wants
|
||||
arch-chroot /mnt mkdir -p /etc/systemd/system/sysinit.target.wants
|
||||
|
||||
# Enable the DHCP client daemon service
|
||||
arch-chroot /mnt ln -sf /usr/lib/systemd/system/dhcpcd.service \
|
||||
/etc/systemd/system/multi-user.target.wants/dhcpcd.service
|
||||
|
||||
# Enable the timesync daemon service (sync the time periodically with a remote server)
|
||||
arch-chroot /mnt ln -sf /usr/lib/systemd/system/systemd-timesyncd.service \
|
||||
/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service
|
||||
|
||||
# Enable the rng-tools daemon
|
||||
arch-chroot /mnt ln -sf /usr/lib/systemd/system/rngd.service \
|
||||
/etc/systemd/system/sysinit.target.wants/rngd.service
|
||||
|
||||
# Enable colors in pacman by uncommenting the Color line.
|
||||
sed -i '/Color/s/^#//g' /mnt/etc/pacman.conf
|
||||
|
||||
# Show package upgrades as a list
|
||||
sed -i '/VerbosePkgLists/s/^#//g' /mnt/etc/pacman.conf
|
||||
|
||||
# Give users in the wheel group permission to use sudo
|
||||
echo "%wheel ALL=(ALL) ALL" > /mnt/etc/sudoers.d/01_wheel_all
|
||||
|
||||
# Create a new user account with sudo privileges and the fish shell.
|
||||
arch-chroot /mnt useradd -m -g users -G wheel -s /usr/bin/fish "$USERNAME"
|
||||
|
||||
# Lock the root account (i.e. disable root login)
|
||||
arch-chroot /mnt passwd -l root
|
||||
|
||||
# Clone this repository to the user's $HOME
|
||||
arch-chroot /mnt su "$USERNAME" -c "git clone https://github.com/GloverDonovan/dotfiles /home/$USERNAME/.files"
|
@ -1,30 +0,0 @@
|
||||
# Install Scripts
|
||||
|
||||
Here are my Arch Linux install scripts. They are divided into 4 parts:
|
||||
|
||||
1. Pre-install: Setting up the drive to install Arch on
|
||||
2. Install: Installing Arch Linux to that drive
|
||||
3. Configure: Writing some basic low-level config files
|
||||
4. Post-install: Post-install configuration
|
||||
|
||||
I use `install.sh` to call these scripts with the proper user-generated variables.
|
||||
|
||||
> **Note**: If you do not understand my install scripts, you should follow the [Installation guide][archguide] instead.
|
||||
|
||||
## Usage
|
||||
|
||||
First, download the install script.
|
||||
|
||||
```sh
|
||||
curl -L https://git.io/.install -o install.sh
|
||||
```
|
||||
|
||||
After you have verified that the install script is indeed correct, run it.
|
||||
|
||||
```sh
|
||||
sh install.sh
|
||||
```
|
||||
|
||||
That's it!
|
||||
|
||||
[archguide]: https://wiki.archlinux.org/index.php/Installation_guide
|
@ -1,57 +0,0 @@
|
||||
#!/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/dotfiles/master/.archlinux/install-scripts"
|
||||
[ -f 001-preinstall ] || curl -L "$URL/001-preinstall" -o 001-preinstall
|
||||
[ -f 002-install ] || curl -L "$URL/002-install" -o 002-install
|
||||
[ -f 003-configure ] || curl -L "$URL/003-configure" -o 003-configure
|
||||
[ -f 004-postinstall ] || curl -L "$URL/004-postinstall" -o 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!"
|
Loading…
x
Reference in New Issue
Block a user