Fix kernel build version

Signed-off-by: Itxaka <itxaka@kairos.io>
This commit is contained in:
Itxaka
2023-12-04 10:26:04 +01:00
parent 0f9e981e12
commit 99ca4b2461
3 changed files with 16 additions and 16 deletions

View File

@@ -60,7 +60,7 @@ jobs:
uses: mikefarah/yq@v4.40.4 uses: mikefarah/yq@v4.40.4
id: kernel_version id: kernel_version
with: with:
cmd: yq -r '.version' packages/kernels/upstream/definition.yaml cmd: yq -r '.labels| with_entries(select(.key == "package.version"))|.[]' packages/kernels/upstream/definition.yaml
# this builds the kernel cross-compiled for arm64 so its faster # this builds the kernel cross-compiled for arm64 so its faster
# notice that wee are not using builx nor platform so it runs under amd64 # notice that wee are not using builx nor platform so it runs under amd64
# This is much faster than building the kernel on arm64 via buildx and --platform # This is much faster than building the kernel on arm64 via buildx and --platform

View File

@@ -26,7 +26,7 @@ jobs:
uses: mikefarah/yq@v4.40.4 uses: mikefarah/yq@v4.40.4
id: kernel_version id: kernel_version
with: with:
cmd: yq -r '.version' packages/kernels/upstream/definition.yaml cmd: yq -r '.labels| with_entries(select(.key == "package.version"))|.[]' packages/kernels/upstream/definition.yaml
# this builds the kernel cross-compiled for arm64 so its faster # this builds the kernel cross-compiled for arm64 so its faster
# notice that wee are not using builx nor platform so it runs under amd64 # notice that wee are not using builx nor platform so it runs under amd64
# This is much faster than building the kernel on arm64 via buildx and --platform # This is much faster than building the kernel on arm64 via buildx and --platform

View File

@@ -2,9 +2,9 @@ image: "fedora:latest"
package_dir: "/package" package_dir: "/package"
prelude: prelude:
- dnf update -y && dnf install -y gcc make bison flex openssl openssl-devel elfutils-libelf-devel bc kmod xxd wget xz dwarves python3 cpio perl gettext diffutils bash coreutils tar which bzip2 findutils m4 perl-interpreter perl-Carp perl-devel perl-generators make diffutils gawk binutils redhat-rpm-config hmaccalc gcc-c++ python3-devel zstd gcc-c++-aarch64-linux-gnu binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu - dnf update -y && dnf install -y gcc make bison flex openssl openssl-devel elfutils-libelf-devel bc kmod xxd wget xz dwarves python3 cpio perl gettext diffutils bash coreutils tar which bzip2 findutils m4 perl-interpreter perl-Carp perl-devel perl-generators make diffutils gawk binutils redhat-rpm-config hmaccalc gcc-c++ python3-devel zstd gcc-c++-aarch64-linux-gnu binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu
- wget https://cdn.kernel.org/pub/linux/kernel/v${PACKAGE_VERSION%%.*}.x/linux-${PACKAGE_VERSION}.tar.xz - wget https://cdn.kernel.org/pub/linux/kernel/v${PACKAGE_VERSION%%.*}.x/linux-${PACKAGE_VERSION%\-*}.tar.xz
- ls -lh - ls -lh
- tar xf linux-${PACKAGE_VERSION}.tar.xz - tar xf linux-${PACKAGE_VERSION%\-*}.tar.xz
env: env:
{{ if .Values.arch }} {{ if .Values.arch }}
{{ if eq .Values.arch "arm64" }} {{ if eq .Values.arch "arm64" }}
@@ -16,32 +16,32 @@ env:
{{end}} {{end}}
steps: steps:
- mkdir -p /package/boot - mkdir -p /package/boot
- mkdir -p /package/lib/modules/${PACKAGE_VERSION}/ - mkdir -p /package/lib/modules/${PACKAGE_VERSION%\-*}/
{{ if .Values.arch }} {{ if .Values.arch }}
{{ if eq .Values.arch "arm64" }} {{ if eq .Values.arch "arm64" }}
- cp configs/arm64.config linux-${PACKAGE_VERSION}/.config - cp configs/arm64.config linux-${PACKAGE_VERSION%\-*}/.config
{{ else }} {{ else }}
- cp configs/x86.config linux-${PACKAGE_VERSION}/.config - cp configs/x86.config linux-${PACKAGE_VERSION%\-*}/.config
{{ end }} {{ end }}
{{ end }} {{ end }}
- cd linux-${PACKAGE_VERSION} && make olddefconfig - cd linux-${PACKAGE_VERSION%\-*} && make olddefconfig
{{ if .Values.arch }} {{ if .Values.arch }}
{{ if eq .Values.arch "arm64" }} {{ if eq .Values.arch "arm64" }}
- diff configs/arm64.config linux-${PACKAGE_VERSION}/.config || true - diff configs/arm64.config linux-${PACKAGE_VERSION%\-*}/.config || true
{{ else }} {{ else }}
- diff configs/x86.config linux-${PACKAGE_VERSION}/.config || true - diff configs/x86.config linux-${PACKAGE_VERSION%\-*}/.config || true
{{ end }} {{ end }}
{{ end }} {{ end }}
- cd linux-${PACKAGE_VERSION} && make kernelversion - cd linux-${PACKAGE_VERSION%\-*} && make kernelversion
{{ if .Values.arch }} {{ if .Values.arch }}
{{ if eq .Values.arch "arm64" }} {{ if eq .Values.arch "arm64" }}
- cd linux-${PACKAGE_VERSION} && make -j$(nproc) Image - cd linux-${PACKAGE_VERSION%\-*} && make -j$(nproc) Image
{{ else }} {{ else }}
- cd linux-${PACKAGE_VERSION} && make -j$(nproc) bzImage - cd linux-${PACKAGE_VERSION%\-*} && make -j$(nproc) bzImage
{{ end }} {{ end }}
{{ end }} {{ end }}
- cd linux-${PACKAGE_VERSION} && make -j$(nproc) modules - cd linux-${PACKAGE_VERSION%\-*} && make -j$(nproc) modules
- cd linux-${PACKAGE_VERSION} && make install - cd linux-${PACKAGE_VERSION%\-*} && make install
- cd linux-${PACKAGE_VERSION} && ZSTD_CLEVEL=19 make INSTALL_MOD_PATH="/package/" INSTALL_MOD_STRIP=1 modules_install - cd linux-${PACKAGE_VERSION%\-*} && ZSTD_CLEVEL=19 make INSTALL_MOD_PATH="/package/" INSTALL_MOD_STRIP=1 modules_install
- cp /boot/* /package/boot - cp /boot/* /package/boot