tinkerbell / hook

In-memory Operating System Installation Environment for Executing Tinkerbell Workflows
Apache License 2.0
102 stars 49 forks source link

add lvm2 package into kernel Dockerfile, lead to failure of kernel build #151

Closed sheepcat closed 2 weeks ago

sheepcat commented 1 year ago

Hi guys I want to add lvm2 into my hook's kernel kernel's Dockerfile look like:

FROM linuxkit/alpine:e2391e0b164c57db9f6c4ae110ee84f766edc430 AS kernel-build RUN apk add \ argp-standalone \ automake \ bash \ bc \ binutils-dev \ bison \ build-base \ curl \ diffutils \ flex \ git \ gmp-dev \ gnupg \ installkernel \ kmod \ elfutils-dev \ linux-headers \ mpc1-dev \ mpfr-dev \ ncurses-dev \ openssl-dev \ patch \ rsync \ sed \ squashfs-tools \ tar \ xz \ xz-dev \ zlib-dev \ lvm2 # add lvm2


Expected Behaviour

kernel build success

Current Behaviour

docker buildx build --platform linux/amd64 --build-arg KERNEL_VERSION=5.10.85 --build-arg KERNEL_SERIES=5.10.x --build-arg EXTRA= --build-arg DEBUG= --label org.opencontainers.image.source=https://github.com/linuxkit/linuxkit --label org.opencontainers.image.revision=fd8ca1864dacef7ac819016dbbb2ad52433d0c0d --no-cache -t xxxxxxx . [+] Building 5.1s (6/24) => [internal] load build definition from Dockerfile 0.2s => => transferring dockerfile: 32B 0.0s => [internal] load .dockerignore 0.3s => => transferring context: 2B 0.0s => [internal] load metadata for docker.io/linuxkit/alpine:e2391e0b164c57db9f6c4ae110ee84f766edc430 2.5s => CACHED [kernel-build 1/19] FROM docker.io/linuxkit/alpine:e2391e0b164c57db9f6c4ae110ee84f766edc430@sha256:bca9e72a17c1c74cf7b28a397c643048fd055fa096a3edfe1d16365a5307b9d9 0.0s => [internal] load build context 0.7s => => transferring context: 8.63kB 0.0s => ERROR [kernel-build 2/19] RUN apk add argp-standalone automake bash bc binutils-dev bison build-base curl diffutils flex git gmp-de 2.1s

[kernel-build 2/19] RUN apk add argp-standalone automake bash bc binutils-dev bison build-base curl diffutils flex git gmp-dev gnupg installkernel kmod elfutils-dev linux-headers mpc1-dev mpfr-dev ncurses-dev openssl-dev patch rsync sed squashfs-tools tar xz xz-dev zlib-dev lvm2 util-linux udev ntfs-3g:

5 1.367 lvm2 (missing):

5 1.367 ERROR: unsatisfiable constraints:

5 1.369 required by: world[lvm2]

5 1.369 ntfs-3g (missing):

5 1.369 required by: world[ntfs-3g]


failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c apk add argp-standalone automake bash bc binutils-dev bison build-base curl diffutils flex git gmp-dev gnupg installkernel kmod elfutils-dev linux-headers mpc1-dev mpfr-dev ncurses-dev openssl-dev patch rsync sed squashfs-tools tar xz xz-dev zlib-dev lvm2 util-linux udev ntfs-3g]: exit code: 2

is this the way i used to add pkg is wrong?

with great appreciated

jacobweinstock commented 2 weeks ago

Hey @sheepcat. Apologies, i dont understand what youre wanting to do here. Packages don't end up in the Linux kernel. If you're interested in using lvm in an Action, then I recommend the Action have the lvm package installed and then running any lvm commands you need. In my testing running vgscan; vgchange -ay from an Action will make sure the lvm partitions show up. Then you can interact with the volumes as needed. Hope that helps. Thanks.