Author: sparky                       Date: Thu Feb 10 20:33:54 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- some fixes and tiny hacks to make it build with dietlibc; TEST !

---- Files affected:
packages/util-linux-ng:
   util-linux-diet.patch (1.2 -> 1.3) , util-linux-ng.spec (1.84 -> 1.85) 

---- Diffs:

================================================================
Index: packages/util-linux-ng/util-linux-diet.patch
diff -u packages/util-linux-ng/util-linux-diet.patch:1.2 
packages/util-linux-ng/util-linux-diet.patch:1.3
--- packages/util-linux-ng/util-linux-diet.patch:1.2    Thu Feb 10 12:54:02 2011
+++ packages/util-linux-ng/util-linux-diet.patch        Thu Feb 10 21:33:48 2011
@@ -45,3 +45,105 @@
  
  static int do_scale_by_power (uintmax_t *x, int base, int power)
  {
+--- util-linux-2.19/shlibs/mount/src/utils.c~  2011-01-24 23:46:29.000000000 
+0100
++++ util-linux-2.19/shlibs/mount/src/utils.c   2011-02-10 20:12:00.499611392 
+0100
+@@ -398,7 +398,11 @@
+       int rc = -1;
+         struct passwd pwd;
+       struct passwd *pw;
++#ifdef _SC_GETPW_R_SIZE_MAX
+       size_t sz = sysconf(_SC_GETPW_R_SIZE_MAX);
++#else
++      size_t sz = 0;
++#endif
+       char *buf;
+ 
+       if (!username || !uid)
+@@ -427,7 +431,11 @@
+       int rc = -1;
+         struct group grp;
+       struct group *gr;
++#ifdef _SC_GETGR_R_SIZE_MAX
+       size_t sz = sysconf(_SC_GETGR_R_SIZE_MAX);
++#else
++      size_t sz = 0;
++#endif
+       char *buf;
+ 
+       if (!groupname || !gid)
+--- util-linux-2.19/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 
20:26:15.846797059 +0100
+@@ -610,8 +610,14 @@
+ 
+       DBG(UPDATE, mnt_debug("%s: locking", lfile));
+ 
+-      fd = open(lfile, O_RDONLY|O_CREAT|O_CLOEXEC, S_IWUSR|
+-                                                   S_IRUSR|S_IRGRP|S_IROTH);
++      fd = open(lfile,
++#ifdef O_CLOEXEC
++              O_RDONLY|O_CREAT|O_CLOEXEC,
++#else
++              O_RDONLY|O_CREAT,
++#endif
++              S_IWUSR|S_IRUSR|S_IRGRP|S_IROTH);
++
+       free(lfile);
+ 
+       if (fd < 0)
+--- util-linux-2.19/lib/at.c~  2011-01-31 16:43:47.000000000 +0100
++++ util-linux-2.19/lib/at.c   2011-02-10 20:30:37.336797058 +0100
+@@ -7,6 +7,7 @@
+ #include <stdlib.h>
+ #include <fcntl.h>
+ #include <sys/stat.h>
++#include <limits.h>
+ 
+ #include "at.h"
+ 
+--- util-linux-2.19/shlibs/mount/src/utils.c~  2011-02-10 20:32:07.906797058 
+0100
++++ util-linux-2.19/shlibs/mount/src/utils.c   2011-02-10 20:49:24.336797058 
+0100
+@@ -664,7 +664,15 @@
+       if (rc <= 0)
+               return -errno;
+ 
++#ifdef __dietlibc__
++      if ( mktemp( n ) == NULL ) {
++              free(n);
++              return -errno;
++      }
++      fd = open(n, flags | O_EXCL);
++#else
+       fd = mkostemp(n, flags | O_EXCL);
++#endif
+       if (fd >= 0 && name)
+               *name = n;
+       else
+--- util-linux-2.19/misc-utils/findmnt.c~      2011-01-31 16:43:47.000000000 
+0100
++++ util-linux-2.19/misc-utils/findmnt.c       2011-02-10 20:54:23.100130391 
+0100
+@@ -30,6 +30,9 @@
+ #include <sys/ioctl.h>
+ #endif
+ #include <assert.h>
++#ifdef __dietlibc__
++#include <sys/stat.h> /* for major and minor macros */
++#endif
+ 
+ #define USE_UNSTABLE_LIBMOUNT_API
+ #include <libmount.h>
+--- util-linux-2.19/fsck/fsck.c~       2011-02-07 16:19:29.000000000 +0100
++++ util-linux-2.19/fsck/fsck.c        2011-02-10 21:09:27.024658725 +0100
+@@ -270,7 +270,13 @@
+       if (verbose)
+               printf(_("Locking disk %s ... "), diskname);
+ 
+-      inst->lock = open(diskname, O_CLOEXEC | O_RDONLY);
++      inst->lock = open(diskname,
++#ifdef O_CLOEXEC
++                      O_CLOEXEC | O_RDONLY
++#else
++                      O_RDONLY
++#endif
++                      );
+       if (inst->lock >= 0) {
+               int rc = -1;
+ 

================================================================
Index: packages/util-linux-ng/util-linux-ng.spec
diff -u packages/util-linux-ng/util-linux-ng.spec:1.84 
packages/util-linux-ng/util-linux-ng.spec:1.85
--- packages/util-linux-ng/util-linux-ng.spec:1.84      Thu Feb 10 19:58:20 2011
+++ packages/util-linux-ng/util-linux-ng.spec   Thu Feb 10 21:33:48 2011
@@ -658,12 +658,15 @@
 # configure gets it unconditionally wrong
 sed -i -e 's/#define HAVE_WIDECHAR 1//' config.h
 
-sed -i -e 's/ cal\$(EXEEXT) / /' misc-utils/Makefile
+sed -i -e 's/ cal\$(EXEEXT) / /; s/ lsblk\$(EXEEXT)//' misc-utils/Makefile
 
 for dir in shlibs/* disk-utils misc-utils fsck fdisk schedutils hwclock; do
        %{__make} -C $dir \
+       %if %{with uClibc}
+               CPPFLAGS="$CPPFLAGS -Dversionsort=alphasort" \
+       %endif
        %if %{with dietlibc}
-               CPPFLAGS="$CPPFLAGS -D_BSD_SOURCE" \
+               CPPFLAGS="$CPPFLAGS -D_BSD_SOURCE -Dversionsort=alphasort" \
                LDFLAGS="-lcompat"
        %endif
        # empty line required because there is a backslash up there
@@ -750,7 +753,7 @@
 ln -s fsck $RPM_BUILD_ROOT%{_libdir}/initrd/e2fsck
 
 # We don't need those
-rm 
$RPM_BUILD_ROOT%{_libdir}/initrd/{chkdupexe,ddate,uuidd,mcookie,whereis,mkfs*,fsck.cramfs,fsck.minix,isosize,logger}
+%{__rm} 
$RPM_BUILD_ROOT%{_libdir}/initrd/{chkdupexe,ddate,uuidd,mcookie,whereis,mkfs*,fsck.minix,isosize,logger}
 
 %if %{with dietlibc}
 cp -a initrd%{_libdir}/lib*.a $RPM_BUILD_ROOT%{dietlibdir}
@@ -1403,6 +1406,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.85  2011/02/10 20:33:48  sparky
+- some fixes and tiny hacks to make it build with dietlibc; TEST !
+
 Revision 1.84  2011/02/10 18:58:20  sparky
 - lackage lsblk and fstrim
 
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/util-linux-ng/util-linux-diet.patch?r1=1.2&r2=1.3&f=u
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/util-linux-ng/util-linux-ng.spec?r1=1.84&r2=1.85&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to