From 4a93e91faeb562cc709761c0a0cf8576dbf61e1b Mon Sep 17 00:00:00 2001 From: Florian Agbuya Date: Fri, 24 Nov 2023 10:09:56 +0800 Subject: [PATCH] zynq_image: add various fixes --- zynq_image.nix | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/zynq_image.nix b/zynq_image.nix index 6739896..c1750f3 100644 --- a/zynq_image.nix +++ b/zynq_image.nix @@ -5,10 +5,13 @@ let # dont use overlays for the qemu, it causes a lot of wasted time on recompiles x86pkgs = import pkgs.path { system = "x86_64-linux"; }; - # armv7l cross-compile and boot fixes + build = config.system.build; customKernel = pkgs.linux.override { extraConfig = '' OVERLAY_FS y + CORESIGHT_LINKS_AND_SINKS m + CORESIGHT_SINK_TPIU m + CORESIGHT_SOURCE_ETM3X m ''; }; customKernelPackages = pkgs.linuxPackagesFor customKernel; @@ -16,7 +19,7 @@ in { boot.kernelPackages = customKernelPackages; nixpkgs.system = "armv7l-linux"; system.build.zynq_image = let - cmdline = "root=/dev/mmcblk0 console=ttyPS0,115200n8 systemConfig=${builtins.unsafeDiscardStringContext config.system.build.toplevel}"; + cmdline = "root=/dev/mmcblk0 console=ttyPS0,115200n8 systemConfig=${builtins.unsafeDiscardStringContext build.toplevel}"; qemuScript = '' #!/bin/bash -v export PATH=${x86pkgs.qemu}/bin:$PATH @@ -33,7 +36,7 @@ in { -serial /dev/null \ -serial stdio \ -display none \ - -dtb $base/zynq-zc702.dtb \ + -dtb $base/zynq-zc706.dtb \ -kernel $base/zImage \ -initrd $base/initrd \ -drive file=./tmp/root.squashfs,if=sd,format=raw \ @@ -46,11 +49,11 @@ in { } '' mkdir $out cd $out - cp -s ${config.system.build.squashfs} root.squashfs - cp -s ${config.system.build.kernel}/*zImage . - cp -s ${config.system.build.initialRamdisk}/initrd initrd - cp -s ${config.system.build.kernel}/dtbs/zynq-zc702.dtb . - ln -sv ${config.system.build.toplevel} toplevel + cp ${build.squashfs} root.squashfs + cp ${build.kernel}/*zImage . + cp ${build.initialRamdisk}/initrd initrd + cp ${build.kernel}/dtbs/zynq-zc706.dtb . + ln -sv ${build.toplevel} toplevel cp $qemuScriptPath qemu-script chmod +x qemu-script patchShebangs qemu-script @@ -58,12 +61,12 @@ in { ''; system.build.rpi_image_tar = pkgs.runCommand "dist.tar" {} '' mkdir -p $out/nix-support - tar -cvf $out/dist.tar ${config.system.build.rpi_image} + tar -cvf $out/dist.tar ${build.rpi_image} echo "file binary-dist $out/dist.tar" >> $out/nix-support/hydra-build-products ''; environment.systemPackages = [ pkgs.strace ]; environment.etc."service/getty/run".source = pkgs.writeShellScript "getty" '' - agetty ttyPS0 115200 + bash /dev/ttyPS0 ''; environment.etc."pam.d/other".text = "";