Skip to contentSkip to conversation

mtd: add option to build mkfs.ubifs for target

PATCH New Paul B. Henson 3 participants 6 messages Jul 29, 2013 – Jul 31, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: add option to build mkfs.ubifs for target

---
 package/mtd/Config.in |    6 ++++++
 package/mtd/mtd.mk    |    7 +++++++
 2 files changed, 13 insertions(+), 0 deletions(-)
package/mtd/Config.in +6 -0
index ddc3737..2e13157 100644
@@ -54,6 +54,12 @@ config BR2_PACKAGE_MTD_MKFSJFFS2
 	select BR2_PACKAGE_ZLIB
 	select BR2_PACKAGE_LZO
 
+config BR2_PACKAGE_MTD_MKFSUBIFS
+	bool "mkfs.ubifs"
+	select BR2_PACKAGE_ZLIB
+	select BR2_PACKAGE_LZO
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
+
 config BR2_PACKAGE_MTD_MTD_DEBUG
 	bool "mtd_debug"
 	default y
package/mtd/mtd.mk +7 -0
index 994a73a..55fa727 100644
@@ -14,6 +14,10 @@ ifeq ($(BR2_PACKAGE_MTD_MKFSJFFS2),y)
 MTD_DEPENDENCIES = zlib lzo
 endif
 
+ifeq ($(BR2_PACKAGE_MTD_MKFSUBIFS),y)
+MTD_DEPENDENCIES += util-linux zlib lzo
+endif
+
 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
 MTD_DEPENDENCIES += busybox
 endif
@@ -71,7 +75,10 @@ MTD_TARGETS_UBI_$(BR2_PACKAGE_MTD_UBIRMVOL)	+= ubirmvol
 MTD_TARGETS_UBI_$(BR2_PACKAGE_MTD_UBIRSVOL)	+= ubirsvol
 MTD_TARGETS_UBI_$(BR2_PACKAGE_MTD_UBIUPDATEVOL)	+= ubiupdatevol
 
+MTD_TARGETS_UBIFS_$(BR2_PACKAGE_MTD_MKFSUBIFS)	+= mkfs.ubifs
+
 MTD_TARGETS_y += $(addprefix ubi-utils/,$(MTD_TARGETS_UBI_y))
+MTD_TARGETS_y += $(addprefix mkfs.ubifs/,$(MTD_TARGETS_UBIFS_y))
 
 # only call make if atleast a single tool is enabled
 ifneq ($(MTD_TARGETS_y),)
Signature · 1 line
1.7.8.6
#1 lore raw

PATCH 1/1 mtd: add option to build mkfs.ubifs for target

Hi Paul,

Thanks for contributing! See below for a small comment.

Quoted 39 lines · Paul B. Henson
---
 package/mtd/Config.in |    6 ++++++
 package/mtd/mtd.mk    |    7 +++++++
 2 files changed, 13 insertions(+), 0 deletions(-)
package/mtd/Config.in +6 -0
index ddc3737..2e13157 100644
@@ -54,6 +54,12 @@ config BR2_PACKAGE_MTD_MKFSJFFS2
        select BR2_PACKAGE_ZLIB
        select BR2_PACKAGE_LZO
 
+config BR2_PACKAGE_MTD_MKFSUBIFS
+       bool "mkfs.ubifs"
+       select BR2_PACKAGE_ZLIB
+       select BR2_PACKAGE_LZO
+       select BR2_PACKAGE_UTIL_LINUX_LIBUUID
+
 config BR2_PACKAGE_MTD_MTD_DEBUG
        bool "mtd_debug"
        default y
package/mtd/mtd.mk +4 -0
index 994a73a..55fa727 100644
@@ -14,6 +14,10 @@ ifeq ($(BR2_PACKAGE_MTD_MKFSJFFS2),y)
 MTD_DEPENDENCIES = zlib lzo
 endif
 
+ifeq ($(BR2_PACKAGE_MTD_MKFSUBIFS),y)
+MTD_DEPENDENCIES += util-linux zlib lzo
+endif
+
 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
 MTD_DEPENDENCIES += busybox
 endif

package/mtd/mtd.mk MTD_TARGETS_UBI_$(BR2_PACKAGE_MTD_UBIRMVOL) += ubirmvol · line 81

Quoted 7 lines
package/mtd/mtd.mk +3 -0
@@ -71,7 +75,10 @@ MTD_TARGETS_UBI_$(BR2_PACKAGE_MTD_UBIRMVOL)  += ubirmvol
 MTD_TARGETS_UBI_$(BR2_PACKAGE_MTD_UBIRSVOL)    += ubirsvol
 MTD_TARGETS_UBI_$(BR2_PACKAGE_MTD_UBIUPDATEVOL)        += ubiupdatevol
 
+MTD_TARGETS_UBIFS_$(BR2_PACKAGE_MTD_MKFSUBIFS) += mkfs.ubifs
+
 MTD_TARGETS_y += $(addprefix ubi-utils/,$(MTD_TARGETS_UBI_y))
+MTD_TARGETS_y += $(addprefix mkfs.ubifs/,$(MTD_TARGETS_UBIFS_y))

I find it a bit overkill to use $(addprefix) for just one binary. My suggestion would be to simply:
MTD_TARGETS_$(BR2_PACKAGE_MTD_MKFSUBIFS) += mkfs.ubifs/mkfs.ubifs

Otherwise, the patch looks good.

Best regards,
Thomas

#2 lore raw

PATCH 1/1 mtd: add option to build mkfs.ubifs for target

Quoted 3 lines · Thomas De Schampheleire

I find it a bit overkill to use $(addprefix) for just one binary. My suggestion would be to simply:
MTD_TARGETS_$(BR2_PACKAGE_MTD_MKFSUBIFS) += mkfs.ubifs/mkfs.ubifs

I must confess my patch was based on observation and duplication, not on a deep understanding of internals ;). I'll make this change and resubmit the patch, thanks for the feedback.

#3 lore raw

PATCH 1/1 mtd: add option to build mkfs.ubifs for target

In reply to Paul B. Henson

Dear Paul B. Henson,

Quoted 5 lines · Paul B. Henson
---
 package/mtd/Config.in |    6 ++++++
 package/mtd/mtd.mk    |    7 +++++++
 2 files changed, 13 insertions(+), 0 deletions(-)

Applied, thanks. I've made the changes suggested by Thomas De Schampheleire, as well as added the necessary 'depends on' statements for the requires toolchain features.

Thanks,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#4 lore raw

PATCH 1/1 mtd: add option to build mkfs.ubifs for target

Quoted 3 lines · Thomas Petazzoni

Applied, thanks. I've made the changes suggested by Thomas De Schampheleire, as well as added the necessary 'depends on' statements for the requires toolchain features.

Cool, I appreciate you tuning it up for me.

It looks like you copied the dependencies from util-linux? I'm not that familiar with kconfig, there's no concept of transitive dependencies, such that if mkfs.ubifs selects util-linux, it will automatically inherit its dependencies? If I'm understanding correctly, if at some point util-linux changes dependencies, the mtd config for mkfs.ubifs would also need to be updated explicitly to capture them?

Thanks much?

#5 lore raw

PATCH 1/1 mtd: add option to build mkfs.ubifs for target

Dear Paul B. Henson,

Quoted 6 lines · Paul B. Henson

It looks like you copied the dependencies from util-linux? I'm not that familiar with kconfig, there's no concept of transitive dependencies, such that if mkfs.ubifs selects util-linux, it will automatically inherit its dependencies? If I'm understanding correctly, if at some point util-linux changes dependencies, the mtd config for mkfs.ubifs would also need to be updated explicitly to capture them?

That's correct. When you "select FOO", kconfig ignores the dependencies that "config FOO" may have, so you have to manually propagate them. That's a bit annoying, but we don't have (yet?) enough understanding of kconfig internals to change that. Yann E. Morin is getting more and more knowledge about kconfig internals, so I'm hoping it may happen some day, but for now, we have to propagate those dependencies manually.

Thanks!

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com