commit f5156425a21287fa700ef0c5cea5357145632514
parent db54c877d698c1f93bc66c8e5eeace4919f02a92
Author: Daniel Barlow <dan@telent.net>
Date: Fri, 7 Apr 2023 09:39:47 +0100
correct jffs2 endian, remove unused bindings
Diffstat:
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/modules/jffs2.nix b/modules/jffs2.nix
@@ -1,12 +1,10 @@
{
config
, pkgs
-, lib
, ...
}:
let
- inherit (lib) mkOption types concatStringsSep;
- inherit (pkgs) liminix callPackage writeText closureInfo;
+ inherit (pkgs) closureInfo;
in
{
imports = [
@@ -16,21 +14,23 @@ in
kernel.config.JFFS2_FS = "y";
outputs = rec {
systemConfiguration =
- let inherit (pkgs.pkgsBuildBuild) systemconfig;
- in systemconfig config.filesystem.contents;
+ pkgs.pkgsBuildBuild.systemconfig config.filesystem.contents;
jffs2fs =
let
- inherit (pkgs.pkgsBuildBuild) runCommand systemconfig mtdutils;
- sysconf = systemConfiguration;
+ inherit (pkgs.pkgsBuildBuild) runCommand mtdutils;
+ endian = if pkgs.stdenv.isBigEndian
+ then "--big-endian" else "--little-endian";
in runCommand "make-jffs2" {
depsBuildBuild = [ mtdutils ];
} ''
mkdir -p $TMPDIR/empty/nix/store/
- cp ${sysconf}/activate $TMPDIR/empty/activate
- pkgClosure=${closureInfo { rootPaths = [ sysconf ]; }}
+ cp ${systemConfiguration}/activate $TMPDIR/empty/activate
+ pkgClosure=${closureInfo {
+ rootPaths = [ systemConfiguration ];
+ }}
cp $pkgClosure/registration nix-path-registration
grafts=$(sed < $pkgClosure/store-paths 's/^\(.*\)$/--graft \1:\1/g')
- mkfs.jffs2 --pad --big-endian --root $TMPDIR/empty --output $out $grafts --verbose
+ mkfs.jffs2 ${endian} --pad --root $TMPDIR/empty --output $out $grafts
'';
jffs2boot =
let o = config.outputs; in
@@ -42,8 +42,6 @@ in
ln -s ${o.manifest} manifest
ln -s ${o.initramfs} initramfs
'';
-
-
};
};
}