forked from DGNum/liminix
tftp: introduce an alternative command line for TFTP
Normal command line and TFTP command line can be sometimes very different. e.g. We don't want to load UBI filesystems for a TFTP boot as it may interfere with our root device loading. Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
This commit is contained in:
parent
2d6414ea41
commit
86e81efbd6
4 changed files with 25 additions and 1 deletions
|
@ -28,6 +28,14 @@ in {
|
|||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
commandLine = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = config.boot.commandLine;
|
||||
description = ''
|
||||
TFTP-specific command line.
|
||||
Defaults to the classical one if unset.
|
||||
'';
|
||||
};
|
||||
};
|
||||
options.system.outputs = {
|
||||
tftpboot = mkOption {
|
||||
|
@ -105,7 +113,7 @@ in {
|
|||
zimage = "bootz";
|
||||
}; in choices.${cfg.kernelFormat};
|
||||
|
||||
cmdline = concatStringsSep " " config.boot.commandLine;
|
||||
cmdline = concatStringsSep " " config.boot.tftp.commandLine;
|
||||
objcopy = "${pkgs.stdenv.cc.bintools.targetPrefix}objcopy";
|
||||
stripAndZip = ''
|
||||
${objcopy} -O binary -R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id -S vmlinux.elf vmlinux.bin
|
||||
|
|
|
@ -29,6 +29,13 @@ in
|
|||
};
|
||||
boot.initramfs.enable = true;
|
||||
|
||||
# In TFTP, the device named "rootfs" is the UBI device.
|
||||
# We tell the kernel to load it.
|
||||
# This avoids interference from the other UBI volumes.
|
||||
boot.tftp.commandLine = [
|
||||
"ubi.mtd=rootfs"
|
||||
];
|
||||
|
||||
system.outputs.rootfs =
|
||||
let
|
||||
inherit (pkgs.pkgsBuildBuild) runCommand;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue