unify kernel command line handling

We now use MIPS_CMDLINE_DTB_EXTEND for all boot varieties
(tftpboot, flash boot, kexec) with the addition of
MIPS_BOOTLOADER_CMDLINE_REQUIRE_COOKIE - local patch -
so that the bootloader args are ignored unless they
contain the string "liminix"
This commit is contained in:
Daniel Barlow 2023-03-23 21:50:44 +00:00
parent 1c36f1b373
commit a5cfa37ed3
6 changed files with 74 additions and 10 deletions

View file

@ -11,7 +11,6 @@ in {
imports = [ ./ramdisk.nix ];
config = {
boot.ramdisk.enable = true;
kernel.config.MIPS_CMDLINE_FROM_BOOTLOADER = "y";
outputs.tftpboot =
let o = config.outputs; in
@ -35,12 +34,12 @@ in {
squashfsStart=0x$(printf %x $((${cfg.loadAddress} + 0x100000 + $uimageSize)))
squashfsBytes=$(($(stat -L -c %s ${config.outputs.squashfs}) + 0x100000 &(~0xfffff)))
squashfsMb=$(($squashfsBytes >> 20))
cmd="mtdparts=phram0:''${squashfsMb}M(nix) phram.phram=phram0,''${squashfsStart},''${squashfsMb}Mi memmap=''${squashfsMb}M\$''${squashfsStart} root=1f00";
cmd="mtdparts=phram0:''${squashfsMb}M(rootfs) phram.phram=phram0,''${squashfsStart},''${squashfsMb}Mi memmap=''${squashfsMb}M\$''${squashfsStart} root=1f00";
cat > $out << EOF
setenv serverip ${cfg.serverip}
setenv ipaddr ${cfg.ipaddr}
setenv bootargs '${concatStringsSep " " config.boot.commandLine} $cmd'
setenv bootargs 'liminix $cmd'
tftp 0x$(printf %x ${cfg.loadAddress}) result/uimage ; tftp 0x$(printf %x $squashfsStart) result/squashfs
bootm 0x$(printf %x ${cfg.loadAddress})
EOF