1
0

rename extlinux output to bootfiles

this is in preparation for introducing other non-extlinux
modules that populate /boot
This commit is contained in:
Daniel Barlow 2024-12-23 00:09:31 +00:00
parent 5c78338d71
commit a7b5f80674
2 changed files with 10 additions and 8 deletions

View File

@ -64,6 +64,12 @@ in
directory of files to package into root filesystem directory of files to package into root filesystem
''; '';
}; };
bootfiles = mkOption {
type = types.nullOr types.package;
internal = true;
default = null;
# description = "";
};
bootablerootdir = mkOption { bootablerootdir = mkOption {
type = types.package; type = types.package;
internal = true; internal = true;
@ -107,8 +113,8 @@ in
let inherit (pkgs.pkgsBuildBuild) runCommand; let inherit (pkgs.pkgsBuildBuild) runCommand;
in runCommand "add-slash-boot" { } '' in runCommand "add-slash-boot" { } ''
cp -a ${o.rootdir} $out cp -a ${o.rootdir} $out
${if config.boot.loader.extlinux.enable ${if o.bootfiles != null
then "(cd $out && chmod -R +w . && rmdir boot && cp -a ${o.extlinux} boot)" then "(cd $out && chmod -R +w . && rmdir boot && cp -a ${o.bootfiles} boot)"
else "" else ""
} }
''; '';

View File

@ -12,14 +12,10 @@ let
cmdline = concatStringsSep " " config.boot.commandLine; cmdline = concatStringsSep " " config.boot.commandLine;
wantsDtb = config.hardware.dts ? src && config.hardware.dts.src != null; wantsDtb = config.hardware.dts ? src && config.hardware.dts.src != null;
in { in {
options.system.outputs.extlinux = mkOption {
type = types.package;
# description = "";
};
options.boot.loader.extlinux.enable = mkEnableOption "extlinux"; options.boot.loader.extlinux.enable = mkEnableOption "extlinux";
config = mkIf cfg.enable { config = mkIf cfg.enable {
system.outputs.extlinux = pkgs.runCommand "extlinux" {} '' system.outputs.bootfiles = pkgs.runCommand "extlinux" {} ''
mkdir $out mkdir $out
cd $out cd $out
${if wantsDtb then "cp ${o.dtb} dtb" else "true"} ${if wantsDtb then "cp ${o.dtb} dtb" else "true"}
@ -37,7 +33,7 @@ in {
_EOF _EOF
''; '';
filesystem = dir { filesystem = dir {
boot = symlink config.system.outputs.extlinux; boot = symlink config.system.outputs.bootfiles;
}; };
}; };
} }