Add dptx-dummy so that dptx.bin gets into the initrd

This commit is contained in:
Artemis Tosini 2021-08-29 01:37:48 +00:00
parent 99a2935bc7
commit 82e28cda1c
Signed by: artemist
GPG key ID: ADFFE553DCBB831E
5 changed files with 43 additions and 0 deletions

View file

@ -0,0 +1 @@
*.cmd

View file

@ -0,0 +1,26 @@
{ stdenv, lib, kernel }:
stdenv.mkDerivation rec {
pname = "dptx-dummy";
version = "0.1";
src = ./src;
nativeBuildInputs = kernel.moduleBuildDependencies;
setSourceRoot = ''
export sourceRoot=$(pwd)/src;
'';
makeFlags = [
"-C"
"${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
"M=$(sourceRoot)"
];
buildFlags = [ "modules" ];
installFlags = [ "INSTALL_MOD_PATH=${placeholder "out"}" ];
installTargets = [ "modules_install" ];
meta = with lib; {
description = "Dummy module that requires rockchip/dptx.bin";
homepage = "https://artem.ist";
license = licenses.gpl2;
maintainers = [ maintainers.artemist ];
platforms = platforms.linux;
};
}

View file

@ -0,0 +1 @@
obj-m := dptx-dummy.o

View file

@ -0,0 +1,6 @@
#include <linux/module.h>
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Artemis Tosini <me@artem.ist>");
MODULE_DESCRIPTION("Dummy module that requires rockchip/dptx.bin");
MODULE_FIRMWARE("rockchip/dptx.bin");

View file

@ -55,5 +55,14 @@
extraConfig = lib.mkForce "HandlePowerKey=lock"; extraConfig = lib.mkForce "HandlePowerKey=lock";
}; };
swapDevices = [{
device = "/dev/disk/by-partuuid/3f4fb4d3-1e13-f64a-a435-8f866833c2b1";
randomEncryption = true;
}];
# rockchip/dptx.bin isn't in the initrd. Instead of fix nixpkgs let's do something incredibly cursed
boot.extraModulePackages = [ (pkgs.callPackage ../../externals/packages/dptx-dummy { kernel = config.boot.kernelPackages.kernel; }) ];
boot.initrd.availableKernelModules = [ "dptx-dummy" ];
system.stateVersion = "21.11"; system.stateVersion = "21.11";
} }