add a package which populates a /boot dir with everything needed to read extlinux.conf on x86

this will replace our weird generic-extlinux-compatible wrapper in
future patches.
This commit is contained in:
colin 2022-06-23 23:43:38 -07:00
parent d1aa9d190e
commit 065d139cbc
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,30 @@
{ stdenv, pkgs }:
stdenv.mkDerivation rec {
pname = "bootpart-uefi-x86_64";
version = "1";
buildInputs = [ pkgs.syslinux ];
dontUnpack = true;
installPhase = with pkgs; ''
# populate the EFI directory with syslinux, and configure it to read that extlinux.conf file managed by nixos
mkdir -p "$out/EFI/syslinux" "$out/EFI/BOOT"
cp -R "${syslinux}/share/syslinux/efi64"/* "$out/EFI/syslinux"
echo "DEFAULT trampoline" > "$out/EFI/syslinux/syslinux.cfg"
echo "LABEL trampoline" >> "$out/EFI/syslinux/syslinux.cfg"
echo "CONFIG ../../extlinux/extlinux.conf ../../extlinux" >> "$out/EFI/syslinux/syslinux.cfg"
# create the EFI/BOOT/BOOTX64.EFI default entry
cp "$out/EFI/syslinux"/* "$out/EFI/BOOT"
mv "$out/EFI/BOOT/syslinux.efi" "$out/EFI/BOOT/BOOTX64.EFI"
'';
meta = {
description = "unmanaged files to place in /boot on a x86-64 extlinux system";
platforms = [ "x86_64-linux" ];
};
}

View File

@ -3,6 +3,7 @@
sane-scripts = prev.callPackage ./sane-scripts { };
tow-boot-pinephone = prev.callPackage ./tow-boot-pinephone { };
tow-boot-rpi4 = prev.callPackage ./tow-boot-rpi4 { };
bootpart-uefi-x86_64 = prev.callPackage ./bootpart-uefi-x86_64 { pkgs = prev; };
#### customized packages