Skip to content

Commit c7eb377

Browse files
jfroyfrezbo
authored andcommitted
feat: glibc extension
The extension is mostly copied from the package that is in the nvidia toolkit extensions, but with a few notable changes. - A symbolic link to `ldconfig` is installed at `/sbin/ldconfig`. This allows the nvidia gpu-operator to work without modification. A patch to the extension validation logic is required to allow the new path. - The `/usr/local/glibc` subtree is now structured as a [merged `/usr` root](https://systemd.io/THE_CASE_FOR_THE_USR_MERGE/). This improves compatbility with ld-linux.so.2 for library discovery. Signed-off-by: Jean-Francois Roy <[email protected]> Signed-off-by: Noel Georgi <[email protected]>
1 parent 4a66da5 commit c7eb377

File tree

12 files changed

+47
-12
lines changed

12 files changed

+47
-12
lines changed

.kres.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ spec:
1414
- ecr-credential-provider
1515
- fuse3
1616
- gasket-driver
17+
- glibc
1718
- gvisor
1819
- gvisor-debug
1920
- hello-world-service

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ TARGETS += drbd
6565
TARGETS += ecr-credential-provider
6666
TARGETS += fuse3
6767
TARGETS += gasket-driver
68+
TARGETS += glibc
6869
TARGETS += gvisor
6970
TARGETS += gvisor-debug
7071
TARGETS += hello-world-service

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@ cosign verify --certificate-identity-regexp '@siderolabs\.com$' --certificate-oi
7979

8080
### Miscellaneous
8181

82-
| Name | Image | Description | Version Format |
83-
| ------------------------------- | ----------------------------------------------------------------------------------------------------- | --------------------------- | --------------- |
84-
| [binfmt-misc](misc/binfmt-misc) | [ghcr.io/siderolabs/binfmt-misc](https://github.com/siderolabs/extensions/pkgs/container/binfmt-misc) | Miscellaneous Binary Format | `talos version` |
82+
| Name | Image | Description | Version Format |
83+
| ------------------------------- | ----------------------------------------------------------------------------------------------------- | --------------------------- | ------------------ |
84+
| [binfmt-misc](misc/binfmt-misc) | [ghcr.io/siderolabs/binfmt-misc](https://github.com/siderolabs/extensions/pkgs/container/binfmt-misc) | Miscellaneous Binary Format | `talos version` |
85+
| [glibc](misc/glibc) | [ghcr.io/siderolabs/glibc](https://github.com/siderolabs/extensions/pkgs/container/glibc) | glibc | `upstream version` |
8586

8687
### Network
8788

internal/base/pkg.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ shell: /toolchain/bin/bash
44
dependencies:
55
- image: "{{ .BUILD_ARG_PKGS_PREFIX }}/base:{{ .BUILD_ARG_PKGS }}"
66
- image: "{{ .BUILD_ARG_PKGS_PREFIX }}/ca-certificates:{{ .BUILD_ARG_PKGS }}"
7-
- image: ghcr.io/siderolabs/extensions-validator:4313acf
7+
- image: ghcr.io/siderolabs/extensions-validator:aa3b467
88
finalize:
99
- from: /
1010
to: /

misc/glibc/ld.so.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/usr/local/glibc/usr/lib

misc/glibc/manifest.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: v1alpha1
2+
metadata:
3+
name: glibc
4+
version: "$VERSION"
5+
author: Jean-Francois Roy
6+
description: |
7+
This system extension provides glibc.
8+
compatibility:
9+
talos:
10+
version: ">= v1.9.0"

nvidia-gpu/nvidia-container-toolkit/glibc/pkg.yaml renamed to misc/glibc/pkg.yaml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ dependencies:
1111
- image: cgr.dev/chainguard/wolfi-base@{{ .WOLFI_BASE_REF }}
1212
steps:
1313
- sources:
14-
- url: https://src.fedoraproject.org/lookaside/pkgs/glibc/glibc-{{ .GLIBC_VERSION }}-9-g132a72f93c.tar.xz/sha512/f88ffb4ab47104640c88504ca2619cdca0795565173daf98a37d624333e14ab96699f662597fe51ba94a274c4cc7001bd2c8cc29fd5df012733298049e533bf4/glibc-{{ .GLIBC_VERSION }}-9-g132a72f93c.tar.xz
14+
- url: https://src.fedoraproject.org/lookaside/pkgs/glibc/glibc-{{ .GLIBC_VERSION }}-9-g132a72f93c.tar.xz/sha512/f88ffb4ab47104640c88504ca2619cdca0795565173daf98a37d624333e14ab96699f662597fe51ba94a274c4cc7001bd2c8cc29fd5df012733298049e533bf4/glibc-{{ .VERSION }}-9-g132a72f93c.tar.xz
1515
destination: glibc.tar.xz
1616
sha256: 49cd4eed693ffa9010d81e1c75ab33a278a7cbb404a01564b2e287e04ec3d4d3
1717
sha512: f88ffb4ab47104640c88504ca2619cdca0795565173daf98a37d624333e14ab96699f662597fe51ba94a274c4cc7001bd2c8cc29fd5df012733298049e533bf4
1818
prepare:
19+
- |
20+
sed -i 's#$VERSION#{{ .VERSION }}#' /pkg/manifest.yaml
1921
- |
2022
tar -xf glibc.tar.xz --strip-components=1
2123
@@ -24,8 +26,8 @@ steps:
2426
2527
../configure \
2628
--prefix=/usr/local/glibc \
27-
--libdir=/usr/local/glibc/lib \
28-
--libexecdir=/usr/local/glibc/lib \
29+
--libdir=/usr/local/glibc/usr/lib \
30+
--libexecdir=/usr/local/glibc/usr/lib \
2931
--enable-stack-protection=strong \
3032
--disable-werror
3133
build:
@@ -34,13 +36,25 @@ steps:
3436
make -j $(nproc)
3537
install:
3638
- |
37-
mkdir -p /rootfs/lib64
39+
mkdir -p \
40+
/rootfs/usr/local/glibc/usr/bin \
41+
/rootfs/usr/local/glibc/usr/lib \
42+
/rootfs/usr/local/glibc/usr/lib32 \
43+
/rootfs/usr/local/glibc/usr/sbin
44+
ln -s usr/bin/ /rootfs/usr/local/glibc/bin
45+
ln -s usr/lib/ /rootfs/usr/local/glibc/lib
46+
ln -s usr/lib/ /rootfs/usr/local/glibc/lib64
47+
ln -s usr/sbin/ /rootfs/usr/local/glibc/sbin
48+
ln -s lib/ /rootfs/usr/local/glibc/usr/lib64
3849
3950
cd build
4051
make install DESTDIR=/rootfs
4152
4253
cp /pkg/ld.so.conf /rootfs/usr/local/glibc/etc/ld.so.conf
43-
ln -s /usr/local/glibc/lib/ld-linux-x86-64.so.2 /rootfs/lib64/ld-linux-x86-64.so.2
54+
55+
mkdir -p /rootfs/lib64 /rootfs/sbin
56+
ln -s /usr/local/glibc/usr/lib/ld-linux-x86-64.so.2 /rootfs/lib64/ld-linux-x86-64.so.2
57+
ln -s /usr/local/glibc/usr/sbin/ldconfig /rootfs/sbin/ldconfig
4458
4559
# cleanup
4660
rm -rf /rootfs/usr/local/glibc/include
@@ -49,3 +63,5 @@ steps:
4963
finalize:
5064
- from: /rootfs
5165
to: /rootfs
66+
- from: /pkg/manifest.yaml
67+
to: /

misc/glibc/vars.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# renovate: datasource=docker versioning=docker depName=cgr.dev/chainguard/wolfi-base
2+
WOLFI_BASE_REF: sha256:72c8bfed3266b2780243b144dc5151150015baf5a739edbbde53d154574f1607
3+
4+
VERSION: {{ .GLIBC_VERSION }}

misc/vars.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# renovate: datasource=git-tags extractVersion=^glibc-(?<version>.*)$ depName=https://sourceware.org/git/glibc.git
2+
GLIBC_VERSION: 2.40

nvidia-gpu/nvidia-container-toolkit/glibc/ld.so.conf

Lines changed: 0 additions & 1 deletion
This file was deleted.

nvidia-gpu/vars.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ LIBNVIDIA_CONTAINER_VERSION: v1.16.1
1111
LIBNVIDIA_CONTAINER_REF: 4c2494f16573b585788a42e9c7bee76ecd48c73d
1212
# renovate: datasource=docker versioning=docker depName=cgr.dev/chainguard/wolfi-base
1313
WOLFI_BASE_REF: sha256:72c8bfed3266b2780243b144dc5151150015baf5a739edbbde53d154574f1607
14-
# renovate: datasource=git-tags extractVersion=^glibc-(?<version>.*)$ depName=https://sourceware.org/git/glibc.git
15-
GLIBC_VERSION: 2.40
1614
# renovate: datasource=github-tags extractVersion=^v(?<version>.*)$ depName=seccomp/libseccomp
1715
LIBSECCOMP_VERSION: 2.5.5
1816
# renovate: datasource=git-tags extractVersion=^libcap-(?<version>.*)$ depName=git://git.kernel.org/pub/scm/libs/libcap/libcap.git

reproducibility/pkg.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ dependencies:
2323
- stage: fuse3
2424
# gasket-driver can be ignored from reproducibility test since it's kernel modules copied from pkgs
2525
# - stage: gasket-driver
26+
27+
- stage: glibc
2628
- stage: gvisor
2729
- stage: gvisor-debug
2830
- stage: hello-world-service

0 commit comments

Comments
 (0)