enhance(main/util-linux): build libmount and {lib,}fdisk
Put libmount library in subpackage libmount, mount utilities in subpackage mount-utils, libfdisk in subpackage libfdisk, and fdisk utilities in subpackage fdisk. On my aarch64 device, /system/bin/mount is unable to handle logical volumes (tries to access the non-existing /etc/fstab and errors), so lets add our own libmount package. Enabling libmount also enables the lsblk utility, which we put in blk-utils.
This commit is contained in:
parent
507a3f29e8
commit
bbe42fa887
|
@ -1,5 +1,5 @@
|
|||
TERMUX_SUBPKG_DESCRIPTION="Utilities for handling block device attributes"
|
||||
TERMUX_SUBPKG_DEPENDS="libblkid, libsmartcols, libuuid"
|
||||
TERMUX_SUBPKG_DEPENDS="libblkid, libmount, libsmartcols, libuuid"
|
||||
TERMUX_SUBPKG_BREAKS="util-linux (<< 2.38.1-1)"
|
||||
TERMUX_SUBPKG_REPLACES="util-linux (<< 2.38.1-1)"
|
||||
TERMUX_SUBPKG_DEPEND_ON_PARENT="no"
|
||||
|
|
|
@ -10,6 +10,7 @@ Documentation/licenses/COPYING.BSD-4-Clause-UC
|
|||
Documentation/licenses/COPYING.ISC"
|
||||
TERMUX_PKG_MAINTAINER="@termux"
|
||||
TERMUX_PKG_VERSION=2.38.1
|
||||
TERMUX_PKG_REVISION=1
|
||||
TERMUX_PKG_SRCURL=https://www.kernel.org/pub/linux/utils/util-linux/v${TERMUX_PKG_VERSION:0:4}/util-linux-${TERMUX_PKG_VERSION}.tar.xz
|
||||
TERMUX_PKG_SHA256=60492a19b44e6cf9a3ddff68325b333b8b52b6c59ce3ebd6a0ecaa4c5117e84f
|
||||
# libcrypt is required for only newgrp and sulogin, which are not built anyways
|
||||
|
@ -39,12 +40,13 @@ ac_cv_func_uselocale=no
|
|||
--disable-last
|
||||
--disable-logger
|
||||
--disable-mesg
|
||||
--disable-makeinstall-chown
|
||||
--disable-mountpoint
|
||||
--disable-nologin
|
||||
--disable-pivot_root
|
||||
--disable-raw
|
||||
--disable-switch_root
|
||||
--disable-wall
|
||||
--disable-libmount
|
||||
--disable-lsmem
|
||||
--disable-chmem
|
||||
--disable-rfkill
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
TERMUX_SUBPKG_DESCRIPTION="Utilities to manipulate disk partition tables"
|
||||
TERMUX_SUBPKG_DEPENDS="libfdisk, libmount, ncurses, readline, libsmartcols"
|
||||
TERMUX_SUBPKG_DEPEND_ON_PARENT="no"
|
||||
TERMUX_SUBPKG_INCLUDE="
|
||||
share/man/man8/cfdisk.8.gz
|
||||
share/man/man8/fdisk.8.gz
|
||||
share/man/man8/sfdisk.8.gz
|
||||
share/bash-completion/completions/sfdisk
|
||||
share/bash-completion/completions/fdisk
|
||||
share/bash-completion/completions/cfdisk
|
||||
bin/sfdisk
|
||||
bin/fdisk
|
||||
bin/cfdisk
|
||||
"
|
|
@ -0,0 +1,8 @@
|
|||
TERMUX_SUBPKG_DESCRIPTION="Library for manipulating disk partition tables"
|
||||
TERMUX_SUBPKG_DEPENDS="libblkid, libuuid (>> 2.38.1)"
|
||||
TERMUX_SUBPKG_DEPEND_ON_PARENT="no"
|
||||
TERMUX_SUBPKG_INCLUDE="
|
||||
lib/pkgconfig/fdisk.pc
|
||||
lib/libfdisk.so
|
||||
include/libfdisk/libfdisk.h
|
||||
"
|
|
@ -0,0 +1,8 @@
|
|||
TERMUX_SUBPKG_DESCRIPTION="Library for (un)mounting filesystems"
|
||||
TERMUX_SUBPKG_DEPENDS="libblkid, libsmartcols"
|
||||
TERMUX_SUBPKG_DEPEND_ON_PARENT="no"
|
||||
TERMUX_SUBPKG_INCLUDE="
|
||||
include/libmount/libmount.h
|
||||
lib/libmount.so
|
||||
lib/pkgconfig/mount.pc
|
||||
"
|
|
@ -0,0 +1,27 @@
|
|||
TERMUX_SUBPKG_DESCRIPTION="Utilities for (un)mounting filesystems"
|
||||
TERMUX_SUBPKG_DEPENDS="libblkid, libsmartcols, libmount"
|
||||
TERMUX_SUBPKG_DEPEND_ON_PARENT="no"
|
||||
TERMUX_SUBPKG_BREAKS="termux-tools (<= 1.34.1)"
|
||||
TERMUX_SUBPKG_INCLUDE="
|
||||
bin/findmnt
|
||||
bin/fstrim
|
||||
bin/lslocks
|
||||
bin/mount
|
||||
bin/swapoff
|
||||
bin/swapon
|
||||
bin/umount
|
||||
share/bash-completion/completions/findmnt
|
||||
share/bash-completion/completions/fstrim
|
||||
share/bash-completion/completions/lslocks
|
||||
share/bash-completion/completions/mount
|
||||
share/bash-completion/completions/swapoff
|
||||
share/bash-completion/completions/swapon
|
||||
share/bash-completion/completions/umount
|
||||
share/man/man8/findmnt.8.gz
|
||||
share/man/man8/fstrim.8.gz
|
||||
share/man/man8/lslocks.8.gz
|
||||
share/man/man8/mount.8.gz
|
||||
share/man/man8/swapoff.8.gz
|
||||
share/man/man8/swapon.8.gz
|
||||
share/man/man8/umount.8.gz
|
||||
"
|
|
@ -0,0 +1,45 @@
|
|||
--- ../libmount-src-tab_parse.c.orig 2022-08-08 09:25:50.094443439 +0200
|
||||
+++ ./libmount/src/tab_parse.c 2022-08-08 12:55:36.856303277 +0200
|
||||
@@ -835,6 +835,42 @@
|
||||
return 1;
|
||||
}
|
||||
|
||||
+int strverscmp(const char *l0, const char *r0)
|
||||
+{
|
||||
+ const unsigned char *l = (const void *)l0;
|
||||
+ const unsigned char *r = (const void *)r0;
|
||||
+ size_t i, dp, j;
|
||||
+ int z = 1;
|
||||
+
|
||||
+ /* Find maximal matching prefix and track its maximal digit
|
||||
+ * suffix and whether those digits are all zeros. */
|
||||
+ for (dp=i=0; l[i]==r[i]; i++) {
|
||||
+ int c = l[i];
|
||||
+ if (!c) return 0;
|
||||
+ if (!isdigit(c)) dp=i+1, z=1;
|
||||
+ else if (c!='0') z=0;
|
||||
+ }
|
||||
+
|
||||
+ if (l[dp]!='0' && r[dp]!='0') {
|
||||
+ /* If we're not looking at a digit sequence that began
|
||||
+ * with a zero, longest digit string is greater. */
|
||||
+ for (j=i; isdigit(l[j]); j++)
|
||||
+ if (!isdigit(r[j])) return 1;
|
||||
+ if (isdigit(r[j])) return -1;
|
||||
+ } else if (z && dp<i && (isdigit(l[i]) || isdigit(r[i]))) {
|
||||
+ /* Otherwise, if common prefix of digit sequence is
|
||||
+ * all zeros, digits order less than non-digits. */
|
||||
+ return (unsigned char)(l[i]-'0') - (unsigned char)(r[i]-'0');
|
||||
+ }
|
||||
+
|
||||
+ return l[i] - r[i];
|
||||
+}
|
||||
+
|
||||
+static int versionsort(const struct dirent **a, const struct dirent **b)
|
||||
+{
|
||||
+ return strverscmp((*a)->d_name, (*b)->d_name);
|
||||
+}
|
||||
+
|
||||
#ifdef HAVE_SCANDIRAT
|
||||
static int __mnt_table_parse_dir(struct libmnt_table *tb, const char *dirname)
|
||||
{
|
Loading…
Reference in New Issue