[Glibc-bsd-commits] r2066 - in trunk/ufsutils/debian: . patches

ps-guest at alioth.debian.org ps-guest at alioth.debian.org
Sat Dec 8 16:00:37 UTC 2007


Author: ps-guest
Date: 2007-12-08 16:00:37 +0000 (Sat, 08 Dec 2007)
New Revision: 2066

Added:
   trunk/ufsutils/debian/patches/00_include.patch
Modified:
   trunk/ufsutils/debian/changelog
   trunk/ufsutils/debian/control
   trunk/ufsutils/debian/patches/01_libufs.patch
   trunk/ufsutils/debian/patches/02_fsck.ufs.patch
   trunk/ufsutils/debian/patches/99_makefiles.patch
   trunk/ufsutils/debian/patches/series
   trunk/ufsutils/debian/rules
Log:
 * make ufsutils buildable on linux



Modified: trunk/ufsutils/debian/changelog
===================================================================
--- trunk/ufsutils/debian/changelog	2007-12-07 22:35:17 UTC (rev 2065)
+++ trunk/ufsutils/debian/changelog	2007-12-08 16:00:37 UTC (rev 2066)
@@ -5,7 +5,6 @@
   * New upstream snapshot of RELENG_7
   * Include all needed sources in debian/upstream.sh
   * Make it build much cleanly on kfreebsd - ino_t is int32 on kfreebsd-any !!!
-  * Currently unbuildable on linux
 
  -- Guillem Jover <guillem at debian.org>  Fri, 07 Dec 2007 18:49:11 +0100
 

Modified: trunk/ufsutils/debian/control
===================================================================
--- trunk/ufsutils/debian/control	2007-12-07 22:35:17 UTC (rev 2065)
+++ trunk/ufsutils/debian/control	2007-12-08 16:00:37 UTC (rev 2066)
@@ -2,7 +2,7 @@
 Section: utils
 Priority: optional
 Maintainer: Guillem Jover <guillem at debian.org>
-Build-Depends: debhelper (>= 5), quilt, libedit-dev, libncurses5-dev, libfreebsd-dev, libbsd-dev
+Build-Depends: debhelper (>= 5), quilt, libedit-dev, libncurses5-dev, libfreebsd-dev [kfreebsd-i386 kfreebsd amd64], libbsd-dev [kfreebsd-i386 kfreebsd amd64]
 Standards-Version: 3.6.2
 
 Package: ufsutils

Added: trunk/ufsutils/debian/patches/00_include.patch
===================================================================
--- trunk/ufsutils/debian/patches/00_include.patch	                        (rev 0)
+++ trunk/ufsutils/debian/patches/00_include.patch	2007-12-08 16:00:37 UTC (rev 2066)
@@ -0,0 +1,28 @@
+Index: ufsutils/freebsd/sys/disklabel.h
+===================================================================
+--- ufsutils.orig/freebsd/sys/disklabel.h
++++ ufsutils/freebsd/sys/disklabel.h
+@@ -36,7 +36,8 @@
+ #ifndef _KERNEL
+ #include <sys/types.h>
+ #endif
+-#include <sys/ioccom.h>
++#include <stddef.h>
++#include <sys/ioctl.h>
+ 
+ /*
+  * Disk description table, see disktab(5)
+Index: ufsutils/freebsd/sys/ucred.h
+===================================================================
+--- ufsutils.orig/freebsd/sys/ucred.h
++++ ufsutils/freebsd/sys/ucred.h
+@@ -33,7 +33,9 @@
+ #ifndef _SYS_UCRED_H_
+ #define	_SYS_UCRED_H_
+ 
++#if 0
+ #include <bsm/audit.h>
++#endif
+ 
+ /*
+  * Credentials.

Modified: trunk/ufsutils/debian/patches/01_libufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/01_libufs.patch	2007-12-07 22:35:17 UTC (rev 2065)
+++ trunk/ufsutils/debian/patches/01_libufs.patch	2007-12-08 16:00:37 UTC (rev 2066)
@@ -1,4 +1,20 @@
 #DPATCHLEVEL=1
+Index: ufsutils/libufs/type.c
+===================================================================
+--- ufsutils.orig/libufs/type.c
++++ ufsutils/libufs/type.c
+@@ -131,8 +131,10 @@
+ 			ERROR(disk, "could not find special device");
+ 			return (-1);
+ 		}
++#if HAVE_BSD_STATFS
+ 		strlcpy(dev, sfs.f_mntfromname, sizeof(dev));
+ 		name = dev;
++#endif		
+ 	} else {
+ 		ERROR(disk, "could not find special device");
+ 		return (-1);
+
 Index: ufsutils/include/ufs/ffs/fs.h
 ===================================================================
 --- ufsutils.orig/include/ufs/ffs/fs.h

Modified: trunk/ufsutils/debian/patches/02_fsck.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_fsck.ufs.patch	2007-12-07 22:35:17 UTC (rev 2065)
+++ trunk/ufsutils/debian/patches/02_fsck.ufs.patch	2007-12-08 16:00:37 UTC (rev 2066)
@@ -1,4 +1,23 @@
 #DPATCHLEVEL=1
+Index: ufsutils/fsck.ufs/gjournal.c
+===================================================================
+--- ufsutils.orig/fsck.ufs/gjournal.c
++++ ufsutils/fsck.ufs/gjournal.c
+@@ -54,6 +54,9 @@
+ #include <sys/cdefs.h>
+ __FBSDID("$FreeBSD: src/sbin/fsck_ffs/gjournal.c,v 1.2 2006/11/01 10:56:33 ru Exp $");
+ 
++
++#if HAVE_UFS_SNAPSHOT
++
+ #include <sys/param.h>
+ #include <sys/disklabel.h>
+ #include <sys/mount.h>
+@@ -774,3 +777,4 @@
+ 	/* Write back updated statistics and super-block. */
+ 	putdisk();
+ }
++#endif
 Index: ufsutils/fsck.ufs/ea.c
 ===================================================================
 --- ufsutils.orig/fsck.ufs/ea.c
@@ -146,7 +165,7 @@
 ===================================================================
 --- ufsutils.orig/fsck.ufs/main.c
 +++ ufsutils/fsck.ufs/main.c
-@@ -45,9 +45,16 @@
+@@ -45,9 +45,17 @@
  #include <sys/stat.h>
  #include <sys/file.h>
  #include <sys/time.h>
@@ -155,6 +174,7 @@
 +#else
 +#include <sys/statvfs.h>
 +#define statfs statvfs
++#define f_flags f_flag
 +#endif
  #include <sys/resource.h>
 +#ifdef HAVE_BSD_SYSCTL
@@ -264,6 +284,22 @@
  		if ((mntp == NULL && sblock.fs_clean == 1) ||
  		    (mntp != NULL && (sblock.fs_flags & FS_UNCLEAN) == 0))
  			exit(7);	/* Filesystem clean, report it now */
+@@ -253,6 +275,7 @@
+ 		if ((fsreadfd = open(filesys, O_RDONLY)) < 0 || readsb(0) == 0)
+ 			exit(3);	/* Cannot read superblock */
+ 		close(fsreadfd);
++#if HAVE_UFS_SNAPSHOT
+ 		if ((sblock.fs_flags & FS_GJOURNAL) != 0) {
+ 			//printf("GJournaled file system detected on %s.\n",
+ 			//    filesys);
+@@ -270,6 +293,7 @@
+ 				    "CANNOT RUN FAST FSCK\n");
+ 			}
+ 		}
++#endif
+ 	}
+ 	/*
+ 	 * If we are to do a background check:
 @@ -278,6 +299,7 @@
  	 *	return created snapshot file
  	 *	if not found, clear bkgrdflag and proceed with normal fsck

Modified: trunk/ufsutils/debian/patches/99_makefiles.patch
===================================================================
--- trunk/ufsutils/debian/patches/99_makefiles.patch	2007-12-07 22:35:17 UTC (rev 2065)
+++ trunk/ufsutils/debian/patches/99_makefiles.patch	2007-12-08 16:00:37 UTC (rev 2066)
@@ -49,7 +49,7 @@
 +mandir = $(datadir)/man
 +man8dir = $(mandir)/man8
 +
-+LDADD += -lbsd -lfreebsd
++#LDADD += -lbsd -lfreebsd
 +CFLAGS ?= -Wall -g -O2
 +ALL_CFLAGS += -I../include -include port/port.h -D_GNU_SOURCE
 +# -DHAVE_BSD_ERRNO -DHAVE_BSD_SIGNALS -DHAVE_BSD_STATFS -DHAVE_BSD_DISKLABEL -DHAVE_BSD_MOUNT -DHAVE_UFS_SNAPSHOT -DHAVE_BSD_SYSCTL

Modified: trunk/ufsutils/debian/patches/series
===================================================================
--- trunk/ufsutils/debian/patches/series	2007-12-07 22:35:17 UTC (rev 2065)
+++ trunk/ufsutils/debian/patches/series	2007-12-08 16:00:37 UTC (rev 2066)
@@ -1,3 +1,4 @@
+00_include.patch
 00_libport.patch
 00_mount.patch
 00_param.patch

Modified: trunk/ufsutils/debian/rules
===================================================================
--- trunk/ufsutils/debian/rules	2007-12-07 22:35:17 UTC (rev 2065)
+++ trunk/ufsutils/debian/rules	2007-12-08 16:00:37 UTC (rev 2066)
@@ -18,9 +18,16 @@
 
 DEB_HOST_ARCH_OS = $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
 ifeq (linux,$(DEB_HOST_ARCH_OS))
-CFLAGS += -D_FILE_OFFSET_BITS=64
+CFLAGS += -D_FILE_OFFSET_BITS=64 -I$(CURDIR)/freebsd
 endif
 
+# on GNU/kFreeBSD we need additional library
+ifeq (kfreebsd,$(DEB_HOST_ARCH_OS))
+LDADD += -lbsd -lfreebsd
+endif
+
+
+
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
 	CFLAGS += -O0
 else
@@ -36,7 +43,7 @@
 
 	QUILT_PATCHES=$(CURDIR)/debian/patches quilt push -a || test $$? = 2
 
-	CFLAGS="$(CFLAGS)" $(MAKE)
+	CFLAGS="$(CFLAGS)" LDADD="$(LDADD)" $(MAKE)
 	
 	touch build-stamp
 




More information about the Glibc-bsd-commits mailing list