diff --git a/steps-guix/jump/linux64.sh b/steps-guix/jump/linux64.sh new file mode 100644 index 00000000..864ba2b0 --- /dev/null +++ b/steps-guix/jump/linux64.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# +# SPDX-FileCopyrightText: 2026 Luo Yanpan +# +# SPDX-License-Identifier: GPL-3.0-or-later + +set -e + +new_kernel="/boot/vmlinuz-linux64" +current_kernel="/boot/vmlinuz" +backup_kernel="/boot/vmlinuz-32bit.backup" + +if [ ! -f "${new_kernel}" ]; then + echo "Missing new kernel image: ${new_kernel}" >&2 + exit 1 +fi + +if [ -f "${current_kernel}" ]; then + cp -af "${current_kernel}" "${backup_kernel}" +fi +cp -af "${new_kernel}" "${current_kernel}" +sync + +mkdir -p /etc +if [ "${BARE_METAL}" = True ]; then + kexec -l "${current_kernel}" \ + --append="root=/dev/sda1 rootfstype=ext3 init=/init rw rootwait" +else + kexec -l "${current_kernel}" --console-serial \ + --append="console=ttyS0 root=/dev/sda1 rootfstype=ext3 init=/init rw rootwait" +fi +kexec -e diff --git a/steps-guix/linux-6.12.74/pass1.sh b/steps-guix/linux-6.12.74/pass1.sh new file mode 100644 index 00000000..d9aa9388 --- /dev/null +++ b/steps-guix/linux-6.12.74/pass1.sh @@ -0,0 +1,38 @@ +# SPDX-FileCopyrightText: 2026 Luo Yanpan +# +# SPDX-License-Identifier: GPL-3.0-or-later + +: "${KERNEL_SYSROOT:=/kernel-toolchain}" +: "${KERNEL_TARGET:=x86_64-unknown-linux-musl}" + +kernel_env() { + export PATH="${KERNEL_SYSROOT}/bin:${PATH}" + export HOSTCFLAGS="-I${KERNEL_SYSROOT}/include" + export HOSTLDFLAGS="-L${KERNEL_SYSROOT}/lib" + export LD_LIBRARY_PATH="${KERNEL_SYSROOT}/lib:${LD_LIBRARY_PATH}" +} + +kernel_make() { + kernel_env + make "${MAKEJOBS}" \ + ARCH=x86_64 \ + CROSS_COMPILE="${KERNEL_SYSROOT}/bin/${KERNEL_TARGET}-" \ + "$@" +} + +src_prepare() { + default +} + +src_configure() { + kernel_make defconfig +} + +src_compile() { + kernel_make +} + +src_install() { + install -D -m 644 arch/x86/boot/bzImage \ + "${DESTDIR}/boot/vmlinuz-linux64" +} diff --git a/steps-guix/linux-6.12.74/sources b/steps-guix/linux-6.12.74/sources new file mode 100644 index 00000000..04c348cf --- /dev/null +++ b/steps-guix/linux-6.12.74/sources @@ -0,0 +1 @@ +f https://linux-libre.fsfla.org/pub/linux-libre/releases/6.12.74-gnu/linux-libre-6.12.74-gnu.tar.xz d0071b065a7a5ba5ea9f638828beb113774f9f043182cbf2c6b205d403f074f5 diff --git a/steps-guix/manifest b/steps-guix/manifest index 7a5000f6..36234fc7 100644 --- a/steps-guix/manifest +++ b/steps-guix/manifest @@ -9,3 +9,5 @@ build: argp-standalone-1.4.1 build: musl-fts-1.2.7 build: musl-obstack-1.2.3 build: elfutils-0.194 +build: linux-6.12.74 +jump: linux64