aboutsummaryrefslogtreecommitdiff
path: root/distro/arch-install.sh
blob: 6cfb0957d39e4c13d2616c556c8012b28bd40404 (plain) (blame)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/sh
set -ex

do_edit() {
printf "Edit \"$1\" ? : "
read -r resp
case $resp in
	Y|y) arch-chroot "${_install_path}" nvim "$1" ;;
	*) ;;
esac
}

do_chroot() {
	arch-chroot "$_install_path"  "$@"
}

_install_path="${INSTALL_PATH:-/mnt}"
_tz="${TZ:-America/New_York}"
_hostname="${INSTALL_HOSTNAME:-arch}"
PACSTRAP="${PACSTRAP:-1}"

set +x
if ! awk '{print $2}' /proc/mounts | grep -q '^'"$_install_path"'$' ; then
	echo "Cannot install to \"$_install_path\" because it is not a mountpoint"
	echo "if you've mounted somewhere other than /mnt use:"
	echo "	env INSTALL_PATH=<path> ./arch-install.sh"
	echo where '<path>' is the mount point in question
	exit 1
fi
set -x

if [ $PACSTRAP -eq 1 ] ; then
pacstrap -K "$_install_path" \
	arch-install-scripts \
	base \
	base-devel \
	cryptsetup \
	dosfstools \
	e2fsprogs \
	efibootmgr \
	git \
	gptfdisk \
	grub \
	linux \
	linux-firmware \
	linux-firmware-marvell \
	lvm2 \
	networkmanager \
	nvim \
	sof-firmware \
	tmux \
	xfsprogs \

fi


genfstab -U "$_install_path" >> "${_install_path}/etc/fstab"

do_edit /etc/fstab

do_edit /etc/locale.gen

do_chroot locale-gen

do_chroot ln -sf "/usr/share/zoneinfo/$_tz" /etc/localtime

do_edit /etc/mkinitcpio.conf

do_chroot mkinitcpio -p linux

do_edit /etc/default/grub

do_chroot grub-install --target=x86_64-efi --removable --efi-directory=/boot/efi

do_chroot grub-mkconfig -o /boot/grub/grub.cfg

do_chroot passwd