forked from siderolabs/extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpkg.yaml
72 lines (64 loc) · 2.09 KB
/
pkg.yaml
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
name: qemu-guest-agent
variant: scratch
shell: /toolchain/bin/bash
dependencies:
- stage: base
- image: "{{ .PKGS_PREFIX }}/openssl:{{ .BUILD_ARG_PKGS }}"
- stage: pcre2
- stage: glib
steps:
- sources:
- url: https://download.qemu.org/qemu-{{ .QEMU_VERSION }}.tar.xz
destination: qemu.tar.xz
sha256: 37ce2ef5e500fb752f681117c68b45118303ea49a7e26bd54080ced54fab7def
sha512: 199db58f9a413cbe4449ff557bc362e666c6c0291f9963cb74e5542e8abd1edcd65001fa1fd453b850a376de455f93258707ce6feee5a44bf40753b12a2e956c
prepare:
- |
sed -i 's#$VERSION#{{ .VERSION }}#' /pkg/manifest.yaml
- |
tar -xf qemu.tar.xz --strip-components=1
rm qemu.tar.xz
- |
mkdir -p /usr/bin
ln -s /toolchain/bin/env /usr/bin/env
ln -s /toolchain/bin/python3 /toolchain/bin/python
pip3 install ninja
extra_args=( )
if [[ "${ARCH}" == aarch64 ]]; then
# FIXME: Workaround for “read-only segment has dynamic relocations” linking error.
extra_args+=( --disable-pie )
fi
export PKG_CONFIG_PATH=/usr/lib/pkgconfig
./configure \
--static \
--prefix=/usr/local \
--localstatedir=/var \
--without-default-features \
--disable-system \
--disable-user \
--disable-docs \
--disable-install-blobs \
--enable-guest-agent \
--enable-stack-protector \
"${extra_args[@]}"
build:
- |
make -j $(nproc) qemu-ga
install:
- |
make DESTDIR=/rootfs install
container_root=/rootfs/usr/local/lib/containers/qemu-guest-agent
mkdir -p "${container_root}"
mv /rootfs/usr/local/bin/qemu-ga "${container_root}/qemu-ga"
rmdir /rootfs/usr/local/bin
rm -r /rootfs/usr/local/share/qemu
rmdir /rootfs/usr/local/share
rmdir /rootfs/var/run
rmdir /rootfs/var
finalize:
- from: /rootfs
to: /rootfs
- from: /pkg/manifest.yaml
to: /
- from: /pkg/qemu-guest-agent.yaml
to: /rootfs/usr/local/etc/containers/