2018-10-31 16:31:40 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2018-12-03 00:31:56 +01:00
|
|
|
# Make partitions
|
2018-10-31 16:31:40 +01:00
|
|
|
#
|
|
|
|
# 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
|
2018-12-03 16:44:17 +01:00
|
|
|
parted /dev/sda mkpart primary ext4 1MiB "$DISTSIZE"GiB
|
2018-10-31 16:31:40 +01:00
|
|
|
parted /dev/sda set 1 boot on
|
2018-12-03 16:44:17 +01:00
|
|
|
parted /dev/sda mkpart primary linux-swap "$DISTSIZE"GiB 100%
|
2018-10-31 16:31:40 +01:00
|
|
|
|
|
|
|
# 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
|