feat: mkimg now learned compressed kernel support
This commit is contained in:
parent
841f0b8b38
commit
1e005718e9
2 changed files with 55 additions and 6 deletions
25
0002-riscv-fix-compressed-kernel-boot.patch
Normal file
25
0002-riscv-fix-compressed-kernel-boot.patch
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
From a24e04bd50c229d529c7d6efa5d0397abe68911d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Coelacanthus <coelacanthus@outlook.com>
|
||||||
|
Date: Mon, 23 May 2022 23:23:55 +0800
|
||||||
|
Subject: [PATCH] riscv: fix compressed kernel boot
|
||||||
|
|
||||||
|
---
|
||||||
|
include/configs/qemu-riscv.h | 2 ++
|
||||||
|
1 file changed, 2 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/include/configs/qemu-riscv.h b/include/configs/qemu-riscv.h
|
||||||
|
index 618c3b63d4..11a6cdb8a6 100644
|
||||||
|
--- a/include/configs/qemu-riscv.h
|
||||||
|
+++ b/include/configs/qemu-riscv.h
|
||||||
|
@@ -58,6 +58,8 @@
|
||||||
|
"scriptaddr=0x88100000\0" \
|
||||||
|
"pxefile_addr_r=0x88200000\0" \
|
||||||
|
"ramdisk_addr_r=0x88300000\0" \
|
||||||
|
+ "kernel_comp_addr_r=0x90000000\0" \
|
||||||
|
+ "kernel_comp_size=0x4000000\0" \
|
||||||
|
BOOTENV
|
||||||
|
#endif
|
||||||
|
|
||||||
|
--
|
||||||
|
2.36.1
|
||||||
|
|
34
mkimg.sh
Normal file → Executable file
34
mkimg.sh
Normal file → Executable file
|
@ -6,6 +6,26 @@
|
||||||
. /usr/share/makepkg/util.sh
|
. /usr/share/makepkg/util.sh
|
||||||
colorize
|
colorize
|
||||||
|
|
||||||
|
toggle-systemd-firstboot() {
|
||||||
|
msg2 "Toggle systemd-firstboot..."
|
||||||
|
sudo rm ./qcow2/etc/{machine-id,localtime,hostname,shadow,locale.conf}
|
||||||
|
sudo arch-chroot qcow2 mkdir -p /etc/systemd/system/systemd-firstboot.service.d
|
||||||
|
sudo arch-chroot qcow2 cat << EOF | tee /etc/systemd/system/systemd-firstboot.service.d/install.conf
|
||||||
|
[Service]
|
||||||
|
ExecStart=
|
||||||
|
ExecStart=/usr/bin/systemd-firstboot --prompt
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=sysinit.target
|
||||||
|
EOF
|
||||||
|
sudo arch-chroot qcow2 systemctl enable systemd-firstboot.service
|
||||||
|
}
|
||||||
|
|
||||||
|
use-fixed-password() {
|
||||||
|
msg2 "Using fixed password..."
|
||||||
|
: # set in rootfs
|
||||||
|
}
|
||||||
|
|
||||||
msg "Building dracut-hook package..."
|
msg "Building dracut-hook package..."
|
||||||
|
|
||||||
git clone https://aur.archlinux.org/dracut-hook.git
|
git clone https://aur.archlinux.org/dracut-hook.git
|
||||||
|
@ -20,6 +40,8 @@ pushd u-boot
|
||||||
git checkout v2022.04
|
git checkout v2022.04
|
||||||
msg2 "Apply binutils 2.38 compitible patch"
|
msg2 "Apply binutils 2.38 compitible patch"
|
||||||
git apply ../0001-riscv-fix-compitible-with-binutils-2.38.patch
|
git apply ../0001-riscv-fix-compitible-with-binutils-2.38.patch
|
||||||
|
msg2 "Apply compressed kernel patch"
|
||||||
|
git apply ../0002-riscv-fix-compressed-kernel-boot.patch
|
||||||
make \
|
make \
|
||||||
CROSS_COMPILE=riscv64-linux-gnu- \
|
CROSS_COMPILE=riscv64-linux-gnu- \
|
||||||
qemu-riscv64_smode_defconfig
|
qemu-riscv64_smode_defconfig
|
||||||
|
@ -76,9 +98,9 @@ sudo pacman \
|
||||||
--noconfirm \
|
--noconfirm \
|
||||||
-S linux linux-firmware dracut
|
-S linux linux-firmware dracut
|
||||||
|
|
||||||
arch-chroot
|
sudo arch-chroot qcow2 dracut --force --add "qemu qemu-net" --regenerate-all
|
||||||
mkdir -p boot/extlinux
|
sudo arch-chroot qcow2 mkdir -p boot/extlinux
|
||||||
cat << EOF | tee boot/extlinux/extlinux.conf
|
sudo arch-chroot qcow2 cat << EOF | tee boot/extlinux/extlinux.conf
|
||||||
menu title Arch RISC-V QEMU Boot
|
menu title Arch RISC-V QEMU Boot
|
||||||
timeout 100
|
timeout 100
|
||||||
default linux
|
default linux
|
||||||
|
@ -96,8 +118,10 @@ yes y | sudo pacman \
|
||||||
--sysroot ./rootfs \
|
--sysroot ./rootfs \
|
||||||
--sync --clean --clean
|
--sync --clean --clean
|
||||||
|
|
||||||
msg2 "Remove initialized files to toggle systemd-firstboot..."
|
# Using fixed password for systemd-firstboot don't ask password for unknown reason
|
||||||
rm ./rootfs/etc/{machine-id,localtime,hostname,shadow,locale.conf}
|
# https://github.com/CoelacanthusHex/archriscv-scriptlet/issues/1
|
||||||
|
#toggle-systemd-firstboot
|
||||||
|
use-fixed-password
|
||||||
|
|
||||||
msg2 "Unmount..."
|
msg2 "Unmount..."
|
||||||
sudo umount qcow2
|
sudo umount qcow2
|
||||||
|
|
Loading…
Add table
Reference in a new issue