Skip to content

Commit 85f8901

Browse files
committed
feat: make pkgs build bootstrapped
Build pkgs using only [Stageˣ]-derived tools image, without relying on Alpine Fixes: siderolabs/toolchain#129 Fixes: #1151 - feat: update bldr - fix: remove /toolchain prefix - feat: build what is possible using network: none - feat: usrmerge and unified /usr/lib - chore: use StageX bash instead of Alpine bash - fix: make iptables build - chore: move kernel modules under /usr/lib/modules - refactor: remove git requirement - test: check nvidia nonfree drivers' signatures Signed-off-by: Dmitry Sharshakov <dmitry.sharshakov@siderolabs.com>
1 parent 5763e3e commit 85f8901

56 files changed

Lines changed: 276 additions & 284 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.kres.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ spec:
8484
for platform in $(shell echo $(PLATFORM) | tr "," " "); do \
8585
arch=`basename $$platform` ; \
8686
$(MAKE) docker-kernel-prepare PLATFORM=$$platform BUILDKIT_MULTI_PLATFORM=0 TARGET_ARGS="--tag=$(REGISTRY)/$(USERNAME)/kernel:$(TAG)-$$arch --load"; \
87-
docker run --rm -it --entrypoint=/toolchain/bin/bash -e PATH=/toolchain/bin:/bin -w /src -v $$PWD/kernel/build/config-$$arch:/host/.hostconfig $(REGISTRY)/$(USERNAME)/kernel:$(TAG)-$$arch -c 'cp /host/.hostconfig .config && make $* && cp .config /host/.hostconfig'; \
87+
docker run --rm -it --entrypoint=/bin/bash -w /src -v $$PWD/kernel/build/config-$$arch:/host/.hostconfig $(REGISTRY)/$(USERNAME)/kernel:$(TAG)-$$arch -c 'cp /host/.hostconfig .config && make $* && cp .config /host/.hostconfig'; \
8888
done
8989
---
9090
kind: common.Renovate

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2025-01-20T16:24:34Z by kres 3b3f992.
3+
# Generated on 2025-02-03T20:51:08Z by kres 987bf4d.
44

55
# common variables
66

@@ -25,7 +25,7 @@ SOURCE_DATE_EPOCH := $(shell git log $(INITIAL_COMMIT_SHA) --pretty=%ct)
2525

2626
# sync bldr image with pkgfile
2727

28-
BLDR_RELEASE := v0.3.2
28+
BLDR_RELEASE := v0.4.0-1-g76a2c8f
2929
BLDR_IMAGE := ghcr.io/siderolabs/bldr:$(BLDR_RELEASE)
3030
BLDR := docker run --rm --user $(shell id -u):$(shell id -g) --volume $(PWD):/src --entrypoint=/bldr $(BLDR_IMAGE) --root=/src
3131

@@ -189,7 +189,7 @@ kernel-%:
189189
for platform in $(shell echo $(PLATFORM) | tr "," " "); do \
190190
arch=`basename $$platform` ; \
191191
$(MAKE) docker-kernel-prepare PLATFORM=$$platform BUILDKIT_MULTI_PLATFORM=0 TARGET_ARGS="--tag=$(REGISTRY)/$(USERNAME)/kernel:$(TAG)-$$arch --load"; \
192-
docker run --rm -it --entrypoint=/toolchain/bin/bash -e PATH=/toolchain/bin:/bin -w /src -v $$PWD/kernel/build/config-$$arch:/host/.hostconfig $(REGISTRY)/$(USERNAME)/kernel:$(TAG)-$$arch -c 'cp /host/.hostconfig .config && make $* && cp .config /host/.hostconfig'; \
192+
docker run --rm -it --entrypoint=/bin/bash -w /src -v $$PWD/kernel/build/config-$$arch:/host/.hostconfig $(REGISTRY)/$(USERNAME)/kernel:$(TAG)-$$arch -c 'cp /host/.hostconfig .config && make $* && cp .config /host/.hostconfig'; \
193193
done
194194

195195
.PHONY: rekres

Pkgfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# syntax = ghcr.io/siderolabs/bldr:v0.3.2
1+
# syntax = ghcr.io/siderolabs/bldr:v0.4.0-1-g76a2c8f
22

33
format: v1alpha2
44

55
vars:
6-
TOOLS_IMAGE: ghcr.io/siderolabs/tools:v1.10.0-alpha.0-7-g7200845
6+
TOOLS_IMAGE: ghcr.io/siderolabs/tools:v1.10.0-alpha.0-10-g9db33dd
77

88
# renovate: datasource=github-releases depName=containernetworking/plugins
99
cni_version: v1.6.2
@@ -72,6 +72,11 @@ vars:
7272
ipxe_sha256: 6ba8c70598666c8393c424c774329303ed198c3dc6e294fac14ff3c34368b0e4
7373
ipxe_sha512: 576c8abd7ad8ff738f935d40bc93eb3a25aff1053f1853af1d75d33b40573b4cf6f96bc19e6084b78a5454ca0b708abfc06e69c8c5a2d0efd57e9b5ad182b92c
7474

75+
# renovate: datasource=git-refs versioning=git depName=https://github.com/a13xp0p0v/kernel-hardening-checker.git
76+
kspp_ref: 0c00f3fa766496d221ae3b79ce3f6730468f3641
77+
kspp_sha256: b3c25019d75355fff63f129e5df86090dc7b0d295565fff2eeb414f7f6e4c263
78+
kspp_sha512: 996f8baad6d58583b23fe7b8d2cabe73d65b85fcc81ef2aa1d42a4a106e5adf9891876579d6a7ca76cb67f6241b2f980310c19785ef94af40e2eda1f372a3933
79+
7580
# renovate: datasource=git-tags extractVersion=^v(?<version>.*)$ depName=git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
7681
linux_version: 6.12.11
7782
linux_sha256: 475172fdbd87a153f123a57952672e773bdb6daf5b58a417d1a5e419fcfeec49

apparmor/pkg.yaml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: apparmor
22
variant: scratch
3-
shell: /toolchain/bin/bash
3+
shell: /bin/bash
44
dependencies:
55
- stage: base
66
- stage: util-linux
@@ -16,17 +16,13 @@ steps:
1616
1717
patch -p1 < /pkg/patches/basename.patch
1818
19-
mkdir -p /usr/bin \
20-
&& ln -sf /toolchain/bin/env /usr/bin/env
21-
ln -s /toolchain/bin/echo /toolchain/bin/which
22-
ln -s /toolchain/include/linux /usr/include/linux
23-
2419
cd libraries/libapparmor
2520
./autogen.sh
2621
2722
./configure \
2823
--disable-dependency-tracking \
29-
--disable-man-pages
24+
--disable-man-pages \
25+
--prefix=/usr
3026
build:
3127
- |
3228
cd libraries/libapparmor
@@ -37,7 +33,7 @@ steps:
3733
install:
3834
- |
3935
cd parser
40-
DISTRO=unknown make install-arch DESTDIR=/rootfs
36+
DISTRO=unknown make install-arch DESTDIR=/rootfs SBINDIR=/rootfs/usr/sbin
4137
finalize:
4238
- from: /rootfs
4339
to: /

base/pkg.yaml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,9 @@
11
name: base
22
variant: scratch
3-
shell: /toolchain/bin/bash
3+
shell: /bin/bash
44
dependencies:
55
- image: "{{ .TOOLS_IMAGE }}"
66
- stage: musl
7-
steps:
8-
- prepare:
9-
- |
10-
cp -R /toolchain/lib/gcc /lib
11-
cp -R /toolchain/lib/libgcc* /lib
12-
cp -R /toolchain/lib/libstdc* /lib
13-
cp -R /toolchain/lib/libz* /lib
14-
15-
mkdir /bin
16-
find /toolchain/bin -type f -executable -printf "%f\n" | xargs -I {} ln -s /toolchain/bin/{} /bin/{}
17-
ln -sv /toolchain/bin/bash /bin/sh
18-
19-
adjust.sh
207
finalize:
218
- from: /
229
to: /

ca-certificates/pkg.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
name: ca-certificates
2+
variant: scratch
3+
shell: /bin/bash
4+
dependencies:
5+
- stage: base
26
steps:
37
- sources:
48
- url: https://curl.se/ca/cacert-2024-12-31.pem

cni/pkg.yaml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: cni
22
variant: scratch
3-
shell: /toolchain/bin/bash
3+
shell: /bin/bash
44
dependencies:
55
- stage: base
66
steps:
@@ -9,22 +9,17 @@ steps:
99
destination: cni-plugins.tar.gz
1010
sha256: "{{ .cni_sha256 }}"
1111
sha512: "{{ .cni_sha512 }}"
12-
env:
13-
GOPATH: /go
1412
prepare:
1513
- |
16-
mkdir -p ${GOPATH}/src/
17-
tar -xzf cni-plugins.tar.gz --strip-components=1 -C ${GOPATH}/src/
14+
tar -xzf cni-plugins.tar.gz --strip-components=1
1815
build:
1916
- |
20-
export PATH=${PATH}:${TOOLCHAIN}/go/bin
21-
cd ${GOPATH}/src/
22-
CGO_ENABLED=0 GOFLAGS="-ldflags=-s" /toolchain/bin/bash ./build_linux.sh
17+
CGO_ENABLED=0 GOFLAGS="-ldflags=-s" bash ./build_linux.sh
2318
install:
2419
- |
2520
mkdir -p /rootfs/opt/cni/bin
2621
27-
mv ${GOPATH}/src/bin/* /rootfs/opt/cni/bin
22+
mv bin/* /rootfs/opt/cni/bin
2823
finalize:
2924
- from: /rootfs
3025
to: /

containerd/pkg.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: containerd
22
variant: scratch
3-
shell: /toolchain/bin/bash
3+
shell: /bin/bash
44
dependencies:
55
- stage: base
66
- stage: libseccomp
@@ -13,8 +13,7 @@ steps:
1313
sha512: "{{ .containerd_sha512 }}"
1414
env:
1515
PKG_CONFIG_PATH: /usr/lib/pkgconfig
16-
CC: /toolchain/bin/gcc
17-
PATH: /toolchain/go/bin:/toolchain/bin:{{ .PATH }}
16+
CC: gcc
1817
BUILDTAGS: 'seccomp no_aufs no_btrfs no_devmapper no_dynamic_plugins no_systemd no_zfs'
1918
prepare:
2019
- |
@@ -26,10 +25,10 @@ steps:
2625
make VERSION={{ .containerd_version }} REVISION={{ .containerd_ref }}
2726
install:
2827
- |
29-
mkdir -p /rootfs/bin
30-
make install PREFIX=/ DESTDIR=/rootfs
28+
mkdir -p /rootfs/usr/bin
29+
make install PREFIX=/usr DESTDIR=/rootfs
3130
32-
rm /rootfs/bin/{containerd-stress,ctr}
31+
rm /rootfs/usr/bin/{containerd-stress,ctr}
3332
finalize:
3433
- from: /rootfs
3534
to: /

cryptsetup/pkg.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: cryptsetup
22
variant: scratch
3-
shell: /toolchain/bin/bash
3+
shell: /bin/bash
44
dependencies:
55
- stage: base
66
- stage: systemd-udevd # dependency for libdevmapper

deps.png

245 KB
Loading

0 commit comments

Comments
 (0)