mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH 1/3] mtd-utils: spring cleanup
@ 2021-01-19 14:46 Uwe Kleine-König
  2021-01-19 14:46 ` [ptxdist] [PATCH 2/3] mtd-utils: version bump 2.1.1 -> 2.1.2 Uwe Kleine-König
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Uwe Kleine-König @ 2021-01-19 14:46 UTC (permalink / raw)
  To: ptxdist

Drop unused config item MTD_UTILS_JITTERTEST which is unused since more
than 15 years.

Reactivate MTD_UTILS_JFFS2READER to install jffs2reader. This tool was
claimed to be removed upstream in commit ba0a8f624d02 (" * mtd-utils:
removed tools which are not in upstream any more"), which I failed to
find in the upstream git history.

mtdpart is a tool that was introduced in mtd-utils 1.5.2, add an
installation option for it.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 rules/mtd-utils.in   | 25 ++++++++++---------------
 rules/mtd-utils.make | 11 +++++++++++
 2 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/rules/mtd-utils.in b/rules/mtd-utils.in
index 8988ba116bdc..1a56d12dccef 100644
--- a/rules/mtd-utils.in
+++ b/rules/mtd-utils.in
@@ -134,23 +134,12 @@ config MTD_UTILS_JFFS2_DUMP
 	help
 	  This utility dumps the contents of a binary JFFS2 image.
 
-#config MTD_UTILS_JFFS2READER
-#	bool
-#	prompt "jffs2reader"
-#	select MTD_UTILS_JFFS
-#	help
-#	  A jffs2 image reader
-
-config MTD_UTILS_JITTERTEST
+config MTD_UTILS_JFFS2READER
 	bool
-	prompt "jittertest"
+	prompt "jffs2reader"
+	select MTD_UTILS_JFFS
 	help
-	  This program is used to measure what the jitter of a
-	  real time task would be under "standard" Linux.
-
-	  More particularly, what is the effect of running
-	  a real time task under Linux with background
-	  JFFS file system activity.
+	  A jffs2 image reader
 
 config MTD_UTILS_MTDDEBUG
 	bool
@@ -158,6 +147,12 @@ config MTD_UTILS_MTDDEBUG
 	help
 	  Does info, read, write and erase on mtd devices
 
+config MTD_UTILS_MTDPART
+	bool
+	prompt "mtdpart"
+	help
+	  Add or remove a partition from an MTD device
+
 config MTD_UTILS_NANDDUMP
 	bool
 	prompt "nanddump"
diff --git a/rules/mtd-utils.make b/rules/mtd-utils.make
index 52dddae8e567..df7db047624f 100644
--- a/rules/mtd-utils.make
+++ b/rules/mtd-utils.make
@@ -118,10 +118,21 @@ ifdef PTXCONF_MTD_UTILS_JFFS2_DUMP
 	@$(call install_copy, mtd-utils, 0, 0, 0755, -, \
 		/usr/sbin/jffs2dump)
 endif
+ifdef PTXCONF_MTD_UTILS_JFFS2READER
+	@$(call install_copy, mtd-utils, 0, 0, 0755, -, \
+		/usr/sbin/jffs2reader)
+endif
+
 ifdef PTXCONF_MTD_UTILS_MTDDEBUG
 	@$(call install_copy, mtd-utils, 0, 0, 0755, -, \
 		/usr/sbin/mtd_debug)
 endif
+
+ifdef PTXCONF_MTD_UTILS_MTDPART
+	@$(call install_copy, mtd-utils, 0, 0, 0755, -, \
+		/usr/sbin/mtdpart)
+endif
+
 ifdef PTXCONF_MTD_UTILS_NANDDUMP
 	@$(call install_copy, mtd-utils, 0, 0, 0755, -, \
 		/usr/sbin/nanddump)
-- 
2.30.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ptxdist] [PATCH 2/3] mtd-utils: version bump 2.1.1 -> 2.1.2
  2021-01-19 14:46 [ptxdist] [PATCH 1/3] mtd-utils: spring cleanup Uwe Kleine-König
@ 2021-01-19 14:46 ` Uwe Kleine-König
  2021-01-25  7:20   ` [ptxdist] [APPLIED] " Michael Olbrich
  2021-01-19 14:46 ` [ptxdist] [PATCH 3/3] mtd-utils: Add support for ubifs mount helper Uwe Kleine-König
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Uwe Kleine-König @ 2021-01-19 14:46 UTC (permalink / raw)
  To: ptxdist

This brings a new tool ubihealthd.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 .../0001-nandmarkbad-new-util-to-mark-blocks-as-bad.patch | 0
 patches/{mtd-utils-2.1.1 => mtd-utils-2.1.2}/autogen.sh   | 0
 patches/{mtd-utils-2.1.1 => mtd-utils-2.1.2}/series       | 0
 rules/mtd-utils.in                                        | 7 +++++++
 rules/mtd-utils.make                                      | 8 ++++++--
 5 files changed, 13 insertions(+), 2 deletions(-)
 rename patches/{mtd-utils-2.1.1 => mtd-utils-2.1.2}/0001-nandmarkbad-new-util-to-mark-blocks-as-bad.patch (100%)
 rename patches/{mtd-utils-2.1.1 => mtd-utils-2.1.2}/autogen.sh (100%)
 rename patches/{mtd-utils-2.1.1 => mtd-utils-2.1.2}/series (100%)

diff --git a/patches/mtd-utils-2.1.1/0001-nandmarkbad-new-util-to-mark-blocks-as-bad.patch b/patches/mtd-utils-2.1.2/0001-nandmarkbad-new-util-to-mark-blocks-as-bad.patch
similarity index 100%
rename from patches/mtd-utils-2.1.1/0001-nandmarkbad-new-util-to-mark-blocks-as-bad.patch
rename to patches/mtd-utils-2.1.2/0001-nandmarkbad-new-util-to-mark-blocks-as-bad.patch
diff --git a/patches/mtd-utils-2.1.1/autogen.sh b/patches/mtd-utils-2.1.2/autogen.sh
similarity index 100%
rename from patches/mtd-utils-2.1.1/autogen.sh
rename to patches/mtd-utils-2.1.2/autogen.sh
diff --git a/patches/mtd-utils-2.1.1/series b/patches/mtd-utils-2.1.2/series
similarity index 100%
rename from patches/mtd-utils-2.1.1/series
rename to patches/mtd-utils-2.1.2/series
diff --git a/rules/mtd-utils.in b/rules/mtd-utils.in
index 1a56d12dccef..cdf8b15adfac 100644
--- a/rules/mtd-utils.in
+++ b/rules/mtd-utils.in
@@ -288,6 +288,13 @@ config MTD_UTILS_UBIFORMAT
 	help
 	  Format an MTD device
 
+config MTD_UTILS_UBIHEALTHD
+	bool
+	prompt "ubihealthd"
+	help
+	  Daemon that randomly scans each PEB of a UBI device to ensure that
+	  filesystems with little reading do enough wear leveling.
+
 config MTD_UTILS_UBIMKVOL
 	bool
 	prompt "ubimkvol"
diff --git a/rules/mtd-utils.make b/rules/mtd-utils.make
index df7db047624f..a5a12b3d14a9 100644
--- a/rules/mtd-utils.make
+++ b/rules/mtd-utils.make
@@ -15,8 +15,8 @@ PACKAGES-$(PTXCONF_MTD_UTILS) += mtd-utils
 #
 # Paths and names
 #
-MTD_UTILS_VERSION	:= 2.1.1
-MTD_UTILS_MD5		:= 94bbd31b217a5169ae26ab8c0442f691
+MTD_UTILS_VERSION	:= 2.1.2
+MTD_UTILS_MD5		:= 19191bc0195a779c0bd1284c886084ab
 MTD_UTILS		:= mtd-utils-$(MTD_UTILS_VERSION)
 MTD_UTILS_SUFFIX	:= tar.bz2
 MTD_UTILS_URL		:= ftp://ftp.infradead.org/pub/mtd-utils/$(MTD_UTILS).$(MTD_UTILS_SUFFIX)
@@ -197,6 +197,10 @@ ifdef PTXCONF_MTD_UTILS_UBICRC32
 	@$(call install_copy, mtd-utils, 0, 0, 0755, -, \
 		/usr/sbin/ubicrc32)
 endif
+ifdef PTXCONF_MTD_UTILS_UBIHEALTHD
+	@$(call install_copy, mtd-utils, 0, 0, 0755, -, \
+		/usr/sbin/ubihealthd)
+endif
 ifdef PTXCONF_MTD_UTILS_UBIMKVOL
 	@$(call install_copy, mtd-utils, 0, 0, 0755, -, \
 		/usr/sbin/ubimkvol)
-- 
2.30.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ptxdist] [PATCH 3/3] mtd-utils: Add support for ubifs mount helper
  2021-01-19 14:46 [ptxdist] [PATCH 1/3] mtd-utils: spring cleanup Uwe Kleine-König
  2021-01-19 14:46 ` [ptxdist] [PATCH 2/3] mtd-utils: version bump 2.1.1 -> 2.1.2 Uwe Kleine-König
@ 2021-01-19 14:46 ` Uwe Kleine-König
  2021-01-25  7:20   ` [ptxdist] [APPLIED] " Michael Olbrich
  2021-02-01 16:10 ` [ptxdist] [PATCH 1/3] mtd-utils: spring cleanup Uwe Kleine-König
  2021-02-03  7:11 ` [ptxdist] [APPLIED] " Michael Olbrich
  3 siblings, 1 reply; 8+ messages in thread
From: Uwe Kleine-König @ 2021-01-19 14:46 UTC (permalink / raw)
  To: ptxdist

This helper simplifies mounting ubifs filesystems via /etc/fstab. This
helper already exists upstream, is not released yet, though.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 .../0002-Add-an-ubifs-mount-helper.patch      | 142 ++++++++++++++++++
 patches/mtd-utils-2.1.2/series                |   3 +-
 rules/mtd-utils.in                            |   6 +
 rules/mtd-utils.make                          |   4 +
 4 files changed, 154 insertions(+), 1 deletion(-)
 create mode 100644 patches/mtd-utils-2.1.2/0002-Add-an-ubifs-mount-helper.patch

diff --git a/patches/mtd-utils-2.1.2/0002-Add-an-ubifs-mount-helper.patch b/patches/mtd-utils-2.1.2/0002-Add-an-ubifs-mount-helper.patch
new file mode 100644
index 000000000000..f45b660ee2d1
--- /dev/null
+++ b/patches/mtd-utils-2.1.2/0002-Add-an-ubifs-mount-helper.patch
@@ -0,0 +1,142 @@
+From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
+Date: Tue, 6 Oct 2020 11:19:13 +0200
+Subject: [PATCH] Add an ubifs mount helper
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This abstracts away attaching of the right ubi and then selecting the right
+ubi device and volume to mount.
+
+As described in the comment at the top this allows to mount ubifs volumes
+directly from /etc/fstab without having to use hardcoded numbers (which
+depend on mount order and so are unreliable) and extra magic to care for
+attaching.
+
+Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
+Origin: upstream, commit:efeba0875ed181e7c1c7915742a3868799604d0c
+---
+ ubifs-utils/Makemodule.am |   2 +
+ ubifs-utils/mount.ubifs   | 101 ++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 103 insertions(+)
+ create mode 100755 ubifs-utils/mount.ubifs
+
+diff --git a/ubifs-utils/Makemodule.am b/ubifs-utils/Makemodule.am
+index 59109ccd613c..5c5d99f7572b 100644
+--- a/ubifs-utils/Makemodule.am
++++ b/ubifs-utils/Makemodule.am
+@@ -47,4 +47,6 @@ UBIFS_EXTRA = \
+ 
+ EXTRA_DIST += $(UBIFS_HEADER) $(UBIFS_EXTRA)
+ 
++dist_sbin_SCRIPTS = ubifs-utils/mount.ubifs
++
+ sbin_PROGRAMS += $(UBIFS_BINS)
+diff --git a/ubifs-utils/mount.ubifs b/ubifs-utils/mount.ubifs
+new file mode 100755
+index 000000000000..b94ddc5649f4
+--- /dev/null
++++ b/ubifs-utils/mount.ubifs
+@@ -0,0 +1,101 @@
++#!/bin/sh
++
++# This script should be installed as /sbin/mount.ubifs. The benefit is that an
++# fstab entry like:
++#
++# 	mtd=mtddev:home     /home        ubifs   defaults 0 0
++#
++# results in the ubi contained in the mtd named "mtddev" to be attached (if not
++# already done) and then the volume named "home" being mounted to /home.
++
++# This is called by mount with the following options:
++# /sbin/mount.ubifs spec dir [-sfnv] [-N namespace] [-o options] [-t type.subtype]
++
++spec="$1"
++shift
++
++mtdname2num() {
++	local name
++
++	name="$1"
++
++	for d in $(find /sys/class/mtd/ -regex '.*/mtd[0-9]*'); do
++		case "$d" in
++			*ro)
++				continue
++				;;
++		esac
++
++		if test "$name" = "$(cat "$d/name")"; then
++			local dev mtdnum
++
++			dev="$(basename "$d")"
++			mtdnum="${dev#mtd}"
++			echo "$mtdnum"
++			return
++		fi
++	done
++
++	return 1
++}
++
++mtdnum2ubi() {
++	local mtdnum
++
++	mtdnum="$1"
++
++	for d in $(find /sys/class/ubi/ -regex '.*/ubi[0-9]*'); do
++		case "$d" in
++			*_[0-9]*)
++				continue
++				;;
++		esac
++
++		if test "$mtdnum" = "$(cat "$d/mtd_num")"; then
++			local ubi
++
++			ubi="$(basename "$d")"
++			echo "$ubi"
++			return;
++		fi
++	done
++
++	return 1
++}
++
++mtdnum2ubi_autoattach() {
++	local mtdnum ubi
++
++	mtdnum="$1"
++
++	ubi="$(mtdnum2ubi "$mtdnum")" && { echo "$ubi"; return; }
++
++	# ubiattach might fail with "mtdX is already attached to ubiY" if there
++	# is more than one mount to do in the same mtd partition. So ignore errors.
++	ubiattach -m "$mtdnum" >&2 || true
++
++	mtdnum2ubi "$mtdnum"
++}
++
++case "$spec" in
++	mtd=*:*)
++		spec="${spec#mtd=}"
++		mtd="${spec%:*}"
++		rspec="${spec#*:}"
++
++		mtdnum="$(mtdname2num "$mtd")" || {
++			echo "Failed to find mtdnum for mtd \"$mtd\""
++			exit 1
++		}
++
++		ubi="$(mtdnum2ubi_autoattach "$mtdnum")" || {
++			echo "Failed to find ubi for mtd \"$mtd\""
++			exit 1
++		}
++
++		spec="$ubi:$rspec"
++
++		;;
++esac
++
++/bin/mount -i -t ubifs "$spec" "$@"
diff --git a/patches/mtd-utils-2.1.2/series b/patches/mtd-utils-2.1.2/series
index 92dc1b94f4ca..7a5eec8b0eeb 100644
--- a/patches/mtd-utils-2.1.2/series
+++ b/patches/mtd-utils-2.1.2/series
@@ -1,4 +1,5 @@
 # generated by git-ptx-patches
 #tag:base --start-number 1
 0001-nandmarkbad-new-util-to-mark-blocks-as-bad.patch
-# 407ded52b82ffa3ff91d50cf6b2388e0  - git-ptx-patches magic
+0002-Add-an-ubifs-mount-helper.patch
+# 096af547b18d202f08576089a0cee058  - git-ptx-patches magic
diff --git a/rules/mtd-utils.in b/rules/mtd-utils.in
index cdf8b15adfac..2cb2b88eb0c3 100644
--- a/rules/mtd-utils.in
+++ b/rules/mtd-utils.in
@@ -288,6 +288,12 @@ config MTD_UTILS_UBIFORMAT
 	help
 	  Format an MTD device
 
+config MTD_UTILS_UBIFS_MOUNTHELPER
+	bool
+	prompt "mount.ubifs"
+	help
+	  Simplifies attaching an ubi and mounting an ubifs via /etc/fstab.
+
 config MTD_UTILS_UBIHEALTHD
 	bool
 	prompt "ubihealthd"
diff --git a/rules/mtd-utils.make b/rules/mtd-utils.make
index a5a12b3d14a9..248443b85345 100644
--- a/rules/mtd-utils.make
+++ b/rules/mtd-utils.make
@@ -197,6 +197,10 @@ ifdef PTXCONF_MTD_UTILS_UBICRC32
 	@$(call install_copy, mtd-utils, 0, 0, 0755, -, \
 		/usr/sbin/ubicrc32)
 endif
+ifdef PTXCONF_MTD_UTILS_UBIFS_MOUNTHELPER
+	@$(call install_copy, mtd-utils, 0, 0, 0755, -, \
+		/usr/sbin/mount.ubifs)
+endif
 ifdef PTXCONF_MTD_UTILS_UBIHEALTHD
 	@$(call install_copy, mtd-utils, 0, 0, 0755, -, \
 		/usr/sbin/ubihealthd)
-- 
2.30.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ptxdist] [APPLIED] mtd-utils: version bump 2.1.1 -> 2.1.2
  2021-01-19 14:46 ` [ptxdist] [PATCH 2/3] mtd-utils: version bump 2.1.1 -> 2.1.2 Uwe Kleine-König
@ 2021-01-25  7:20   ` Michael Olbrich
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Olbrich @ 2021-01-25  7:20 UTC (permalink / raw)
  To: ptxdist; +Cc: Uwe Kleine-Koenig

Thanks, applied as 7d4e5f3969dfe1c2509131f58f3ec38941fc9877.

Michael

[sent from post-receive hook]

On Mon, 25 Jan 2021 08:20:42 +0100, Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:
> This brings a new tool ubihealthd.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Message-Id: <20210119144626.7368-2-u.kleine-koenig@pengutronix.de>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> 
> diff --git a/patches/mtd-utils-2.1.1/0001-nandmarkbad-new-util-to-mark-blocks-as-bad.patch b/patches/mtd-utils-2.1.2/0001-nandmarkbad-new-util-to-mark-blocks-as-bad.patch
> similarity index 100%
> rename from patches/mtd-utils-2.1.1/0001-nandmarkbad-new-util-to-mark-blocks-as-bad.patch
> rename to patches/mtd-utils-2.1.2/0001-nandmarkbad-new-util-to-mark-blocks-as-bad.patch
> diff --git a/patches/mtd-utils-2.1.1/autogen.sh b/patches/mtd-utils-2.1.2/autogen.sh
> similarity index 100%
> rename from patches/mtd-utils-2.1.1/autogen.sh
> rename to patches/mtd-utils-2.1.2/autogen.sh
> diff --git a/patches/mtd-utils-2.1.1/series b/patches/mtd-utils-2.1.2/series
> similarity index 100%
> rename from patches/mtd-utils-2.1.1/series
> rename to patches/mtd-utils-2.1.2/series
> diff --git a/rules/mtd-utils.in b/rules/mtd-utils.in
> index 8988ba116bdc..29a8b413c0c5 100644
> --- a/rules/mtd-utils.in
> +++ b/rules/mtd-utils.in
> @@ -293,6 +293,13 @@ config MTD_UTILS_UBIFORMAT
>  	help
>  	  Format an MTD device
>  
> +config MTD_UTILS_UBIHEALTHD
> +	bool
> +	prompt "ubihealthd"
> +	help
> +	  Daemon that randomly scans each PEB of a UBI device to ensure that
> +	  filesystems with little reading do enough wear leveling.
> +
>  config MTD_UTILS_UBIMKVOL
>  	bool
>  	prompt "ubimkvol"
> diff --git a/rules/mtd-utils.make b/rules/mtd-utils.make
> index 52dddae8e567..0506bb776b8f 100644
> --- a/rules/mtd-utils.make
> +++ b/rules/mtd-utils.make
> @@ -15,8 +15,8 @@ PACKAGES-$(PTXCONF_MTD_UTILS) += mtd-utils
>  #
>  # Paths and names
>  #
> -MTD_UTILS_VERSION	:= 2.1.1
> -MTD_UTILS_MD5		:= 94bbd31b217a5169ae26ab8c0442f691
> +MTD_UTILS_VERSION	:= 2.1.2
> +MTD_UTILS_MD5		:= 19191bc0195a779c0bd1284c886084ab
>  MTD_UTILS		:= mtd-utils-$(MTD_UTILS_VERSION)
>  MTD_UTILS_SUFFIX	:= tar.bz2
>  MTD_UTILS_URL		:= ftp://ftp.infradead.org/pub/mtd-utils/$(MTD_UTILS).$(MTD_UTILS_SUFFIX)
> @@ -186,6 +186,10 @@ ifdef PTXCONF_MTD_UTILS_UBICRC32
>  	@$(call install_copy, mtd-utils, 0, 0, 0755, -, \
>  		/usr/sbin/ubicrc32)
>  endif
> +ifdef PTXCONF_MTD_UTILS_UBIHEALTHD
> +	@$(call install_copy, mtd-utils, 0, 0, 0755, -, \
> +		/usr/sbin/ubihealthd)
> +endif
>  ifdef PTXCONF_MTD_UTILS_UBIMKVOL
>  	@$(call install_copy, mtd-utils, 0, 0, 0755, -, \
>  		/usr/sbin/ubimkvol)

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ptxdist] [APPLIED] mtd-utils: Add support for ubifs mount helper
  2021-01-19 14:46 ` [ptxdist] [PATCH 3/3] mtd-utils: Add support for ubifs mount helper Uwe Kleine-König
@ 2021-01-25  7:20   ` Michael Olbrich
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Olbrich @ 2021-01-25  7:20 UTC (permalink / raw)
  To: ptxdist; +Cc: u.kleine-koenig

Thanks, applied as 9b9185a7696ea48f86035e4c2f95229151b2811b.

Michael

[sent from post-receive hook]

On Mon, 25 Jan 2021 08:20:43 +0100, Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:
> This helper simplifies mounting ubifs filesystems via /etc/fstab. This
> helper already exists upstream, is not released yet, though.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Message-Id: <20210119144626.7368-3-u.kleine-koenig@pengutronix.de>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> 
> diff --git a/patches/mtd-utils-2.1.2/0002-Add-an-ubifs-mount-helper.patch b/patches/mtd-utils-2.1.2/0002-Add-an-ubifs-mount-helper.patch
> new file mode 100644
> index 000000000000..f45b660ee2d1
> --- /dev/null
> +++ b/patches/mtd-utils-2.1.2/0002-Add-an-ubifs-mount-helper.patch
> @@ -0,0 +1,142 @@
> +From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
> +Date: Tue, 6 Oct 2020 11:19:13 +0200
> +Subject: [PATCH] Add an ubifs mount helper
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +This abstracts away attaching of the right ubi and then selecting the right
> +ubi device and volume to mount.
> +
> +As described in the comment at the top this allows to mount ubifs volumes
> +directly from /etc/fstab without having to use hardcoded numbers (which
> +depend on mount order and so are unreliable) and extra magic to care for
> +attaching.
> +
> +Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> +Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
> +Origin: upstream, commit:efeba0875ed181e7c1c7915742a3868799604d0c
> +---
> + ubifs-utils/Makemodule.am |   2 +
> + ubifs-utils/mount.ubifs   | 101 ++++++++++++++++++++++++++++++++++++++++++++++
> + 2 files changed, 103 insertions(+)
> + create mode 100755 ubifs-utils/mount.ubifs
> +
> +diff --git a/ubifs-utils/Makemodule.am b/ubifs-utils/Makemodule.am
> +index 59109ccd613c..5c5d99f7572b 100644
> +--- a/ubifs-utils/Makemodule.am
> ++++ b/ubifs-utils/Makemodule.am
> +@@ -47,4 +47,6 @@ UBIFS_EXTRA = \
> + 
> + EXTRA_DIST += $(UBIFS_HEADER) $(UBIFS_EXTRA)
> + 
> ++dist_sbin_SCRIPTS = ubifs-utils/mount.ubifs
> ++
> + sbin_PROGRAMS += $(UBIFS_BINS)
> +diff --git a/ubifs-utils/mount.ubifs b/ubifs-utils/mount.ubifs
> +new file mode 100755
> +index 000000000000..b94ddc5649f4
> +--- /dev/null
> ++++ b/ubifs-utils/mount.ubifs
> +@@ -0,0 +1,101 @@
> ++#!/bin/sh
> ++
> ++# This script should be installed as /sbin/mount.ubifs. The benefit is that an
> ++# fstab entry like:
> ++#
> ++# 	mtd=mtddev:home     /home        ubifs   defaults 0 0
> ++#
> ++# results in the ubi contained in the mtd named "mtddev" to be attached (if not
> ++# already done) and then the volume named "home" being mounted to /home.
> ++
> ++# This is called by mount with the following options:
> ++# /sbin/mount.ubifs spec dir [-sfnv] [-N namespace] [-o options] [-t type.subtype]
> ++
> ++spec="$1"
> ++shift
> ++
> ++mtdname2num() {
> ++	local name
> ++
> ++	name="$1"
> ++
> ++	for d in $(find /sys/class/mtd/ -regex '.*/mtd[0-9]*'); do
> ++		case "$d" in
> ++			*ro)
> ++				continue
> ++				;;
> ++		esac
> ++
> ++		if test "$name" = "$(cat "$d/name")"; then
> ++			local dev mtdnum
> ++
> ++			dev="$(basename "$d")"
> ++			mtdnum="${dev#mtd}"
> ++			echo "$mtdnum"
> ++			return
> ++		fi
> ++	done
> ++
> ++	return 1
> ++}
> ++
> ++mtdnum2ubi() {
> ++	local mtdnum
> ++
> ++	mtdnum="$1"
> ++
> ++	for d in $(find /sys/class/ubi/ -regex '.*/ubi[0-9]*'); do
> ++		case "$d" in
> ++			*_[0-9]*)
> ++				continue
> ++				;;
> ++		esac
> ++
> ++		if test "$mtdnum" = "$(cat "$d/mtd_num")"; then
> ++			local ubi
> ++
> ++			ubi="$(basename "$d")"
> ++			echo "$ubi"
> ++			return;
> ++		fi
> ++	done
> ++
> ++	return 1
> ++}
> ++
> ++mtdnum2ubi_autoattach() {
> ++	local mtdnum ubi
> ++
> ++	mtdnum="$1"
> ++
> ++	ubi="$(mtdnum2ubi "$mtdnum")" && { echo "$ubi"; return; }
> ++
> ++	# ubiattach might fail with "mtdX is already attached to ubiY" if there
> ++	# is more than one mount to do in the same mtd partition. So ignore errors.
> ++	ubiattach -m "$mtdnum" >&2 || true
> ++
> ++	mtdnum2ubi "$mtdnum"
> ++}
> ++
> ++case "$spec" in
> ++	mtd=*:*)
> ++		spec="${spec#mtd=}"
> ++		mtd="${spec%:*}"
> ++		rspec="${spec#*:}"
> ++
> ++		mtdnum="$(mtdname2num "$mtd")" || {
> ++			echo "Failed to find mtdnum for mtd \"$mtd\""
> ++			exit 1
> ++		}
> ++
> ++		ubi="$(mtdnum2ubi_autoattach "$mtdnum")" || {
> ++			echo "Failed to find ubi for mtd \"$mtd\""
> ++			exit 1
> ++		}
> ++
> ++		spec="$ubi:$rspec"
> ++
> ++		;;
> ++esac
> ++
> ++/bin/mount -i -t ubifs "$spec" "$@"
> diff --git a/patches/mtd-utils-2.1.2/series b/patches/mtd-utils-2.1.2/series
> index 92dc1b94f4ca..7a5eec8b0eeb 100644
> --- a/patches/mtd-utils-2.1.2/series
> +++ b/patches/mtd-utils-2.1.2/series
> @@ -1,4 +1,5 @@
>  # generated by git-ptx-patches
>  #tag:base --start-number 1
>  0001-nandmarkbad-new-util-to-mark-blocks-as-bad.patch
> -# 407ded52b82ffa3ff91d50cf6b2388e0  - git-ptx-patches magic
> +0002-Add-an-ubifs-mount-helper.patch
> +# 096af547b18d202f08576089a0cee058  - git-ptx-patches magic
> diff --git a/rules/mtd-utils.in b/rules/mtd-utils.in
> index 29a8b413c0c5..4a51a8ff7408 100644
> --- a/rules/mtd-utils.in
> +++ b/rules/mtd-utils.in
> @@ -293,6 +293,12 @@ config MTD_UTILS_UBIFORMAT
>  	help
>  	  Format an MTD device
>  
> +config MTD_UTILS_UBIFS_MOUNTHELPER
> +	bool
> +	prompt "mount.ubifs"
> +	help
> +	  Simplifies attaching an ubi and mounting an ubifs via /etc/fstab.
> +
>  config MTD_UTILS_UBIHEALTHD
>  	bool
>  	prompt "ubihealthd"
> diff --git a/rules/mtd-utils.make b/rules/mtd-utils.make
> index 0506bb776b8f..c608d0aef8db 100644
> --- a/rules/mtd-utils.make
> +++ b/rules/mtd-utils.make
> @@ -186,6 +186,10 @@ ifdef PTXCONF_MTD_UTILS_UBICRC32
>  	@$(call install_copy, mtd-utils, 0, 0, 0755, -, \
>  		/usr/sbin/ubicrc32)
>  endif
> +ifdef PTXCONF_MTD_UTILS_UBIFS_MOUNTHELPER
> +	@$(call install_copy, mtd-utils, 0, 0, 0755, -, \
> +		/usr/sbin/mount.ubifs)
> +endif
>  ifdef PTXCONF_MTD_UTILS_UBIHEALTHD
>  	@$(call install_copy, mtd-utils, 0, 0, 0755, -, \
>  		/usr/sbin/ubihealthd)

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ptxdist] [PATCH 1/3] mtd-utils: spring cleanup
  2021-01-19 14:46 [ptxdist] [PATCH 1/3] mtd-utils: spring cleanup Uwe Kleine-König
  2021-01-19 14:46 ` [ptxdist] [PATCH 2/3] mtd-utils: version bump 2.1.1 -> 2.1.2 Uwe Kleine-König
  2021-01-19 14:46 ` [ptxdist] [PATCH 3/3] mtd-utils: Add support for ubifs mount helper Uwe Kleine-König
@ 2021-02-01 16:10 ` Uwe Kleine-König
  2021-02-02 13:52   ` Michael Olbrich
  2021-02-03  7:11 ` [ptxdist] [APPLIED] " Michael Olbrich
  3 siblings, 1 reply; 8+ messages in thread
From: Uwe Kleine-König @ 2021-02-01 16:10 UTC (permalink / raw)
  To: ptxdist


[-- Attachment #1.1: Type: text/plain, Size: 821 bytes --]

Hello Michael,

On Tue, Jan 19, 2021 at 03:46:24PM +0100, Uwe Kleine-König wrote:
> Drop unused config item MTD_UTILS_JITTERTEST which is unused since more
> than 15 years.
> 
> Reactivate MTD_UTILS_JFFS2READER to install jffs2reader. This tool was
> claimed to be removed upstream in commit ba0a8f624d02 (" * mtd-utils:
> removed tools which are not in upstream any more"), which I failed to
> find in the upstream git history.
> 
> mtdpart is a tool that was introduced in mtd-utils 1.5.2, add an
> installation option for it.

you applied patches 2 and 3 but not this one and also didn't comment.
Did you miss this patch?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 181 bytes --]

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ptxdist] [PATCH 1/3] mtd-utils: spring cleanup
  2021-02-01 16:10 ` [ptxdist] [PATCH 1/3] mtd-utils: spring cleanup Uwe Kleine-König
@ 2021-02-02 13:52   ` Michael Olbrich
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Olbrich @ 2021-02-02 13:52 UTC (permalink / raw)
  To: ptxdist

Hi,

On Mon, Feb 01, 2021 at 05:10:24PM +0100, Uwe Kleine-König wrote:
> On Tue, Jan 19, 2021 at 03:46:24PM +0100, Uwe Kleine-König wrote:
> > Drop unused config item MTD_UTILS_JITTERTEST which is unused since more
> > than 15 years.
> > 
> > Reactivate MTD_UTILS_JFFS2READER to install jffs2reader. This tool was
> > claimed to be removed upstream in commit ba0a8f624d02 (" * mtd-utils:
> > removed tools which are not in upstream any more"), which I failed to
> > find in the upstream git history.
> > 
> > mtdpart is a tool that was introduced in mtd-utils 1.5.2, add an
> > installation option for it.
> 
> you applied patches 2 and 3 but not this one and also didn't comment.
> Did you miss this patch?

Right, it seems I forgot to add apply this one. I've queued it internally
for testing.

Michael

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ptxdist] [APPLIED] mtd-utils: spring cleanup
  2021-01-19 14:46 [ptxdist] [PATCH 1/3] mtd-utils: spring cleanup Uwe Kleine-König
                   ` (2 preceding siblings ...)
  2021-02-01 16:10 ` [ptxdist] [PATCH 1/3] mtd-utils: spring cleanup Uwe Kleine-König
@ 2021-02-03  7:11 ` Michael Olbrich
  3 siblings, 0 replies; 8+ messages in thread
From: Michael Olbrich @ 2021-02-03  7:11 UTC (permalink / raw)
  To: ptxdist; +Cc: u.kleine-koenig

Thanks, applied as ea6fd0e84c5e584587c6a1930c0edff1015706df.

Michael

[sent from post-receive hook]

On Wed, 03 Feb 2021 08:11:37 +0100, Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:
> Drop unused config item MTD_UTILS_JITTERTEST which is unused since more
> than 15 years.
> 
> Reactivate MTD_UTILS_JFFS2READER to install jffs2reader. This tool was
> claimed to be removed upstream in commit ba0a8f624d02 (" * mtd-utils:
> removed tools which are not in upstream any more"), which I failed to
> find in the upstream git history.
> 
> mtdpart is a tool that was introduced in mtd-utils 1.5.2, add an
> installation option for it.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Message-Id: <20210119144626.7368-1-u.kleine-koenig@pengutronix.de>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> 
> diff --git a/rules/mtd-utils.in b/rules/mtd-utils.in
> index 4a51a8ff7408..2cb2b88eb0c3 100644
> --- a/rules/mtd-utils.in
> +++ b/rules/mtd-utils.in
> @@ -134,23 +134,12 @@ config MTD_UTILS_JFFS2_DUMP
>  	help
>  	  This utility dumps the contents of a binary JFFS2 image.
>  
> -#config MTD_UTILS_JFFS2READER
> -#	bool
> -#	prompt "jffs2reader"
> -#	select MTD_UTILS_JFFS
> -#	help
> -#	  A jffs2 image reader
> -
> -config MTD_UTILS_JITTERTEST
> +config MTD_UTILS_JFFS2READER
>  	bool
> -	prompt "jittertest"
> +	prompt "jffs2reader"
> +	select MTD_UTILS_JFFS
>  	help
> -	  This program is used to measure what the jitter of a
> -	  real time task would be under "standard" Linux.
> -
> -	  More particularly, what is the effect of running
> -	  a real time task under Linux with background
> -	  JFFS file system activity.
> +	  A jffs2 image reader
>  
>  config MTD_UTILS_MTDDEBUG
>  	bool
> @@ -158,6 +147,12 @@ config MTD_UTILS_MTDDEBUG
>  	help
>  	  Does info, read, write and erase on mtd devices
>  
> +config MTD_UTILS_MTDPART
> +	bool
> +	prompt "mtdpart"
> +	help
> +	  Add or remove a partition from an MTD device
> +
>  config MTD_UTILS_NANDDUMP
>  	bool
>  	prompt "nanddump"
> diff --git a/rules/mtd-utils.make b/rules/mtd-utils.make
> index c608d0aef8db..248443b85345 100644
> --- a/rules/mtd-utils.make
> +++ b/rules/mtd-utils.make
> @@ -118,10 +118,21 @@ ifdef PTXCONF_MTD_UTILS_JFFS2_DUMP
>  	@$(call install_copy, mtd-utils, 0, 0, 0755, -, \
>  		/usr/sbin/jffs2dump)
>  endif
> +ifdef PTXCONF_MTD_UTILS_JFFS2READER
> +	@$(call install_copy, mtd-utils, 0, 0, 0755, -, \
> +		/usr/sbin/jffs2reader)
> +endif
> +
>  ifdef PTXCONF_MTD_UTILS_MTDDEBUG
>  	@$(call install_copy, mtd-utils, 0, 0, 0755, -, \
>  		/usr/sbin/mtd_debug)
>  endif
> +
> +ifdef PTXCONF_MTD_UTILS_MTDPART
> +	@$(call install_copy, mtd-utils, 0, 0, 0755, -, \
> +		/usr/sbin/mtdpart)
> +endif
> +
>  ifdef PTXCONF_MTD_UTILS_NANDDUMP
>  	@$(call install_copy, mtd-utils, 0, 0, 0755, -, \
>  		/usr/sbin/nanddump)

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-02-03  7:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-19 14:46 [ptxdist] [PATCH 1/3] mtd-utils: spring cleanup Uwe Kleine-König
2021-01-19 14:46 ` [ptxdist] [PATCH 2/3] mtd-utils: version bump 2.1.1 -> 2.1.2 Uwe Kleine-König
2021-01-25  7:20   ` [ptxdist] [APPLIED] " Michael Olbrich
2021-01-19 14:46 ` [ptxdist] [PATCH 3/3] mtd-utils: Add support for ubifs mount helper Uwe Kleine-König
2021-01-25  7:20   ` [ptxdist] [APPLIED] " Michael Olbrich
2021-02-01 16:10 ` [ptxdist] [PATCH 1/3] mtd-utils: spring cleanup Uwe Kleine-König
2021-02-02 13:52   ` Michael Olbrich
2021-02-03  7:11 ` [ptxdist] [APPLIED] " Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox