Skip to content

Commit

Permalink
fix: build static xen-guest-agent binary
Browse files Browse the repository at this point in the history
  • Loading branch information
j3rwin committed Mar 8, 2024
1 parent 377f334 commit 9722ba2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
8 changes: 4 additions & 4 deletions guest-agents/xen-guest-agent/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ install:
steps:
- env:
PKG_CONFIG_PATH: /usr/lib/pkgconfig
RUSTFLAGS: '-C target-feature=+crt-static'
- sources:
- url: https://gitlab.com/xen-project/xen-guest-agent/-/archive/{{ .XEN_GUEST_AGENT_VERSION }}/xen-guest-agent-{{ .XEN_GUEST_AGENT_VERSION }}.tar.gz
sha256: 492ba2022b4155b38443ddf34a5bdbb0d72966d0936aab8545b4a135fa69c990
Expand All @@ -21,13 +22,12 @@ steps:
- |
tar -xzvf xe-guest-agent.tar.gz --strip-components=1
build:
- cargo build -F static --release
- cargo build --release -F static --target {{ .ARCH }}-alpine-linux-musl
install:
- |
containerRoot=/rootfs/usr/local/lib/containers/xen-guest-agent
mkdir -p "$containerRoot"/usr/local/lib
mv /usr/lib/libgcc* "$containerRoot/usr/local/lib/"
mv target/release/xen-guest-agent "$containerRoot/xen-guest-agent"
mkdir -p "$containerRoot"
mv target/{{ .ARCH }}-alpine-linux-musl/release/xen-guest-agent "$containerRoot/xen-guest-agent"
finalize:
- from: /rootfs
to: /rootfs
Expand Down
14 changes: 0 additions & 14 deletions guest-agents/xen-guest-agent/xen-guest-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,6 @@ container:
writeableRootfs: false
writeableSysfs: true
mounts:
# ld-musl-x86_64.so.1
- source: /lib
destination: /lib
type: bind
options:
- bind
- ro
# libc.so
- source: /usr/lib
destination: /usr/lib
type: bind
options:
- bind
- ro
# xenbus
- source: /dev/xen
destination: /dev/xen
Expand Down

0 comments on commit 9722ba2

Please sign in to comment.