Skip to content

Commit 053977a

Browse files
Nowa-Ammerlaanmgorny
authored andcommitted
{gentoo,vanilla}-kernel: build with signed modules
Disable enforcing of signatures by default. Leave this up to the kernel command line or secureboot status. This ensures gentoo-kernel-bin doesn't suddenly fail to load third-party modules unless signatures are explicitly enforced by the user. Also add a .gitignore to prevent committing local files. Signed-off-by: Andrew Ammerlaan <[email protected]> Closes: #2 Signed-off-by: Michał Górny <[email protected]>
1 parent 72016f8 commit 053977a

6 files changed

+12
-3
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
signing_key.pem
2+
localconfig.bash
3+
local.diff

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ARG BASE
33
FROM ${BASE}
44

55
CMD cp -a /var/cache/binpkgs /tmp/binpkg \
6-
&& FEATURES=test emerge -1vB ${PKG} \
6+
&& FEATURES=test MODULES_SIGN_KEY="/tmp/signing_key.pem" emerge -1vB ${PKG} \
77
&& emerge -1vk ${PKG} \
88
&& rsync -av --checksum /tmp/binpkg/. /var/cache/binpkgs/ \
99
&& { [[ -z ${POST_PKGS} ]] || emerge -1vt --keep-going=y --jobs ${POST_PKGS}; }

Dockerfile.deps

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ ARG LDFLAGS
1111

1212
COPY package.accept_keywords /etc/portage/package.accept_keywords/local
1313
COPY package.use /etc/portage/package.use/local
14+
COPY kernel-configd /etc/kernel/config.d/local.config
15+
COPY signing_key.pem /tmp/signing_key.pem
1416
RUN printf '\nCFLAGS="%s"\nCXXFLAGS="%s"\nLDFLAGS="%s"\nBINPKG_COMPRESS="xz"\nBINPKG_COMPRESS_FLAGS="-T1 -9"\nFEATURES="${FEATURES} -sandbox -usersandbox -cgroup binpkg-multi-instance -binpkg-docompress -binpkg-dostrip"\nACCEPT_LICENSE="*"\nPKGDIR="/tmp/binpkg"\nBINPKG_FORMAT="gpkg"\n' "${CFLAGS}" "${CFLAGS}" "${LDFLAGS}" >> /etc/portage/make.conf \
1517
&& { [[ -z ${DEPS} ]] || emerge -1vt --jobs ${DEPS}; } \
1618
&& emerge --info \

build.bash

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export_vars() {
3232
virtual/libelf
3333
sys-devel/bc
3434
app-emulation/qemu
35+
dev-libs/openssl
3536
dev-tcltk/expect
3637
sys-kernel/dracut
3738
net-misc/openssh

kernel-configd

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Leave this up to the user, can be enabled with
2+
## module.sig_enforce=1 or by enabling secureboot.
3+
# CONFIG_MODULE_SIG_FORCE is not set

package.use

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ app-emulation/qemu -aio -caps -filecaps -jpeg -ncurses -png -vhost-net -vnc -xat
1111
#dev-python/cryptography PYTHON_TARGETS: pypy3
1212

1313
# for kernel testing
14-
sys-kernel/gentoo-kernel test -strip
14+
sys-kernel/gentoo-kernel modules-sign test
1515
sys-kernel/gentoo-kernel-bin test
16-
sys-kernel/vanilla-kernel test -strip
16+
sys-kernel/vanilla-kernel modules-sign test
1717
sys-kernel/vanilla-kernel-bin test
1818
app-crypt/tpm-emulator modules
1919
dev-util/sysdig modules

0 commit comments

Comments
 (0)