diff --git a/component_versions/version_map.yml b/component_versions/version_map.yml index ccea56a382..b14a7f5e55 100644 --- a/component_versions/version_map.yml +++ b/component_versions/version_map.yml @@ -7,3 +7,4 @@ package: xorriso: 1.5.6 numactl: 2.0.19 openssl: openssl-3.4.1 + nbdkit: 1.39.5 diff --git a/images/cdi-importer/werf.inc.yaml b/images/cdi-importer/werf.inc.yaml index dc47d29431..faa0dc2c19 100644 --- a/images/cdi-importer/werf.inc.yaml +++ b/images/cdi-importer/werf.inc.yaml @@ -18,15 +18,15 @@ libraries: - libsqlite3 packages: - libnbd - - nbd-client - - nbd-server binaries: - # All nbd binaries - - /usr/bin/nbd* + # nbd bins and libs + - /usr/sbin/nbdkit + - /usr/lib/nbdkit/filters/* + - /usr/lib/nbdkit/plugins/* # Mount - /usr/bin/mount /usr/bin/umount # Sqlite libs - - /usr/lib64/libsqlite3.so.0 + - /usr/lib64/libsqlite3.so.0 # Block device binaries - /usr/sbin/blockdev # CDI binaries @@ -52,6 +52,10 @@ import: add: /qemu-img to: /relocate before: setup +- image: packages/binaries/nbdkit + add: /nbdkit + to: /nbdkit + before: setup shell: install: - | @@ -62,4 +66,5 @@ shell: - rm --recursive --force /var/lib/apt/lists/ftp.altlinux.org* /var/cache/apt/*.bin setup: - | + cp -a /nbdkit/. / /relocate_binaries.sh -i "{{ $cdiImporterDependencies.binaries | join " " }}" -o /relocate diff --git a/images/packages/binaries/nbdkit/werf.inc.yaml b/images/packages/binaries/nbdkit/werf.inc.yaml new file mode 100644 index 0000000000..da8cb2fbe4 --- /dev/null +++ b/images/packages/binaries/nbdkit/werf.inc.yaml @@ -0,0 +1,83 @@ +--- +image: {{ $.ImageType }}/{{ $.ImageName }} +final: false +fromImage: builder/scratch +import: +- image: {{ $.ImageType }}/{{ $.ImageName }}-builder + add: /out + to: /nbdkit + before: setup + +--- +{{- $version := get $.Package $.ImageName }} +{{- $gitRepoUrl := "nbdkit/nbdkit.git" }} + +{{- $name := print $.ImageName "-dependencies" -}} +{{- define "$name" -}} +packages: +- git gcc +- automake autoconf-archive make libtool +# - MAKEDEV +- bash-completion +- curl +- qemu +- libisoburn +- e2fsprogs +- expect +- libgnutls30 +- filesystem +- socat +- jq +- iproute2 +- xz +- zlib-ng +- zstd +- zlib +- libblkio +- libnbd +- libtorrent-rasterbar-devel +- libssh +{{- end -}} + +{{ $builderDependencies := include "$name" . | fromYaml }} + +image: {{ $.ImageType }}/{{ $.ImageName }}-builder +final: false +fromImage: builder/alt +secrets: +- id: SOURCE_REPO + value: {{ $.SOURCE_REPO_GIT }} +shell: + beforeInstall: + - | + # /etc/init.d/udevd umount + apt-get update && apt-get install -y \ + {{ $builderDependencies.packages | join " " }} + # /etc/init.d/udevd restart + + apt-get update + apt-get clean + rm --recursive --force /var/lib/apt/lists/ftp.altlinux.org* /var/cache/apt/*.bin + + install: + - | + OUTDIR=/out + mkdir -p ~/.ssh && echo "StrictHostKeyChecking accept-new" > ~/.ssh/config + + git clone --depth=1 $(cat /run/secrets/SOURCE_REPO)/{{ $gitRepoUrl }} --branch v{{ $version }} /src + cd /src + + autoreconf -i + + ./configure \ + --disable-static \ + --prefix=/usr \ + --without-bash-completions + + make -j$(nproc) + + make DESTDIR=$OUTDIR install-strip + + # We don't need man, test and samples files + rm -rf $OUTDIR/usr/include + rm -rf $OUTDIR/usr/share