parent
44b3449622
commit
690a1f40a0
2 changed files with 21 additions and 3 deletions
pkgs
|
@ -37,7 +37,7 @@ runCommand pname {
|
|||
SYSTEMD_REPART_MKFS_OPTIONS_EROFS = "--all-root -zlz4hc,12 -C1048576 -Efragments,dedupe,ztailpacking";
|
||||
};
|
||||
|
||||
kernelCmdLine = "systemd.journald.forward_to_console=1 console=ttyS0 patos.secureboot=${secureBoot}";
|
||||
kernelCmdLine = "systemd.journald.forward_to_console=1 cma=128MB console=tty0 console=ttyS9,115200 console=ttyS2,115200 patos.secureboot=${secureBoot}";
|
||||
}
|
||||
''
|
||||
set -ex -o pipefail
|
||||
|
@ -212,6 +212,7 @@ ${pkgs.patos.systemd}/usr/bin/ukify build \
|
|||
--linux ${pkgs.patos.kernel}/$kernelImage \
|
||||
--initrd ${pkgs.patos.initrd}/initrd.xz \
|
||||
$mcode \
|
||||
--devicetree ${pkgs.patos.kernel}/dtbs/rockchip/rk3588-turing-rk1.dtb \
|
||||
--os-release @rootfs/etc/os-release \
|
||||
--cmdline "$kernelCmdLine roothash=$roothash" \
|
||||
-o patos_$versionString.efi
|
||||
|
@ -219,6 +220,13 @@ ${pkgs.patos.systemd}/usr/bin/ukify build \
|
|||
# install ESP
|
||||
SYSTEMD_RELAX_ESP_CHECKS=1 ${pkgs.patos.systemd}/usr/bin/bootctl install --root ./rootfs --esp-path /boot
|
||||
|
||||
# chain load systemd boot
|
||||
cat << 'EOF' > rootfs/boot/boot.cmd
|
||||
load ''${devtype} ''${devnum}:''${distro_bootpart} ''${kernel_addr_r} EFI/BOOT/BOOTAA64.EFI
|
||||
bootefi ''${kernel_addr_r}
|
||||
EOF
|
||||
${pkgs.ubootTools}/bin/mkimage -A arm64 -T script -C none -d ./rootfs/boot/boot.cmd ./rootfs/boot/boot.scr
|
||||
|
||||
# setup factory reset
|
||||
mkdir -p rootfs/boot/EFI/tools
|
||||
cp ${pkgs.edk2-uefi-shell}/shell.efi rootfs/boot/EFI/tools/
|
||||
|
@ -241,6 +249,15 @@ echo "timeout 2" > rootfs/boot/loader/loader.conf
|
|||
cp patos_$versionString.efi rootfs/boot/EFI/Linux
|
||||
|
||||
# Final partitioning
|
||||
|
||||
cat <<EOF > final.repart.d/00-uboot-reserved.conf
|
||||
[Partition]
|
||||
Type=linux-generic
|
||||
Label=reserved
|
||||
SizeMinBytes=16M
|
||||
SizeMaxBytes=16M
|
||||
EOF
|
||||
|
||||
cat <<EOF > final.repart.d/10-esp.conf
|
||||
[Partition]
|
||||
Type=esp
|
||||
|
@ -278,6 +295,9 @@ ${pkgs.patos.systemd}/usr/bin/systemd-repart \
|
|||
--definitions=./final.repart.d \
|
||||
patos_$versionString.img > final-repart-output.json
|
||||
|
||||
# install Turing RK1 uboot
|
||||
dd if=${pkgs.ubootTuringRK1}/u-boot-rockchip.bin of=./patos_$versionString.img seek=64 conv=notrunc
|
||||
|
||||
rm -rf rootfs init.repart.d final.repart.d *.json
|
||||
sha256sum *.root *.verity *.efi *.tar.xz > SHA256SUMS
|
||||
|
||||
|
|
|
@ -115,8 +115,6 @@ Format=btrfs
|
|||
MakeDirectories=/var/lib/confexts /var/lib/extensions /var/lib/portables /var/lib/extensions.d /var/.snapshots
|
||||
MountPoint=/var
|
||||
Label=patos-state
|
||||
Encrypt=tpm2
|
||||
EncryptedVolume=patos-state:none:tpm2-device=auto,luks,discard
|
||||
Subvolumes=/var/lib/confexts /var/lib/extensions /var/lib/portables /var/lib/extensions.d /var/.snapshots
|
||||
MountPoint=/var/lib/confexts:subvol=/var/lib/confexts
|
||||
MountPoint=/var/lib/extensions:subvol=/var/lib/extensions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue