-
Notifications
You must be signed in to change notification settings - Fork 4
/
Pre-Installation.sh
44 lines (33 loc) · 969 Bytes
/
Pre-Installation.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
# Pre-Installation
# Connect to the Internet
# wifi-menu
# Update the system clock
timedatectl set-ntp true
# Partition the disks
parted /dev/sda mklabel gpt
echo "mkpart ESP fat32 1MiB 200MiB
set 1 boot on
mkpart primary ext4 200MiB 100%
quit
" | parted /dev/sda
# Format the partitions
mkfs.fat -F32 /dev/sda1
mkfs.ext4 /dev/sda2
# Mount the partitions
mount /dev/sda2 /mnt
mkdir -p /mnt/boot
mount /dev/sda1 /mnt/boot
# Select the mirrors
cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
grep -E -A 1 ".*Germany.*$" /etc/pacman.d/mirrorlist.bak | sed '/--/d' > /etc/pacman.d/mirrorlist
# Install the base packages
pacstrap -i /mnt base base-devel
# Configure the system
genfstab -U /mnt > /mnt/etc/fstab
# Copy the setup folder to the new system
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cp -R $DIR /mnt/
# Change root into the new system and start second Script
echo "Execute Installation.sh"
arch-chroot /mnt /bin/bash