On Thu, 10 Feb 2011, Karel Zak wrote:
The stable util-linux 2.19 release is available at
ftp://ftp.kernel.org/pub/linux/utils/util-linux/v2.19/
Feedback and bug reports, as always, are welcomed.
Hi Karel,
I just fetched util-linux 2.19 and tried to build on x86 with glibc-2.3.6
and kernel linux-2.6.28.6.
A few problems were easily fixed by the attached patches
patch-01-PATH_MAX PATH_MAX undefined
patch-02-MNT_DETACH MNT_DETACH undefined
patch-03-O_CLOEXEC O_CLOEXEC undefined
patch-04-sortfunc incompatible pointer type
but others were not. The output from make follows
CC utils.lo
../../../../util-linux-2.19/shlibs/mount/src/utils.c: In function `mnt_open_uniq_filename':
../../../../util-linux-2.19/shlibs/mount/src/utils.c:659: warning: implicit declaration of function `mkostemp'
CC mount.o
In file included from ../../../../util-linux-2.19/shlibs/mount/samples/mount.c:31:
../../../shlibs/mount/src/libmount.h:29:3: warning: #warning libmount API is not stable yet!
CCLD mount
../../../shlibs/mount/src/.libs/libmount.so: undefined reference to `mkostemp'
collect2: ld returned 1 exit status
CCLD findmnt
../shlibs/mount/src/.libs/libmount.so: undefined reference to `mkostemp'
collect2: ld returned 1 exit status
i.e., makeostemp() is missing in glibc-2.3.6 (introduced in 2.7)
CC lsblk-lsblk.o
../../util-linux-2.19/misc-utils/lsblk.c: In function `is_partition_dirent':
../../util-linux-2.19/misc-utils/lsblk.c:256: warning: implicit declaration of function `faccessat'
../../util-linux-2.19/misc-utils/lsblk.c: In function `sysfs_open':
../../util-linux-2.19/misc-utils/lsblk.c:296: warning: implicit declaration of function `openat'
../../util-linux-2.19/misc-utils/lsblk.c: In function `sysfs_opendir':
../../util-linux-2.19/misc-utils/lsblk.c:330: warning: implicit declaration of function `fdopendir'
../../util-linux-2.19/misc-utils/lsblk.c:330: warning: assignment makes pointer from integer without a cast
CCLD lsblk
lsblk-lsblk.o: In function `is_partition_dirent':
lsblk.c:(.text+0x2c3): undefined reference to `faccessat'
lsblk-lsblk.o: In function `sysfs_open':
lsblk.c:(.text+0x35a): undefined reference to `openat'
lsblk.c:(.text+0x3af): undefined reference to `openat'
lsblk-lsblk.o: In function `sysfs_opendir':
lsblk.c:(.text+0x426): undefined reference to `fdopendir'
collect2: ld returned 1 exit status
i.e., misc-utils/lsblk.c uses openat() & Co instead of open_at()
../../util-linux-2.19/misc-utils/lsblk.c: In function `help':
../../util-linux-2.19/misc-utils/lsblk.c:874: warning: implicit declaration of function `gettext'
i.e., misc-utils/lsblk.c uses gettext() even with --disable-nls
Regards
Peter Breitenlohner <peb@xxxxxxxxxxxx>
diff -ur util-linux-2.19.orig/lib/at.c util-linux-2.19/lib/at.c
--- util-linux-2.19.orig/lib/at.c 2011-01-31 16:43:47.000000000 +0100
+++ util-linux-2.19/lib/at.c 2011-02-10 11:23:08.531977816 +0100
@@ -7,6 +7,7 @@
#include <stdlib.h>
#include <fcntl.h>
#include <sys/stat.h>
+#include <limits.h>
#include "at.h"
diff -ur util-linux-2.19.orig/shlibs/mount/src/context_umount.c util-linux-2.19/shlibs/mount/src/context_umount.c
--- util-linux-2.19.orig/shlibs/mount/src/context_umount.c 2011-02-07 14:47:02.000000000 +0100
+++ util-linux-2.19/shlibs/mount/src/context_umount.c 2011-02-10 12:16:28.571228880 +0100
@@ -21,6 +21,10 @@
#include "strutils.h"
#include "mountP.h"
+#if !defined(MNT_DETACH)
+#define MNT_DETACH 2
+#endif
+
static int lookup_umount_fs(struct libmnt_context *cxt)
{
int rc;
diff -ur util-linux-2.19.orig/fsck/fsck.c util-linux-2.19/fsck/fsck.c
--- util-linux-2.19.orig/fsck/fsck.c 2011-02-07 16:19:29.000000000 +0100
+++ util-linux-2.19/fsck/fsck.c 2011-02-10 13:02:41.594906184 +0100
@@ -270,6 +270,9 @@
if (verbose)
printf(_("Locking disk %s ... "), diskname);
+#ifndef O_CLOEXEC
+#define O_CLOEXEC 0
+#endif
inst->lock = open(diskname, O_CLOEXEC | O_RDONLY);
if (inst->lock >= 0) {
int rc = -1;
diff -ur util-linux-2.19.orig/shlibs/mount/src/tab_update.c util-linux-2.19/shlibs/mount/src/tab_update.c
--- util-linux-2.19.orig/shlibs/mount/src/tab_update.c 2011-02-09 14:23:48.000000000 +0100
+++ util-linux-2.19/shlibs/mount/src/tab_update.c 2011-02-10 13:02:43.706182294 +0100
@@ -610,6 +610,9 @@
DBG(UPDATE, mnt_debug("%s: locking", lfile));
+#ifndef O_CLOEXEC
+#define O_CLOEXEC 0
+#endif
fd = open(lfile, O_RDONLY|O_CREAT|O_CLOEXEC, S_IWUSR|
S_IRUSR|S_IRGRP|S_IROTH);
free(lfile);
diff -ur util-linux-2.19.orig/disk-utils/mkfs.cramfs.c util-linux-2.19/disk-utils/mkfs.cramfs.c
--- util-linux-2.19.orig/disk-utils/mkfs.cramfs.c 2011-01-21 13:07:24.000000000 +0100
+++ util-linux-2.19/disk-utils/mkfs.cramfs.c 2011-02-10 13:41:01.060573144 +0100
@@ -285,9 +285,9 @@
* We define our own sorting function instead of using alphasort which
* uses strcoll and changes ordering based on locale information.
*/
-static int cramsort (const struct dirent **a, const struct dirent **b)
+static int cramsort (const void *a, const void *b)
{
- return strcmp((*a)->d_name, (*b)->d_name);
+ return strcmp((*(const struct dirent **)a)->d_name, (*(const struct dirent **)b)->d_name);
}
static unsigned int parse_directory(struct entry *root_entry, const char *name, struct entry **prev, loff_t *fslen_ub)
@@ -306,7 +306,7 @@
endpath++;
/* read in the directory and sort */
- dircount = scandir(name, &dirlist, 0, cramsort);
+ dircount = scandir(name, &dirlist, NULL, cramsort);
if (dircount < 0) {
perror(name);