Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/partclone: new package
@ 2025-07-12 15:30 Matt Silva
  0 siblings, 0 replies; 3+ messages in thread
From: Matt Silva @ 2025-07-12 15:30 UTC (permalink / raw)
  To: buildroot; +Cc: Thomas Petazzoni, Matt Silva

Partclone provides utilities to back up and restore used blocks of a
partition and it is designed for higher compatibility of the file system
by using existing libraries.

Signed-off-by: Matt Silva <dev@matt-silva.com>
---
 package/Config.in                |   1 +
 package/partclone/Config.in      |  84 ++++++++++++++++++++++++
 package/partclone/partclone.hash |   6 ++
 package/partclone/partclone.mk   | 106 +++++++++++++++++++++++++++++++
 4 files changed, 197 insertions(+)
 create mode 100644 package/partclone/Config.in
 create mode 100644 package/partclone/partclone.hash
 create mode 100644 package/partclone/partclone.mk

diff --git a/package/Config.in b/package/Config.in
index 9a841082c6..23436e751f 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -244,6 +244,7 @@ menu "Filesystem and flash utilities"
 	source "package/nfs-utils/Config.in"
 	source "package/nilfs-utils/Config.in"
 	source "package/ntfs-3g/Config.in"
+	source "package/partclone/Config.in"
 	source "package/sp-oops-extract/Config.in"
 	source "package/squashfs/Config.in"
 	source "package/sshfs/Config.in"
diff --git a/package/partclone/Config.in b/package/partclone/Config.in
new file mode 100644
index 0000000000..83ebfa1213
--- /dev/null
+++ b/package/partclone/Config.in
@@ -0,0 +1,84 @@
+config BR2_PACKAGE_PARTCLONE
+	bool "partclone"
+	select BR2_PACKAGE_OPENSSL
+	help
+	  Partclone provides utilities to backup a partition smartly and
+	  it is designed for higher compatibility of the file system by
+	  using existing library.
+
+	  https://github.com/Thomas-Tsai/partclone
+
+if BR2_PACKAGE_PARTCLONE
+
+config BR2_PACKAGE_PARTCLONE_FAT
+	bool "fat"
+	help
+	  Include support for the FAT filesystem
+
+config BR2_PACKAGE_PARTCLONE_EXFAT
+	bool "exfat"
+	select BR2_PACKAGE_EXFATPROGS
+	help
+	  Include support for the exFAT filesystem
+
+config BR2_PACKAGE_PARTCLONE_EXT
+	bool "ext"
+	select BR2_PACKAGE_E2FSPROGS
+	help
+	  Include support for the ext2/3/4 filesystems
+
+config BR2_PACKAGE_PARTCLONE_NTFS
+	bool "ntfs"
+	select BR2_PACKAGE_NTFS_3G
+	help
+	  Include support for the NTFS filesystem
+
+config BR2_PACKAGE_PARTCLONE_XFS
+	bool "xfs"
+	depends on BR2_PACKAGE_XFSPROGS
+	help
+	  Include support for the XFS filesystem
+
+comment "xfs support depends on xfsprogs"
+	depends on !BR2_PACKAGE_XFSPROGS
+
+config BR2_PACKAGE_PARTCLONE_BTRFS
+	bool "btrfs"
+	select BR2_PACKAGE_BTRFS_PROGS
+	help
+	  Include support for the BTRFS filesystem
+
+config BR2_PACKAGE_PARTCLONE_F2FS
+	bool "f2fs"
+	select BR2_PACKAGE_F2FS_TOOLS
+	help
+	  Include support for the F2FS filesystem
+
+config BR2_PACKAGE_PARTCLONE_HFSP
+	bool "hfsp"
+	help
+	  Include support for the HFS Plus filesystem
+
+config BR2_PACKAGE_PARTCLONE_FUSE
+	bool "fuse"
+	select BR2_PACKAGE_LIBFUSE
+	help
+	  Include FUSE support
+
+config BR2_PACKAGE_PARTCLONE_MINIX
+	bool "minix"
+	help
+	  Include support for the Minix filesystem
+
+config BR2_PACKAGE_PARTCLONE_APFS
+	bool "apfs"
+	help
+	  Include support for the APFS filesystem
+
+config BR2_PACKAGE_PARTCLONE_NILFS2
+	bool "nilfs2"
+	select BR2_PACKAGE_NILFS_UTILS
+	help
+	  Include support for the NILFS2 filesystem
+
+endif
diff --git a/package/partclone/partclone.hash b/package/partclone/partclone.hash
new file mode 100644
index 0000000000..b73883d3fd
--- /dev/null
+++ b/package/partclone/partclone.hash
@@ -0,0 +1,6 @@
+# locally caluclated
+sha256  b7e35a01331a05ec44133f2ec4a097ffb3c005653c0b601279b18dea55ef3b0f  partclone-0.3.37.tar.gz
+
+# license files, locally calculated
+sha256  5380427a1d822444a47a742cf47f5fffbe89519da037c1b150a897c968ed355e  AUTHORS
+sha256  8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  COPYING
diff --git a/package/partclone/partclone.mk b/package/partclone/partclone.mk
new file mode 100644
index 0000000000..15d3c7b1fb
--- /dev/null
+++ b/package/partclone/partclone.mk
@@ -0,0 +1,106 @@
+################################################################################
+#
+# partclone
+#
+################################################################################
+
+PARTCLONE_VERSION = 0.3.37
+PARTCLONE_SITE = $(call github,Thomas-Tsai,partclone,$(PARTCLONE_VERSION))
+PARTCLONE_LICENSE = GPL-2.0+
+PARTCLONE_LICENSE_FILES = AUTHORS COPYING
+
+PARTCLONE_DEPENDENCIES = openssl
+
+# The following features are not supported as they have dependencies that aren't
+# in buildroot:
+#  --enable_reiserfs
+#  --enable_reiser4
+#  --enable_ufs: there is an existing "ufs-utils" package in buildroot; however,
+#                that package is for "Universal Flash Storage" devices, and the
+#                package partclone requires is for "Unix File System"
+#  --enable_vmfs
+#  --enable_jfs
+
+ifeq ($(BR2_PACKAGE_PARTCLONE_FAT),y)
+PARTCLONE_CONF_OPTS += --enable-fat
+else
+PARTCLONE_CONF_OPTS += --disable-fat
+endif
+
+ifeq ($(BR2_PACKAGE_PARTCLONE_EXFAT),y)
+PARTCLONE_DEPENDENCIES += exfatprogs
+PARTCLONE_CONF_OPTS += --enable-exfat
+else
+PARTCLONE_CONF_OPTS += --disable-exfat
+endif
+
+ifeq ($(BR2_PACKAGE_PARTCLONE_EXT),y)
+PARTCLONE_DEPENDENCIES += e2fsprogs
+PARTCLONE_CONF_OPTS += --enable-extfs
+else
+PARTCLONE_CONF_OPTS += --disable-extfs
+endif
+
+ifeq ($(BR2_PACKAGE_PARTCLONE_NTFS),y)
+PARTCLONE_DEPENDENCIES += ntfs-3g
+PARTCLONE_CONF_OPTS += --enable-ntfs
+else
+PARTCLONE_CONF_OPTS += --disable-ntfs
+endif
+
+ifeq ($(BR2_PACKAGE_PARTCLONE_XFS),y)
+PARTCLONE_DEPENDENCIES += xfsprogs
+PARTCLONE_CONF_OPTS += --enable-xfs
+else
+PARTCLONE_CONF_OPTS += --disable-xfs
+endif
+
+ifeq ($(BR2_PACKAGE_PARTCLONE_BTRFS),y)
+PARTCLONE_DEPENDENCIES += btrfs-progs
+PARTCLONE_CONF_OPTS += --enable-btrfs
+else
+PARTCLONE_CONF_OPTS += --disable-brtfs
+endif
+
+ifeq ($(BR2_PACKAGE_PARTCLONE_F2FS),y)
+PARTCLONE_DEPENDENCIES += f2fs-tools
+PARTCLONE_CONF_OPTS += --enable-f2fs
+else
+PARTCLONE_CONF_OPTS += --disable-f2fs
+endif
+
+ifeq ($(BR2_PACKAGE_PARTCLONE_HFSP),y)
+PARTCLONE_CONF_OPTS += --enable-hfsp
+else
+PARTCLONE_CONF_OPTS += --disable-hfsp
+endif
+
+ifeq ($(BR2_PACKAGE_PARTCLONE_FUSE),y)
+PARTCLONE_DEPENDENCIES += libfuse
+PARTCLONE_CONF_OPTS += --enable-fuse
+else
+PARTCLONE_CONF_OPTS += --disable-fuse
+endif
+
+ifeq ($(BR2_PACKAGE_PARTCLONE_MINIX),y)
+PARTCLONE_CONF_OPTS += --enable-minix
+else
+PARTCLONE_CONF_OPTS += --disable-minix
+endif
+
+ifeq ($(BR2_PACKAGE_PARTCLONE_APFS),y)
+PARTCLONE_CONF_OPTS += --enable-apfs
+else
+PARTCLONE_CONF_OPTS += --disable-apfs
+endif
+
+ifeq ($(BR2_PACKAGE_PARTCLONE_NILFS2),y)
+PARTCLONE_DEPENDENCIES += nilfs-utils
+PARTCLONE_CONF_OPTS += --enable-nilfs2
+else
+PARTCLONE_CONF_OPTS += --disable-nilfs2
+endif
+
+PARTCLONE_AUTORECONF = YES
+
+$(eval $(autotools-package))
-- 
2.50.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/partclone: new package
@ 2026-03-19 10:05 Dowan GULLIENT via buildroot
  2026-05-13  0:14 ` Matthew Silva
  0 siblings, 1 reply; 3+ messages in thread
From: Dowan GULLIENT via buildroot @ 2026-03-19 10:05 UTC (permalink / raw)
  To: buildroot; +Cc: dev


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

Hi Matt,

I have reviewed and tested your patch using the utils/test-pkg script,
built it with make partclone and ran it on qemu.
The package works well on most architectures after the fix, but I found a
few issues that need to be addressed in a v2:

1. Architecture dependency:
The build fails on no-MMU platforms (like ARMv7-M) because partclone
depends  on util-linux (libuuid) which requires pthread_atfork, which is
unavailable there.
Please add "depends on BR2_USE_MMU" in Config.in.

2. Missing dependencies:

   - In Config.in: You need to select BR2_PACKAGE_UTIL_LINUX and
   -   BR2_PACKAGE_UTIL_LINUX_LIBUUID to ensure the uuid.pc pkg-config file
   is  generated and installed in the staging directory
   - In partclone.mk: Add host-pkgconf and util-linux to
   PARTCLONE_DEPENDENCIES.

3. Verify the dependency propagation :
Kconfig does not support propagation of dependances, so in config.in you
might have to add "depends on ..." to all the dependencies that require it,
here is few examples but I did not verified all of them :

Complete
"   select BR2_PACKAGE_NTFS_3G"
with
"   depends on BR2_USE_WCHAR
    depends on BR2_TOOLCHAIN_HAS_THREADS
    depends on BR2_USE_MMU
    depends on !BR2_STATIC_LIBS
    select BR2_PACKAGE_NTFS_3G"

and modify
"   depends on BR2_PACKAGE_XFSPROGS"
with
"   depends on BR2_PACKAGE_LIBURCU_ARCH_SUPPORTS # xfsprogs
    depends on BR2_USE_MMU # xfsprogs
    depends on BR2_TOOLCHAIN_HAS_THREADS # xfsprogs
    depends on BR2_INSTALL_LIBSTDCPP # xfsprogs
    depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_9 # xfsprogs
    select BR2_PACKAGE_XFSPROGS"

That way you will not break the package if you select those features and
the user only have to select one option.

4. Small typo:
In partclone.mk, --disable-brtfs should be --disable-btrfs.

With these changes, the package passes all 6 toolchains in test-pkg.
Once you send a v2, I'll be happy to provide my "Tested-by" tag.

5. Additional details:
There was a few additional details to improve the patch:

   - PARTCLONE_AUTORECONF = YES : maybe explain why this option is
   mandatory ?
   - Verify that the license of the package is correct
   - BR2_PACKAGE_OPENSSL : you probably used the default libopenssl
   provider but does it work with wolfSSL, LibreSSL, ... or we have to limit
   the usage to libopenssl ?
   - You can include “The following features are not supported ...” in the
   commit message instead of the makefile


Best regards,
Dowan

[-- Attachment #1.2: Type: text/html, Size: 3905 bytes --]

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

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2026-05-13  0:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-12 15:30 [Buildroot] [PATCH 1/1] package/partclone: new package Matt Silva
  -- strict thread matches above, loose matches on Subject: below --
2026-03-19 10:05 Dowan GULLIENT via buildroot
2026-05-13  0:14 ` Matthew Silva

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