Skip to content

Commit 466fcb7

Browse files
committed
chore(core): build numactl
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
1 parent 5a81a90 commit 466fcb7

3 files changed

Lines changed: 77 additions & 8 deletions

File tree

component_versions/version_map.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ firmware:
44
edk2: stable202411
55
package:
66
swtpm: 0.10.0
7+
numactl: 2.0.19
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
image: {{ $.ImageType }}/{{ $.ImageName }}
3+
final: false
4+
fromImage: builder/scratch
5+
import:
6+
- image: {{ $.ImageType }}/{{ $.ImageName }}-builder
7+
add: /out
8+
to: /numactl
9+
before: setup
10+
11+
---
12+
{{- $version := get $.Package $.ImageName }}
13+
{{- $gitRepoUrl := "numactl/numactl.git" }}
14+
15+
{{- $name := print $.ImageName "-dependencies" -}}
16+
{{- define "$name" -}}
17+
packages:
18+
- gcc
19+
- git pkg-config trousers
20+
- automake autoconf make libtool
21+
- tree
22+
{{- end -}}
23+
24+
{{ $builderDependencies := include "$name" . | fromYaml }}
25+
26+
image: {{ $.ImageType }}/{{ $.ImageName }}-builder
27+
final: false
28+
fromImage: builder/alt
29+
secrets:
30+
- id: SOURCE_REPO
31+
value: {{ $.SOURCE_REPO_GIT }}
32+
shell:
33+
beforeInstall:
34+
- |
35+
apt-get update && apt-get install -y \
36+
{{ $builderDependencies.packages | join " " }}
37+
apt-get clean
38+
rm --recursive --force /var/lib/apt/lists/ftp.altlinux.org* /var/cache/apt/*.bin
39+
40+
install:
41+
- |
42+
OUTDIR=/out
43+
mkdir -p ~/.ssh && echo "StrictHostKeyChecking accept-new" > ~/.ssh/config
44+
45+
git clone --depth=1 $(cat /run/secrets/SOURCE_REPO)/{{ $gitRepoUrl }} --branch v{{ $version }} /src
46+
cd /src
47+
48+
./autogen.sh
49+
50+
./configure --prefix=/usr --libdir=/usr/lib64 --enable-static=no
51+
52+
make -j$(nproc)
53+
54+
make DESTDIR=$OUTDIR install
55+
56+
strip $OUTDIR/usr/bin/*
57+
58+
tree $OUTDIR
59+
60+
# We don't need man, test and samples files
61+
rm -rf $OUTDIR/usr/include
62+
rm -rf $OUTDIR/usr/share
63+
rm -rf $OUTDIR/usr/lib64/pkgconfig
64+
rm -rf $OUTDIR/usr/bin/numademo
65+
66+
tree $OUTDIR

images/virt-launcher/werf.inc.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ libs:
7070
- libdaxctl-devel
7171
- libfuse3-devel
7272
- rdma-core-devel
73-
- libnuma-devel
7473
- bzlib-devel
7574
- liblzo2-devel
7675
- libsnappy-devel
@@ -126,7 +125,6 @@ packages:
126125
- iptables
127126
- libffi8
128127
- nftables
129-
- numactl
130128
- openssl
131129
- passt
132130
- pcre
@@ -152,7 +150,7 @@ binaries:
152150
# Dmidecode
153151
- /usr/sbin/biosdecode /usr/sbin/dmidecode
154152
# Numactl
155-
- /usr/bin/memhog /usr/bin/migratepages /usr/bin/migspeed /usr/bin/numactl /usr/bin/numademo /usr/bin/numastat
153+
- /usr/bin/memhog /usr/bin/migratepages /usr/bin/migspeed /usr/bin/numactl /usr/bin/numastat
156154
# Hwclock
157155
- /usr/sbin/hwclock
158156
{{- end -}}
@@ -247,6 +245,10 @@ import:
247245
before: setup
248246
includePaths:
249247
- temp_pod
248+
- image: packages/binaries/numactl
249+
add: /numactl
250+
to: /
251+
before: install
250252
shell:
251253
beforeInstall:
252254
- |
@@ -268,15 +270,15 @@ shell:
268270
echo "find and copy additional libs"
269271
FILES=$(find /VBINS/usr/bin/ -type f)
270272
FILES+=" $(find /VBINS/usr/sbin/ -type f)"
271-
273+
272274
LIBS="/usr/lib64/libbsd.so* /usr/lib64/libnbd.so* /usr/lib64/libfuse3.so*"
273275
LIBS+=" /usr/lib64/libjson-c.so* /usr/lib64/libssh.so* /usr/lib64/libssh2.so*"
274276
LIBS+=" /usr/lib64/libtpms.so*"
275277
LIBS+=" /usr/lib64/libxml2.so* /usr/lib64/libgcc_s*"
276278
277279
echo "Relocate additional libs for files in /VBINS"
278280
./relocate_binaries.sh -i "$FILES" -o /VBINS
279-
281+
280282
echo "Relocate additional libs to /VBINS"
281283
./relocate_binaries.sh -i "$LIBS" -o /VBINS
282284
@@ -358,7 +360,7 @@ shell:
358360
359361
echo "List files in /relocate/usr/local/lib64"
360362
ls -la usr/local/lib64
361-
363+
362364
- |
363365
cd /relocate
364366
@@ -431,8 +433,8 @@ shell:
431433
apt-get update && apt-get install --yes gcc musl-dev musl-tools
432434
apt-get clean
433435
install:
434-
- |
436+
- |
435437
echo "Building simple app that prints I'am temp pod"
436438
mkdir -p /bins
437439
musl-gcc -static -Os -o /bins/temp_pod temp_pod.c
438-
strip /bins/temp_pod
440+
strip /bins/temp_pod

0 commit comments

Comments
 (0)