omnia: support fw_{print,set}env commands
This commit is contained in:
parent
d6f96c0448
commit
870e4d86cc
1 changed files with 33 additions and 1 deletions
|
@ -11,7 +11,21 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
module = {pkgs, config, lib, lim, ... }:
|
module = {pkgs, config, lib, lim, ... }:
|
||||||
let openwrt = pkgs.openwrt;
|
let
|
||||||
|
openwrt = pkgs.openwrt;
|
||||||
|
inherit (lib) mkOption types;
|
||||||
|
inherit (pkgs.liminix.services) oneshot;
|
||||||
|
inherit (pkgs) liminix;
|
||||||
|
mtd_by_name_links = pkgs.liminix.services.oneshot rec {
|
||||||
|
name = "mtd_by_name_links";
|
||||||
|
up = ''
|
||||||
|
mkdir -p /dev/mtd/by-name
|
||||||
|
cd /dev/mtd/by-name
|
||||||
|
for i in /sys/class/mtd/mtd*[0-9]; do
|
||||||
|
ln -s ../../$(basename $i) $(cat $i/name)
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
../../modules/arch/arm.nix
|
../../modules/arch/arm.nix
|
||||||
|
@ -20,7 +34,9 @@
|
||||||
../../modules/outputs/mbrimage.nix
|
../../modules/outputs/mbrimage.nix
|
||||||
../../modules/outputs/extlinux.nix
|
../../modules/outputs/extlinux.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
services.mtd-name-links = mtd_by_name_links;
|
||||||
kernel = {
|
kernel = {
|
||||||
src = pkgs.pkgsBuildBuild.fetchurl {
|
src = pkgs.pkgsBuildBuild.fetchurl {
|
||||||
name = "linux.tar.gz";
|
name = "linux.tar.gz";
|
||||||
|
@ -87,6 +103,15 @@
|
||||||
MVPP2 = "y";
|
MVPP2 = "y";
|
||||||
MV_XOR = "y";
|
MV_XOR = "y";
|
||||||
|
|
||||||
|
# there is NOR flash on this device, which is used for U-Boot
|
||||||
|
# and the rescue system (which we don't interfere with) but
|
||||||
|
# also for the U-Boot environment variables (which we might
|
||||||
|
# need to meddle with)
|
||||||
|
MTD_SPI_NOR = "y";
|
||||||
|
SPI = "y";
|
||||||
|
SPI_MASTER = "y";
|
||||||
|
SPI_ORION = "y";
|
||||||
|
|
||||||
NET_DSA = "y";
|
NET_DSA = "y";
|
||||||
NET_DSA_MV88E6XXX = "y"; # depends on PTP_1588_CLOCK_OPTIONAL
|
NET_DSA_MV88E6XXX = "y"; # depends on PTP_1588_CLOCK_OPTIONAL
|
||||||
};
|
};
|
||||||
|
@ -116,6 +141,13 @@
|
||||||
ath10k = symlink firmware;
|
ath10k = symlink firmware;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
etc = dir {
|
||||||
|
"fw_env.config" =
|
||||||
|
let f = pkgs.writeText "fw_env.config" ''
|
||||||
|
/dev/mtd/by-name/u-boot-env 0x0 0x10000 0x10000
|
||||||
|
'';
|
||||||
|
in symlink f;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
boot.tftp = {
|
boot.tftp = {
|
||||||
|
|
Loading…
Reference in a new issue