1
0
forked from extern/nix-config
donovanglover-nix-config/.archlinux/install-scripts/001-preinstall
Donovan Glover 200d2b9e7a
archlinux: Update install scripts
Instead of running two systemctl commands (start and enable),
one can simply use `systemctl enable --now` instead.

The grub command was removed since I never used it and haven't
found a need to do so.
2018-11-15 21:18:51 -05:00

30 lines
793 B
Bash

#!/bin/sh
#
# This script assumes you already have an active internet connection
# (preferably through Ethernet).
#
# 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 60GiB
parted /dev/sda set 1 boot on
parted /dev/sda mkpart primary linux-swap 60GiB 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