diff mbox series

[meta-swupdate,V2] mtd-utils: Use include dir that upstream suggests

Message ID 20200707085825.4021430-1-sbabic@denx.de
State Accepted
Headers show
Series [meta-swupdate,V2] mtd-utils: Use include dir that upstream suggests | expand

Commit Message

Stefano Babic July 7, 2020, 8:58 a.m. UTC
This prepares to move mtd headers in /usr/include instead of the mtd/
namespace used by kernel. This will be synchronized with future dev
packages for mtd-utils that will be merged into Linux distros (Debian).
For a while, the OE recipe will still contain links to the old path to
be compatible with previous SWUpdate release. The links should be
dropped in future.

Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Bastian Germann <bage@linutronix.de>
---
 recipes-devtools/mtd/mtd-utils_%.bbappend | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

Comments

Bastian Germann July 7, 2020, 9:08 a.m. UTC | #1
Am 07.07.20 um 10:58 schrieb Stefano Babic:
> This prepares to move mtd headers in /usr/include instead of the mtd/
> namespace used by kernel. This will be synchronized with future dev
> packages for mtd-utils that will be merged into Linux distros (Debian).
> For a while, the OE recipe will still contain links to the old path to
> be compatible with previous SWUpdate release. The links should be
> dropped in future.
> 
> Signed-off-by: Stefano Babic <sbabic@denx.de>
> CC: Bastian Germann <bage@linutronix.de>

Reviewed-by: Bastian Germann <bage@linutronix.de>

> ---
>  recipes-devtools/mtd/mtd-utils_%.bbappend | 15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/recipes-devtools/mtd/mtd-utils_%.bbappend b/recipes-devtools/mtd/mtd-utils_%.bbappend
> index 7ffbb0c..476c2f8 100644
> --- a/recipes-devtools/mtd/mtd-utils_%.bbappend
> +++ b/recipes-devtools/mtd/mtd-utils_%.bbappend
> @@ -1,13 +1,18 @@
>  FILES_${PN}-staticdev += "ubi-utils/libubi.a ${libdir}/*.a"
>  
> +SRCREV = "639b871fe3d2cb3e73d21363e8c13ede2bbd9f99"
> +
>  do_install_append () {
>  	install -d ${D}${includedir}/mtd/
>  	install -d ${D}${libdir}/
> -	install -m 0644 ${S}/include/libubi.h ${D}${includedir}/mtd/
> -	install -m 0644 ${S}/include/libmtd.h ${D}${includedir}/mtd/
> -	install -m 0644 ${S}/include/mtd/ubi-media.h ${D}${includedir}/mtd/
> -	#oe_libinstall -a -C ubi-utils libubi ${D}${libdir}/
> -	#oe_libinstall -a -C lib libmtd ${D}${libdir}/
> +	install -m 0644 ${S}/include/libubi.h ${D}${includedir}
> +	install -m 0644 ${S}/include/libmtd.h ${D}${includedir}
> +	install -m 0644 ${S}/include/libscan.h ${D}${includedir}
> +	install -m 0644 ${S}/include/libubigen.h ${D}${includedir}
> +	ln -s ../libubi.h ${D}${includedir}/mtd/libubi.h
> +	ln -s ../libmtd.h ${D}${includedir}/mtd/libmtd.h
> +	ln -s ../libscan.h ${D}${includedir}/mtd/libscan.h
> +	ln -s ../libubigen.h ${D}${includedir}/mtd/libubigen.h
>  	oe_libinstall -a libubi ${D}${libdir}/
>  	oe_libinstall -a libmtd ${D}${libdir}/
>  }
>
Manuel Leonhardt July 8, 2020, 8:44 a.m. UTC | #2
Hi Stefano,

This change makes master incompatible with thud, as a patch can no more be 
applied:

ERROR: mtd-utils-2.0.2+AUTOINC+639b871fe3-r0 do_patch: Command Error: 
'quilt --quiltrc 
/camera-pkg/build/tmp/work/aarch64-poky-linux/mtd-utils/2.0.2+AUTOINC+639b871fe3-r0/recipe-sysroot-native/etc/quiltrc 
push' exited with 0  Output:
Applying patch 
0001-Revert-Return-correct-error-number-in-ubi_get_vol_in.patch
patching file lib/libubi.c
Hunk #1 FAILED at 1240.
1 out of 1 hunk FAILED -- rejects in file lib/libubi.c
Patch 0001-Revert-Return-correct-error-number-in-ubi_get_vol_in.patch can 
be reverse-applied
ERROR: mtd-utils-2.0.2+AUTOINC+639b871fe3-r0 do_patch: Function failed: 
patch_do_patch
ERROR: Logfile of failure stored in: 
/camera-pkg/build/tmp/work/aarch64-poky-linux/mtd-utils/2.0.2+AUTOINC+639b871fe3-r0/temp/log.do_patch.32067

Currently the master is set to be compatible with thud, though:

LAYERSERIES_COMPAT_swupdate = "rocko sumo thud warrior zeus dunfell"

Best, Manuel
Bastian Germann schrieb am Dienstag, 7. Juli 2020 um 11:08:53 UTC+2:

> Am 07.07.20 um 10:58 schrieb Stefano Babic:
> > This prepares to move mtd headers in /usr/include instead of the mtd/
> > namespace used by kernel. This will be synchronized with future dev
> > packages for mtd-utils that will be merged into Linux distros (Debian).
> > For a while, the OE recipe will still contain links to the old path to
> > be compatible with previous SWUpdate release. The links should be
> > dropped in future.
> > 
> > Signed-off-by: Stefano Babic <sba...@denx.de>
> > CC: Bastian Germann <ba...@linutronix.de>
>
> Reviewed-by: Bastian Germann <ba...@linutronix.de>
>
> > ---
> > recipes-devtools/mtd/mtd-utils_%.bbappend | 15 ++++++++++-----
> > 1 file changed, 10 insertions(+), 5 deletions(-)
> > 
> > diff --git a/recipes-devtools/mtd/mtd-utils_%.bbappend 
> b/recipes-devtools/mtd/mtd-utils_%.bbappend
> > index 7ffbb0c..476c2f8 100644
> > --- a/recipes-devtools/mtd/mtd-utils_%.bbappend
> > +++ b/recipes-devtools/mtd/mtd-utils_%.bbappend
> > @@ -1,13 +1,18 @@
> > FILES_${PN}-staticdev += "ubi-utils/libubi.a ${libdir}/*.a"
> > 
> > +SRCREV = "639b871fe3d2cb3e73d21363e8c13ede2bbd9f99"
> > +
> > do_install_append () {
> > install -d ${D}${includedir}/mtd/
> > install -d ${D}${libdir}/
> > - install -m 0644 ${S}/include/libubi.h ${D}${includedir}/mtd/
> > - install -m 0644 ${S}/include/libmtd.h ${D}${includedir}/mtd/
> > - install -m 0644 ${S}/include/mtd/ubi-media.h ${D}${includedir}/mtd/
> > - #oe_libinstall -a -C ubi-utils libubi ${D}${libdir}/
> > - #oe_libinstall -a -C lib libmtd ${D}${libdir}/
> > + install -m 0644 ${S}/include/libubi.h ${D}${includedir}
> > + install -m 0644 ${S}/include/libmtd.h ${D}${includedir}
> > + install -m 0644 ${S}/include/libscan.h ${D}${includedir}
> > + install -m 0644 ${S}/include/libubigen.h ${D}${includedir}
> > + ln -s ../libubi.h ${D}${includedir}/mtd/libubi.h
> > + ln -s ../libmtd.h ${D}${includedir}/mtd/libmtd.h
> > + ln -s ../libscan.h ${D}${includedir}/mtd/libscan.h
> > + ln -s ../libubigen.h ${D}${includedir}/mtd/libubigen.h
> > oe_libinstall -a libubi ${D}${libdir}/
> > oe_libinstall -a libmtd ${D}${libdir}/
> > }
> > 
>
Stefano Babic July 8, 2020, 9:04 a.m. UTC | #3
Hi Manuel,

On 08.07.20 10:44, Manuel Leonhardt wrote:
> Hi Stefano,
> 
> This change makes master incompatible with thud, as a patch can no more
> be applied:
> 

I know, but...

I have tried to let -master compatible with as many releases possible.
This is not provided by the most meta- layers, but it is nice if it is
possible to get last SWUpdate running.

However, there are several changes in last times that broke
compatibility: libubootenv is now merged in OE-Core (this is nice,
but..), and then build is already broken for all releases before
dunfell. This patch sets on current mtd-utils tree: this means that even
dunfell is too old, and I am implicitely upgrading mtd-utils in dunfell
to 2.1.1+.

As thud is considered obsolete from poky itself, I have to drop its
support, too. Anyway, -master cannot be considered compatible anymore
with previous releases.


> ERROR: mtd-utils-2.0.2+AUTOINC+639b871fe3-r0 do_patch: Command Error:
> 'quilt --quiltrc
> /camera-pkg/build/tmp/work/aarch64-poky-linux/mtd-utils/2.0.2+AUTOINC+639b871fe3-r0/recipe-sysroot-native/etc/quiltrc
> push' exited with 0  Output:
> Applying patch
> 0001-Revert-Return-correct-error-number-in-ubi_get_vol_in.patch
> patching file lib/libubi.c
> Hunk #1 FAILED at 1240.
> 1 out of 1 hunk FAILED -- rejects in file lib/libubi.c

..but the issue is due to the patches inside poky that apply to
mts-utils 1.0.0. If you drop them, it should work.

Anyway, I suggest you import into your meta-recipes-base-arri the recipe
for mtd-utils (that is, 2.1.1) from dunfell. Because the version is
higher as the one in your poky (thud), recipe in poky will be simply
ignored and you can use meta-swupdate (master) again and I suppose the
issue is solved.

> Patch 0001-Revert-Return-correct-error-number-in-ubi_get_vol_in.patch
> can be reverse-applied
> ERROR: mtd-utils-2.0.2+AUTOINC+639b871fe3-r0 do_patch: Function failed:
> patch_do_patch
> ERROR: Logfile of failure stored in:
> /camera-pkg/build/tmp/work/aarch64-poky-linux/mtd-utils/2.0.2+AUTOINC+639b871fe3-r0/temp/log.do_patch.32067
> 
> Currently the master is set to be compatible with thud, though:
> 
> LAYERSERIES_COMPAT_swupdate = "rocko sumo thud warrior zeus dunfell"

This is the intention, but I know that all releases before dunfell are
not working out of the box, but it is not a big deal to fix them. But
supporting all of them is a lot of work (including testing), and I
decided to align myself to what Yocto is doing, that is older releases
reach their EOL and are not anymore supported. On the other side, I
cannot block some useful changes just for compatibility with old
releases. The issue reported by Bastian is real, and having a special
solution for each distro (this will impact buildroot, too) is a no deal.

Best regards,
Stefano

> 
> Best, Manuel
> Bastian Germann schrieb am Dienstag, 7. Juli 2020 um 11:08:53 UTC+2:
> 
>     Am 07.07.20 um 10:58 schrieb Stefano Babic:
>     > This prepares to move mtd headers in /usr/include instead of the mtd/
>     > namespace used by kernel. This will be synchronized with future dev
>     > packages for mtd-utils that will be merged into Linux distros
>     (Debian).
>     > For a while, the OE recipe will still contain links to the old
>     path to
>     > be compatible with previous SWUpdate release. The links should be
>     > dropped in future.
>     >
>     > Signed-off-by: Stefano Babic <sba...@denx.de>
>     > CC: Bastian Germann <ba...@linutronix.de>
> 
>     Reviewed-by: Bastian Germann <ba...@linutronix.de>
> 
>     > ---
>     > recipes-devtools/mtd/mtd-utils_%.bbappend | 15 ++++++++++-----
>     > 1 file changed, 10 insertions(+), 5 deletions(-)
>     >
>     > diff --git a/recipes-devtools/mtd/mtd-utils_%.bbappend
>     b/recipes-devtools/mtd/mtd-utils_%.bbappend
>     > index 7ffbb0c..476c2f8 100644
>     > --- a/recipes-devtools/mtd/mtd-utils_%.bbappend
>     > +++ b/recipes-devtools/mtd/mtd-utils_%.bbappend
>     > @@ -1,13 +1,18 @@
>     > FILES_${PN}-staticdev += "ubi-utils/libubi.a ${libdir}/*.a"
>     >
>     > +SRCREV = "639b871fe3d2cb3e73d21363e8c13ede2bbd9f99"
>     > +
>     > do_install_append () {
>     > install -d ${D}${includedir}/mtd/
>     > install -d ${D}${libdir}/
>     > - install -m 0644 ${S}/include/libubi.h ${D}${includedir}/mtd/
>     > - install -m 0644 ${S}/include/libmtd.h ${D}${includedir}/mtd/
>     > - install -m 0644 ${S}/include/mtd/ubi-media.h ${D}${includedir}/mtd/
>     > - #oe_libinstall -a -C ubi-utils libubi ${D}${libdir}/
>     > - #oe_libinstall -a -C lib libmtd ${D}${libdir}/
>     > + install -m 0644 ${S}/include/libubi.h ${D}${includedir}
>     > + install -m 0644 ${S}/include/libmtd.h ${D}${includedir}
>     > + install -m 0644 ${S}/include/libscan.h ${D}${includedir}
>     > + install -m 0644 ${S}/include/libubigen.h ${D}${includedir}
>     > + ln -s ../libubi.h ${D}${includedir}/mtd/libubi.h
>     > + ln -s ../libmtd.h ${D}${includedir}/mtd/libmtd.h
>     > + ln -s ../libscan.h ${D}${includedir}/mtd/libscan.h
>     > + ln -s ../libubigen.h ${D}${includedir}/mtd/libubigen.h
>     > oe_libinstall -a libubi ${D}${libdir}/
>     > oe_libinstall -a libmtd ${D}${libdir}/
>     > }
>     >
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "swupdate" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to swupdate+unsubscribe@googlegroups.com
> <mailto:swupdate+unsubscribe@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/swupdate/3052d33a-afe4-4659-9364-8f8286f1f9afn%40googlegroups.com
> <https://groups.google.com/d/msgid/swupdate/3052d33a-afe4-4659-9364-8f8286f1f9afn%40googlegroups.com?utm_medium=email&utm_source=footer>.
diff mbox series

Patch

diff --git a/recipes-devtools/mtd/mtd-utils_%.bbappend b/recipes-devtools/mtd/mtd-utils_%.bbappend
index 7ffbb0c..476c2f8 100644
--- a/recipes-devtools/mtd/mtd-utils_%.bbappend
+++ b/recipes-devtools/mtd/mtd-utils_%.bbappend
@@ -1,13 +1,18 @@ 
 FILES_${PN}-staticdev += "ubi-utils/libubi.a ${libdir}/*.a"
 
+SRCREV = "639b871fe3d2cb3e73d21363e8c13ede2bbd9f99"
+
 do_install_append () {
 	install -d ${D}${includedir}/mtd/
 	install -d ${D}${libdir}/
-	install -m 0644 ${S}/include/libubi.h ${D}${includedir}/mtd/
-	install -m 0644 ${S}/include/libmtd.h ${D}${includedir}/mtd/
-	install -m 0644 ${S}/include/mtd/ubi-media.h ${D}${includedir}/mtd/
-	#oe_libinstall -a -C ubi-utils libubi ${D}${libdir}/
-	#oe_libinstall -a -C lib libmtd ${D}${libdir}/
+	install -m 0644 ${S}/include/libubi.h ${D}${includedir}
+	install -m 0644 ${S}/include/libmtd.h ${D}${includedir}
+	install -m 0644 ${S}/include/libscan.h ${D}${includedir}
+	install -m 0644 ${S}/include/libubigen.h ${D}${includedir}
+	ln -s ../libubi.h ${D}${includedir}/mtd/libubi.h
+	ln -s ../libmtd.h ${D}${includedir}/mtd/libmtd.h
+	ln -s ../libscan.h ${D}${includedir}/mtd/libscan.h
+	ln -s ../libubigen.h ${D}${includedir}/mtd/libubigen.h
 	oe_libinstall -a libubi ${D}${libdir}/
 	oe_libinstall -a libmtd ${D}${libdir}/
 }