mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-22 19:16:32 +01:00
refactor(steps-guix): use improve-based linux64 handover to keep /init untouched
This commit is contained in:
parent
156cd660c5
commit
55be03a50d
2 changed files with 1 additions and 1 deletions
32
steps-guix/improve/linux64.sh
Normal file
32
steps-guix/improve/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 init=/init rw rootwait"
|
||||
else
|
||||
kexec -l "${current_kernel}" --console-serial \
|
||||
--append="console=ttyS0 root=/dev/sda1 init=/init rw rootwait"
|
||||
fi
|
||||
kexec -e
|
||||
Loading…
Add table
Add a link
Reference in a new issue