-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-arch.sh
More file actions
executable file
·40 lines (29 loc) · 1.15 KB
/
Copy pathsetup-arch.sh
File metadata and controls
executable file
·40 lines (29 loc) · 1.15 KB
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
#!/bin/sh
set -exuo pipefail
ARMV7_ARCHITECTURE="armv7"
GPG_KEY_ID="77193F152BDBE6A6"
MOUNTPOINT="/mnt"
ARCHITECTURE="$(cat /etc/apk/arch)"
apk update
apk add --no-cache arch-install-scripts
if [ "${ARCHITECTURE}" = "${ARMV7_ARCHITECTURE}" ]; then
sed -i '/Architecture/s/auto/armv7h/' /etc/pacman.conf
fi
echo '[options]' | tee -a /etc/pacman.conf
echo "SigLevel = Required DatabaseOptional" | tee -a /etc/pacman.conf
for repo in core extra alarm aur; do
echo "[$repo]" | tee -a /etc/pacman.conf
echo "Include = /etc/pacman.d/mirrorlist" | tee -a /etc/pacman.conf
done
mkdir /etc/pacman.d/
echo 'Server = http://mirror.archlinuxarm.org/$arch/$repo' | tee -a /etc/pacman.d/mirrorlist
pacman-key --init
pacman-key -r "${GPG_KEY_ID}"
pacman-key --lsign-key "${GPG_KEY_ID}"
mkdir -p "${MOUNTPOINT}"
pacstrap "${MOUNTPOINT}" base arch-install-scripts $@
rm -r "${MOUNTPOINT}/var/cache/pacman/pkg"
if [ "${ARCHITECTURE}" = "${ARMV7_ARCHITECTURE}" ]; then
# fix bug in armv7h pacman https://archlinuxarm.org/forum/viewtopic.php?f=57&t=16830
sed -i '/^CFLAGS=/,/^[[:upper:]]+=/{s/[[:space:]]*-mno-omit-leaf-frame-pointer\b//g}' "${MOUNTPOINT}/etc/makepkg.conf"
fi