From 78040f6c949689193fb91205bd8d1c5e0ff46e59 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sat, 30 Jan 2021 18:47:01 +0000 Subject: [PATCH] nix/pkgs: init hp-rom; add to netboot --- nix/pkgs/default.nix | 1 + nix/pkgs/hp-rom.nix | 30 ++++++++++++++++++++++++++++++ ops/nixos/netboot/default.nix | 3 ++- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 nix/pkgs/hp-rom.nix diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix index fc4266fd20..d5c57ef556 100644 --- a/nix/pkgs/default.nix +++ b/nix/pkgs/default.nix @@ -22,5 +22,6 @@ django-allauth = pkgs.python3Packages.callPackage ./django-allauth.nix {}; django-tailwind = pkgs.python3Packages.callPackage ./django-tailwind.nix {}; windows = import ./windows args; + hp-rom = import ./hp-rom.nix args; } // (import ./heptapod-runner.nix args) // (import ./lightspeed args) diff --git a/nix/pkgs/hp-rom.nix b/nix/pkgs/hp-rom.nix new file mode 100644 index 0000000000..fd014b0c04 --- /dev/null +++ b/nix/pkgs/hp-rom.nix @@ -0,0 +1,30 @@ +{ pkgs, ... }: + +let + bl465c = pkgs.fetchurl { + url = "https://downloads.hpe.com/pub/softlib2/software1/sc-linux-fw-sys/p361457557/v150912/RPMS/i386/firmware-system-a19-2018.03.14-1.1.i386.rpm"; + hash = "sha256:0h3i5jbqc40sxysq20l3ky0vxbn28avhm6fh6bv3bmar4lx1azcm"; + }; +in +pkgs.runCommandNoCC "hp-rom" { + inherit bl465c; + + nativeBuildInputs = [ + pkgs.libarchive + ]; +} '' + mkdir $out + mkdir $out/share $out/bin + + mkdir tmp + pushd tmp + bsdtar xvf $bl465c + mv ./usr/lib/i386-linux-gnu/firmware-system-a19-2018.03.14-1.1 $out/share/bl465c + substituteInPlace $out/share/bl465c/hpsetup \ + --replace "InitLog()" "InitLog() { :; }; InitLogOLD()" \ + --replace "EndLog()" "EndLog() { :; }; EndLogOLD()" \ + --replace 'EXEDIR=$(dirname $0)' "EXEDIR=$out/share/bl465c" + patchShebangs $out/share/bl465c/hpsetup + ln -s ../share/bl465c/hpsetup $out/bin/bl465c-rompaq + popd +'' diff --git a/ops/nixos/netboot/default.nix b/ops/nixos/netboot/default.nix index 585e819d5e..5f995aa8e5 100644 --- a/ops/nixos/netboot/default.nix +++ b/ops/nixos/netboot/default.nix @@ -15,8 +15,9 @@ in { systemd.services.sshd.wantedBy = lib.mkOverride 0 [ "multi-user.target" ]; boot.kernelPackages = pkgs.linuxPackages_latest; - environment.systemPackages = with pkgs; [ + environment.systemPackages = with depot.pkgs; [ mprime + hp-rom ]; system.build.netbootWrap = pkgs.symlinkJoin {