liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit abd01a78093115aed3c02e2356fd04e51a5c8aa3
parent d0c2b3b274e90d37cfc6d12a4d9360262a5ad4aa
Author: Daniel Barlow <dan@telent.net>
Date:   Tue, 26 Sep 2023 18:40:22 +0100

apply mtdpslit patch only for openwrt kernel

it doesn't apply to mainline because there's no mtdsplit
in mainline

Diffstat:
Mpkgs/kernel/default.nix | 1-
Dpkgs/kernel/make-mtdsplit-jffs2-endian-agnostic.patch | 20--------------------
Mpkgs/openwrt/default.nix | 1+
Apkgs/openwrt/make-mtdsplit-jffs2-endian-agnostic.patch | 25+++++++++++++++++++++++++
4 files changed, 26 insertions(+), 21 deletions(-)

diff --git a/pkgs/kernel/default.nix b/pkgs/kernel/default.nix @@ -54,7 +54,6 @@ stdenv.mkDerivation rec { patches = [ ./cmdline-cookie.patch - ./make-mtdsplit-jffs2-endian-agnostic.patch ]; # this is here to work around what I think is a bug in nixpkgs diff --git a/pkgs/kernel/make-mtdsplit-jffs2-endian-agnostic.patch b/pkgs/kernel/make-mtdsplit-jffs2-endian-agnostic.patch @@ -1,20 +0,0 @@ -On a little-endian CPU, the little-endian JFFS2 magic -appears to be word-swapped. - -There is probably a better way to implement this; if you are reading -this patch you are probably well-qualified to do that and upstream it -to OpenWrt - - -diff --git a/drivers/mtd/mtdsplit/mtdsplit.c b/drivers/mtd/mtdsplit/mtdsplit.c -index b2e51dcfc6..533af0298e 100644 ---- a/drivers/mtd/mtdsplit/mtdsplit.c -+++ b/drivers/mtd/mtdsplit/mtdsplit.c -@@ -92,6 +93,6 @@ - *type = MTDSPLIT_PART_TYPE_SQUASHFS; - return 0; -- } else if (magic == 0x19852003) { -+ } else if ((magic == 0x19852003) || (magic == 0x20031985)) { - if (type) - *type = MTDSPLIT_PART_TYPE_JFFS2; - return 0; diff --git a/pkgs/openwrt/default.nix b/pkgs/openwrt/default.nix @@ -26,6 +26,7 @@ let patch --batch -p1 --reverse < ${src}/target/linux/generic/pending-5.15/330-MIPS-kexec-Accept-command-line-parameters-from-users.patch patches ${src}/target/linux/generic/hack-5.15/*.patch patches ${src}/target/linux/${family}/patches-5.15/*.patch + patches ${./make-mtdsplit-jffs2-endian-agnostic.patch} ''; in { inherit src; diff --git a/pkgs/openwrt/make-mtdsplit-jffs2-endian-agnostic.patch b/pkgs/openwrt/make-mtdsplit-jffs2-endian-agnostic.patch @@ -0,0 +1,25 @@ +From 12345790 Tue Sep 26 18:30:44 2023 +From: Daniel Barlow <dan@telent.net> +Date: Tue Sep 26 18:29:47 BST 2023 +Subject: mtdsplit: find magic of little-endian JFFS2 + +On a little-endian CPU, the little-endian JFFS2 magic +appears to be word-swapped. + +There is probably a better way to implement this; if you are reading +this patch you are probably well-qualified to do that and upstream it +to OpenWrt + + +diff --git a/drivers/mtd/mtdsplit/mtdsplit.c b/drivers/mtd/mtdsplit/mtdsplit.c +index b2e51dcfc6..533af0298e 100644 +--- a/drivers/mtd/mtdsplit/mtdsplit.c ++++ b/drivers/mtd/mtdsplit/mtdsplit.c +@@ -92,6 +93,6 @@ + *type = MTDSPLIT_PART_TYPE_SQUASHFS; + return 0; +- } else if (magic == 0x19852003) { ++ } else if ((magic == 0x19852003) || (magic == 0x20031985)) { + if (type) + *type = MTDSPLIT_PART_TYPE_JFFS2; + return 0;