efi-boot-stub: enable hook for running (fixup) commands after efibootmgr run
This commit is contained in:
parent
9b7ce4a1b5
commit
a3ee9aac98
@ -122,3 +122,10 @@ for fn in "@efiSysMountPoint@/efi/nixos/"*; do
|
|||||||
rm -vf -- "$fn"
|
rm -vf -- "$fn"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Run any extra commands users may need
|
||||||
|
if test -n "@runEfibootmgr@"; then
|
||||||
|
set +e
|
||||||
|
@postEfiBootMgrCommands@
|
||||||
|
set -e
|
||||||
|
fi
|
||||||
|
@ -8,7 +8,7 @@ let
|
|||||||
isExecutable = true;
|
isExecutable = true;
|
||||||
inherit (pkgs) bash;
|
inherit (pkgs) bash;
|
||||||
path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep pkgs.glibc] ++ (pkgs.stdenv.lib.optionals config.boot.loader.efiBootStub.runEfibootmgr [pkgs.efibootmgr pkgs.module_init_tools]);
|
path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep pkgs.glibc] ++ (pkgs.stdenv.lib.optionals config.boot.loader.efiBootStub.runEfibootmgr [pkgs.efibootmgr pkgs.module_init_tools]);
|
||||||
inherit (config.boot.loader.efiBootStub) efiSysMountPoint runEfibootmgr installStartupNsh efiDisk efiPartition;
|
inherit (config.boot.loader.efiBootStub) efiSysMountPoint runEfibootmgr installStartupNsh efiDisk efiPartition postEfiBootMgrCommands;
|
||||||
|
|
||||||
efiShell = if config.boot.loader.efiBootStub.installShell then
|
efiShell = if config.boot.loader.efiBootStub.installShell then
|
||||||
if pkgs.stdenv.isi686 then
|
if pkgs.stdenv.isi686 then
|
||||||
@ -103,6 +103,17 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
postEfiBootMgrCommands = mkOption {
|
||||||
|
default = "";
|
||||||
|
type = types.string;
|
||||||
|
description = ''
|
||||||
|
Shell commands to be executed immediately after efibootmgr has setup the system EFI.
|
||||||
|
Some systems do not follow the EFI specifications properly and insert extra entries.
|
||||||
|
Others will brick (fix by removing battery) on boot when it finds more than X entries.
|
||||||
|
This hook allows for running a few extra efibootmgr commands to combat these issues.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user