install.sh 707 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash

set -e
set -x

if [ -e /dev/vda ]; then
  device=/dev/vda
elif [ -e /dev/sda ]; then
  device=/dev/sda
else
  echo "ERROR: There is no disk available for installation" >&2
  exit 1
fi
export device

memory_size_in_kilobytes=$(free | awk '/^Mem:/ { print $2 }')
swap_size_in_kilobytes=$((memory_size_in_kilobytes * 2))
sfdisk "$device" <<EOF
label: dos
size=${swap_size_in_kilobytes}KiB, type=82
                                   type=83, bootable
EOF

mkswap "${device}1"
Christian Rebischke's avatar
Christian Rebischke committed
25
mkfs.ext4 -L "rootfs" "${device}2"
26
27
mount "${device}2" /mnt

28
pacstrap /mnt base linux grub openssh sudo polkit haveged
29
swapon "${device}1"
30
genfstab -p /mnt >>/mnt/etc/fstab
31
32
33
swapoff "${device}1"

arch-chroot /mnt /bin/bash