-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathqemu.patch
49 lines (46 loc) · 1.45 KB
/
qemu.patch
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
--- /usr/bin/archbuild 2019-09-22 00:10:53.000000000 +0800
+++ qemu_archbuild 2020-01-20 21:52:05.298993263 +0800
@@ -263,6 +263,11 @@
tag="${cmd%-build}"
repo=${tag%-*}
arch=${tag##*-}
+ if [[ "x${arch}" = "xaarch64" ]]; then
+ qemu_static='/usr/bin/qemu-aarch64-static'
+ else
+ qemu_static='/usr/bin/qemu-arm-static'
+ fi
fi
chroots='/var/lib/archbuild'
clean_first=false
@@ -300,6 +305,8 @@
# Pass all arguments after -- right to makepkg
makechrootpkg_args+=("${@:$OPTIND}")
+. /usr/share/devtools/qemu_archbuild.sh
+
if ${clean_first} || [[ ! -d "${chroots}/${repo}-${arch}" ]]; then
msg "Creating chroot for [%s] (%s)..." "${repo}" "${arch}"
@@ -319,6 +326,9 @@
mkarchroot \
-C "${pacman_config}" \
-M "${makepkg_config}" \
+ -f "$qemu_static" \
+ -f '/usr/share/devtools/qemu_mirrorlist' \
+ -c "${pkgcache}/${arch}/" \
"${chroots}/${repo}-${arch}/root" \
"${base_packages[@]}" || abort
else
@@ -326,6 +336,9 @@
arch-nspawn \
-C "${pacman_config}" \
-M "${makepkg_config}" \
+ -f "$qemu_static" \
+ -f '/usr/share/devtools/qemu_mirrorlist' \
+ -c "${pkgcache}/${arch}/" \
"${chroots}/${repo}-${arch}/root" \
pacman -Syuu --noconfirm || abort
fi
@@ -336,4 +349,4 @@
fi
msg "Building in chroot for [%s] (%s)..." "${repo}" "${arch}"
-exec makechrootpkg -r "${chroots}/${repo}-${arch}" "${makechrootpkg_args[@]}"
+exec makechrootpkg -r "${chroots}/${repo}-${arch}" -X "${pkgcache}/${arch}/" "${makechrootpkg_args[@]}"