diff --git a/hardware/disk/libblockdev/actions.py b/hardware/disk/libblockdev/actions.py index cba50c4ba0..6b4730cf2c 100644 --- a/hardware/disk/libblockdev/actions.py +++ b/hardware/disk/libblockdev/actions.py @@ -9,17 +9,19 @@ from pisi.actionsapi import pisitools from pisi.actionsapi import shelltools from pisi.actionsapi import get -shelltools.export("python2", "/usr/bin/python2.7") +# shelltools.export("python2", "/usr/bin/python2.7") def setup(): # shelltools.system("sed 's/g_memdup/&2/' -i \ # src/lib/plugin_apis/vdo.{c,api} \ # src/plugins/vdo.c") - shelltools.system("sh ./autogen.sh") - shelltools.system("sed -i 's|python2-config|python2.7-config|g' configure") + # shelltools.system("sh ./autogen.sh") + autotools.autoreconf("-ivf") + # shelltools.system("sed -i 's|python2-config|python2.7-config|g' configure") autotools.configure("--without-gtk-doc \ --without-nvdimm \ + --with-python3 \ --without-dm") pisitools.dosed("libtool", " -shared ", " -Wl,-O1,--as-needed -shared ") diff --git a/hardware/disk/libblockdev/files/aefd677.patch b/hardware/disk/libblockdev/files/aefd677.patch new file mode 100644 index 0000000000..05037d60c2 --- /dev/null +++ b/hardware/disk/libblockdev/files/aefd677.patch @@ -0,0 +1,160 @@ +diff --git a/src/plugins/fs/generic.c b/src/plugins/fs/generic.c +index 4406d5c..075af7e 100644 +--- a/src/plugins/fs/generic.c ++++ b/src/plugins/fs/generic.c +@@ -229,7 +229,7 @@ const BDFSInfo fs_info[BD_FS_LAST_FS] = { + .repair_util = "ntfsfix", + .resize_util = "ntfsresize", + .label_util = "ntfslabel", +- .info_util = "ntfscluster", ++ .info_util = "ntfsinfo", + .uuid_util = "ntfslabel" }, + /* F2FS */ + { .type = "f2fs", +diff --git a/src/plugins/fs/ntfs.c b/src/plugins/fs/ntfs.c +index 517d1cf..1aa503c 100644 +--- a/src/plugins/fs/ntfs.c ++++ b/src/plugins/fs/ntfs.c +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + + #include "ntfs.h" + #include "fs.h" +@@ -36,8 +37,8 @@ static GMutex deps_check_lock; + #define DEPS_NTFSRESIZE_MASK (1 << DEPS_NTFSRESIZE) + #define DEPS_NTFSLABEL 3 + #define DEPS_NTFSLABEL_MASK (1 << DEPS_NTFSLABEL) +-#define DEPS_NTFSCLUSTER 4 +-#define DEPS_NTFSCLUSTER_MASK (1 << DEPS_NTFSCLUSTER) ++#define DEPS_NTFSINFO 4 ++#define DEPS_NTFSINFO_MASK (1 << DEPS_NTFSINFO) + + #define DEPS_LAST 5 + +@@ -46,7 +47,7 @@ static const UtilDep deps[DEPS_LAST] = { + {"ntfsfix", NULL, NULL, NULL}, + {"ntfsresize", NULL, NULL, NULL}, + {"ntfslabel", NULL, NULL, NULL}, +- {"ntfscluster", NULL, NULL, NULL}, ++ {"ntfsinfo", NULL, NULL, NULL}, + }; + + static guint32 fs_mode_util[BD_FS_MODE_LAST+1] = { +@@ -55,7 +56,7 @@ static guint32 fs_mode_util[BD_FS_MODE_LAST+1] = { + DEPS_NTFSFIX_MASK, /* check */ + DEPS_NTFSFIX_MASK, /* repair */ + DEPS_NTFSLABEL_MASK, /* set-label */ +- DEPS_NTFSCLUSTER_MASK, /* query */ ++ DEPS_NTFSINFO_MASK, /* query */ + DEPS_NTFSRESIZE_MASK, /* resize */ + DEPS_NTFSLABEL_MASK /* set-uuid */ + }; +@@ -356,7 +357,7 @@ gboolean bd_fs_ntfs_resize (const gchar *device, guint64 new_size, GError **erro + * Tech category: %BD_FS_TECH_NTFS-%BD_FS_TECH_MODE_QUERY + */ + BDFSNtfsInfo* bd_fs_ntfs_get_info (const gchar *device, GError **error) { +- const gchar *args[3] = {"ntfscluster", device, NULL}; ++ const gchar *args[4] = {"ntfsinfo", "-m", device, NULL}; + gboolean success = FALSE; + gchar *output = NULL; + BDFSNtfsInfo *ret = NULL; +@@ -365,8 +366,9 @@ BDFSNtfsInfo* bd_fs_ntfs_get_info (const gchar *device, GError **error) { + gchar *val_start = NULL; + g_autofree gchar* mountpoint = NULL; + GError *l_error = NULL; ++ size_t cluster_size = 0; + +- if (!check_deps (&avail_deps, DEPS_NTFSCLUSTER_MASK, deps, DEPS_LAST, &deps_check_lock, error)) ++ if (!check_deps (&avail_deps, DEPS_NTFSINFO_MASK, deps, DEPS_LAST, &deps_check_lock, error)) + return NULL; + + mountpoint = bd_fs_get_mountpoint (device, &l_error); +@@ -400,8 +402,9 @@ BDFSNtfsInfo* bd_fs_ntfs_get_info (const gchar *device, GError **error) { + lines = g_strsplit (output, "\n", 0); + g_free (output); + line_p = lines; ++ + /* find the beginning of the (data) section we are interested in */ +- while (line_p && *line_p && !g_str_has_prefix (*line_p, "bytes per volume")) ++ while (line_p && *line_p && !strstr (*line_p, "Cluster Size")) + line_p++; + if (!line_p || !(*line_p)) { + g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_PARSE, "Failed to parse NTFS file system information"); +@@ -410,12 +413,12 @@ BDFSNtfsInfo* bd_fs_ntfs_get_info (const gchar *device, GError **error) { + return NULL; + } + +- /* extract data from something like this: "bytes per volume : 998240256" */ ++ /* extract data from something like this: "Cluster Size: 4096" */ + val_start = strchr (*line_p, ':'); + val_start++; +- ret->size = g_ascii_strtoull (val_start, NULL, 0); ++ cluster_size = g_ascii_strtoull (val_start, NULL, 0); + +- while (line_p && *line_p && !g_str_has_prefix (*line_p, "bytes of free space")) ++ while (line_p && *line_p && !strstr (*line_p, "Volume Size in Clusters")) + line_p++; + if (!line_p || !(*line_p)) { + g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_PARSE, "Failed to parse NTFS file system information"); +@@ -424,10 +427,27 @@ BDFSNtfsInfo* bd_fs_ntfs_get_info (const gchar *device, GError **error) { + return NULL; + } + +- /* extract data from something like this: "bytes of free space : 992759808" */ ++ /* extract data from something like this: "Volume Size in Clusters: 15314943" */ + val_start = strchr (*line_p, ':'); + val_start++; +- ret->free_space = g_ascii_strtoull (val_start, NULL, 0); ++ ret->size = g_ascii_strtoull (val_start, NULL, 0) * cluster_size; ++ ++ while (line_p && *line_p && !strstr (*line_p, "Free Clusters")) ++ line_p++; ++ if (!line_p || !(*line_p)) { ++ g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_PARSE, "Failed to parse NTFS file system information"); ++ g_strfreev (lines); ++ bd_fs_ntfs_info_free (ret); ++ return NULL; ++ } ++ ++ /* extract data from something like this: "Free Clusters: 7812655 (51,0%)" */ ++ val_start = strchr (*line_p, ':'); ++ val_start++; ++ ret->free_space = g_ascii_strtoull (val_start, NULL, 0) * cluster_size; ++ ++ printf("size: %lu\n", ret->size); ++ printf("free_space: %lu\n", ret->free_space); + + g_strfreev (lines); + +diff --git a/tests/fs_tests/ntfs_test.py b/tests/fs_tests/ntfs_test.py +index c04e39d..ff0fc31 100644 +--- a/tests/fs_tests/ntfs_test.py ++++ b/tests/fs_tests/ntfs_test.py +@@ -56,9 +56,9 @@ class NTFSTestAvailability(NTFSNoDevTestCase): + with self.assertRaisesRegex(GLib.GError, "The 'ntfsfix' utility is not available"): + BlockDev.fs_is_tech_avail(BlockDev.FSTech.NTFS, BlockDev.FSTechMode.REPAIR) + +- # now try without ntfscluster +- with utils.fake_path(all_but="ntfscluster"): +- with self.assertRaisesRegex(GLib.GError, "The 'ntfscluster' utility is not available"): ++ # now try without ntfsinfo ++ with utils.fake_path(all_but="ntfsinfo"): ++ with self.assertRaisesRegex(GLib.GError, "The 'ntfsinfo' utility is not available"): + BlockDev.fs_is_tech_avail(BlockDev.FSTech.NTFS, BlockDev.FSTechMode.QUERY) + + # now try without ntfsresize +diff --git a/tests/utils.py b/tests/utils.py +index c498c10..ef21507 100644 +--- a/tests/utils.py ++++ b/tests/utils.py +@@ -81,7 +81,7 @@ ALL_UTILS = {"lvm", "btrfs", "mkswap", "swaplabel", "multipath", "mpathconf", "d + "mke2fs", "e2fsck", "tune2fs", "dumpe2fs", "resize2fs", + "mkfs.f2fs", "fsck.f2fs", "fsck.f2fs", "dump.f2fs", "resize.f2fs", + "mkfs.nilfs2", "nilfs-tune", "nilfs-resize", +- "mkntfs", "ntfsfix", "ntfsresize", "ntfslabel", "ntfscluster", ++ "mkntfs", "ntfsfix", "ntfsresize", "ntfslabel", "ntfsinfo", + "mkfs.vfat", "fatlabel", "fsck.vfat", "vfat-resize", + "mkfs.xfs", "xfs_db", "xfs_repair", "xfs_admin", "xfs_growfs"} diff --git a/hardware/disk/libblockdev/pspec.xml b/hardware/disk/libblockdev/pspec.xml index 37db830363..4258790d4e 100644 --- a/hardware/disk/libblockdev/pspec.xml +++ b/hardware/disk/libblockdev/pspec.xml @@ -12,13 +12,14 @@ app A library for manipulating block devices Blok cihazlarını değiştirmek için bir kütüphane - https://github.com/storaged-project/libblockdev/archive/refs/tags/2.28-1.tar.gz + https://github.com/storaged-project/libblockdev/archive/refs/tags/3.0.1-1.tar.gz nss-devel mdadm util-linux glib2-devel parted-devel + libnvme-devel libyaml-devel python-devel python3-devel @@ -31,6 +32,9 @@ device-mapper-devel gobject-introspection-devel + + aefd677.patch + @@ -42,6 +46,7 @@ eudev parted libyaml + libnvme libkmod volume_key libbytesize @@ -73,6 +78,13 @@ + + 2023-07-12 + 3.0.1 + Version bump. + Mustafa Cinasal + muscnsl@gmail.com + 2022-11-05 2.28 diff --git a/hardware/disk/udisks2/files/udisks-2.x-ntfs-3g.patch b/hardware/disk/udisks2/files/udisks-2.x-ntfs-3g.patch index b40c220c6c..58b203fcd7 100644 --- a/hardware/disk/udisks2/files/udisks-2.x-ntfs-3g.patch +++ b/hardware/disk/udisks2/files/udisks-2.x-ntfs-3g.patch @@ -1,10 +1,11 @@ diff -Nuar a/src/udiskslinuxfilesystem.c b/src/udiskslinuxfilesystem.c ---- a/src/udiskslinuxfilesystem.c 2020-05-26 12:59:20.000000000 +0000 -+++ b/src/udiskslinuxfilesystem.c 2020-07-09 13:47:11.230931796 +0000 -@@ -300,6 +300,7 @@ - "vfat", - "exfat", +--- a/src/udiskslinuxfilesystem.c 2023-06-28 18:13:57.000000000 +0300 ++++ b/src/udiskslinuxfilesystem.c 2023-07-12 15:01:02.769714651 +0300 +@@ -373,6 +373,7 @@ + "nilfs2", "ntfs", + "ntfs3", + "ntfs-3g", - NULL, - }; + "udf", + "reiserfs", + "reiser4", diff --git a/hardware/disk/udisks2/pspec.xml b/hardware/disk/udisks2/pspec.xml index a1d48c841f..ed04de20e5 100644 --- a/hardware/disk/udisks2/pspec.xml +++ b/hardware/disk/udisks2/pspec.xml @@ -13,7 +13,7 @@ app:console Disk Management Service udisks provides a daemon, API and command line tools for managing disk devices attached to the system. - https://github.com/storaged-project/udisks/releases/download/udisks-2.9.4/udisks-2.9.4.tar.bz2 + https://github.com/storaged-project/udisks/releases/download/udisks-2.10.0/udisks-2.10.0.tar.bz2 @@ -40,7 +40,7 @@ ntfs-3g gptfdisk btrfs-progs-devel - libblockdev-devel + libblockdev-devel @@ -89,6 +89,7 @@ /var/lib/ /run/udisks /usr/share/dbus-1/interfaces/*.xml + /usr/share/zsh/site-functions/_udisks2 @@ -117,6 +118,13 @@ + + 2023-07-12 + 2.10.0 + Version bump. + Mustafa Cinasal + muscnsl@gmail.com + 2021-11-21 2.9.4