* [Buildroot] [PATCH 1/2] android-tools: Enable build for ext4 fsutils
@ 2017-11-30 20:56 Keith Mok
2017-11-30 20:56 ` [Buildroot] [PATCH 2/2] android-tools: upport char, block, fifo, socket devices Keith Mok
2017-12-01 12:49 ` [Buildroot] [PATCH 1/2] android-tools: Enable build for ext4 fsutils Gary Bisson
0 siblings, 2 replies; 10+ messages in thread
From: Keith Mok @ 2017-11-30 20:56 UTC (permalink / raw)
To: buildroot
This enable the build for make_ext4fs, simg2img, etc.
For creating Android sparse ext4 files and extract tools (simg2img).
Signed-off-by: Keith Mok <ek9852@gmail.com>
---
...ke_ext4fs-makefiles-for-out-of-tree-build.patch | 53 ++++++++++++++++++++++
package/android-tools/Config.in | 12 +++++
package/android-tools/Config.in.host | 6 +++
package/android-tools/android-tools.mk | 39 +++++++++++-----
4 files changed, 99 insertions(+), 11 deletions(-)
create mode 100644 package/android-tools/0008-Fix-make_ext4fs-makefiles-for-out-of-tree-build.patch
diff --git a/package/android-tools/0008-Fix-make_ext4fs-makefiles-for-out-of-tree-build.patch b/package/android-tools/0008-Fix-make_ext4fs-makefiles-for-out-of-tree-build.patch
new file mode 100644
index 0000000..ec68c25
--- /dev/null
+++ b/package/android-tools/0008-Fix-make_ext4fs-makefiles-for-out-of-tree-build.patch
@@ -0,0 +1,53 @@
+[PATCH] Fix make_ext4fs makefiles for out-of-tree build
+
+Signed-off-by: Keith Mok <keith@density.io>
+---
+ debian/makefiles/ext4_utils.mk | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/debian/makefiles/ext4_utils.mk b/debian/makefiles/ext4_utils.mk
+index cb64916..b56e27e 100644
+--- a/debian/makefiles/ext4_utils.mk
++++ b/debian/makefiles/ext4_utils.mk
+@@ -1,6 +1,7 @@
+ # Makefile for ext4_utils; based on https://heiher.info/2227.html
+ # Author: Dmitrijs Ledkovs <xnox@ubuntu.com>
+
++VPATH+= $(SRCDIR)/extras/ext4_utils
+ SRCS+=make_ext4fs.c
+ SRCS+=ext4fixup.c
+ SRCS+=ext4_utils.c
+@@ -13,7 +14,7 @@ SRCS+=sha1.c
+ SRCS+=wipe.c
+ SRCS+=crc16.c
+
+-VPATH+=../../core/libsparse
++VPATH+= $(SRCDIR)/core/libsparse
+ SRCS+= backed_block.c
+ SRCS+= sparse_crc32.c
+ SRCS+= sparse.c
+@@ -23,6 +24,7 @@ SRCS+= output_file.c
+
+ OBJS_SHARED:= $(SRCS:.c=.o)
+
++VPATH+= $(SRCDIR)/extras/ext4_utils
+ SRCS+=make_ext4fs_main.c
+ SRCS+=ext4fixup_main.c
+ SRCS+=setup_fs.c
+@@ -31,10 +33,9 @@ SRCS+=img2simg.c
+ SRCS+=simg2img.c
+ SRCS+=simg2simg.c
+
+-CPPFLAGS+= -I.
+-CPPFLAGS+= -I/usr/include
+-CPPFLAGS+= -I../../core/include
+-CPPFLAGS+= -I../../core/libsparse/include/
++CPPFLAGS+= -I$(SRCDIR)/core/include
++CPPFLAGS+= -I$(SRCDIR)/extras/ext4_utils/
++CPPFLAGS+= -I$(SRCDIR)/core/libsparse/include/
+
+ LIBS+= -lz -lselinux
+
+--
+2.13.6 (Apple Git-96)
+
diff --git a/package/android-tools/Config.in b/package/android-tools/Config.in
index 96e36e6..6697d45 100644
--- a/package/android-tools/Config.in
+++ b/package/android-tools/Config.in
@@ -75,6 +75,18 @@ config BR2_PACKAGE_ANDROID_TOOLS_ADBD
target, which can be used to interact with a host machine
implementing the ADB protocol.
+config BR2_PACKAGE_ANDROID_TOOLS_EXT4_UTILS
+ bool "ext4-utils"
+ depends on BR2_TOOLCHAIN_HAS_THREADS # libselinux
+ depends on !BR2_STATIC_LIBS # libselinux
+ depends on BR2_TOOLCHAIN_USES_GLIBC # libselinux
+ depends on !BR2_arc # libselinux
+ select BR2_PACKAGE_LIBSELINUX
+ select BR2_PACKAGE_ZLIB
+ help
+ This option will build and install the ext4 utility for the
+ host, which can be used to build sparse/extract ext4 image.
+
endif
comment "android-tools needs a toolchain w/ threads"
diff --git a/package/android-tools/Config.in.host b/package/android-tools/Config.in.host
index 993c4c9..a30b2d4 100644
--- a/package/android-tools/Config.in.host
+++ b/package/android-tools/Config.in.host
@@ -23,4 +23,10 @@ config BR2_PACKAGE_HOST_ANDROID_TOOLS_ADB
host, which can be used to interact with target devices
implementing the ADB protocol.
+config BR2_PACKAGE_HOST_ANDROID_TOOLS_EXT4_UTILS
+ bool "ext4-utils"
+ help
+ This option will build and install the ext4 utility for the
+ host, which can be used to build sparse/extract ext4 image.
+
endif
diff --git a/package/android-tools/android-tools.mk b/package/android-tools/android-tools.mk
index f6c6913..01398de 100644
--- a/package/android-tools/android-tools.mk
+++ b/package/android-tools/android-tools.mk
@@ -31,54 +31,71 @@ HOST_ANDROID_TOOLS_PRE_PATCH_HOOKS += ANDROID_TOOLS_DEBIAN_PATCH
ANDROID_TOOLS_PRE_PATCH_HOOKS += ANDROID_TOOLS_DEBIAN_PATCH
ifeq ($(BR2_PACKAGE_HOST_ANDROID_TOOLS_FASTBOOT),y)
-HOST_ANDROID_TOOLS_TARGETS += fastboot
+HOST_ANDROID_TOOLS_BUILD_TARGETS += fastboot
+HOST_ANDROID_TOOLS_INSTALL_TARGETS += fastboot/fastboot
HOST_ANDROID_TOOLS_DEPENDENCIES += host-zlib host-libselinux
endif
ifeq ($(BR2_PACKAGE_HOST_ANDROID_TOOLS_ADB),y)
-HOST_ANDROID_TOOLS_TARGETS += adb
+HOST_ANDROID_TOOLS_BUILD_TARGETS += adb
+HOST_ANDROID_TOOLS_INSTALL_TARGETS += adb/adb
HOST_ANDROID_TOOLS_DEPENDENCIES += host-zlib host-openssl
endif
+ifeq ($(BR2_PACKAGE_HOST_ANDROID_TOOLS_EXT4_UTILS),y)
+HOST_ANDROID_TOOLS_BUILD_TARGETS += ext4_utils
+HOST_ANDROID_TOOLS_INSTALL_TARGETS += ext4_utils/ext2simg ext4_utils/ext4fixup ext4_utils/img2simg ext4_utils/make_ext4fs ext4_utils/simg2img ext4_utils/simg2simg
+HOST_ANDROID_TOOLS_DEPENDENCIES += host-zlib host-libselinux
+endif
+
ifeq ($(BR2_PACKAGE_ANDROID_TOOLS_FASTBOOT),y)
-ANDROID_TOOLS_TARGETS += fastboot
+ANDROID_TOOLS_BUILD_TARGETS += fastboot
+ANDROID_TOOLS_INSTALL_TARGETS += fastboot/fastboot
ANDROID_TOOLS_DEPENDENCIES += zlib libselinux
endif
ifeq ($(BR2_PACKAGE_ANDROID_TOOLS_ADB),y)
-ANDROID_TOOLS_TARGETS += adb
+ANDROID_TOOLS_BUILD_TARGETS += adb
+ANDROID_TOOLS_INSTALL_TARGETS += adb/adb
ANDROID_TOOLS_DEPENDENCIES += zlib openssl
endif
ifeq ($(BR2_PACKAGE_ANDROID_TOOLS_ADBD),y)
-ANDROID_TOOLS_TARGETS += adbd
+ANDROID_TOOLS_BUILD_TARGETS += adbd
+ANDROID_TOOLS_INSTALL_TARGETS += adbd/adbd
ANDROID_TOOLS_DEPENDENCIES += zlib openssl
endif
+ifeq ($(BR2_PACKAGE_ANDROID_TOOLS_EXT4_UTILS),y)
+ANDROID_TOOLS_BUILD_TARGETS += ext4_utils
+ANDROID_TOOLS_INSTALL_TARGETS += ext4_utils/ext2simg ext4_utils/ext4fixup ext4_utils/img2simg ext4_utils/make_ext4fs ext4_utils/simg2img ext4_utils/simg2simg
+ANDROID_TOOLS_DEPENDENCIES += zlib libselinux
+endif
+
# Build each tool in its own directory not to share object files
define HOST_ANDROID_TOOLS_BUILD_CMDS
- $(foreach t,$(HOST_ANDROID_TOOLS_TARGETS),\
+ $(foreach t,$(HOST_ANDROID_TOOLS_BUILD_TARGETS),\
mkdir -p $(@D)/build-$(t) && \
$(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) SRCDIR=$(@D) \
-C $(@D)/build-$(t) -f $(@D)/debian/makefiles/$(t).mk$(sep))
endef
define ANDROID_TOOLS_BUILD_CMDS
- $(foreach t,$(ANDROID_TOOLS_TARGETS),\
+ $(foreach t,$(ANDROID_TOOLS_BUILD_TARGETS),\
mkdir -p $(@D)/build-$(t) && \
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) SRCDIR=$(@D) \
-C $(@D)/build-$(t) -f $(@D)/debian/makefiles/$(t).mk$(sep))
endef
define HOST_ANDROID_TOOLS_INSTALL_CMDS
- $(foreach t,$(HOST_ANDROID_TOOLS_TARGETS),\
- $(INSTALL) -D -m 0755 $(@D)/build-$(t)/$(t) $(HOST_DIR)/bin/$(t)$(sep))
+ $(foreach t,$(HOST_ANDROID_TOOLS_INSTALL_TARGETS),\
+ $(INSTALL) -D -m 0755 $(@D)/build-$(t) $(HOST_DIR)/bin/$(basename $(notdir $(t)))$(sep))
endef
define ANDROID_TOOLS_INSTALL_TARGET_CMDS
- $(foreach t,$(ANDROID_TOOLS_TARGETS),\
- $(INSTALL) -D -m 0755 $(@D)/build-$(t)/$(t) $(TARGET_DIR)/usr/bin/$(t)$(sep))
+ $(foreach t,$(ANDROID_TOOLS_INSTALL_TARGETS),\
+ $(INSTALL) -D -m 0755 $(@D)/build-$(t) $(TARGET_DIR)/usr/bin/$(basename $(notdir $(t)))$(sep))
endef
$(eval $(host-generic-package))
--
2.7.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH 2/2] android-tools: upport char, block, fifo, socket devices
2017-11-30 20:56 [Buildroot] [PATCH 1/2] android-tools: Enable build for ext4 fsutils Keith Mok
@ 2017-11-30 20:56 ` Keith Mok
2017-12-01 12:55 ` Thomas Petazzoni
2017-12-01 12:49 ` [Buildroot] [PATCH 1/2] android-tools: Enable build for ext4 fsutils Gary Bisson
1 sibling, 1 reply; 10+ messages in thread
From: Keith Mok @ 2017-11-30 20:56 UTC (permalink / raw)
To: buildroot
Pick changes from openwrt to enable support of special
device for make_ext4fs
---
...ment-support-for-block-and-char-dev-nodes.patch | 109 +++++++++++++++++++++
1 file changed, 109 insertions(+)
create mode 100644 package/android-tools/0009-PATCH-Implement-support-for-block-and-char-dev-nodes.patch
diff --git a/package/android-tools/0009-PATCH-Implement-support-for-block-and-char-dev-nodes.patch b/package/android-tools/0009-PATCH-Implement-support-for-block-and-char-dev-nodes.patch
new file mode 100644
index 0000000..e86d9c6
--- /dev/null
+++ b/package/android-tools/0009-PATCH-Implement-support-for-block-and-char-dev-nodes.patch
@@ -0,0 +1,109 @@
+From 3258b175c3ea1f76823c6b69b5036ac7efb5599d Mon Sep 17 00:00:00 2001
+From: Jo-Philipp Wich <jow@openwrt.org>
+Date: Thu, 30 Nov 2017 10:10:24 -0800
+Subject: [PATCH] [PATCH] Implement support for block and char dev nodes, fifos
+ and sockets.
+
+Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
+Signed-off-by: Keith Mok <ek9852@gmail.com>
+---
+ extras/ext4_utils/contents.c | 45 +++++++++++++++++++++++++++++++++++++++++
+ extras/ext4_utils/contents.h | 1 +
+ extras/ext4_utils/make_ext4fs.c | 6 +++++-
+ 3 files changed, 51 insertions(+), 1 deletion(-)
+
+diff --git a/extras/ext4_utils/contents.c b/extras/ext4_utils/contents.c
+index 6300680..b11ecba 100644
+--- a/extras/ext4_utils/contents.c
++++ b/extras/ext4_utils/contents.c
+@@ -225,6 +225,51 @@ u32 make_link(const char *filename, const char *link)
+ return inode_num;
+ }
+
++/* Creates a special file on disk. Returns the inode number of the new file */
++u32 make_special(const char *path)
++{
++ struct ext4_inode *inode;
++ struct stat s;
++ u32 inode_num;
++ u32 devmajor;
++ u32 devminor;
++
++ if (stat(path, &s)) {
++ error("failed to stat file\n");
++ return EXT4_ALLOCATE_FAILED;
++ }
++
++ inode_num = allocate_inode(info);
++ if (inode_num == EXT4_ALLOCATE_FAILED) {
++ error("failed to allocate inode\n");
++ return EXT4_ALLOCATE_FAILED;
++ }
++
++ inode = get_inode(inode_num);
++ if (inode == NULL) {
++ error("failed to get inode %u", inode_num);
++ return EXT4_ALLOCATE_FAILED;
++ }
++
++ inode->i_mode = s.st_mode & S_IFMT;
++ inode->i_links_count = 1;
++ inode->i_flags |= aux_info.default_i_flags;
++
++ devmajor = major(s.st_rdev);
++ devminor = minor(s.st_rdev);
++
++ if ((devmajor < 256) && (devminor < 256)) {
++ inode->i_block[0] = devmajor * 256 + devminor;
++ inode->i_block[1] = 0;
++ } else {
++ inode->i_block[0] = 0;
++ inode->i_block[1] = (devminor & 0xff) | (devmajor << 8) |
++ ((devminor & ~0xff) << 12);
++ }
++
++ return inode_num;
++}
++
+ int inode_set_permissions(u32 inode_num, u16 mode, u16 uid, u16 gid, u32 mtime)
+ {
+ struct ext4_inode *inode = get_inode(inode_num);
+diff --git a/extras/ext4_utils/contents.h b/extras/ext4_utils/contents.h
+index 35867fd..b155429 100644
+--- a/extras/ext4_utils/contents.h
++++ b/extras/ext4_utils/contents.h
+@@ -36,6 +36,7 @@ u32 make_directory(u32 dir_inode_num, u32 entries, struct dentry *dentries,
+ u32 dirs);
+ u32 make_file(const char *filename, u64 len);
+ u32 make_link(const char *filename, const char *link);
++u32 make_special(const char *path);
+ int inode_set_permissions(u32 inode_num, u16 mode, u16 uid, u16 gid, u32 mtime);
+ int inode_set_selinux(u32 inode_num, const char *secon);
+ #endif
+diff --git a/extras/ext4_utils/make_ext4fs.c b/extras/ext4_utils/make_ext4fs.c
+index b2d1426..70c4284 100644
+--- a/extras/ext4_utils/make_ext4fs.c
++++ b/extras/ext4_utils/make_ext4fs.c
+@@ -70,7 +70,6 @@
+ /* TODO: Not implemented:
+ Allocating blocks in the same block group as the file inode
+ Hash or binary tree directories
+- Special files: sockets, devices, fifos
+ */
+
+ static int filter_dot(const struct dirent *d)
+@@ -259,6 +258,11 @@ static u32 build_directory_structure(const char *full_path, const char *dir_path
+ free(subdir_dir_path);
+ } else if (dentries[i].file_type == EXT4_FT_SYMLINK) {
+ entry_inode = make_link(dentries[i].full_path, dentries[i].link);
++ } else if (dentries[i].file_type == EXT4_FT_CHRDEV ||
++ dentries[i].file_type == EXT4_FT_BLKDEV ||
++ dentries[i].file_type == EXT4_FT_SOCK ||
++ dentries[i].file_type == EXT4_FT_FIFO) {
++ entry_inode = make_special(dentries[i].full_path);
+ } else {
+ error("unknown file type on %s", dentries[i].path);
+ entry_inode = 0;
+--
+2.13.6 (Apple Git-96)
+
--
2.7.4
^ permalink raw reply related [flat|nested] 10+ messages in thread* [Buildroot] [PATCH 2/2] android-tools: upport char, block, fifo, socket devices
2017-11-30 20:56 ` [Buildroot] [PATCH 2/2] android-tools: upport char, block, fifo, socket devices Keith Mok
@ 2017-12-01 12:55 ` Thomas Petazzoni
2017-12-02 6:20 ` Keith Mok
0 siblings, 1 reply; 10+ messages in thread
From: Thomas Petazzoni @ 2017-12-01 12:55 UTC (permalink / raw)
To: buildroot
Hello,
Thanks for your contributions! See below for a few comments/questions.
On Thu, 30 Nov 2017 12:56:31 -0800, Keith Mok wrote:
> Pick changes from openwrt to enable support of special
> device for make_ext4fs
Missing Signed-off-by line.
> ---
> ...ment-support-for-block-and-char-dev-nodes.patch | 109 +++++++++++++++++++++
> 1 file changed, 109 insertions(+)
> create mode 100644 package/android-tools/0009-PATCH-Implement-support-for-block-and-char-dev-nodes.patch
>
> diff --git a/package/android-tools/0009-PATCH-Implement-support-for-block-and-char-dev-nodes.patch b/package/android-tools/0009-PATCH-Implement-support-for-block-and-char-dev-nodes.patch
> new file mode 100644
> index 0000000..e86d9c6
> --- /dev/null
> +++ b/package/android-tools/0009-PATCH-Implement-support-for-block-and-char-dev-nodes.patch
> @@ -0,0 +1,109 @@
> +From 3258b175c3ea1f76823c6b69b5036ac7efb5599d Mon Sep 17 00:00:00 2001
> +From: Jo-Philipp Wich <jow@openwrt.org>
> +Date: Thu, 30 Nov 2017 10:10:24 -0800
> +Subject: [PATCH] [PATCH] Implement support for block and char dev nodes, fifos
> + and sockets.
> +
> +Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
> +Signed-off-by: Keith Mok <ek9852@gmail.com>
This really is a feature patch, and we don't like to take features
patches in Buildroot (unlike OpenWRT). Indeed, those are often a pain
to maintain over time.
Do you see any possibility of this being merged upstream? I do realize
that the upstream for android-tools is somewhat unusual, and that
getting contributions accepted might be more challenging than with
other open source projects. But still I'd like to hear about what has
been tried to push this upstream.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH 2/2] android-tools: upport char, block, fifo, socket devices
2017-12-01 12:55 ` Thomas Petazzoni
@ 2017-12-02 6:20 ` Keith Mok
2017-12-31 17:35 ` Thomas Petazzoni
0 siblings, 1 reply; 10+ messages in thread
From: Keith Mok @ 2017-12-02 6:20 UTC (permalink / raw)
To: buildroot
Wil try to submit to AOSP for [PATCH 2/2].
But for [PATCH 1/1] it is not a features batch. The debian package already
have the make_ext4fs, we ust miss the makefile in buildroot.
2017-12-01 4:55 GMT-08:00 Thomas Petazzoni <
thomas.petazzoni@free-electrons.com>:
> Hello,
>
> Thanks for your contributions! See below for a few comments/questions.
>
> On Thu, 30 Nov 2017 12:56:31 -0800, Keith Mok wrote:
> > Pick changes from openwrt to enable support of special
> > device for make_ext4fs
>
> Missing Signed-off-by line.
>
> > ---
> > ...ment-support-for-block-and-char-dev-nodes.patch | 109
> +++++++++++++++++++++
> > 1 file changed, 109 insertions(+)
> > create mode 100644 package/android-tools/0009-
> PATCH-Implement-support-for-block-and-char-dev-nodes.patch
> >
> > diff --git a/package/android-tools/0009-PATCH-Implement-support-for-block-and-char-dev-nodes.patch
> b/package/android-tools/0009-PATCH-Implement-support-for-
> block-and-char-dev-nodes.patch
> > new file mode 100644
> > index 0000000..e86d9c6
> > --- /dev/null
> > +++ b/package/android-tools/0009-PATCH-Implement-support-for-
> block-and-char-dev-nodes.patch
> > @@ -0,0 +1,109 @@
> > +From 3258b175c3ea1f76823c6b69b5036ac7efb5599d Mon Sep 17 00:00:00 2001
> > +From: Jo-Philipp Wich <jow@openwrt.org>
> > +Date: Thu, 30 Nov 2017 10:10:24 -0800
> > +Subject: [PATCH] [PATCH] Implement support for block and char dev
> nodes, fifos
> > + and sockets.
> > +
> > +Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
> > +Signed-off-by: Keith Mok <ek9852@gmail.com>
>
> This really is a feature patch, and we don't like to take features
> patches in Buildroot (unlike OpenWRT). Indeed, those are often a pain
> to maintain over time.
>
> Do you see any possibility of this being merged upstream? I do realize
> that the upstream for android-tools is somewhat unusual, and that
> getting contributions accepted might be more challenging than with
> other open source projects. But still I'd like to hear about what has
> been tried to push this upstream.
>
> Best regards,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20171201/a5a8e97c/attachment.html>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH 2/2] android-tools: upport char, block, fifo, socket devices
2017-12-02 6:20 ` Keith Mok
@ 2017-12-31 17:35 ` Thomas Petazzoni
0 siblings, 0 replies; 10+ messages in thread
From: Thomas Petazzoni @ 2017-12-31 17:35 UTC (permalink / raw)
To: buildroot
Hello,
On Fri, 1 Dec 2017 22:20:06 -0800, Keith Mok wrote:
> Wil try to submit to AOSP for [PATCH 2/2].
Have you received any feedback ?
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH 1/2] android-tools: Enable build for ext4 fsutils
2017-11-30 20:56 [Buildroot] [PATCH 1/2] android-tools: Enable build for ext4 fsutils Keith Mok
2017-11-30 20:56 ` [Buildroot] [PATCH 2/2] android-tools: upport char, block, fifo, socket devices Keith Mok
@ 2017-12-01 12:49 ` Gary Bisson
2017-12-02 6:25 ` Keith Mok
1 sibling, 1 reply; 10+ messages in thread
From: Gary Bisson @ 2017-12-01 12:49 UTC (permalink / raw)
To: buildroot
Hi Keith,
Thank you for your contribution. Please find my remark inline below.
On Thu, Nov 30, 2017 at 12:56:30PM -0800, Keith Mok wrote:
> This enable the build for make_ext4fs, simg2img, etc.
> For creating Android sparse ext4 files and extract tools (simg2img).
>
> Signed-off-by: Keith Mok <ek9852@gmail.com>
> ---
> ...ke_ext4fs-makefiles-for-out-of-tree-build.patch | 53 ++++++++++++++++++++++
> package/android-tools/Config.in | 12 +++++
> package/android-tools/Config.in.host | 6 +++
> package/android-tools/android-tools.mk | 39 +++++++++++-----
> 4 files changed, 99 insertions(+), 11 deletions(-)
> create mode 100644 package/android-tools/0008-Fix-make_ext4fs-makefiles-for-out-of-tree-build.patch
>
> diff --git a/package/android-tools/0008-Fix-make_ext4fs-makefiles-for-out-of-tree-build.patch b/package/android-tools/0008-Fix-make_ext4fs-makefiles-for-out-of-tree-build.patch
> new file mode 100644
> index 0000000..ec68c25
> --- /dev/null
> +++ b/package/android-tools/0008-Fix-make_ext4fs-makefiles-for-out-of-tree-build.patch
> @@ -0,0 +1,53 @@
> +[PATCH] Fix make_ext4fs makefiles for out-of-tree build
> +
> +Signed-off-by: Keith Mok <keith@density.io>
> +---
> + debian/makefiles/ext4_utils.mk | 11 ++++++-----
> + 1 file changed, 6 insertions(+), 5 deletions(-)
> +
> +diff --git a/debian/makefiles/ext4_utils.mk b/debian/makefiles/ext4_utils.mk
> +index cb64916..b56e27e 100644
> +--- a/debian/makefiles/ext4_utils.mk
> ++++ b/debian/makefiles/ext4_utils.mk
> +@@ -1,6 +1,7 @@
> + # Makefile for ext4_utils; based on https://heiher.info/2227.html
> + # Author: Dmitrijs Ledkovs <xnox@ubuntu.com>
> +
> ++VPATH+= $(SRCDIR)/extras/ext4_utils
> + SRCS+=make_ext4fs.c
> + SRCS+=ext4fixup.c
> + SRCS+=ext4_utils.c
> +@@ -13,7 +14,7 @@ SRCS+=sha1.c
> + SRCS+=wipe.c
> + SRCS+=crc16.c
> +
> +-VPATH+=../../core/libsparse
> ++VPATH+= $(SRCDIR)/core/libsparse
> + SRCS+= backed_block.c
> + SRCS+= sparse_crc32.c
> + SRCS+= sparse.c
> +@@ -23,6 +24,7 @@ SRCS+= output_file.c
> +
> + OBJS_SHARED:= $(SRCS:.c=.o)
> +
> ++VPATH+= $(SRCDIR)/extras/ext4_utils
> + SRCS+=make_ext4fs_main.c
> + SRCS+=ext4fixup_main.c
> + SRCS+=setup_fs.c
> +@@ -31,10 +33,9 @@ SRCS+=img2simg.c
> + SRCS+=simg2img.c
> + SRCS+=simg2simg.c
> +
> +-CPPFLAGS+= -I.
> +-CPPFLAGS+= -I/usr/include
> +-CPPFLAGS+= -I../../core/include
> +-CPPFLAGS+= -I../../core/libsparse/include/
> ++CPPFLAGS+= -I$(SRCDIR)/core/include
> ++CPPFLAGS+= -I$(SRCDIR)/extras/ext4_utils/
> ++CPPFLAGS+= -I$(SRCDIR)/core/libsparse/include/
> +
> + LIBS+= -lz -lselinux
> +
> +--
> +2.13.6 (Apple Git-96)
> +
> diff --git a/package/android-tools/Config.in b/package/android-tools/Config.in
> index 96e36e6..6697d45 100644
> --- a/package/android-tools/Config.in
> +++ b/package/android-tools/Config.in
> @@ -75,6 +75,18 @@ config BR2_PACKAGE_ANDROID_TOOLS_ADBD
> target, which can be used to interact with a host machine
> implementing the ADB protocol.
>
> +config BR2_PACKAGE_ANDROID_TOOLS_EXT4_UTILS
> + bool "ext4-utils"
> + depends on BR2_TOOLCHAIN_HAS_THREADS # libselinux
> + depends on !BR2_STATIC_LIBS # libselinux
> + depends on BR2_TOOLCHAIN_USES_GLIBC # libselinux
> + depends on !BR2_arc # libselinux
> + select BR2_PACKAGE_LIBSELINUX
> + select BR2_PACKAGE_ZLIB
> + help
> + This option will build and install the ext4 utility for the
> + host, which can be used to build sparse/extract ext4 image.
> +
There should be a comment here to explain all the dependencies. It is
required when the dependencies are not met, so the user knows about it.
You can have a look at the fasboot comment as an example (should be more
or less the same).
Other than that, the series looks good!
Thanks,
Gary
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH 1/2] android-tools: Enable build for ext4 fsutils
2017-12-01 12:49 ` [Buildroot] [PATCH 1/2] android-tools: Enable build for ext4 fsutils Gary Bisson
@ 2017-12-02 6:25 ` Keith Mok
2017-12-04 11:23 ` Gary Bisson
0 siblings, 1 reply; 10+ messages in thread
From: Keith Mok @ 2017-12-02 6:25 UTC (permalink / raw)
To: buildroot
Basically depends on BR2_PACKAGE_LIBSELINUX.
But BR2_PACKAGE_LIBSELINUX depends on BR2_TOOLCHAIN_HAS_THREADS
BR2_STATIC_LIBS BR2_TOOLCHAIN_USES_GLIBC BR2_arc
Those dependency are just copied from FASTBOOT.
Thanks,
Keith
2017-12-01 4:49 GMT-08:00 Gary Bisson <gary.bisson@boundarydevices.com>:
> Hi Keith,
>
> Thank you for your contribution. Please find my remark inline below.
>
> On Thu, Nov 30, 2017 at 12:56:30PM -0800, Keith Mok wrote:
> > This enable the build for make_ext4fs, simg2img, etc.
> > For creating Android sparse ext4 files and extract tools (simg2img).
> >
> > Signed-off-by: Keith Mok <ek9852@gmail.com>
> > ---
> > ...ke_ext4fs-makefiles-for-out-of-tree-build.patch | 53
> ++++++++++++++++++++++
> > package/android-tools/Config.in | 12 +++++
> > package/android-tools/Config.in.host | 6 +++
> > package/android-tools/android-tools.mk | 39
> +++++++++++-----
> > 4 files changed, 99 insertions(+), 11 deletions(-)
> > create mode 100644 package/android-tools/0008-
> Fix-make_ext4fs-makefiles-for-out-of-tree-build.patch
> >
> > diff --git a/package/android-tools/0008-Fix-make_ext4fs-makefiles-for-out-of-tree-build.patch
> b/package/android-tools/0008-Fix-make_ext4fs-makefiles-for-
> out-of-tree-build.patch
> > new file mode 100644
> > index 0000000..ec68c25
> > --- /dev/null
> > +++ b/package/android-tools/0008-Fix-make_ext4fs-makefiles-for-
> out-of-tree-build.patch
> > @@ -0,0 +1,53 @@
> > +[PATCH] Fix make_ext4fs makefiles for out-of-tree build
> > +
> > +Signed-off-by: Keith Mok <keith@density.io>
> > +---
> > + debian/makefiles/ext4_utils.mk | 11 ++++++-----
> > + 1 file changed, 6 insertions(+), 5 deletions(-)
> > +
> > +diff --git a/debian/makefiles/ext4_utils.mk b/debian/makefiles/
> ext4_utils.mk
> > +index cb64916..b56e27e 100644
> > +--- a/debian/makefiles/ext4_utils.mk
> > ++++ b/debian/makefiles/ext4_utils.mk
> > +@@ -1,6 +1,7 @@
> > + # Makefile for ext4_utils; based on https://heiher.info/2227.html
> > + # Author: Dmitrijs Ledkovs <xnox@ubuntu.com>
> > +
> > ++VPATH+= $(SRCDIR)/extras/ext4_utils
> > + SRCS+=make_ext4fs.c
> > + SRCS+=ext4fixup.c
> > + SRCS+=ext4_utils.c
> > +@@ -13,7 +14,7 @@ SRCS+=sha1.c
> > + SRCS+=wipe.c
> > + SRCS+=crc16.c
> > +
> > +-VPATH+=../../core/libsparse
> > ++VPATH+= $(SRCDIR)/core/libsparse
> > + SRCS+= backed_block.c
> > + SRCS+= sparse_crc32.c
> > + SRCS+= sparse.c
> > +@@ -23,6 +24,7 @@ SRCS+= output_file.c
> > +
> > + OBJS_SHARED:= $(SRCS:.c=.o)
> > +
> > ++VPATH+= $(SRCDIR)/extras/ext4_utils
> > + SRCS+=make_ext4fs_main.c
> > + SRCS+=ext4fixup_main.c
> > + SRCS+=setup_fs.c
> > +@@ -31,10 +33,9 @@ SRCS+=img2simg.c
> > + SRCS+=simg2img.c
> > + SRCS+=simg2simg.c
> > +
> > +-CPPFLAGS+= -I.
> > +-CPPFLAGS+= -I/usr/include
> > +-CPPFLAGS+= -I../../core/include
> > +-CPPFLAGS+= -I../../core/libsparse/include/
> > ++CPPFLAGS+= -I$(SRCDIR)/core/include
> > ++CPPFLAGS+= -I$(SRCDIR)/extras/ext4_utils/
> > ++CPPFLAGS+= -I$(SRCDIR)/core/libsparse/include/
> > +
> > + LIBS+= -lz -lselinux
> > +
> > +--
> > +2.13.6 (Apple Git-96)
> > +
> > diff --git a/package/android-tools/Config.in b/package/android-tools/
> Config.in
> > index 96e36e6..6697d45 100644
> > --- a/package/android-tools/Config.in
> > +++ b/package/android-tools/Config.in
> > @@ -75,6 +75,18 @@ config BR2_PACKAGE_ANDROID_TOOLS_ADBD
> > target, which can be used to interact with a host machine
> > implementing the ADB protocol.
> >
> > +config BR2_PACKAGE_ANDROID_TOOLS_EXT4_UTILS
> > + bool "ext4-utils"
> > + depends on BR2_TOOLCHAIN_HAS_THREADS # libselinux
> > + depends on !BR2_STATIC_LIBS # libselinux
> > + depends on BR2_TOOLCHAIN_USES_GLIBC # libselinux
> > + depends on !BR2_arc # libselinux
> > + select BR2_PACKAGE_LIBSELINUX
> > + select BR2_PACKAGE_ZLIB
> > + help
> > + This option will build and install the ext4 utility for the
> > + host, which can be used to build sparse/extract ext4 image.
> > +
>
> There should be a comment here to explain all the dependencies. It is
> required when the dependencies are not met, so the user knows about it.
>
> You can have a look at the fasboot comment as an example (should be more
> or less the same).
>
> Other than that, the series looks good!
>
> Thanks,
> Gary
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20171201/0872e305/attachment.html>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH 1/2] android-tools: Enable build for ext4 fsutils
2017-12-02 6:25 ` Keith Mok
@ 2017-12-04 11:23 ` Gary Bisson
2017-12-05 17:21 ` Keith Mok
0 siblings, 1 reply; 10+ messages in thread
From: Gary Bisson @ 2017-12-04 11:23 UTC (permalink / raw)
To: buildroot
Hi Keith,
On Fri, Dec 01, 2017 at 10:25:05PM -0800, Keith Mok wrote:
> Basically depends on BR2_PACKAGE_LIBSELINUX.
> But BR2_PACKAGE_LIBSELINUX depends on BR2_TOOLCHAIN_HAS_THREADS
> BR2_STATIC_LIBS BR2_TOOLCHAIN_USES_GLIBC BR2_arc
> Those dependency are just copied from FASTBOOT.
Yes the 'depends' are ok, no problem there, but a 'comment' section is
missing. See under the fastboot 'config' section [1].
Regards,
Gary
[1] https://git.buildroot.net/buildroot/tree/package/android-tools/Config.in#n49
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH 1/2] android-tools: Enable build for ext4 fsutils
2017-12-04 11:23 ` Gary Bisson
@ 2017-12-05 17:21 ` Keith Mok
2017-12-31 17:35 ` Thomas Petazzoni
0 siblings, 1 reply; 10+ messages in thread
From: Keith Mok @ 2017-12-05 17:21 UTC (permalink / raw)
To: buildroot
Just sync with Google, that they are removed make_ext4fs in internal
branch. and merge Android specific things into e2fsprogs.
So we possibly no need this anymore.
Thanks,
Keith
2017-12-04 5:23 GMT-06:00 Gary Bisson <gary.bisson@boundarydevices.com>:
> Hi Keith,
>
> On Fri, Dec 01, 2017 at 10:25:05PM -0800, Keith Mok wrote:
> > Basically depends on BR2_PACKAGE_LIBSELINUX.
> > But BR2_PACKAGE_LIBSELINUX depends on BR2_TOOLCHAIN_HAS_THREADS
> > BR2_STATIC_LIBS BR2_TOOLCHAIN_USES_GLIBC BR2_arc
> > Those dependency are just copied from FASTBOOT.
>
> Yes the 'depends' are ok, no problem there, but a 'comment' section is
> missing. See under the fastboot 'config' section [1].
>
> Regards,
> Gary
>
> [1] https://git.buildroot.net/buildroot/tree/package/
> android-tools/Config.in#n49
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20171205/9c97b44a/attachment.html>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH 1/2] android-tools: Enable build for ext4 fsutils
2017-12-05 17:21 ` Keith Mok
@ 2017-12-31 17:35 ` Thomas Petazzoni
0 siblings, 0 replies; 10+ messages in thread
From: Thomas Petazzoni @ 2017-12-31 17:35 UTC (permalink / raw)
To: buildroot
Hello,
On Tue, 5 Dec 2017 11:21:13 -0600, Keith Mok wrote:
> Just sync with Google, that they are removed make_ext4fs in internal
> branch. and merge Android specific things into e2fsprogs.
> So we possibly no need this anymore.
OK, so I've marked your patch as "Rejected" in our patch tracking
system. If a patch is still needed, please resend a new version.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2017-12-31 17:35 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-30 20:56 [Buildroot] [PATCH 1/2] android-tools: Enable build for ext4 fsutils Keith Mok
2017-11-30 20:56 ` [Buildroot] [PATCH 2/2] android-tools: upport char, block, fifo, socket devices Keith Mok
2017-12-01 12:55 ` Thomas Petazzoni
2017-12-02 6:20 ` Keith Mok
2017-12-31 17:35 ` Thomas Petazzoni
2017-12-01 12:49 ` [Buildroot] [PATCH 1/2] android-tools: Enable build for ext4 fsutils Gary Bisson
2017-12-02 6:25 ` Keith Mok
2017-12-04 11:23 ` Gary Bisson
2017-12-05 17:21 ` Keith Mok
2017-12-31 17:35 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox