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

Robert Millan rmh at alioth.debian.org
Sat Oct 26 14:20:07 UTC 2013


Author: rmh
Date: 2013-10-26 14:20:07 +0000 (Sat, 26 Oct 2013)
New Revision: 5094

Added:
   trunk/ufsutils/debian/patches/fsck_getopt.diff
   trunk/ufsutils/debian/patches/makefiles.diff
Removed:
   trunk/ufsutils/debian/TODO
   trunk/ufsutils/debian/patches/00_include.patch
   trunk/ufsutils/debian/patches/00_libport.patch
   trunk/ufsutils/debian/patches/00_mount.patch
   trunk/ufsutils/debian/patches/00_param.patch
   trunk/ufsutils/debian/patches/00_portable_ufs_types.patch
   trunk/ufsutils/debian/patches/01_libufs.patch
   trunk/ufsutils/debian/patches/02_bsdlabel.ufs.patch
   trunk/ufsutils/debian/patches/02_dumpfs.ufs.patch
   trunk/ufsutils/debian/patches/02_fsck.ufs.patch
   trunk/ufsutils/debian/patches/02_fsdb.ufs.patch
   trunk/ufsutils/debian/patches/02_growfs.ufs.patch
   trunk/ufsutils/debian/patches/02_mkfs.ufs.patch
   trunk/ufsutils/debian/patches/02_tunefs.ufs.patch
   trunk/ufsutils/debian/patches/03_ufsmount.patch
Modified:
   trunk/ufsutils/debian/changelog
   trunk/ufsutils/debian/control
   trunk/ufsutils/debian/patches/04_avoid_diocgdelete.patch
   trunk/ufsutils/debian/patches/05_wipe_otherfs.patch
   trunk/ufsutils/debian/patches/series
   trunk/ufsutils/debian/rules
   trunk/ufsutils/debian/ufsutils-udeb.install
   trunk/ufsutils/debian/ufsutils.install
Log:
  * New upstream release.

  [ Robert Millan ]
  * Switch architecture to kfreebsd-any.
  * Update debian/rules using freebsd-utils as template.
  * Changes above render obsolete most of the patches. Simplify patchset
    to make it more maintainable and easier to update. Patches left:
    - Already in upstream: 00_portable_berase.patch
    - Not in upstream, but probably mergeable: 05_wipe_otherfs.patch,
      fsck_getopt.diff
    - Pending on kern/162905 (help is welcome): 04_avoid_diocgdelete.patch
    - Not mergeable: makefiles.diff

Deleted: trunk/ufsutils/debian/TODO
===================================================================
--- trunk/ufsutils/debian/TODO	2013-10-26 14:16:16 UTC (rev 5093)
+++ trunk/ufsutils/debian/TODO	2013-10-26 14:20:07 UTC (rev 5094)
@@ -1,9 +0,0 @@
-TODO:
-
-- hurd specific support. (4th user mode, author, trans)
-- portable mount(2).
-- portable libdisklabel.
-- portable libblockdevice.
-- userland fs manipulation utils (ala hfsutils).
-- ufs snapshot support.
-- alternative to bsd sysctl.

Modified: trunk/ufsutils/debian/changelog
===================================================================
--- trunk/ufsutils/debian/changelog	2013-10-26 14:16:16 UTC (rev 5093)
+++ trunk/ufsutils/debian/changelog	2013-10-26 14:20:07 UTC (rev 5094)
@@ -1,3 +1,20 @@
+ufsutils (9.2-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+  [ Robert Millan ]
+  * Switch architecture to kfreebsd-any.
+  * Update debian/rules using freebsd-utils as template.
+  * Changes above render obsolete most of the patches. Simplify patchset
+    to make it more maintainable and easier to update. Patches left:
+    - Already in upstream: 00_portable_berase.patch
+    - Not in upstream, but probably mergeable: 05_wipe_otherfs.patch,
+      fsck_getopt.diff
+    - Pending on kern/162905 (help is welcome): 04_avoid_diocgdelete.patch
+    - Not mergeable: makefiles.diff
+
+ -- Robert Millan <rmh at debian.org>  Sat, 26 Oct 2013 15:08:15 +0200
+
 ufsutils (8.2-4) unstable; urgency=low
 
   [ Robert Millan ]

Modified: trunk/ufsutils/debian/control
===================================================================
--- trunk/ufsutils/debian/control	2013-10-26 14:16:16 UTC (rev 5093)
+++ trunk/ufsutils/debian/control	2013-10-26 14:20:07 UTC (rev 5094)
@@ -3,20 +3,19 @@
 Priority: optional
 Maintainer: GNU/kFreeBSD Maintainers <debian-bsd at lists.debian.org>
 Uploaders: Aurelien Jarno <aurel32 at debian.org>, Robert Millan <rmh at debian.org>
-Build-Depends: dpkg-dev (>= 1.17.0), debhelper (>= 7), pkg-config,
+Build-Depends: debhelper (>= 7),
  freebsd-buildutils,
- libbsd-dev (>= 0.4.0),
+ freebsd-glue (>= 0.1.12~),
+ libbsd-dev (>= 0.3.0),
  libedit-dev,
- libc0.1-dev (>= 2.10.1) [kfreebsd-any]
+ libtinfo-dev,
 Vcs-Browser: http://anonscm.debian.org/viewvc/glibc-bsd/trunk/ufsutils/
 Vcs-Svn: svn://anonscm.debian.org/glibc-bsd/trunk/ufsutils/
-Standards-Version: 3.9.4
+Standards-Version: 3.9.2
 
 Package: ufsutils
-Architecture: any
+Architecture: kfreebsd-any
 Depends: ${shlibs:Depends}, ${misc:Depends}
-Provides: fsck-backend
-Conflicts: hurd
 Description: UFS filesystems utilities
  Utilities to manage the UFS filesystem, mostly used in BSD or derived
  operating systems. This include FFS, UFS and UFS2.

Deleted: trunk/ufsutils/debian/patches/00_include.patch
===================================================================
--- trunk/ufsutils/debian/patches/00_include.patch	2013-10-26 14:16:16 UTC (rev 5093)
+++ trunk/ufsutils/debian/patches/00_include.patch	2013-10-26 14:20:07 UTC (rev 5094)
@@ -1,29 +0,0 @@
----
- sys/sys/disklabel.h |    3 ++-
- sys/sys/ucred.h     |    2 ++
- 2 files changed, 4 insertions(+), 1 deletion(-)
-
---- a/sys/sys/disklabel.h
-+++ b/sys/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)
---- a/sys/sys/ucred.h
-+++ b/sys/sys/ucred.h
-@@ -33,7 +33,9 @@
- #ifndef _SYS_UCRED_H_
- #define	_SYS_UCRED_H_
- 
-+#if 0
- #include <bsm/audit.h>
-+#endif
- 
- /*
-  * Credentials.

Deleted: trunk/ufsutils/debian/patches/00_libport.patch
===================================================================
--- trunk/ufsutils/debian/patches/00_libport.patch	2013-10-26 14:16:16 UTC (rev 5093)
+++ trunk/ufsutils/debian/patches/00_libport.patch	2013-10-26 14:20:07 UTC (rev 5094)
@@ -1,171 +0,0 @@
----
- lib/port/Makefile       |   19 +++++++++
- lib/port/blockdev.c     |   92 ++++++++++++++++++++++++++++++++++++++++++++++++
- lib/port/blockdev.h     |    8 ++++
- lib/port/getdisklabel.c |    7 +++
- lib/port/port.h         |   22 +++++++++++
- 5 files changed, 148 insertions(+)
-
---- /dev/null
-+++ b/lib/port/getdisklabel.c
-@@ -0,0 +1,7 @@
-+#include <stdlib.h>
-+#include <sys/disklabel.h>
-+
-+struct disklabel *getdiskbyname(const char *name)
-+{
-+	return NULL;
-+}
---- /dev/null
-+++ b/lib/port/port.h
-@@ -0,0 +1,22 @@
-+#ifndef LIBPORT_H
-+#define LIBPORT_H
-+
-+#ifdef __FreeBSD_kernel__
-+
-+#  include <sys/param.h>
-+#  include <sys/disk.h>
-+#  include <sys/ioctl.h>
-+
-+/* all features are available */
-+
-+#  define HAVE_BSD_DISKLABEL 1
-+#  define HAVE_BSD_ERRNO 1
-+#  define HAVE_BSD_MOUNT 1
-+#  define HAVE_BSD_SIGNALS 1
-+#  define HAVE_BSD_STATFS 1
-+#  define HAVE_BSD_SYSCTL 1
-+#  define HAVE_UFS_SNAPSHOT 1
-+
-+#endif
-+
-+#endif
---- /dev/null
-+++ b/lib/port/blockdev.c
-@@ -0,0 +1,92 @@
-+/*
-+ * Copyright (C) 2004 Guillem Jover <guillem at debian.org>
-+ * All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ *
-+ * 1. Redistributions of source code must retain the above copyright
-+ *    notice, this list of conditions and the following disclaimer.
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ *    notice, this list of conditions and the following disclaimer in the
-+ *    documentation and/or other materials provided with the distribution.
-+ * 3. The name of the author may not be used to endorse or promote products
-+ *    derived from this software without specific prior written permission.
-+ *
-+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
-+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
-+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
-+ * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+ */
-+
-+#include <sys/types.h>
-+#include <sys/ioctl.h>
-+#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD_kernel__)
-+#include <sys/param.h>
-+#if defined(__FreeBSD_kernel__) && __FreeBSD_kernel_version >= 500000
-+#include <sys/disk.h>
-+#endif
-+#include <sys/disklabel.h>
-+#ifndef DIOCGMEDIASIZE
-+#define DIOCGMEDIASIZE _IOR('d', 129, off_t)
-+#endif
-+#elif defined(__linux__)
-+#ifndef BLKGETSIZE
-+#define BLKGETSIZE _IO(0x12,96)
-+#endif
-+#endif
-+#include <sys/stat.h>
-+#include <unistd.h>
-+#include "blockdev.h"
-+
-+static const int sector_size = 512;
-+
-+int64_t
-+get_block_device_size(int fd)
-+{
-+	int64_t size = 0;
-+	struct stat64 st;
-+
-+#if defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__NetBSD__)
-+	{
-+		struct disklabel disklabel;
-+		off_t device_size;
-+
-+		if (!ioctl(fd, DIOCGMEDIASIZE, &device_size))
-+			return device_size;
-+
-+		if (!ioctl(fd, DIOCGDINFO, &disklabel)) {
-+			size = ((int64_t)disklabel.d_secperunit) * sector_size;
-+			return size;
-+		}
-+	}
-+#elif defined(__linux__)
-+	{
-+		long int device_sectors;
-+
-+		if (!ioctl(fd, BLKGETSIZE, &device_sectors)) {
-+			size = ((int64_t)device_sectors) * sector_size;
-+			return size;
-+		}
-+	}
-+#else
-+	/* XXX: Implement a generic seek binary test for targets currently
-+	 *      not supported.
-+	 */
-+#error "Do not know how to get block device size"
-+#endif
-+
-+	/* Regular files or devices under the Hurd.  */
-+	if (fstat64(fd, &st) == 0) {
-+		return st.st_size;
-+	}
-+
-+	return size;
-+}
---- /dev/null
-+++ b/lib/port/blockdev.h
-@@ -0,0 +1,8 @@
-+#ifndef LIBPORT_BLOCKDEV_H
-+#define LIBPORT_BLOCKDEV_H
-+
-+#include <sys/types.h>
-+
-+int64_t get_block_device_size(int fd);
-+
-+#endif
---- /dev/null
-+++ b/lib/port/Makefile
-@@ -0,0 +1,19 @@
-+# ufsutils local portability library
-+
-+LIB=	port
-+
-+# We only want a static library
-+NO_PIC=1
-+
-+SRCS=	blockdev.c getdisklabel.c
-+INCS=	blockdev.h port.h
-+
-+WARNS?=	2
-+
-+CFLAGS+= -D_LIBPORT
-+.if defined(LIBPORT_DEBUG)
-+CFLAGS+= -D_LIBPORT_DEBUGGING
-+.endif
-+CFLAGS+= -I${.CURDIR}
-+
-+.include <bsd.lib.mk>

Deleted: trunk/ufsutils/debian/patches/00_mount.patch
===================================================================
--- trunk/ufsutils/debian/patches/00_mount.patch	2013-10-26 14:16:16 UTC (rev 5093)
+++ trunk/ufsutils/debian/patches/00_mount.patch	2013-10-26 14:20:07 UTC (rev 5094)
@@ -1,78 +0,0 @@
----
- sys/sys/mount.h |   19 ++++++++++---------
- 1 file changed, 10 insertions(+), 9 deletions(-)
-
---- a/sys/sys/mount.h
-+++ b/sys/sys/mount.h
-@@ -34,20 +34,16 @@
- #define _SYS_MOUNT_H_
- 
- #include <sys/ucred.h>
--#include <sys/queue.h>
--#ifdef _KERNEL
--#include <sys/lock.h>
--#include <sys/lockmgr.h>
--#include <sys/_mutex.h>
--#endif
-+#include <stdint.h>
-+#include <sys/vfs.h>
-+#include <sys/types.h>
-+#include <sys/socket.h>
- 
- /*
-  * NOTE: When changing statfs structure, mount structure, MNT_* flags or
-  * MNTK_* flags also update DDB show mount command in vfs_subr.c.
-  */
- 
--typedef struct fsid { int32_t val[2]; } fsid_t;	/* filesystem id type */
--
- /*
-  * File identifier.
-  * These are unique per filesystem on a single machine.
-@@ -65,6 +61,7 @@
-  */
- #define	MFSNAMELEN	16		/* length of type name including null */
- #define	MNAMELEN	88		/* size of on/from name bufs */
-+#if 0
- #define	STATFS_VERSION	0x20030518	/* current version number */
- struct statfs {
- 	uint32_t f_version;		/* structure version number */
-@@ -220,6 +217,7 @@
- } while (0)
- 
- #endif /* _KERNEL */
-+#endif
- 
- /*
-  * User specifiable flags, stored in mnt_flag.
-@@ -415,6 +413,7 @@
- 	char		*np_index;	/* Index file */
- };
- 
-+#if 0
- /*
-  * Filesystem configuration information. One of these exists for each
-  * type of filesystem supported by the kernel. These are searched at
-@@ -452,6 +451,7 @@
- 	int	vfc_flags;
- };
- #endif
-+#endif
- 
- /*
-  * NB: these flags refer to IMPLEMENTATION properties, not properties of
-@@ -517,6 +517,7 @@
- #define VQ_FLAG4000	0x4000	/* placeholder */
- #define VQ_FLAG8000	0x8000	/* placeholder */
- 
-+#if 0
- #ifdef _KERNEL
- /* Point a sysctl request at a vfsidctl's data. */
- #define VCTLTOREQ(vc, req)						\
-@@ -794,5 +795,5 @@
- __END_DECLS
- 
- #endif /* _KERNEL */
--
-+#endif
- #endif /* !_SYS_MOUNT_H_ */

Deleted: trunk/ufsutils/debian/patches/00_param.patch
===================================================================
--- trunk/ufsutils/debian/patches/00_param.patch	2013-10-26 14:16:16 UTC (rev 5093)
+++ trunk/ufsutils/debian/patches/00_param.patch	2013-10-26 14:20:07 UTC (rev 5094)
@@ -1,64 +0,0 @@
----
- sys/sys/param.h |   10 ++++++++++
- 1 file changed, 10 insertions(+)
-
---- a/sys/sys/param.h
-+++ b/sys/sys/param.h
-@@ -38,6 +38,7 @@
- #ifndef _SYS_PARAM_H_
- #define _SYS_PARAM_H_
- 
-+#if 0
- #include <sys/_null.h>
- 
- #define	BSD	199506		/* System version (year & month). */
-@@ -77,6 +78,9 @@
-  * MAXLOGNAME should be == UT_NAMESIZE+1 (see <utmp.h>)
-  */
- #include <sys/syslimits.h>
-+#endif
-+#include <sys/types.h>
-+#include <limits.h>
- 
- #define	MAXCOMLEN	19		/* max command name remembered */
- #define	MAXINTERP	32		/* max interpreter file name length */
-@@ -89,6 +93,7 @@
- #define MAXHOSTNAMELEN	256		/* max hostname size */
- #define SPECNAMELEN	63		/* max length of devicename */
- 
-+#if 0
- /* More types and definitions used throughout the kernel. */
- #ifdef _KERNEL
- #include <sys/cdefs.h>
-@@ -116,6 +121,7 @@
- #ifndef _KERNEL
- #include <sys/limits.h>
- #endif
-+#endif
- 
- #ifndef _NO_NAMESPACE_POLLUTION
- 
-@@ -194,7 +200,9 @@
- #define	PDROP	0x200	/* OR'd with pri to stop re-entry of interlock mutex */
- #define	PBDRY	0x400	/* for PCATCH stop is done on the user boundary */
- 
-+#if 0
- #define	NZERO	0		/* default "nice" */
-+#endif
- 
- #define	NBBY	8		/* number of bits in a byte */
- #define	NBPW	sizeof(int)	/* number of bytes per word (integer) */
-@@ -263,6 +271,7 @@
- #define	MIN(a,b) (((a)<(b))?(a):(b))
- #define	MAX(a,b) (((a)>(b))?(a):(b))
- 
-+#if 0
- #ifdef _KERNEL
- /*
-  * Basic byte order function prototypes for non-inline functions.
-@@ -317,4 +326,5 @@
- #define	member2struct(s, m, x)						\
- 	((struct s *)(void *)((char *)(x) - offsetof(struct s, m)))
- 
-+#endif
- #endif	/* _SYS_PARAM_H_ */

Deleted: trunk/ufsutils/debian/patches/00_portable_ufs_types.patch
===================================================================
--- trunk/ufsutils/debian/patches/00_portable_ufs_types.patch	2013-10-26 14:16:16 UTC (rev 5093)
+++ trunk/ufsutils/debian/patches/00_portable_ufs_types.patch	2013-10-26 14:20:07 UTC (rev 5094)
@@ -1,14 +0,0 @@
-
-Reported by Vladimir Serbinenko.  Fixed in upstream SVN r227382.
-
---- a/sys/ufs/ffs/fs.h
-+++ b/sys/ufs/ffs/fs.h
-@@ -333,7 +333,7 @@
- 	ufs2_daddr_t fs_csaddr;		/* blk addr of cyl grp summary area */
- 	int64_t	 fs_pendingblocks;	/* (u) blocks being freed */
- 	u_int32_t fs_pendinginodes;	/* (u) inodes being freed */
--	ino_t	 fs_snapinum[FSMAXSNAP];/* list of snapshot inode numbers */
-+	uint32_t fs_snapinum[FSMAXSNAP];/* list of snapshot inode numbers */
- 	u_int32_t fs_avgfilesize;	/* expected average file size */
- 	u_int32_t fs_avgfpdir;		/* expected # of files per directory */
- 	int32_t	 fs_save_cgsize;	/* save real cg size to use fs_bsize */

Deleted: trunk/ufsutils/debian/patches/01_libufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/01_libufs.patch	2013-10-26 14:16:16 UTC (rev 5093)
+++ trunk/ufsutils/debian/patches/01_libufs.patch	2013-10-26 14:20:07 UTC (rev 5094)
@@ -1,85 +0,0 @@
----
- lib/libufs/block.c   |    2 ++
- lib/libufs/type.c    |    4 +++-
- sys/ufs/ffs/fs.h     |    5 ++++-
- sys/ufs/ufs/dinode.h |    2 ++
- sys/ufs/ufs/dir.h    |    2 ++
- 5 files changed, 13 insertions(+), 2 deletions(-)
-
---- a/lib/libufs/type.c
-+++ b/lib/libufs/type.c
-@@ -111,7 +111,7 @@ again:	if ((ret = stat(name, &st)) < 0)
- 	if (ret >= 0 && S_ISREG(st.st_mode)) {
- 		/* Possibly a disk image, give it a try.  */
- 		;
--	} else if (ret >= 0 && S_ISCHR(st.st_mode)) {
-+	} else if (ret >= 0 && (S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode))) {
- 		/* This is what we need, do nothing. */
- 		;
- 	} else if ((fs = getfsfile(name)) != NULL) {
-@@ -134,8 +134,10 @@ again:	if ((ret = stat(name, &st)) < 0)
- 			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);
---- a/sys/ufs/ffs/fs.h
-+++ b/sys/ufs/ffs/fs.h
-@@ -33,6 +33,9 @@
- #ifndef _UFS_FFS_FS_H_
- #define _UFS_FFS_FS_H_
- 
-+#include <sys/types.h>
-+#include <stdint.h>
-+
- /*
-  * Each disk drive contains some number of filesystems.
-  * A filesystem consists of a number of cylinder groups.
-@@ -504,7 +507,7 @@ struct cg {
-  * Turn filesystem block numbers into disk block addresses.
-  * This maps filesystem blocks to device size blocks.
-  */
--#define	fsbtodb(fs, b)	((daddr_t)(b) << (fs)->fs_fsbtodb)
-+#define	fsbtodb(fs, b)	(((intmax_t)(b)) << (fs)->fs_fsbtodb)
- #define	dbtofsb(fs, b)	((b) >> (fs)->fs_fsbtodb)
- 
- /*
---- a/sys/ufs/ufs/dinode.h
-+++ b/sys/ufs/ufs/dinode.h
-@@ -68,6 +68,8 @@
- #ifndef _UFS_UFS_DINODE_H_
- #define	_UFS_UFS_DINODE_H_
- 
-+#include <sys/types.h>
-+
- /*
-  * The root inode is the root of the filesystem.  Inode 0 can't be used for
-  * normal purposes and historically bad blocks were linked to inode 1, thus
---- a/sys/ufs/ufs/dir.h
-+++ b/sys/ufs/ufs/dir.h
-@@ -38,6 +38,8 @@
- #ifndef _UFS_UFS_DIR_H_
- #define	_UFS_UFS_DIR_H_
- 
-+#include <sys/types.h>
-+
- /*
-  * Theoretically, directories can be more than 2Gb in length, however, in
-  * practice this seems unlikely. So, we define the type doff_t as a 32-bit
---- a/lib/libufs/block.c
-+++ b/lib/libufs/block.c
-@@ -30,7 +30,9 @@ __FBSDID("$FreeBSD$");
- 
- #include <sys/param.h>
- #include <sys/mount.h>
-+#ifdef HAVE_BSD_DISKLABEL
- #include <sys/disk.h>
-+#endif
- #include <sys/disklabel.h>
- #include <sys/stat.h>
- 

Deleted: trunk/ufsutils/debian/patches/02_bsdlabel.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_bsdlabel.ufs.patch	2013-10-26 14:16:16 UTC (rev 5093)
+++ trunk/ufsutils/debian/patches/02_bsdlabel.ufs.patch	2013-10-26 14:20:07 UTC (rev 5094)
@@ -1,58 +0,0 @@
----
- sbin/bsdlabel/bsdlabel.c |   13 +++++++++++--
- 1 file changed, 11 insertions(+), 2 deletions(-)
-
---- a/sbin/bsdlabel/bsdlabel.c
-+++ b/sbin/bsdlabel/bsdlabel.c
-@@ -60,7 +60,9 @@ __FBSDID("$FreeBSD$");
- #include <sys/file.h>
- #include <sys/stat.h>
- #include <sys/wait.h>
-+#if HAVE_BSD_DISKLABEL
- #include <sys/disk.h>
-+#endif
- #define DKTYPENAMES
- #define FSTYPENAMES
- #define MAXPARTITIONS	26
-@@ -69,7 +71,7 @@ __FBSDID("$FreeBSD$");
- #include <unistd.h>
- #include <string.h>
- #include <stdio.h>
--#include <libgeom.h>
-+//#include <libgeom.h>
- #include <stdlib.h>
- #include <signal.h>
- #include <stdarg.h>
-@@ -720,10 +722,12 @@ editit(void)
- 
- 	omask = sigblock(sigmask(SIGINT)|sigmask(SIGQUIT)|sigmask(SIGHUP));
- 	while ((pid = fork()) < 0) {
-+#if HAVE_BSD_ERRNO
- 		if (errno == EPROCLIM) {
- 			warnx("you have too many processes");
- 			return(0);
- 		}
-+#endif
- 		if (errno != EAGAIN) {
- 			warn("fork");
- 			return(0);
-@@ -1508,13 +1512,18 @@ getvirginlabel(void)
- 	 * to get any good ideas from the device, construct something
- 	 * which is IBM-PC friendly.
- 	 */
-+#if HAVE_BSD_DISKLABEL
- 	if (ioctl(f, DIOCGFWSECTORS, &u) == 0)
- 		loclab.d_nsectors = u;
- 	else
-+#endif
- 		loclab.d_nsectors = 63;
-+#if HAVE_BSD_DISKLABEL
- 	if (ioctl(f, DIOCGFWHEADS, &u) == 0)
- 		loclab.d_ntracks = u;
--	else if (loclab.d_secperunit <= 63*1*1024)
-+	else
-+#endif
-+	if (loclab.d_secperunit <= 63*1*1024)
- 		loclab.d_ntracks = 1;
- 	else if (loclab.d_secperunit <= 63*16*1024)
- 		loclab.d_ntracks = 16;

Deleted: trunk/ufsutils/debian/patches/02_dumpfs.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_dumpfs.ufs.patch	2013-10-26 14:16:16 UTC (rev 5093)
+++ trunk/ufsutils/debian/patches/02_dumpfs.ufs.patch	2013-10-26 14:20:07 UTC (rev 5094)
@@ -1,14 +0,0 @@
----
- sbin/dumpfs/dumpfs.c |    1 +
- 1 file changed, 1 insertion(+)
-
---- a/sbin/dumpfs/dumpfs.c
-+++ b/sbin/dumpfs/dumpfs.c
-@@ -68,6 +68,7 @@ static const char rcsid[] =
- #include <fcntl.h>
- #include <fstab.h>
- #include <libufs.h>
-+#include <time.h>
- #include <stdint.h>
- #include <stdio.h>
- #include <stdlib.h>

Deleted: trunk/ufsutils/debian/patches/02_fsck.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_fsck.ufs.patch	2013-10-26 14:16:16 UTC (rev 5093)
+++ trunk/ufsutils/debian/patches/02_fsck.ufs.patch	2013-10-26 14:20:07 UTC (rev 5094)
@@ -1,512 +0,0 @@
----
- sbin/fsck_ffs/Makefile    |    2 -
- sbin/fsck_ffs/ea.c        |    2 -
- sbin/fsck_ffs/fsck.h      |    1 
- sbin/fsck_ffs/fsck_ffs.8  |    7 ++----
- sbin/fsck_ffs/fsutil.c    |   13 ++++++++++--
- sbin/fsck_ffs/gjournal.c  |    4 +++
- sbin/fsck_ffs/inode.c     |    3 +-
- sbin/fsck_ffs/main.c      |   49 ++++++++++++++++++++++++++++++++++++++++++++--
- sbin/fsck_ffs/pass1.c     |    2 +
- sbin/fsck_ffs/setup.c     |   14 +++++++++++++
- sbin/fsck_ffs/utilities.c |    6 +++--
- 11 files changed, 90 insertions(+), 13 deletions(-)
-
---- a/sbin/fsck_ffs/gjournal.c
-+++ b/sbin/fsck_ffs/gjournal.c
-@@ -54,6 +54,9 @@
- #include <sys/cdefs.h>
- __FBSDID("$FreeBSD$");
- 
-+
-+#if HAVE_UFS_SNAPSHOT
-+
- #include <sys/param.h>
- #include <sys/disklabel.h>
- #include <sys/mount.h>
-@@ -774,3 +777,4 @@ gjournal_check(const char *filesys)
- 	/* Write back updated statistics and super-block. */
- 	putdisk();
- }
-+#endif
---- a/sbin/fsck_ffs/ea.c
-+++ b/sbin/fsck_ffs/ea.c
-@@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$");
- 
- #include <sys/param.h>
- #include <sys/time.h>
--#include <sys/stdint.h>
-+#include <stdint.h>
- 
- #include <ufs/ufs/dinode.h>
- #include <ufs/ufs/dir.h>
---- a/sbin/fsck_ffs/fsck_ffs.8
-+++ b/sbin/fsck_ffs/fsck_ffs.8
-@@ -30,11 +30,11 @@
- .\" $FreeBSD$
- .\"
- .Dd January 25, 2009
--.Dt FSCK_FFS 8
-+.Dt FSCK.UFS 8
- .Os
- .Sh NAME
--.Nm fsck_ffs ,
--.Nm fsck_ufs
-+.Nm fsck.ffs ,
-+.Nm fsck.ufs
- .Nd file system consistency check and interactive repair
- .Sh SYNOPSIS
- .Nm
-@@ -349,5 +349,4 @@ are fully enumerated and explained in Ap
- .Xr fstab 5 ,
- .Xr fsck 8 ,
- .Xr fsdb 8 ,
--.Xr newfs 8 ,
- .Xr reboot 8
---- a/sbin/fsck_ffs/fsutil.c
-+++ b/sbin/fsck_ffs/fsutil.c
-@@ -38,7 +38,9 @@ __FBSDID("$FreeBSD$");
- #include <sys/param.h>
- #include <sys/time.h>
- #include <sys/types.h>
-+#if HAVE_BSD_SYSCTL
- #include <sys/sysctl.h>
-+#endif
- #include <sys/disklabel.h>
- #include <sys/stat.h>
- #include <sys/disklabel.h>
-@@ -55,6 +57,7 @@ __FBSDID("$FreeBSD$");
- #include <stdint.h>
- #include <stdio.h>
- #include <stdlib.h>
-+#include <signal.h>
- #include <unistd.h>
- 
- #include "fsck.h"
-@@ -277,11 +280,13 @@ ckfini(int markclean)
- 	if (bkgrdflag) {
- 		unlink(snapname);
- 		if ((!(sblock.fs_flags & FS_UNCLEAN)) != markclean) {
-+#ifdef HAVE_BSD_SYSCTL
- 			cmd.value = FS_UNCLEAN;
- 			cmd.size = markclean ? -1 : 1;
- 			if (sysctlbyname("vfs.ffs.setflags", 0, 0,
- 			    &cmd, sizeof cmd) == -1)
- 				rwerror("SET FILE SYSTEM FLAGS", FS_UNCLEAN);
-+#endif
- 			if (!preen) {
- 				printf("\n***** FILE SYSTEM MARKED %s *****\n",
- 				    markclean ? "CLEAN" : "DIRTY");
-@@ -639,7 +644,7 @@ getpathname(char *namebuf, ino_t curdir,
- }
- 
- void
--catch(int sig __unused)
-+catch(int sig)
- {
- 
- 	ckfini(0);
-@@ -652,7 +657,7 @@ catch(int sig __unused)
-  * so that reboot sequence may be interrupted.
-  */
- void
--catchquit(int sig __unused)
-+catchquit(int sig)
- {
- 	printf("returning to single-user after file system check\n");
- 	returntosingle = 1;
-@@ -721,11 +726,13 @@ pfatal(const char *fmt, ...)
- 		 * Force foreground fsck to clean up inconsistency.
- 		 */
- 		if (bkgrdflag) {
-+#if HAVE_BSD_SYSCTL
- 			cmd.value = FS_NEEDSFSCK;
- 			cmd.size = 1;
- 			if (sysctlbyname("vfs.ffs.setflags", 0, 0,
- 			    &cmd, sizeof cmd) == -1)
- 				pwarn("CANNOT SET FS_NEEDSFSCK FLAG\n");
-+#endif
- 			fprintf(stdout, "CANNOT RUN IN BACKGROUND\n");
- 			ckfini(0);
- 			exit(EEXIT);
-@@ -742,6 +749,7 @@ pfatal(const char *fmt, ...)
- 	/*
- 	 * Force foreground fsck to clean up inconsistency.
- 	 */
-+#if HAVE_BSD_SYSCTL
- 	if (bkgrdflag) {
- 		cmd.value = FS_NEEDSFSCK;
- 		cmd.size = 1;
-@@ -749,6 +757,7 @@ pfatal(const char *fmt, ...)
- 		    &cmd, sizeof cmd) == -1)
- 			pwarn("CANNOT SET FS_NEEDSFSCK FLAG\n");
- 	}
-+#endif
- 	ckfini(0);
- 	exit(EEXIT);
- }
---- a/sbin/fsck_ffs/inode.c
-+++ b/sbin/fsck_ffs/inode.c
-@@ -36,7 +36,7 @@ static const char sccsid[] = "@(#)inode.
- __FBSDID("$FreeBSD$");
- 
- #include <sys/param.h>
--#include <sys/stdint.h>
-+#include <stdint.h>
- #include <sys/time.h>
- #include <sys/sysctl.h>
- 
-@@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$");
- #include <err.h>
- #include <pwd.h>
- #include <string.h>
-+#include <time.h>
- 
- #include "fsck.h"
- 
---- a/sbin/fsck_ffs/main.c
-+++ b/sbin/fsck_ffs/main.c
-@@ -45,9 +45,17 @@ __FBSDID("$FreeBSD$");
- #include <sys/stat.h>
- #include <sys/file.h>
- #include <sys/time.h>
-+#ifdef HAVE_BSD_STATFS
- #include <sys/mount.h>
-+#else
-+#include <sys/statvfs.h>
-+#define statfs statvfs
-+#define f_flags f_flag
-+#endif
- #include <sys/resource.h>
-+#ifdef HAVE_BSD_SYSCTL
- #include <sys/sysctl.h>
-+#endif
- #include <sys/uio.h>
- #include <sys/disklabel.h>
- 
-@@ -62,14 +70,18 @@ __FBSDID("$FreeBSD$");
- #include <paths.h>
- #include <stdint.h>
- #include <string.h>
-+#include <time.h>
-+#include <signal.h>
- 
- #include "fsck.h"
- 
--static void usage(void) __dead2;
-+static void usage(void);
- static int argtoi(int flag, const char *req, const char *str, int base);
- static int checkfilesys(char *filesys);
- static int chkdoreload(struct statfs *mntp);
-+#ifdef HAVE_BSD_STATFS
- static struct statfs *getmntpt(const char *);
-+#endif
- 
- int
- main(int argc, char *argv[])
-@@ -79,10 +91,12 @@ main(int argc, char *argv[])
- 	struct itimerval itimerval;
- 	int ret = 0;
- 
-+	setprogname(argv[0]);
-+
- 	sync();
- 	skipclean = 1;
- 	inoopt = 0;
--	while ((ch = getopt(argc, argv, "b:Bc:CdfFm:npry")) != -1) {
-+	while ((ch = getopt(argc, argv, "ab:Bc:CdfFm:npry")) != -1) {
- 		switch (ch) {
- 		case 'b':
- 			skipclean = 0;
-@@ -126,6 +140,7 @@ main(int argc, char *argv[])
- 			yflag = 0;
- 			break;
- 
-+		case 'a':
- 		case 'p':
- 			preen++;
- 			/*FALLTHROUGH*/
-@@ -157,7 +172,9 @@ main(int argc, char *argv[])
- 		(void)signal(SIGINT, catch);
- 	if (ckclean)
- 		(void)signal(SIGQUIT, catchquit);
-+#ifdef HAVE_BSD_SIGNALS
- 	signal(SIGINFO, infohandler);
-+#endif
- 	if (bkgrdflag) {
- 		signal(SIGALRM, alarmhandler);
- 		itimerval.it_interval.tv_sec = 5;
-@@ -204,8 +221,10 @@ checkfilesys(char *filesys)
- 	ufs2_daddr_t n_ffree, n_bfree;
- 	struct dups *dp;
- 	struct statfs *mntp;
-+#if HAVE_UFS_SNAPSHOT && HAVE_BSD_STATFS
- 	struct stat snapdir;
- 	struct group *grp;
-+#endif
- 	ufs2_daddr_t blks;
- 	struct iovec *iov;
- 	char errmsg[255];
-@@ -226,10 +245,14 @@ checkfilesys(char *filesys)
- 	 * if it is listed among the mounted file systems. Failing that
- 	 * check to see if it is listed in /etc/fstab.
- 	 */
-+#if HAVE_BSD_STATFS
- 	mntp = getmntpt(filesys);
- 	if (mntp != NULL)
- 		filesys = mntp->f_mntfromname;
- 	else
-+#else
-+	mntp = NULL;
-+#endif
- 		filesys = blockcheck(filesys);
- 	/*
- 	 * If -F flag specified, check to see whether a background check
-@@ -247,8 +270,10 @@ checkfilesys(char *filesys)
- 		if ((sblock.fs_flags & FS_DOSOFTDEP) == 0)
- 			exit(5);	/* Not running soft updates */
- 		size = MIBSIZE;
-+#if HAVE_BSD_SYSCTL
- 		if (sysctlnametomib("vfs.ffs.adjrefcnt", adjrefcnt, &size) < 0)
- 			exit(6);	/* Lacks kernel support */
-+#endif
- 		if ((mntp == NULL && sblock.fs_clean == 1) ||
- 		    (mntp != NULL && (sblock.fs_flags & FS_UNCLEAN) == 0))
- 			exit(7);	/* Filesystem clean, report it now */
-@@ -261,6 +286,7 @@ checkfilesys(char *filesys)
- 		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);
-@@ -278,6 +304,7 @@ checkfilesys(char *filesys)
- 				    "CANNOT RUN FAST FSCK\n");
- 			}
- 		}
-+#endif
- 	}
- 	/*
- 	 * If we are to do a background check:
-@@ -286,6 +313,7 @@ checkfilesys(char *filesys)
- 	 *	return created snapshot file
- 	 *	if not found, clear bkgrdflag and proceed with normal fsck
- 	 */
-+#if HAVE_UFS_SNAPSHOT && HAVE_BSD_STATFS
- 	if (bkgrdflag) {
- 		if (mntp == NULL) {
- 			bkgrdflag = 0;
-@@ -368,6 +396,7 @@ checkfilesys(char *filesys)
- 				filesys = snapname;
- 		}
- 	}
-+#endif
- 
- 	switch (setup(filesys)) {
- 	case 0:
-@@ -375,7 +404,9 @@ checkfilesys(char *filesys)
- 			pfatal("CAN'T CHECK FILE SYSTEM.");
- 		return (0);
- 	case -1:
-+#if HAVE_UFS_SNAPSHOT && HAVE_BSD_STATFS
- 	clean:
-+#endif
- 		pwarn("clean, %ld free ", (long)(sblock.fs_cstotal.cs_nffree +
- 		    sblock.fs_frag * sblock.fs_cstotal.cs_nbfree));
- 		printf("(%lld frags, %lld blocks, %.1f%% fragmentation)\n",
-@@ -395,8 +426,10 @@ checkfilesys(char *filesys)
- 	 */
- 	if (preen == 0) {
- 		printf("** Last Mounted on %s\n", sblock.fs_fsmnt);
-+#if HAVE_BSD_STATFS
- 		if (mntp != NULL && mntp->f_flags & MNT_ROOTFS)
- 			printf("** Root file system\n");
-+#endif
- 		printf("** Phase 1 - Check Blocks and Sizes\n");
- 	}
- 	pass1();
-@@ -495,8 +528,13 @@ checkfilesys(char *filesys)
- 	/*
- 	 * Check to see if the file system is mounted read-write.
- 	 */
-+#if HAVE_BSD_STATFS
- 	if (bkgrdflag == 0 && mntp != NULL && (mntp->f_flags & MNT_RDONLY) == 0)
- 		resolved = 0;
-+#else
-+	if (bkgrdflag == 0 && mntp != NULL && (mntp->f_flag & ST_RDONLY) == 0)
-+		resolved = 0;
-+#endif
- 	ckfini(resolved);
- 
- 	for (cylno = 0; cylno < sblock.fs_ncg; cylno++)
-@@ -537,6 +575,8 @@ chkdoreload(struct statfs *mntp)
- 	 * it unless it is read-write, so we can continue using it
- 	 * as safely as possible.
- 	 */
-+#if HAVE_BSD_STATFS && HAVE_BSD_MOUNT
-+
- 	if (mntp->f_flags & MNT_RDONLY) {
- 		build_iovec(&iov, &iovlen, "fstype", "ffs", 4);
- 		build_iovec(&iov, &iovlen, "from", mntp->f_mntfromname,
-@@ -560,8 +600,12 @@ chkdoreload(struct statfs *mntp)
- 		return (1);
- 	}
- 	return (0);
-+#else
-+#warning "FIXME: use linux mount call"
-+#endif
- }
- 
-+#if HAVE_BSD_STATFS
- /*
-  * Get the mount point information for name.
-  */
-@@ -601,6 +645,7 @@ getmntpt(const char *name)
- 	statfsp = NULL;
- 	return (statfsp);
- }
-+#endif
- 
- static void
- usage(void)
---- a/sbin/fsck_ffs/pass1.c
-+++ b/sbin/fsck_ffs/pass1.c
-@@ -357,9 +357,11 @@ checkinode(ino_t inumber, struct inodesc
- 	inoinfo(inumber)->ino_type = IFTODT(mode);
- 	badblk = dupblk = 0;
- 	idesc->id_number = inumber;
-+#if HAVE_UFS_SNAPSHOT
- 	if (DIP(dp, di_flags) & SF_SNAPSHOT)
- 		idesc->id_type = SNAP;
- 	else
-+#endif
- 		idesc->id_type = ADDR;
- 	(void)ckinode(dp, idesc);
- 	if (sblock.fs_magic == FS_UFS2_MAGIC && dp->dp2.di_extsize > 0) {
---- a/sbin/fsck_ffs/setup.c
-+++ b/sbin/fsck_ffs/setup.c
-@@ -36,11 +36,14 @@ static const char sccsid[] = "@(#)setup.
- __FBSDID("$FreeBSD$");
- 
- #include <sys/param.h>
-+#include <sys/types.h>
- #include <sys/stat.h>
- #define FSTYPENAMES
- #include <sys/disklabel.h>
- #include <sys/file.h>
-+#if HAVE_BSD_SYSCTL
- #include <sys/sysctl.h>
-+#endif
- 
- #include <ufs/ufs/dinode.h>
- #include <ufs/ffs/fs.h>
-@@ -51,6 +54,7 @@ __FBSDID("$FreeBSD$");
- #include <limits.h>
- #include <stdint.h>
- #include <string.h>
-+#include <unistd.h>
- 
- #include "fsck.h"
- 
-@@ -87,6 +91,7 @@ setup(char *dev)
- 		}
- 		return (0);
- 	}
-+#if HAVE_UFS_SNAPSHOT
- 	if ((statb.st_mode & S_IFMT) != S_IFCHR &&
- 	    (statb.st_mode & S_IFMT) != S_IFBLK) {
- 		if (bkgrdflag != 0 && (statb.st_flags & SF_SNAPSHOT) == 0) {
-@@ -121,6 +126,7 @@ setup(char *dev)
- 			}
- 		}
- 	}
-+#endif
- 	if ((fsreadfd = open(dev, O_RDONLY)) < 0) {
- 		if (bkgrdflag) {
- 			unlink(snapname);
-@@ -131,6 +137,7 @@ setup(char *dev)
- 	}
- 	if (bkgrdflag) {
- 		unlink(snapname);
-+#if HAVE_BSD_SYSCTL
- 		size = MIBSIZE;
- 		if (sysctlnametomib("vfs.ffs.adjrefcnt", adjrefcnt, &size) < 0||
- 		    sysctlnametomib("vfs.ffs.adjblkcnt", adjblkcnt, &size) < 0||
-@@ -160,6 +167,7 @@ setup(char *dev)
- 		}
- 		cmd.version = FFS_CMD_VERSION;
- 		cmd.handle = fsreadfd;
-+#endif
- 		fswritefd = -1;
- 	}
- 	if (preen == 0)
-@@ -471,6 +479,8 @@ calcsb(char *dev, int devfd, struct fs *
- 		return (0);
- 	}
- 	lp = getdisklabel(dev, devfd);
-+	if (!lp)
-+		return (0);
- 	if (isdigit(*cp))
- 		pp = &lp->d_partitions[0];
- 	else
-@@ -521,13 +531,17 @@ calcsb(char *dev, int devfd, struct fs *
- static struct disklabel *
- getdisklabel(char *s, int fd)
- {
-+#ifdef HAVE_BSD_DISKLABEL
- 	static struct disklabel lab;
- 
- 	if (ioctl(fd, DIOCGDINFO, (char *)&lab) < 0) {
- 		if (s == NULL)
-+#endif
- 			return ((struct disklabel *)NULL);
-+#ifdef HAVE_BSD_DISKLABEL
- 		pwarn("ioctl (GCINFO): %s\n", strerror(errno));
- 		errx(EEXIT, "%s: can't read disk label", s);
- 	}
- 	return (&lab);
-+#endif
- }
---- a/sbin/fsck_ffs/utilities.c
-+++ b/sbin/fsck_ffs/utilities.c
-@@ -108,14 +108,16 @@ retry:
- 	return (origname);
- }
- 
-+#ifdef HAVE_BSD_SIGNALS
- void
--infohandler(int sig __unused)
-+infohandler(int sig)
- {
- 	got_siginfo = 1;
- }
-+#endif
- 
- void
--alarmhandler(int sig __unused)
-+alarmhandler(int sig)
- {
- 	got_sigalarm = 1;
- }
---- a/sbin/fsck_ffs/Makefile
-+++ b/sbin/fsck_ffs/Makefile
-@@ -10,7 +10,7 @@ SRCS=	dir.c ea.c fsutil.c inode.c main.c
- 	pass4.c pass5.c setup.c utilities.c ffs_subr.c ffs_tables.c gjournal.c \
- 	getmntopts.c
- DPADD=	${LIBUFS}
--LDADD=	-lufs
-+LDADD=	-lport -lufs
- WARNS?=	2
- CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../mount
- 
---- a/sbin/fsck_ffs/fsck.h
-+++ b/sbin/fsck_ffs/fsck.h
-@@ -63,6 +63,7 @@
- #include <unistd.h>
- #include <stdlib.h>
- #include <stdio.h>
-+#include <signal.h>
- 
- #define	MAXDUP		10	/* limit on dup blks (per inode) */
- #define	MAXBAD		10	/* limit on bad blks (per inode) */

Deleted: trunk/ufsutils/debian/patches/02_fsdb.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_fsdb.ufs.patch	2013-10-26 14:16:16 UTC (rev 5093)
+++ trunk/ufsutils/debian/patches/02_fsdb.ufs.patch	2013-10-26 14:20:07 UTC (rev 5094)
@@ -1,94 +0,0 @@
----
- sbin/fsdb/Makefile   |    2 +-
- sbin/fsdb/fsdb.8     |    2 +-
- sbin/fsdb/fsdb.c     |   14 +++++++++++++-
- sbin/fsdb/fsdbutil.c |   13 ++++++++++++-
- 4 files changed, 27 insertions(+), 4 deletions(-)
-
---- a/sbin/fsdb/fsdb.8
-+++ b/sbin/fsdb/fsdb.8
-@@ -263,7 +263,7 @@ There are a bunch of other things that y
- .Nm
- does not implement.
- .Sh WARNING
--Use this tool with extreme caution--you can damage an FFS file system
-+Use this tool with extreme caution\-\-you can damage an FFS file system
- beyond what
- .Xr fsck 8
- can repair.
---- a/sbin/fsdb/fsdb.c
-+++ b/sbin/fsdb/fsdb.c
-@@ -35,13 +35,13 @@ static const char rcsid[] =
- 
- #include <sys/param.h>
- #include <sys/time.h>
-+#include <time.h>
- #include <ctype.h>
- #include <err.h>
- #include <grp.h>
- #include <histedit.h>
- #include <pwd.h>
- #include <string.h>
--#include <timeconv.h>
- 
- #include <ufs/ufs/dinode.h>
- #include <ufs/ufs/dir.h>
-@@ -60,6 +60,18 @@ static int find_blks64(uint64_t *buf, in
- static int find_indirblks32(uint32_t blk, int ind_level, uint32_t *blknum);
- static int find_indirblks64(uint64_t blk, int ind_level, uint64_t *blknum);
- 
-+static inline int32_t
-+_time_to_time32(time_t t)
-+{
-+    return((int32_t)t);
-+}
-+
-+static inline int64_t
-+_time_to_time64(time_t t)
-+{
-+    return((int64_t)t);
-+}    
-+
- static void 
- usage(void)
- {
---- a/sbin/fsdb/fsdbutil.c
-+++ b/sbin/fsdb/fsdbutil.c
-@@ -41,7 +41,6 @@ static const char rcsid[] =
- #include <stdint.h>
- #include <string.h>
- #include <time.h>
--#include <timeconv.h>
- 
- #include <ufs/ufs/dinode.h>
- #include <ufs/ffs/fs.h>
-@@ -51,6 +50,18 @@ static const char rcsid[] =
- #include "fsdb.h"
- #include "fsck.h"
- 
-+static inline time_t
-+_time64_to_time(int64_t t64)
-+{
-+    return((time_t)t64);
-+}
-+    
-+static inline time_t
-+_time32_to_time(int32_t t32)
-+{
-+    return((time_t)t32);
-+}
-+    
- static int charsperline(void);
- static int printindir(ufs2_daddr_t blk, int level, char *bufp);
- static void printblocks(ino_t inum, union dinode *dp);
---- a/sbin/fsdb/Makefile
-+++ b/sbin/fsdb/Makefile
-@@ -9,7 +9,7 @@ SRCS=	fsdb.c fsdbutil.c \
- 	pass5.c setup.c utilities.c ffs_subr.c ffs_tables.c
- CFLAGS+= -I${.CURDIR}/../fsck_ffs
- WARNS?= 2
--LDADD=	-ledit -ltermcap
-+LDADD=	-ledit
- DPADD=	${LIBEDIT} ${LIBTERMCAP}
- .PATH:	${.CURDIR}/../fsck_ffs ${.CURDIR}/../../sys/ufs/ffs
- 

Deleted: trunk/ufsutils/debian/patches/02_growfs.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_growfs.ufs.patch	2013-10-26 14:16:16 UTC (rev 5093)
+++ trunk/ufsutils/debian/patches/02_growfs.ufs.patch	2013-10-26 14:20:07 UTC (rev 5094)
@@ -1,54 +0,0 @@
----
- sbin/growfs/growfs.c |    8 +++++++-
- 1 file changed, 7 insertions(+), 1 deletion(-)
-
---- a/sbin/growfs/growfs.c
-+++ b/sbin/growfs/growfs.c
-@@ -51,10 +51,10 @@ __FBSDID("$FreeBSD$");
- 
- /* ********************************************************** INCLUDES ***** */
- #include <sys/param.h>
-+#define rounddown(x, y) (((x)/(y))*(y))
- #include <sys/disklabel.h>
- #include <sys/ioctl.h>
- #include <sys/stat.h>
--#include <sys/disk.h>
- 
- #include <stdio.h>
- #include <paths.h>
-@@ -1925,10 +1925,12 @@ get_dev_size(int fd, int *size)
-    int sectorsize;
-    off_t mediasize;
- 
-+#ifdef HAVE_BSD_DISKLABEL
-    if (ioctl(fd, DIOCGSECTORSIZE, &sectorsize) == -1)
-         err(1,"DIOCGSECTORSIZE");
-    if (ioctl(fd, DIOCGMEDIASIZE, &mediasize) == -1)
-         err(1,"DIOCGMEDIASIZE");
-+#endif
- 
-    if (sectorsize <= 0)
-        errx(1, "bogus sectorsize: %d", sectorsize);
-@@ -2285,9 +2287,11 @@ return_disklabel(int fd, struct disklabe
- 		}
- 		lp->d_checksum=sum;
- 
-+#if HAVE_BSD_DISKLABEL
- 		if (ioctl(fd, DIOCWDINFO, (char *)lp) < 0) {
- 			errx(1, "DIOCWDINFO failed");
- 		}
-+#endif
- 	}
- 	free(lp);
- 
-@@ -2311,8 +2315,10 @@ get_disklabel(int fd)
- 	if (!lab)
- 		errx(1, "malloc failed");
- 
-+#ifdef HAVE_BSD_DISKLABEL
-     if (!ioctl(fd, DIOCGDINFO, (char *)lab))
-         return (lab);
-+#endif
- 
-     unlabeled++;
- 

Deleted: trunk/ufsutils/debian/patches/02_mkfs.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_mkfs.ufs.patch	2013-10-26 14:16:16 UTC (rev 5093)
+++ trunk/ufsutils/debian/patches/02_mkfs.ufs.patch	2013-10-26 14:20:07 UTC (rev 5094)
@@ -1,125 +0,0 @@
----
- sbin/newfs/Makefile |    3 ++-
- sbin/newfs/mkfs.c   |    1 +
- sbin/newfs/newfs.8  |    4 ++--
- sbin/newfs/newfs.c  |   22 ++++++++++++++++++----
- 4 files changed, 23 insertions(+), 7 deletions(-)
-
---- a/sbin/newfs/mkfs.c
-+++ b/sbin/newfs/mkfs.c
-@@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$");
- #include <stdint.h>
- #include <stdio.h>
- #include <unistd.h>
-+#include <time.h>
- #include <sys/param.h>
- #include <sys/time.h>
- #include <sys/types.h>
---- a/sbin/newfs/newfs.c
-+++ b/sbin/newfs/newfs.c
-@@ -55,7 +55,9 @@ __FBSDID("$FreeBSD$");
-  */
- #include <sys/param.h>
- #include <sys/stat.h>
-+#ifdef HAVE_BSD_DISKLABEL
- #include <sys/disk.h>
-+#endif
- #include <sys/disklabel.h>
- #include <sys/file.h>
- #include <sys/mount.h>
-@@ -133,6 +135,8 @@ main(int argc, char *argv[])
- 	off_t mediasize;
- 	char part_name;		/* partition name, default to full disk */
- 
-+	setprogname(argv[0]);
-+
- 	part_name = 'c';
- 	reserved = 0;
- 	while ((ch = getopt(argc, argv,
-@@ -303,8 +307,9 @@ main(int argc, char *argv[])
- 	}
- 	if (fstat(disk.d_fd, &st) < 0)
- 		err(1, "%s", special);
--	if ((st.st_mode & S_IFMT) != S_IFCHR) {
--		warn("%s: not a character-special device", special);
-+	if ((st.st_mode & S_IFMT) != S_IFCHR &&
-+	    (st.st_mode & S_IFMT) != S_IFBLK) {
-+		warn("%s: not a block or character-special device", special);
- 		is_file = 1;	/* assume it is a file */
- 		dkname = special;
- 		if (sectorsize == 0)
-@@ -312,10 +317,15 @@ main(int argc, char *argv[])
- 		mediasize = st.st_size;
- 		/* set fssize from the partition */
- 	} else {
-+#ifdef HAVE_BSD_DISKLABEL
- 	    if (sectorsize == 0)
- 		if (ioctl(disk.d_fd, DIOCGSECTORSIZE, &sectorsize) == -1)
- 		    sectorsize = 0;	/* back out on error for safety */
--	    if (sectorsize && ioctl(disk.d_fd, DIOCGMEDIASIZE, &mediasize) != -1)
-+#else
-+	    sectorsize = 512;
-+#endif
-+	    mediasize = get_block_device_size(disk.d_fd);
-+	    if (sectorsize && mediasize)
- 		getfssize(&fssize, special, mediasize / sectorsize, reserved);
- 	}
- 	pp = NULL;
-@@ -370,7 +380,7 @@ main(int argc, char *argv[])
- 			pp->p_size *= secperblk;
- 	}
- 	mkfs(pp, special);
--	if (!unlabeled) {
-+	if (!unlabeled && pp != NULL) {
- 		if (realsectorsize != DEV_BSIZE)
- 			pp->p_size /= realsectorsize / DEV_BSIZE;
- 		if (!Nflag && bcmp(pp, &oldpartition, sizeof(oldpartition)))
-@@ -415,8 +425,10 @@ getdisklabel(char *s)
- 		return &lab;
- 	}
- 
-+#if HAVE_BSD_DISKLABEL
- 	if (ioctl(disk.d_fd, DIOCGDINFO, (char *)&lab) != -1)
- 		return (&lab);
-+#endif
- 	unlabeled++;
- 	if (disktype) {
- 		lp = getdiskbyname(disktype);
-@@ -441,8 +453,10 @@ rewritelabel(char *s, struct disklabel *
- 			errx(1, "cannot write label");
- 		return;
- 	}
-+#if HAVE_BSD_DISKLABEL
- 	if (ioctl(disk.d_fd, DIOCWDINFO, (char *)lp) == -1)
- 		warn("ioctl (WDINFO): %s: can't rewrite disk label", s);
-+#endif
- }
- 
- static void
---- a/sbin/newfs/Makefile
-+++ b/sbin/newfs/Makefile
-@@ -5,7 +5,8 @@
- 
- PROG=	newfs
- DPADD=	${LIBUFS}
--LDADD=	-lufs
-+LDADD=	-lufs -lport
-+CFLAGS+= -include ../../lib/port/blockdev.h
- SRCS=	newfs.c mkfs.c geom_bsd_enc.c
- 
- WARNS?=	2
---- a/sbin/newfs/newfs.8
-+++ b/sbin/newfs/newfs.8
-@@ -78,10 +78,10 @@ The following options define the general
- .It Fl E
- Erase the content of the disk before making the filesystem.
- The reserved area in front of the superblock (for bootcode) will not be erased.
--
-+.Pp
- This is a relevant option for flash based storage devices that use
- wear levelling algorithms.
--
-+.Pp
- NB: Erasing may take as long time as writing every sector on the disk.
- .It Fl J
- Enable journaling on the new file system via gjournal.

Deleted: trunk/ufsutils/debian/patches/02_tunefs.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_tunefs.ufs.patch	2013-10-26 14:16:16 UTC (rev 5093)
+++ trunk/ufsutils/debian/patches/02_tunefs.ufs.patch	2013-10-26 14:20:07 UTC (rev 5094)
@@ -1,63 +0,0 @@
----
- sbin/tunefs/tunefs.c |   15 +++++++++++++++
- 1 file changed, 15 insertions(+)
-
---- a/sbin/tunefs/tunefs.c
-+++ b/sbin/tunefs/tunefs.c
-@@ -48,8 +48,15 @@ __FBSDID("$FreeBSD$");
- #include <sys/mount.h>
- #include <sys/disklabel.h>
- #include <sys/stat.h>
-+#ifndef HAVE_BSD_STATFS
-+#include <sys/statvfs.h>
-+#define statfs statvfs
-+#define f_flags f_flag
-+#endif
- 
-+#if HAVE_BSD_MOUNT
- #include <ufs/ufs/ufsmount.h>
-+#endif
- #include <ufs/ufs/dinode.h>
- #include <ufs/ffs/fs.h>
- 
-@@ -84,8 +91,12 @@ main(int argc, char *argv[])
- 	int mflag, mvalue, Nflag, nflag, oflag, ovalue, pflag, sflag, svalue;
- 	int ch, found_arg, i;
- 	const char *chg[2];
-+#ifdef HAVE_BSD_MOUNT
- 	struct ufs_args args;
-+#endif
-+#ifdef HAVE_BSD_STATFS
- 	struct statfs stfs;
-+#endif
- 
- 	if (argc < 3)
- 		usage();
-@@ -253,9 +264,11 @@ main(int argc, char *argv[])
- 		goto err;
- 	if (disk.d_name != special) {
- 		special = disk.d_name;
-+#ifdef HAVE_BSD_STATFS
- 		if (statfs(special, &stfs) == 0 &&
- 		    strcmp(special, stfs.f_mntonname) == 0)
- 			active = 1;
-+#endif
- 	}
- 
- 	if (pflag) {
-@@ -440,6 +453,7 @@ main(int argc, char *argv[])
- 	if (sbwrite(&disk, Aflag) == -1)
- 		goto err;
- 	ufs_disk_close(&disk);
-+#if HAVE_BSD_MOUNT && HAVE_BSD_STATFS
- 	if (active) {
- 		bzero(&args, sizeof(args));
- 		if (mount("ufs", on,
-@@ -447,6 +461,7 @@ main(int argc, char *argv[])
- 			err(9, "%s: reload", special);
- 		warnx("file system reloaded");
- 	}
-+#endif
- 	exit(0);
- err:
- 	if (disk.d_error != NULL)

Deleted: trunk/ufsutils/debian/patches/03_ufsmount.patch
===================================================================
--- trunk/ufsutils/debian/patches/03_ufsmount.patch	2013-10-26 14:16:16 UTC (rev 5093)
+++ trunk/ufsutils/debian/patches/03_ufsmount.patch	2013-10-26 14:20:07 UTC (rev 5094)
@@ -1,15 +0,0 @@
----
- sys/ufs/ufs/ufsmount.h |    2 --
- 1 file changed, 2 deletions(-)
-
---- a/sys/ufs/ufs/ufsmount.h
-+++ b/sys/ufs/ufs/ufsmount.h
-@@ -33,8 +33,6 @@
- #ifndef _UFS_UFS_UFSMOUNT_H_
- #define _UFS_UFS_UFSMOUNT_H_
- 
--#include <sys/buf.h>	/* XXX For struct workhead. */
--
- /*
-  * Arguments to mount UFS-based filesystems
-  */

Modified: trunk/ufsutils/debian/patches/04_avoid_diocgdelete.patch
===================================================================
--- trunk/ufsutils/debian/patches/04_avoid_diocgdelete.patch	2013-10-26 14:16:16 UTC (rev 5093)
+++ trunk/ufsutils/debian/patches/04_avoid_diocgdelete.patch	2013-10-26 14:20:07 UTC (rev 5094)
@@ -4,7 +4,7 @@
 
 --- a/lib/libufs/block.c
 +++ b/lib/libufs/block.c
-@@ -141,7 +141,7 @@
+@@ -139,7 +139,7 @@
  	return (cnt);
  }
  

Modified: trunk/ufsutils/debian/patches/05_wipe_otherfs.patch
===================================================================
--- trunk/ufsutils/debian/patches/05_wipe_otherfs.patch	2013-10-26 14:16:16 UTC (rev 5093)
+++ trunk/ufsutils/debian/patches/05_wipe_otherfs.patch	2013-10-26 14:20:07 UTC (rev 5094)
@@ -1,39 +1,35 @@
 --- a/sbin/newfs/mkfs.c
 +++ b/sbin/newfs/mkfs.c
-@@ -505,21 +505,23 @@
- 		    sblock.fs_size * sblock.fs_fsize - sblock.fs_sblockloc);
+@@ -48,6 +48,7 @@
+ #include <sys/disklabel.h>
+ #include <sys/file.h>
+ #include <sys/ioctl.h>
++#include <sys/disk.h>
+ #include <sys/mman.h>
+ #include <sys/resource.h>
+ #include <sys/stat.h>
+@@ -531,6 +532,24 @@
+ 			}
+ 		}
  	}
- 	/*
--	 * Wipe out old UFS1 superblock(s) if necessary.
-+	 * Wipe out other file systems. For now we erase first and last 512 kiB
-+	 * (this works for at least UFS1 and ZFS).
- 	 */
--	if (!Nflag && Oflag != 1) {
--		i = bread(&disk, part_ofs + SBLOCK_UFS1 / disk.d_bsize, chdummy, SBLOCKSIZE);
--		if (i == -1)
--			err(1, "can't read old UFS1 superblock: %s", disk.d_error);
++	/* Wipe out other file systems. For now we erase first and last 512 kiB
++	 * (this works for at least UFS1 and ZFS). */
 +	if (!Eflag && !Nflag) {
-+		off_t mediasize = get_block_device_size(disk.d_fd);
- 
--		if (fsdummy.fs_magic == FS_UFS1_MAGIC) {
--			fsdummy.fs_magic = 0;
--			bwrite(&disk, part_ofs + SBLOCK_UFS1 / disk.d_bsize,
--			    chdummy, SBLOCKSIZE);
--			for (cg = 0; cg < fsdummy.fs_ncg; cg++)
--				bwrite(&disk, part_ofs + fsbtodb(&fsdummy,
--				  cgsblock(&fsdummy, cg)), chdummy, SBLOCKSIZE);
--		}
-+		printf("Erasing sectors [%jd...%jd]\n", 
-+		    sblock.fs_sblockloc / disk.d_bsize,
-+		    fsbtodb(&sblock, sblock.fs_size) - 1);
++		off_t mediasize;
++		if (!ioctl(disk.d_fd, DIOCGMEDIASIZE, &mediasize))
++			err(1, "DIOCGMEDIASIZE");
++		printf("Erasing sectors [%jd...%jd]\n",
++			sblock.fs_sblockloc / disk.d_bsize,
++			fsbtodb(&sblock, sblock.fs_size) - 1);
 +		berase(&disk, sblock.fs_sblockloc / disk.d_bsize,
-+		    1024 * disk.d_bsize - sblock.fs_sblockloc);
++			1024 * disk.d_bsize - sblock.fs_sblockloc);
 +
-+		printf("Erasing sectors [%jd...%jd]\n", 
-+		    (mediasize - 1024 * 512) / disk.d_bsize,
-+		    (mediasize / disk.d_bsize) - 1);
++		printf("Erasing sectors [%jd...%jd]\n",
++			(mediasize - 1024 * 512) / disk.d_bsize,
++			(mediasize / disk.d_bsize) - 1);
 +		berase(&disk, (mediasize - 1024 * 512) / disk.d_bsize,
-+		    1024 * 512);
- 	}
++			1024 * 512);
++	}
  	if (!Nflag)
  		do_sbwrite(&disk);
+ 	if (Xflag == 1) {

Added: trunk/ufsutils/debian/patches/fsck_getopt.diff
===================================================================
--- trunk/ufsutils/debian/patches/fsck_getopt.diff	                        (rev 0)
+++ trunk/ufsutils/debian/patches/fsck_getopt.diff	2013-10-26 14:20:07 UTC (rev 5094)
@@ -0,0 +1,20 @@
+--- a/sbin/fsck_ffs/main.c
++++ b/sbin/fsck_ffs/main.c
+@@ -82,7 +82,7 @@
+ 	sync();
+ 	skipclean = 1;
+ 	inoopt = 0;
+-	while ((ch = getopt(argc, argv, "b:Bc:CdEfFm:npryZ")) != -1) {
++	while ((ch = getopt(argc, argv, "ab:Bc:CdEfFm:npryZ")) != -1) {
+ 		switch (ch) {
+ 		case 'b':
+ 			skipclean = 0;
+@@ -130,6 +130,8 @@
+ 			yflag = 0;
+ 			break;
+ 
++		case 'a':
++			/* For compatibility with the Linux version of fsck. */
+ 		case 'p':
+ 			preen++;
+ 			/*FALLTHROUGH*/

Added: trunk/ufsutils/debian/patches/makefiles.diff
===================================================================
--- trunk/ufsutils/debian/patches/makefiles.diff	                        (rev 0)
+++ trunk/ufsutils/debian/patches/makefiles.diff	2013-10-26 14:20:07 UTC (rev 5094)
@@ -0,0 +1,111 @@
+--- a/sbin/badsect/Makefile
++++ b/sbin/badsect/Makefile
+@@ -7,4 +7,7 @@
+ MAN=	badsect.8
+ WARNS?=	2
+ 
++CFLAGS+=	-I../../lib/libufs
++LDADD+=		-L../../lib/libufs
++
+ .include <bsd.prog.mk>
+--- a/sbin/dumpfs/Makefile
++++ b/sbin/dumpfs/Makefile
+@@ -7,4 +7,9 @@
+ LDADD=	-lufs
+ MAN=	dumpfs.8
+ 
++LDADD+=	-lbsd
++
++CFLAGS+=	-I../../lib/libufs
++LDADD+=		-L../../lib/libufs
++
+ .include <bsd.prog.mk>
+--- a/sbin/ffsinfo/Makefile
++++ b/sbin/ffsinfo/Makefile
+@@ -15,5 +15,8 @@
+ CFLAGS+=-DFS_DEBUG -I${GROWFS}
+ DPADD=	${LIBUFS}
+ LDADD=	-lufs
++
++CFLAGS+=	-I../../lib/libufs
++LDADD+=		-L../../lib/libufs -lbsd
+  
+ .include <bsd.prog.mk>               
+--- a/sbin/fsck_ffs/Makefile
++++ b/sbin/fsck_ffs/Makefile
+@@ -13,6 +13,11 @@
+ WARNS?=	2
+ CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../mount
+ 
++LDADD+=	-lbsd
++
++CFLAGS+=	-I../../lib/libufs
++LDADD+=		-L../../lib/libufs
++
+ .PATH:	${.CURDIR}/../../sys/ufs/ffs ${.CURDIR}/../mount
+ 
+ .include <bsd.prog.mk>
+--- a/sbin/newfs/Makefile
++++ b/sbin/newfs/Makefile
+@@ -5,12 +5,15 @@
+ 
+ PROG=	newfs
+ DPADD=	${LIBUFS} ${LIBUTIL}
+-LDADD=	-lufs -lutil
++LDADD=	-lufs
+ SRCS=	newfs.c mkfs.c geom_bsd_enc.c
+ 
+ WARNS?=	3
+ MAN=	newfs.8
+ 
++CFLAGS+=	-I../../lib/libufs
++LDADD+=		-L../../lib/libufs -lbsd -lfreebsd-glue
++
+ .include <bsd.prog.mk>
+ 
+ test:	${PROG}
+--- a/sbin/tunefs/Makefile
++++ b/sbin/tunefs/Makefile
+@@ -6,6 +6,9 @@
+ LDADD=	-lufs
+ MAN=	tunefs.8
+ 
++CFLAGS+=	-I../../lib/libufs
++LDADD+=		-L../../lib/libufs -lbsd
++
+ WARNS=	3
+ 
+ .include <bsd.prog.mk>
+--- a/sbin/growfs/Makefile
++++ b/sbin/growfs/Makefile
+@@ -18,6 +18,8 @@
+ .endif  
+ 
+ DPADD=	${LIBUTIL}
+-LDADD=	-lutil
++#LDADD=	-lutil
++
++LDADD+=		-lbsd -lfreebsd-glue
+ 
+ .include <bsd.prog.mk>      
+--- a/sbin/fsdb/Makefile
++++ b/sbin/fsdb/Makefile
+@@ -13,4 +13,7 @@
+ DPADD=	${LIBEDIT} ${LIBTERMCAP}
+ .PATH:	${.CURDIR}/../fsck_ffs ${.CURDIR}/../../sys/ufs/ffs
+ 
++LDADD+=	-lbsd
++CFLAGS+=	-I../../lib/libufs
++
+ .include <bsd.prog.mk>
+--- a/lib/libufs/Makefile
++++ b/lib/libufs/Makefile
+@@ -7,6 +7,8 @@
+ SRCS=	block.c cgroup.c inode.c sblock.c type.c ffs_subr.c ffs_tables.c
+ INCS=	libufs.h
+ 
++LDADD+=	-lbsd
++
+ MAN=	bread.3 cgread.3 libufs.3 sbread.3 ufs_disk_close.3
+ MLINKS+= bread.3 bwrite.3
+ MLINKS+= bread.3 berase.3

Modified: trunk/ufsutils/debian/patches/series
===================================================================
--- trunk/ufsutils/debian/patches/series	2013-10-26 14:16:16 UTC (rev 5093)
+++ trunk/ufsutils/debian/patches/series	2013-10-26 14:20:07 UTC (rev 5094)
@@ -1,17 +1,12 @@
+# Patches from (or merged in) upstream
 00_portable_berase.patch
-00_include.patch
-00_libport.patch
-00_mount.patch
-00_param.patch
-00_portable_ufs_types.patch
-01_libufs.patch
-02_bsdlabel.ufs.patch
-02_dumpfs.ufs.patch
-02_fsck.ufs.patch
-02_fsdb.ufs.patch
-02_growfs.ufs.patch
-02_mkfs.ufs.patch
-02_tunefs.ufs.patch
-03_ufsmount.patch
-04_avoid_diocgdelete.patch
+
+# Patches that are in good shape for merging upstream
 05_wipe_otherfs.patch
+fsck_getopt.diff
+
+# Other patches that might or might not be mergeable
+
+# Patches that are likely to be Debian-specific
+04_avoid_diocgdelete.patch
+makefiles.diff

Modified: trunk/ufsutils/debian/rules
===================================================================
--- trunk/ufsutils/debian/rules	2013-10-26 14:16:16 UTC (rev 5093)
+++ trunk/ufsutils/debian/rules	2013-10-26 14:20:07 UTC (rev 5094)
@@ -1,171 +1,161 @@
 #!/usr/bin/make -f
-# -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# GNU copyright 1997 to 1999 by Joey Hess.
+# Sample debian/rules that uses cdbs.  Originaly written by Robert Millan.
+# This file is public domain.
 
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
-DESTDIR = $(CURDIR)/debian/tmp
-libdir := $(DESTDIR)/lib
-sbindir := $(DESTDIR)/sbin
-man8dir := $(DESTDIR)/usr/share/man/man8
+export SHELL = bash
 
-DEB_HOST_ARCH_OS = $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
+CFLAGS = -Wall -g -pipe -fPIC -D_GNU_SOURCE \
+	-Werror=implicit-function-declaration \
+	-isystem /usr/include/freebsd \
+	$(NULL)
+CXXFLAGS = $(CFLAGS)
 
-CFLAGS := -Wall -Werror=implicit-function-declaration \
-          $(shell dpkg-buildflags --get CPPFLAGS) \
-          $(shell dpkg-buildflags --get CFLAGS) \
-          $(shell pkg-config --cflags libbsd-overlay)
-LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) \
-           $(shell pkg-config --libs libbsd-overlay)
+ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -O0
+	CXXFLAGS += -O0
+else
+	CFLAGS += -O2
+	CXXFLAGS += -O2
+endif
 
-# Note: GNU/kFreeBSD already has a 64-bit off_t. It must not be enabled,
-# as it would change size of ino_t.
-ifneq (kfreebsd,$(DEB_HOST_ARCH_OS))
-CFLAGS += -D_FILE_OFFSET_BITS=64
+full_version	:= $(shell dpkg-parsechangelog | grep ^Version: | sed -e 's/^.*: //g')
+tar_version	:= $(shell echo $(full_version) | sed -e 's/-.*//g')
+svn_revision	:= $(shell echo $(full_version) | sed -e 's/.*~svn\([0-9]*\)-[0-9]*/\1/g')
+version		:= $(shell echo $(full_version) | sed -e 's/[~+-].*//g')
+major           := $(shell echo $(version) | sed -e 's/\..*//g')
+revision	:= $(shell echo $(full_version) | sed -e 's/^[^+-]*//g')
 
-# Only use the local sys partial headers hierarchy on non-kFreeBSD systems.
-CFLAGS += -I$(CURDIR)/sys
-endif
+SVN		:= http://svn.freebsd.org/base/release/$(version).0
+#SVN		:= http://svn.freebsd.org/base/releng/$(version)
+#SVN		:= http://svn.freebsd.org/base/stable/$(major)
+#SVN		:= http://svn.freebsd.org/base/head
 
-CFLAGS += -I$(CURDIR)/lib/port -include port.h \
-          -I$(CURDIR)/lib/libufs \
-          -D_GNU_SOURCE
-LDFLAGS += -L$(CURDIR)/lib/port -L$(CURDIR)/lib/libufs
+SOURCE = ufsutils
+ORIGDIR = $(SOURCE)-$(tar_version)
+TARNAME = $(SOURCE)_$(tar_version).orig.tar.gz
 
 PATH := /usr/lib/freebsd:$(PATH)
-PMAKE = CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
-        NO_WERROR=1 NO_SHARED=NO NO_PROFILE=1 NO_PIC=1 WARNS=0 \
+DESTDIR = $(CURDIR)/debian/tmp
+PMAKE = COPTS="$(CFLAGS)" CFLAGS="$(CFLAGS)" \
+        NO_WERROR=1 NOGCCERROR=1 NOSHARED=NO NO_SHARED=NO \
         DESTDIR=$(DESTDIR) make
 
-SRCDIRS := \
-  lib/libufs \
-  sbin/badsect \
-  sbin/dumpfs \
-  sbin/ffsinfo \
-  sbin/fsck_ffs \
-  sbin/fsdb \
-  sbin/growfs \
-  sbin/newfs \
-  sbin/tunefs \
-  $(nil)
+build: build-arch build-indep
 
-SOURCE = $(shell dpkg-parsechangelog -SSource)
-VERSION = $(shell dpkg-parsechangelog -SVersion | sed -e 's/-.*//g')
-SVN = http://svn.freebsd.org/base/release/$(VERSION).0
-ORIGDIR = $(SOURCE)-$(VERSION)
-TARNAME = $(SOURCE)_$(VERSION).orig.tar.gz
-
 get-orig-source:
 	rm -rf $(ORIGDIR)
-	mkdir -p $(ORIGDIR)/sys/sys $(ORIGDIR)/sys/geom
-	for i in $(SRCDIRS) \
-		 sbin/bsdlabel \
-		 sbin/dump \
-		 sbin/mount \
-		 sbin/sunlabel \
-		 sys/ufs \
-		 sys/geom/geom_bsd_enc.c \
-		 sys/sys/disklabel.h sys/sys/mount.h sys/sys/param.h \
-		 sys/sys/ucred.h ; \
-	do \
-	    svn export $(SVN)/$$i $(ORIGDIR)/$$i ; \
+	mkdir -p $(ORIGDIR)/sys/geom
+	for i in \
+		sbin/badsect sbin/dumpfs sbin/fsck_ffs sbin/fsdb \
+		sbin/growfs sbin/newfs sbin/tunefs sbin/ffsinfo \
+		sys/ufs lib/libufs sys/geom/geom_bsd_enc.c \
+		sbin/mount \
+	; do \
+	    svn export $(SVN)/$$i $(ORIGDIR)/$$i || exit ; \
 	done
 	tar --numeric-owner --owner 0 --group 0 -czf ../$(TARNAME) $(ORIGDIR)
 	rm -rf $(ORIGDIR)
 
-build-indep:
+build-arch: ufsutils
 
-build-arch:
-	dh_testdir
+ufsutils: ufsutils-stamp
+ufsutils-stamp:
+	$(PMAKE) -C lib/libufs
+	$(PMAKE) -C sbin/badsect
+	$(PMAKE) -C sbin/dumpfs
+	$(PMAKE) -C sbin/fsck_ffs
+	$(PMAKE) -C sbin/fsdb
+	$(PMAKE) -C sbin/growfs
+	$(PMAKE) -C sbin/newfs
+	$(PMAKE) -C sbin/tunefs
+	$(PMAKE) -C sbin/ffsinfo
+	touch $@
 
-	$(PMAKE) -C lib/port
-	for d in $(SRCDIRS); do \
-		$(PMAKE) -C $$d; \
-	done
+build-indep: build-indep-stamp
+build-indep-stamp:
+	touch $@
 
-build: build-indep build-arch
-
-.PHONY: build-indep build-arch build
-
 clean:
 	dh_testdir
+	dh_testroot
 
-	[ ! -f lib/port/Makefile ] || $(PMAKE) -C lib/port clean
-	for d in $(SRCDIRS); do \
-		$(PMAKE) -C $$d clean; \
-	done
+	$(PMAKE) -C lib/libufs clean
+	$(PMAKE) -C sbin/badsect clean
+	$(PMAKE) -C sbin/dumpfs clean
+	$(PMAKE) -C sbin/fsck_ffs clean
+	$(PMAKE) -C sbin/fsdb clean
+	$(PMAKE) -C sbin/growfs clean
+	$(PMAKE) -C sbin/newfs clean
+	$(PMAKE) -C sbin/tunefs clean
+	$(PMAKE) -C sbin/ffsinfo clean
 
+	rm -f *stamp
 	dh_clean
 
+install: install-indep install-arch
 install-indep:
 
-install-arch: build-arch
+install-arch:
 	dh_testdir
 	dh_testroot
-	dh_prep
-	dh_installdirs
+	dh_prep -a
+	dh_installdirs -a
+	dh_install -a
 
-	mkdir -p $(libdir)
-	mkdir -p $(sbindir)
-	mkdir -p $(man8dir)
+	mkdir -p debian/ufsutils/{sbin,usr/share/man/man8}
+	for i in badsect dumpfs fsdb growfs tunefs ; do \
+		install -m 755 sbin/$$i/$$i	debian/ufsutils/sbin/$$i.ufs ; \
+		install -m 644 sbin/$$i/$$i.8	debian/ufsutils/usr/share/man/man8/$$i.ufs.8 ; \
+	done
+	install -m 755 sbin/fsck_ffs/fsck_ffs	debian/ufsutils/sbin/fsck.ufs
+	install -m 644 sbin/fsck_ffs/fsck_ffs.8	debian/ufsutils/usr/share/man/man8/fsck.ufs.8
+	install -m 755 sbin/newfs/newfs		debian/ufsutils/sbin/mkfs.ufs
+	install -m 644 sbin/newfs/newfs.8	debian/ufsutils/usr/share/man/man8/mkfs.ufs.8
+	install -m 755 sbin/ffsinfo/ffsinfo	debian/ufsutils/sbin/ffsinfo
+	install -m 644 sbin/ffsinfo/ffsinfo.8	debian/ufsutils/usr/share/man/man8/ffsinfo.8
 
-	for d in $(SRCDIRS); do \
-		$(PMAKE) -C $$d install BINDIR=/sbin SHLIBDIR=/lib; \
+	mkdir -p debian/ufsutils-udeb/sbin
+	for i in badsect growfs tunefs ; do \
+		install -m 755 sbin/$$i/$$i	debian/ufsutils-udeb/sbin/$$i.ufs ; \
 	done
+	install -m 755 sbin/fsck_ffs/fsck_ffs	debian/ufsutils-udeb/sbin/fsck.ufs
+	install -m 755 sbin/newfs/newfs		debian/ufsutils-udeb/sbin/mkfs.ufs
 
-	# Rename files
-	mv $(sbindir)/badsect	$(sbindir)/badsect.ufs
-	mv $(sbindir)/dumpfs	$(sbindir)/dumpfs.ufs
-	mv $(sbindir)/fsck_ffs	$(sbindir)/fsck.ufs
-	mv $(sbindir)/fsdb	$(sbindir)/fsdb.ufs
-	mv $(sbindir)/growfs	$(sbindir)/growfs.ufs
-	mv $(sbindir)/newfs	$(sbindir)/mkfs.ufs
-	mv $(sbindir)/tunefs	$(sbindir)/tunefs.ufs
-
-	# Remove hardlinks
-	rm $(sbindir)/fsck_4.2bsd
-	rm $(sbindir)/fsck_ufs
-
-	mv $(man8dir)/badsect.8.gz	$(man8dir)/badsect.ufs.8.gz
-	mv $(man8dir)/dumpfs.8.gz	$(man8dir)/dumpfs.ufs.8.gz
-	mv $(man8dir)/fsck_ffs.8.gz	$(man8dir)/fsck.ufs.8.gz
-	mv $(man8dir)/fsdb.8.gz		$(man8dir)/fsdb.ufs.8.gz
-	mv $(man8dir)/growfs.8.gz	$(man8dir)/growfs.ufs.8.gz
-	mv $(man8dir)/newfs.8.gz	$(man8dir)/mkfs.ufs.8.gz
-	mv $(man8dir)/tunefs.8.gz	$(man8dir)/tunefs.ufs.8.gz
-
-	# Remove broken symlinks
-	rm $(man8dir)/fsck_4.2bsd.8.gz
-	rm $(man8dir)/fsck_ufs.8.gz
-
-install: install-indep install-arch
-
-.PHONY: clean install-indep install-arch install
-
 # Build architecture-independent files here.
-binary-indep:
-	# Nothing to do.
+binary-indep: build install
+# We have nothing to do by default.
 
-# Build architecture-dependent files here.
-binary-arch: install-arch
+# Build architecture-dependant files that arn't kernel modules here.
+binary-arch: build install
 	dh_testdir
 	dh_testroot
-	dh_installchangelogs -s
-	dh_installdocs -s
-	dh_install -s --sourcedir=debian/tmp
-	dh_installman -s
-	dh_link -s
-	dh_strip -s
-	dh_compress -s
-	dh_fixperms -s
-	dh_installdeb -s
-	dh_shlibdeps -s
-	dh_gencontrol -s
-	dh_md5sums -s
-	dh_builddeb -s
+	dh_installchangelogs
+	dh_installdocs
+	dh_installexamples
+#	dh_installmenu
+	dh_installdebconf
+#	dh_installlogrotate
+#	dh_installemacsen
+#	dh_installpam
+#	dh_installmime
+#	dh_installcron
+#	dh_installinfo
+	dh_installman
+	dh_link
+	dh_strip
+	dh_compress
+	dh_fixperms
+#	dh_perl
+#	dh_python
+	dh_makeshlibs
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
 
-binary: binary-indep binary-arch
-
-.PHONY: binary-indep binary-arch binary
+binary: binary-arch binary-indep
+.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure

Modified: trunk/ufsutils/debian/ufsutils-udeb.install
===================================================================
--- trunk/ufsutils/debian/ufsutils-udeb.install	2013-10-26 14:16:16 UTC (rev 5093)
+++ trunk/ufsutils/debian/ufsutils-udeb.install	2013-10-26 14:20:07 UTC (rev 5094)
@@ -1,5 +1,3 @@
-sbin/badsect.ufs 
-sbin/fsck.ufs
-sbin/growfs.ufs
-sbin/mkfs.ufs
-sbin/tunefs.ufs
+lib/libufs/libufs.so.*		/lib
+
+# The rest of this package is handled in debian/rules (requires fine-tuning)

Modified: trunk/ufsutils/debian/ufsutils.install
===================================================================
--- trunk/ufsutils/debian/ufsutils.install	2013-10-26 14:16:16 UTC (rev 5093)
+++ trunk/ufsutils/debian/ufsutils.install	2013-10-26 14:20:07 UTC (rev 5094)
@@ -1,2 +1,3 @@
-sbin
-usr/share/man/man8
+lib/libufs/libufs.so.*		/lib
+
+# The rest of this package is handled in debian/rules (requires fine-tuning)




More information about the Glibc-bsd-commits mailing list