mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-22 19:16:32 +01:00
feat(steps-guix): build linux64 kernel and switch via jump with backup
This commit is contained in:
parent
8703b089ef
commit
6b10401b65
4 changed files with 73 additions and 0 deletions
32
steps-guix/jump/linux64.sh
Normal file
32
steps-guix/jump/linux64.sh
Normal file
|
|
@ -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
|
||||||
38
steps-guix/linux-6.12.74/pass1.sh
Normal file
38
steps-guix/linux-6.12.74/pass1.sh
Normal file
|
|
@ -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"
|
||||||
|
}
|
||||||
1
steps-guix/linux-6.12.74/sources
Normal file
1
steps-guix/linux-6.12.74/sources
Normal file
|
|
@ -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
|
||||||
|
|
@ -9,3 +9,5 @@ build: argp-standalone-1.4.1
|
||||||
build: musl-fts-1.2.7
|
build: musl-fts-1.2.7
|
||||||
build: musl-obstack-1.2.3
|
build: musl-obstack-1.2.3
|
||||||
build: elfutils-0.194
|
build: elfutils-0.194
|
||||||
|
build: linux-6.12.74
|
||||||
|
jump: linux64
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue