mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-23 03:26:31 +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
|
||||
Loading…
Add table
Add a link
Reference in a new issue