diff mbox series

[v2] package/zerofree: new package

Message ID 20220625141223.26460-1-vincent.stehle@laposte.net
State Superseded
Headers show
Series [v2] package/zerofree: new package | expand

Commit Message

Vincent Stehlé June 25, 2022, 2:12 p.m. UTC
zerofree is a utility which scans the free blocks in an ext2 filesystem and
fills any non-zero blocks with zeroes.

https://frippery.org/uml/

Signed-off-by: Vincent Stehlé <vincent.stehle@laposte.net>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---


Hi,

This is a follow-up to my first attempt[1] at packaging zerofree.
The good news is that it now builds with all libc flavours, including musl.
Do not hesitate to send any feedback.

Best regards,
Vincent.

Changes in v2:
- Use a workaround to allow building with musl.

[1]: https://lists.buildroot.org/pipermail/buildroot/2022-March/639794.html


 DEVELOPERS                     |  1 +
 package/Config.in              |  1 +
 package/zerofree/Config.in     | 13 +++++++++++++
 package/zerofree/zerofree.hash |  3 +++
 package/zerofree/zerofree.mk   | 27 +++++++++++++++++++++++++++
 5 files changed, 45 insertions(+)
 create mode 100644 package/zerofree/Config.in
 create mode 100644 package/zerofree/zerofree.hash
 create mode 100644 package/zerofree/zerofree.mk

Comments

Julien Olivain June 26, 2022, 10:43 a.m. UTC | #1
Hi Vincent, All,

I successfully tested your package.

For info, I tested on master at a0bf877, with commands:

     make check-package
     ...
     0 warnings generated

     ./utils/test-pkg -a -p zerofree
     ...
     44 builds, 3 skipped, 0 build failed, 0 legal-info failed, 0 
show-info failed

And also tested the package in qemu_aarch64_virt_defconfig.

On 25/06/2022 16:12, Vincent Stehlé via buildroot wrote:
> zerofree is a utility which scans the free blocks in an ext2 filesystem 
> and
> fills any non-zero blocks with zeroes.
> 
> https://frippery.org/uml/
> 
> Signed-off-by: Vincent Stehlé <vincent.stehle@laposte.net>

Tested-by: Julien Olivain <ju.o@free.fr>

> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
> 
> 
> Hi,
> 
> This is a follow-up to my first attempt[1] at packaging zerofree.
> The good news is that it now builds with all libc flavours, including 
> musl.
> Do not hesitate to send any feedback.
> 
> Best regards,
> Vincent.
> 
> Changes in v2:
> - Use a workaround to allow building with musl.
> 
> [1]: 
> https://lists.buildroot.org/pipermail/buildroot/2022-March/639794.html
> 
> 
>  DEVELOPERS                     |  1 +
>  package/Config.in              |  1 +
>  package/zerofree/Config.in     | 13 +++++++++++++
>  package/zerofree/zerofree.hash |  3 +++
>  package/zerofree/zerofree.mk   | 27 +++++++++++++++++++++++++++
>  5 files changed, 45 insertions(+)
>  create mode 100644 package/zerofree/Config.in
>  create mode 100644 package/zerofree/zerofree.hash
>  create mode 100644 package/zerofree/zerofree.mk
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index fc329fec27..e74e02b821 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -2918,6 +2918,7 @@ F:	configs/uevm5432_defconfig
>  F:	package/i7z/
>  F:	package/msr-tools/
>  F:	package/pixz/
> +F:	package/zerofree/
> 
>  N:	Vinicius Tinti <viniciustinti@gmail.com>
>  F:	package/python-thrift/
> diff --git a/package/Config.in b/package/Config.in
> index f09da05be0..5ab03016e8 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -237,6 +237,7 @@ menu "Filesystem and flash utilities"
>  	source "package/udftools/Config.in"
>  	source "package/unionfs/Config.in"
>  	source "package/xfsprogs/Config.in"
> +	source "package/zerofree/Config.in"
>  	source "package/zfs/Config.in"
>  endmenu
> 
> diff --git a/package/zerofree/Config.in b/package/zerofree/Config.in
> new file mode 100644
> index 0000000000..2ce2901a27
> --- /dev/null
> +++ b/package/zerofree/Config.in
> @@ -0,0 +1,13 @@
> +config BR2_PACKAGE_ZEROFREE
> +	bool "zerofree"
> +	depends on BR2_USE_MMU # e2fsprogs
> +	depends on !BR2_STATIC_LIBS
> +	select BR2_PACKAGE_E2FSPROGS
> +	help
> +	  zerofree is a utility which scans the free blocks in an ext2
> +	  filesystem and fills any non-zero blocks with zeroes.
> +
> +	  https://frippery.org/uml/
> +
> +comment "zerofree needs MMU and dynamic library"
> +	depends on !BR2_USE_MMU || BR2_STATIC_LIBS
> diff --git a/package/zerofree/zerofree.hash 
> b/package/zerofree/zerofree.hash
> new file mode 100644
> index 0000000000..3399611787
> --- /dev/null
> +++ b/package/zerofree/zerofree.hash
> @@ -0,0 +1,3 @@
> +# Locally calculated
> +sha256
> 956bc861b55ba0a2b7593c58d32339dab1a0e7da6ea2b813d27c80f08b723867
> zerofree-1.1.1.tgz
> +sha256
> 90daae00475a992a367da5b0658469a5d1c4449dbbe964c5b7246e1aec92f491
> COPYING
> diff --git a/package/zerofree/zerofree.mk 
> b/package/zerofree/zerofree.mk
> new file mode 100644
> index 0000000000..ca5a019de7
> --- /dev/null
> +++ b/package/zerofree/zerofree.mk
> @@ -0,0 +1,27 @@
> +################################################################################
> +#
> +# zerofree
> +#
> +################################################################################
> +
> +ZEROFREE_VERSION = 1.1.1
> +ZEROFREE_SOURCE = zerofree-$(ZEROFREE_VERSION).tgz
> +ZEROFREE_SITE = https://frippery.org/uml
> +ZEROFREE_LICENSE = GPL-2.0
> +ZEROFREE_LICENSE_FILE = COPYING
> +ZEROFREE_DEPENDENCIES = e2fsprogs
> +
> +# We use the same workaround as in https://bugs.gentoo.org/716136
> +# to build with musl.
> +ZEROFREE_CFLAGS = $(TARGET_CFLAGS) \
> +	$(if $(BR2_TOOLCHAIN_USES_MUSL),-DHAVE_SYS_TYPES_H) # dev_t
> +
> +define ZEROFREE_BUILD_CMDS
> +	$(MAKE) CC="$(TARGET_CC)" CFLAGS="$(ZEROFREE_CFLAGS)" -C $(@D) all
> +endef
> +
> +define ZEROFREE_INSTALL_TARGET_CMDS
> +	$(INSTALL) -D -m 0755 $(@D)/zerofree $(TARGET_DIR)/usr/bin
> +endef
> +
> +$(eval $(generic-package))
> --
> 2.35.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

Thanks!

Julien.
diff mbox series

Patch

diff --git a/DEVELOPERS b/DEVELOPERS
index fc329fec27..e74e02b821 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2918,6 +2918,7 @@  F:	configs/uevm5432_defconfig
 F:	package/i7z/
 F:	package/msr-tools/
 F:	package/pixz/
+F:	package/zerofree/
 
 N:	Vinicius Tinti <viniciustinti@gmail.com>
 F:	package/python-thrift/
diff --git a/package/Config.in b/package/Config.in
index f09da05be0..5ab03016e8 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -237,6 +237,7 @@  menu "Filesystem and flash utilities"
 	source "package/udftools/Config.in"
 	source "package/unionfs/Config.in"
 	source "package/xfsprogs/Config.in"
+	source "package/zerofree/Config.in"
 	source "package/zfs/Config.in"
 endmenu
 
diff --git a/package/zerofree/Config.in b/package/zerofree/Config.in
new file mode 100644
index 0000000000..2ce2901a27
--- /dev/null
+++ b/package/zerofree/Config.in
@@ -0,0 +1,13 @@ 
+config BR2_PACKAGE_ZEROFREE
+	bool "zerofree"
+	depends on BR2_USE_MMU # e2fsprogs
+	depends on !BR2_STATIC_LIBS
+	select BR2_PACKAGE_E2FSPROGS
+	help
+	  zerofree is a utility which scans the free blocks in an ext2
+	  filesystem and fills any non-zero blocks with zeroes.
+
+	  https://frippery.org/uml/
+
+comment "zerofree needs MMU and dynamic library"
+	depends on !BR2_USE_MMU || BR2_STATIC_LIBS
diff --git a/package/zerofree/zerofree.hash b/package/zerofree/zerofree.hash
new file mode 100644
index 0000000000..3399611787
--- /dev/null
+++ b/package/zerofree/zerofree.hash
@@ -0,0 +1,3 @@ 
+# Locally calculated
+sha256  956bc861b55ba0a2b7593c58d32339dab1a0e7da6ea2b813d27c80f08b723867  zerofree-1.1.1.tgz
+sha256  90daae00475a992a367da5b0658469a5d1c4449dbbe964c5b7246e1aec92f491  COPYING
diff --git a/package/zerofree/zerofree.mk b/package/zerofree/zerofree.mk
new file mode 100644
index 0000000000..ca5a019de7
--- /dev/null
+++ b/package/zerofree/zerofree.mk
@@ -0,0 +1,27 @@ 
+################################################################################
+#
+# zerofree
+#
+################################################################################
+
+ZEROFREE_VERSION = 1.1.1
+ZEROFREE_SOURCE = zerofree-$(ZEROFREE_VERSION).tgz
+ZEROFREE_SITE = https://frippery.org/uml
+ZEROFREE_LICENSE = GPL-2.0
+ZEROFREE_LICENSE_FILE = COPYING
+ZEROFREE_DEPENDENCIES = e2fsprogs
+
+# We use the same workaround as in https://bugs.gentoo.org/716136
+# to build with musl.
+ZEROFREE_CFLAGS = $(TARGET_CFLAGS) \
+	$(if $(BR2_TOOLCHAIN_USES_MUSL),-DHAVE_SYS_TYPES_H) # dev_t
+
+define ZEROFREE_BUILD_CMDS
+	$(MAKE) CC="$(TARGET_CC)" CFLAGS="$(ZEROFREE_CFLAGS)" -C $(@D) all
+endef
+
+define ZEROFREE_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/zerofree $(TARGET_DIR)/usr/bin
+endef
+
+$(eval $(generic-package))