summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authoragc <agc>2005-12-30 23:03:05 +0000
committeragc <agc>2005-12-30 23:03:05 +0000
commit2b98ba7280297dea68ac4369ebf6b018716a0340 (patch)
treecff8a5dd98bdf4d607adcd48d83ab49c1ada4ea4 /sysutils
parent9f6e002d39793dc4bd3c3356748b0cf8bd5ba090 (diff)
downloadpkgsrc-2b98ba7280297dea68ac4369ebf6b018716a0340.tar.gz
Initial import of xfsprogs-2.7.3 into the Packages Collection.
XFS combines advanced journaling technology with full 64-bit addressing and scalable structures and algorithms. + Journaled 64-bit filesystem with guaranteed filesystem consistency. + XFS supports filesystem growth for mounted volumes, allows filesystem "freeze" and "thaw" operations to support volume level snapshots, and provides an online file defragmentation utility. + XFS supports user and group quotas. XFS considers quota information as filesystem metadata and uses journaling to avoid the need for lengthy quota consistency checks after a crash. + For Linux 2.6 and beyond, when using 64 bit addressing in the block devices layer (CONFIG_LBD) and a 64 bit platform, filesystem size limit increases to 9 million terabytes (or the device limits). For these later kernels on 32 bit platforms, 16TB is the current limit even with 64 bit addressing enabled in the block layer. This package contains filesystem manipulation and support programs. Very loosely based on the FreeBSD port (I took the MASTER_SITES from there).
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/xfsprogs/DESCR20
-rw-r--r--sysutils/xfsprogs/Makefile23
-rw-r--r--sysutils/xfsprogs/PLIST44
-rw-r--r--sysutils/xfsprogs/distinfo17
-rw-r--r--sysutils/xfsprogs/patches/patch-aa13
-rw-r--r--sysutils/xfsprogs/patches/patch-ab16
-rw-r--r--sysutils/xfsprogs/patches/patch-ac13
-rw-r--r--sysutils/xfsprogs/patches/patch-ad201
-rw-r--r--sysutils/xfsprogs/patches/patch-ae179
-rw-r--r--sysutils/xfsprogs/patches/patch-af67
-rw-r--r--sysutils/xfsprogs/patches/patch-ag16
-rw-r--r--sysutils/xfsprogs/patches/patch-ah129
-rw-r--r--sysutils/xfsprogs/patches/patch-ai27
-rw-r--r--sysutils/xfsprogs/patches/patch-aj16
-rw-r--r--sysutils/xfsprogs/patches/patch-ak16
-rw-r--r--sysutils/xfsprogs/patches/patch-al50
16 files changed, 847 insertions, 0 deletions
diff --git a/sysutils/xfsprogs/DESCR b/sysutils/xfsprogs/DESCR
new file mode 100644
index 00000000000..717ed6f62e4
--- /dev/null
+++ b/sysutils/xfsprogs/DESCR
@@ -0,0 +1,20 @@
+XFS combines advanced journaling technology with full 64-bit
+addressing and scalable structures and algorithms.
+
++ Journaled 64-bit filesystem with guaranteed filesystem consistency.
+
++ XFS supports filesystem growth for mounted volumes, allows
+filesystem "freeze" and "thaw" operations to support volume level
+snapshots, and provides an online file defragmentation utility.
+
++ XFS supports user and group quotas. XFS considers quota information
+as filesystem metadata and uses journaling to avoid the need for
+lengthy quota consistency checks after a crash.
+
++ For Linux 2.6 and beyond, when using 64 bit addressing in the block
+devices layer (CONFIG_LBD) and a 64 bit platform, filesystem size
+limit increases to 9 million terabytes (or the device limits). For
+these later kernels on 32 bit platforms, 16TB is the current limit
+even with 64 bit addressing enabled in the block layer.
+
+This package contains filesystem manipulation and support programs.
diff --git a/sysutils/xfsprogs/Makefile b/sysutils/xfsprogs/Makefile
new file mode 100644
index 00000000000..6cf84d11719
--- /dev/null
+++ b/sysutils/xfsprogs/Makefile
@@ -0,0 +1,23 @@
+# $NetBSD: Makefile,v 1.1.1.1 2005/12/30 23:03:05 agc Exp $
+
+DISTNAME= xfsprogs-2.7.3.src
+PKGNAME= ${DISTNAME:S/.src//}
+CATEGORIES= sysutils
+MASTER_SITES= ftp://oss.sgi.com/projects/xfs/cmd_tars/
+
+MAINTAINER= tech-pkg@NetBSD.org
+HOMEPAGE= http://oss.sgi.com/projects/xfs
+COMMENT= XFS filesystem manipulation utilities
+
+GNU_CONFIGURE= yes
+USE_TOOLS+= gmake autoconf
+USE_LIBTOOL= yes
+CONFIGURE_ARGS+=--enable-readline
+CONFIGURE_ENV+= INSTALL_USER=${ROOT_USER} INSTALL_GROUP=${ROOT_GROUP}
+
+WRKSRC= ${WRKDIR}/${PKGNAME_NOREV}
+BUILD_TARGET=
+
+.include "../../devel/readline/buildlink3.mk"
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/sysutils/xfsprogs/PLIST b/sysutils/xfsprogs/PLIST
new file mode 100644
index 00000000000..1c44515bd86
--- /dev/null
+++ b/sysutils/xfsprogs/PLIST
@@ -0,0 +1,44 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2005/12/30 23:03:05 agc Exp $
+bin/xfs_admin
+bin/xfs_bmap
+bin/xfs_check
+bin/xfs_copy
+bin/xfs_db
+bin/xfs_freeze
+bin/xfs_growfs
+bin/xfs_info
+bin/xfs_io
+bin/xfs_logprint
+bin/xfs_mkfile
+bin/xfs_ncheck
+bin/xfs_quota
+bin/xfs_rtcp
+lib/libhandle.so.1
+lib/libhandle.so.1.0.3
+man/man5/xfs.5
+man/man8/fsck.xfs.8
+man/man8/mkfs.xfs.8
+man/man8/xfs_admin.8
+man/man8/xfs_bmap.8
+man/man8/xfs_check.8
+man/man8/xfs_copy.8
+man/man8/xfs_db.8
+man/man8/xfs_freeze.8
+man/man8/xfs_growfs.8
+man/man8/xfs_info.8
+man/man8/xfs_io.8
+man/man8/xfs_logprint.8
+man/man8/xfs_mkfile.8
+man/man8/xfs_ncheck.8
+man/man8/xfs_quota.8
+man/man8/xfs_repair.8
+man/man8/xfs_rtcp.8
+sbin/fsck.xfs
+sbin/mkfs.xfs
+sbin/xfs_repair
+share/doc/xfsprogs/CHANGES.gz
+share/doc/xfsprogs/COPYING
+share/doc/xfsprogs/CREDITS
+share/doc/xfsprogs/PORTING
+share/doc/xfsprogs/README
+@dirrm share/doc/xfsprogs
diff --git a/sysutils/xfsprogs/distinfo b/sysutils/xfsprogs/distinfo
new file mode 100644
index 00000000000..2a8150c97b6
--- /dev/null
+++ b/sysutils/xfsprogs/distinfo
@@ -0,0 +1,17 @@
+$NetBSD: distinfo,v 1.1.1.1 2005/12/30 23:03:05 agc Exp $
+
+SHA1 (xfsprogs-2.7.3.src.tar.gz) = abfe3ea13475810a0ef854f48b9ca9912ee7fbc5
+RMD160 (xfsprogs-2.7.3.src.tar.gz) = 7a4f6b0d5da640041334cef4b4aa2e60ba43af53
+Size (xfsprogs-2.7.3.src.tar.gz) = 895400 bytes
+SHA1 (patch-aa) = c2d7667d5f4d7cf027ef0c41b774852cc28638e5
+SHA1 (patch-ab) = beb412afa8904af887ba237f356bd29ac3327755
+SHA1 (patch-ac) = 417f9e94d22f39947932bf38147aab90384f308c
+SHA1 (patch-ad) = 3ecf2ef5eb280fc36d68ed6b8ed348faae32d9ff
+SHA1 (patch-ae) = 5224f9a7aaa31e25e15ad1706da076fdda21b0c0
+SHA1 (patch-af) = 92acf0b8ffe373570750f7a3dcb86c219a4f880d
+SHA1 (patch-ag) = 01b6470feea8536756ca0f48ccdfc106e6a17402
+SHA1 (patch-ah) = 2a28a644eac5284443fc843485cf3ded08a9ed7b
+SHA1 (patch-ai) = 42e07792f0c4bb816a772c789cbca387cefbb528
+SHA1 (patch-aj) = 2d7e3e05bff6951a22b2df13193db758a509a732
+SHA1 (patch-ak) = d6f9027a339fe3607003b4fe34062936868f47da
+SHA1 (patch-al) = 832d5d90b9314f5aea312908df16ff3c74449d00
diff --git a/sysutils/xfsprogs/patches/patch-aa b/sysutils/xfsprogs/patches/patch-aa
new file mode 100644
index 00000000000..4cf8259f523
--- /dev/null
+++ b/sysutils/xfsprogs/patches/patch-aa
@@ -0,0 +1,13 @@
+$NetBSD: patch-aa,v 1.1.1.1 2005/12/30 23:03:05 agc Exp $
+
+--- include/Makefile 2005/12/29 13:56:15 1.1
++++ include/Makefile 2005/12/29 14:00:07
+@@ -45,7 +45,7 @@
+ xfs_rtalloc.h xfs_sb.h xfs_trans.h xfs_trans_space.h xfs_types.h
+
+ HFILES += $(PKG_PLATFORM).h xfs.h
+-PHFILES = darwin.h freebsd.h irix.h linux.h
++PHFILES = darwin.h freebsd.h irix.h linux.h netbsd.h
+ DKHFILES = volume.h fstyp.h dvh.h
+ LSRCFILES = $(shell echo $(PHFILES) | sed -e "s/$(PKG_PLATFORM).h//g")
+ LSRCFILES += platform_defs.h.in builddefs.in buildmacros buildrules $(DKHFILES)
diff --git a/sysutils/xfsprogs/patches/patch-ab b/sysutils/xfsprogs/patches/patch-ab
new file mode 100644
index 00000000000..51e75318b8f
--- /dev/null
+++ b/sysutils/xfsprogs/patches/patch-ab
@@ -0,0 +1,16 @@
+$NetBSD: patch-ab,v 1.1.1.1 2005/12/30 23:03:05 agc Exp $
+
+--- include/builddefs.in 2005/12/29 13:56:15 1.1
++++ include/builddefs.in 2005/12/29 13:59:14
+@@ -116,6 +116,11 @@
+ PLDLIBS = -L/usr/local/lib -lintl
+ PCFLAGS = -I/usr/local/include
+ endif
++ifeq ($(PKG_PLATFORM),netbsd)
++PLDLIBS = -L${PREFIX}/lib -Wl,-R${PREFIX}/lib -lintl
++PCFLAGS = -I${PREFIX}/include
++endif
++
+
+ GCFLAGS = -O1 $(OPTIMIZER) $(DEBUG) -funsigned-char -fno-strict-aliasing -Wall \
+ -DVERSION=\"$(PKG_VERSION)\" -DLOCALEDIR=\"$(PKG_LOCALE_DIR)\" \
diff --git a/sysutils/xfsprogs/patches/patch-ac b/sysutils/xfsprogs/patches/patch-ac
new file mode 100644
index 00000000000..60ab258a71f
--- /dev/null
+++ b/sysutils/xfsprogs/patches/patch-ac
@@ -0,0 +1,13 @@
+$NetBSD: patch-ac,v 1.1.1.1 2005/12/30 23:03:05 agc Exp $
+
+--- include/platform_defs.h.in 2005/12/29 14:03:45 1.1
++++ include/platform_defs.h.in 2005/12/29 14:04:54
+@@ -50,6 +50,8 @@
+ #include <xfs/linux.h>
+ #elif defined(__FreeBSD__)
+ #include <xfs/freebsd.h>
++#elif defined(__NetBSD__)
++#include <xfs/netbsd.h>
+ #elif defined(__APPLE__)
+ #include <xfs/darwin.h>
+ #elif defined(__sgi__) || defined(___sgi)
diff --git a/sysutils/xfsprogs/patches/patch-ad b/sysutils/xfsprogs/patches/patch-ad
new file mode 100644
index 00000000000..f667123e535
--- /dev/null
+++ b/sysutils/xfsprogs/patches/patch-ad
@@ -0,0 +1,201 @@
+$NetBSD: patch-ad,v 1.1.1.1 2005/12/30 23:03:05 agc Exp $
+
+--- /dev/null 2005-12-29 13:42:11.000000000 +0000
++++ include/netbsd.h 2005-12-29 14:07:41.000000000 +0000
+@@ -0,0 +1,196 @@
++/*
++ * Copyright (c) 2004 Silicon Graphics, Inc. All Rights Reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it would be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
++ *
++ * Further, this software is distributed without any warranty that it is
++ * free of the rightful claim of any third person regarding infringement
++ * or the like. Any license provided herein, whether implied or
++ * otherwise, applies only to this software file. Patent licenses, if
++ * any, provided herein do not apply to combinations of this program with
++ * other software, or any other product whatsoever.
++ *
++ * You should have received a copy of the GNU General Public License along
++ * with this program; if not, write the Free Software Foundation, Inc., 59
++ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
++ *
++ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
++ * Mountain View, CA 94043, or:
++ *
++ * http://www.sgi.com
++ *
++ * For further information regarding this notice, see:
++ *
++ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
++ *
++ */
++#ifndef __XFS_NetBSD_H__
++#define __XFS_NetBSD_H__
++
++#include <sys/stat.h>
++#include <sys/param.h>
++#include <sys/ioctl.h>
++#include <sys/ioccom.h>
++#include <sys/mount.h>
++#if (defined(__NetBSD__) && (__NetBSD_Version__ >= 299000900))
++# include <sys/statvfs.h>
++#else
++# include <sys/statfs.h>
++#endif
++#include <ctype.h>
++#include <libgen.h>
++#include <paths.h>
++#include <uuid.h>
++
++#include <sys/endian.h>
++
++#define __bswap16 htobe16
++#define __bswap32 htobe32
++#define __bswap64 htobe64
++
++/* NetBSD file API is 64-bit aware */
++#define fstat64 fstat
++#define ftruncate64 ftruncate
++#define lseek64 lseek
++#define stat64 stat
++#define pwrite64 pwrite
++#define pread64 pread
++#define fdatasync fsync
++#define memalign(a,size) valloc(size)
++
++typedef u_int8_t __u8;
++typedef int8_t __s8;
++typedef u_int16_t __u16;
++typedef int16_t __s16;
++typedef u_int32_t __u32;
++typedef int32_t __s32;
++typedef u_int64_t __u64;
++typedef int64_t __s64;
++
++#define constpp char * const *
++
++#define EFSCORRUPTED 990 /* Filesystem is corrupted */
++
++typedef off_t xfs_off_t;
++typedef off_t off64_t;
++typedef __uint64_t xfs_ino_t;
++typedef __uint32_t xfs_dev_t;
++typedef __int64_t xfs_daddr_t;
++typedef char* xfs_caddr_t;
++typedef off_t loff_t;
++
++#ifndef _UCHAR_T_DEFINED
++typedef unsigned char uchar_t;
++#define _UCHAR_T_DEFINED 1
++#endif
++typedef enum { B_FALSE,B_TRUE } boolean_t;
++
++#define O_LARGEFILE 0
++
++#ifndef O_DIRECT
++#define O_DIRECT 0
++#endif
++
++#define HAVE_FID 1
++#define HAVE_SWABMACROS 1
++#define INT_SWAP16(type,var) ((typeof(type))(__bswap16((__u16)(var))))
++#define INT_SWAP32(type,var) ((typeof(type))(__bswap32((__u32)(var))))
++#define INT_SWAP64(type,var) ((typeof(type))(__bswap64((__u64)(var))))
++
++static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p)
++{
++ return ioctl(fd, cmd, p);
++}
++
++static __inline__ int platform_test_xfs_fd(int fd)
++{
++#if (defined(__NetBSD__) && (__NetBSD_Version__ >= 299000900))
++ struct statvfs buf;
++ if (fstatvfs(fd, &buf) < 0)
++ return 0;
++#else
++ struct statvfs buf;
++ if (fstatvfs(fd, &buf) < 0)
++ return 0;
++#endif
++ return strcpy(buf.f_fstypename, "xfs") == 0;
++}
++
++static __inline__ int platform_test_xfs_path(const char *path)
++{
++#if (defined(__NetBSD__) && (__NetBSD_Version__ >= 299000900))
++ struct statvfs buf;
++ if (statvfs(path, &buf) < 0)
++ return 0;
++#else
++ struct statvfs buf;
++ if (statvfs(path, &buf) < 0)
++ return 0;
++#endif
++ return strcpy(buf.f_fstypename, "xfs") == 0;
++}
++
++#if (defined(__NetBSD__) && (__NetBSD_Version__ >= 299000900))
++static __inline__ int platform_fstatfs(int fd, struct statvfs *buf)
++{
++ return fstatvfs(fd, buf);
++}
++#else
++static __inline__ int platform_fstatfs(int fd, struct statfs *buf)
++{
++ return fstatfs(fd, buf);
++}
++#endif
++
++static __inline__ void platform_getoptreset(void)
++{
++ extern int optind;
++ optind = 0;
++}
++
++/*
++ * Implement Linux libuuid functions in terms of DEC DCE's uuid
++ * functions from NetBSD libc.
++ */
++
++static __inline__ int gnu_uuid_compare(uuid_t a, uuid_t b)
++{
++ return uuid_compare(&a, &b, NULL);
++}
++#define uuid_compare gnu_uuid_compare
++
++static __inline__ int uuid_is_null(uuid_t uid)
++{
++ return uuid_is_nil(&uid, NULL);
++}
++
++static __inline__ void uuid_unparse(uuid_t uid, char *buf)
++{
++ uint32_t status;
++ char *str;
++ uuid_to_string(&uid, &str, &status);
++ if (status == uuid_s_ok)
++ strcpy(buf, str);
++ else *buf = '\0';
++ free(str);
++}
++
++static __inline__ int gnu_uuid_parse(const char *buf, uuid_t *uid)
++{
++ uint32_t status;
++ uuid_from_string(buf, uid, &status);
++ return (status == uuid_s_ok);
++}
++#define uuid_parse(s,u) gnu_uuid_parse((s), &(u))
++
++#define uuid_generate(uid) uuid_create(&(uid), NULL)
++#define uuid_clear(uid) uuid_create_nil(&(uid), NULL)
++#define uuid_copy(dst, src) memcpy(&(dst), &(src), sizeof(uuid_t))
++
++#endif /* __XFS_NetBSD_H__ */
diff --git a/sysutils/xfsprogs/patches/patch-ae b/sysutils/xfsprogs/patches/patch-ae
new file mode 100644
index 00000000000..a2ac28c0b38
--- /dev/null
+++ b/sysutils/xfsprogs/patches/patch-ae
@@ -0,0 +1,179 @@
+$NetBSD: patch-ae,v 1.1.1.1 2005/12/30 23:03:06 agc Exp $
+
+--- /dev/null 2005-12-29 14:18:54.000000000 +0000
++++ libxfs/netbsd.c 2005-12-29 14:22:31.000000000 +0000
+@@ -0,0 +1,174 @@
++/*
++ * Copyright (c) 2003 Silicon Graphics, Inc. All Rights Reserved.
++ *
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it would be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
++ *
++ * Further, this software is distributed without any warranty that it is
++ * free of the rightful claim of any third person regarding infringement
++ * or the like. Any license provided herein, whether implied or
++ * otherwise, applies only to this software file. Patent licenses, if
++ * any, provided herein do not apply to combinations of this program with
++ * other software, or any other product whatsoever.
++ *
++ * You should have received a copy of the GNU General Public License along
++ * with this program; if not, write the Free Software Foundation, Inc., 59
++ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
++ *
++ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
++ * Mountain View, CA 94043, or:
++ *
++ * http://www.sgi.com
++ *
++ * For further information regarding this notice, see:
++ *
++ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
++ */
++
++#include <xfs/libxfs.h>
++#include <sys/types.h>
++#include <sys/param.h>
++#include <sys/stat.h>
++#include <sys/disk.h>
++#include <sys/mount.h>
++#include <sys/ioctl.h>
++
++extern char *progname;
++
++int
++platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose)
++{
++ struct stat st;
++ int cnt, i;
++#if (defined(__NetBSD__) && (__NetBSD_Version__ >= 299000900))
++ struct statvfs *fsinfo;
++#else
++ struct statfs *fsinfo;
++#endif
++
++ if (!s) {
++ if (stat(block, &st) < 0)
++ return 0;
++ s = &st;
++ }
++
++ /* Remember, FreeBSD can now mount char devices! -- adrian */
++ if (((st.st_mode & S_IFMT) != S_IFBLK) &&
++ ((st.st_mode & S_IFMT) != S_IFCHR))
++ return 0;
++
++ if ((cnt = getmntinfo(&fsinfo, MNT_NOWAIT)) == 0) {
++ fprintf(stderr,
++ _("%s: %s possibly contains a mounted filesystem\n"),
++ progname, name);
++ return 1;
++ }
++
++ for (i = 0; i < cnt; i++) {
++ if (strcmp (name, fsinfo[i].f_mntfromname) != 0)
++ continue;
++
++ if (verbose)
++ fprintf(stderr,
++ _("%s: %s contains a mounted filesystem\n"),
++ progname, name);
++ break;
++ }
++
++ return (i < cnt);
++}
++
++int
++platform_check_iswritable(char *name, char *block, struct stat64 *s, int fatal)
++{
++ int cnt, i;
++#if (defined(__NetBSD__) && (__NetBSD_Version__ >= 299000900))
++ struct statvfs *fsinfo;
++#else
++ struct statfs *fsinfo;
++#endif
++
++ if ((cnt = getmntinfo(&fsinfo, MNT_NOWAIT)) == 0) {
++ fprintf(stderr, _("%s: %s contains a possibly writable, "
++ "mounted filesystem\n"), progname, name);
++ return fatal;
++ }
++
++ for (i = 0; i < cnt; i++) {
++ if (strcmp (name, fsinfo[i].f_mntfromname) != 0)
++ continue;
++
++ if (fsinfo[i].f_flag &= MNT_RDONLY)
++ break;
++ }
++
++ if (i == cnt) {
++ fprintf(stderr, _("%s: %s contains a mounted and writable "
++ "filesystem\n"), progname, name);
++ return fatal;
++ }
++ return 0;
++}
++
++void
++platform_set_blocksize(int fd, char *path, int blocksize)
++{
++ return;
++}
++
++void
++platform_flush_device(int fd, dev_t device)
++{
++ return;
++}
++
++void
++platform_findsizes(char *path, int fd, long long *sz, int *bsz)
++{
++ struct stat st;
++ __int64_t size;
++ u_int ssize;
++
++ if (fstat(fd, &st) < 0) {
++ fprintf(stderr, _("%s: "
++ "cannot stat the device file \"%s\": %s\n"),
++ progname, path, strerror(errno));
++ exit(1);
++ }
++
++ if ((st.st_mode & S_IFMT) == S_IFREG) {
++ *sz = (long long)(st.st_size >> 9);
++ *bsz = 512;
++ return;
++ }
++
++ if ((st.st_mode & S_IFMT) != S_IFCHR) {
++ fprintf(stderr, _("%s: "
++ "Not a device or file: \"%s\"n"),
++ progname, path);
++ exit(1);
++ }
++
++ if ((size = st.st_size) == 0) {
++ fprintf(stderr, _("%s: "
++ "zero size: \"%s\"n"),
++ progname, path);
++ exit(1);
++ }
++
++ if ((ssize = st.st_blksize) == 0) {
++ fprintf(stderr, _("%s: "
++ "zero block size \"%s\": %s\n"),
++ progname, path, strerror(errno));
++ exit(1);
++ }
++
++ *sz = (long long) (size / ssize);
++ *bsz = (int)ssize;
++}
diff --git a/sysutils/xfsprogs/patches/patch-af b/sysutils/xfsprogs/patches/patch-af
new file mode 100644
index 00000000000..df896e4e848
--- /dev/null
+++ b/sysutils/xfsprogs/patches/patch-af
@@ -0,0 +1,67 @@
+$NetBSD: patch-af,v 1.1.1.1 2005/12/30 23:03:06 agc Exp $
+
+--- /dev/null 2005-12-30 09:57:10.000000000 +0000
++++ include/ftw.h 2005-12-30 10:35:54.000000000 +0000
+@@ -0,0 +1,62 @@
++/* NetBSD */
++
++/* From OpenBSD: ftw.h,v 1.1 2003/07/21 21:13:18 millert Exp */
++
++/*
++ * Copyright (c) 2003 Todd C. Miller <Todd.Miller@courtesan.com>
++ *
++ * Permission to use, copy, modify, and distribute this software for any
++ * purpose with or without fee is hereby granted, provided that the above
++ * copyright notice and this permission notice appear in all copies.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ * Sponsored in part by the Defense Advanced Research Projects
++ * Agency (DARPA) and Air Force Research Laboratory, Air Force
++ * Materiel Command, USAF, under agreement number F39502-99-1-0512.
++ */
++
++#ifndef _FTW_H
++#define _FTW_H
++
++#include <sys/types.h>
++#include <sys/stat.h>
++
++/*
++ * Valid flags for the 3rd argument to the function that is passed as the
++ * second argument to ftw(3) and nftw(3). Say it three times fast!
++ */
++#define FTW_F 0 /* File. */
++#define FTW_D 1 /* Directory. */
++#define FTW_DNR 2 /* Directory without read permission. */
++#define FTW_DP 3 /* Directory with subdirectories visited. */
++#define FTW_NS 4 /* Unknown type; stat() failed. */
++#define FTW_SL 5 /* Symbolic link. */
++#define FTW_SLN 6 /* Sym link that names a nonexistent file. */
++
++/*
++ * Flags for use as the 4th argument to nftw(3). These may be ORed together.
++ */
++#define FTW_PHYS 0x01 /* Physical walk, don't follow sym links. */
++#define FTW_MOUNT 0x02 /* The walk does not cross a mount point. */
++#define FTW_DEPTH 0x04 /* Subdirs visited before the dir itself. */
++#define FTW_CHDIR 0x08 /* Change to a directory before reading it. */
++
++struct FTW {
++ int base;
++ int level;
++};
++
++__BEGIN_DECLS
++int ftw(const char *, int (*)(const char *, const struct stat *, int), int);
++int nftw(const char *, int (*)(const char *, const struct stat *, int,
++ struct FTW *), int, int);
++__END_DECLS
++
++#endif /* !_FTW_H */
diff --git a/sysutils/xfsprogs/patches/patch-ag b/sysutils/xfsprogs/patches/patch-ag
new file mode 100644
index 00000000000..c86f7204588
--- /dev/null
+++ b/sysutils/xfsprogs/patches/patch-ag
@@ -0,0 +1,16 @@
+$NetBSD: patch-ag,v 1.1.1.1 2005/12/30 23:03:06 agc Exp $
+
+--- libxcmd/paths.c 2005/12/29 16:23:04 1.1
++++ libxcmd/paths.c 2005/12/29 16:25:03
+@@ -228,7 +228,11 @@
+ fs_table_initialise_mounts(
+ char *path)
+ {
++#if (defined(__NetBSD__) && (__NetBSD_Version__ >= 299000900))
++ struct statvfs *stats;
++#else
+ struct statfs *stats;
++#endif
+ char *dir = NULL, *fsname = NULL, *fslog = NULL, *fsrt = NULL;
+ int i, count, found = 0, error = 0;
+
diff --git a/sysutils/xfsprogs/patches/patch-ah b/sysutils/xfsprogs/patches/patch-ah
new file mode 100644
index 00000000000..51921aac0ed
--- /dev/null
+++ b/sysutils/xfsprogs/patches/patch-ah
@@ -0,0 +1,129 @@
+$NetBSD: patch-ah,v 1.1.1.1 2005/12/30 23:03:06 agc Exp $
+
+--- libxcmd/input.c 2005/12/30 10:39:51 1.1
++++ libxcmd/input.c 2005/12/30 10:41:49
+@@ -40,6 +40,124 @@
+ # include <histedit.h>
+ #endif
+
++#ifndef HAVE_FTW_H
++/* NetBSD */
++
++/* From OpenBSD: nftw.c,v 1.2 2003/07/21 21:15:32 millert Exp */
++
++/*
++ * Copyright (c) 2003 Todd C. Miller <Todd.Miller@courtesan.com>
++ *
++ * Permission to use, copy, modify, and distribute this software for any
++ * purpose with or without fee is hereby granted, provided that the above
++ * copyright notice and this permission notice appear in all copies.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ * Sponsored in part by the Defense Advanced Research Projects
++ * Agency (DARPA) and Air Force Research Laboratory, Air Force
++ * Materiel Command, USAF, under agreement number F39502-99-1-0512.
++ */
++
++#include <sys/cdefs.h>
++
++#ifndef lint
++__RCSID("From NetBSD");
++#endif
++
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <errno.h>
++#include <fts.h>
++#include <ftw.h>
++#include <limits.h>
++
++int
++nftw(const char *path, int (*fn)(const char *, const struct stat *, int,
++ struct FTW *), int nfds, int ftwflags)
++{
++ const char *paths[2];
++ struct FTW f;
++ FTSENT *cur;
++ FTS *ftsp;
++ int ftsflags, fnflag, error, postorder, sverrno;
++
++ /* XXX - nfds is currently unused */
++ if (nfds < 1 || nfds > OPEN_MAX) {
++ errno = EINVAL;
++ return (-1);
++ }
++
++ ftsflags = FTS_COMFOLLOW;
++ if (!(ftwflags & FTW_CHDIR))
++ ftsflags |= FTS_NOCHDIR;
++ if (ftwflags & FTW_MOUNT)
++ ftsflags |= FTS_XDEV;
++ if (ftwflags & FTW_PHYS)
++ ftsflags |= FTS_PHYSICAL;
++ postorder = (ftwflags & FTW_DEPTH) != 0;
++ paths[0] = path;
++ paths[1] = NULL;
++ ftsp = fts_open((char * const *)paths, ftsflags, NULL);
++ if (ftsp == NULL)
++ return (-1);
++ error = 0;
++ while ((cur = fts_read(ftsp)) != NULL) {
++ switch (cur->fts_info) {
++ case FTS_D:
++ if (postorder)
++ continue;
++ fnflag = FTW_D;
++ break;
++ case FTS_DNR:
++ fnflag = FTW_DNR;
++ break;
++ case FTS_DP:
++ if (!postorder)
++ continue;
++ fnflag = FTW_DP;
++ break;
++ case FTS_F:
++ case FTS_DEFAULT:
++ fnflag = FTW_F;
++ break;
++ case FTS_NS:
++ case FTS_NSOK:
++ fnflag = FTW_NS;
++ break;
++ case FTS_SL:
++ fnflag = FTW_SL;
++ break;
++ case FTS_SLNONE:
++ fnflag = FTW_SLN;
++ break;
++ case FTS_DC:
++ errno = ELOOP;
++ /* FALLTHROUGH */
++ default:
++ error = -1;
++ goto done;
++ }
++ f.base = cur->fts_pathlen - cur->fts_namelen;
++ f.level = cur->fts_level;
++ error = fn(cur->fts_path, cur->fts_statp, fnflag, &f);
++ if (error != 0)
++ break;
++ }
++done:
++ sverrno = errno;
++ (void) fts_close(ftsp);
++ errno = sverrno;
++ return (error);
++}
++#endif
++
+ static char *
+ get_prompt(void)
+ {
diff --git a/sysutils/xfsprogs/patches/patch-ai b/sysutils/xfsprogs/patches/patch-ai
new file mode 100644
index 00000000000..90e3375c4b2
--- /dev/null
+++ b/sysutils/xfsprogs/patches/patch-ai
@@ -0,0 +1,27 @@
+$NetBSD: patch-ai,v 1.1.1.1 2005/12/30 23:03:06 agc Exp $
+
+--- include/input.h.orig 2005-10-07 17:51:34.000000000 +0100
++++ include/input.h 2005-12-30 10:45:15.000000000 +0000
+@@ -62,18 +62,12 @@
+ extern gid_t gid_from_string(char *group);
+ extern prid_t prid_from_string(char *project);
+
++#ifdef __NetBSD__
++#undef HAVE_FTW_H
++#else
+ #define HAVE_FTW_H 1 /* TODO: configure me */
++#endif
+
+-#ifdef HAVE_FTW_H
+ #include <ftw.h>
+-#else
+-struct FTW;
+-struct stat;
+-extern int nftw(
+- char *dir,
+- int (*fn)(const char *, const struct stat *, int, struct FTW *),
+- int depth,
+- int flags);
+-#endif
+
+ #endif /* __INPUT_H__ */
diff --git a/sysutils/xfsprogs/patches/patch-aj b/sysutils/xfsprogs/patches/patch-aj
new file mode 100644
index 00000000000..841cb4479d1
--- /dev/null
+++ b/sysutils/xfsprogs/patches/patch-aj
@@ -0,0 +1,16 @@
+$NetBSD: patch-aj,v 1.1.1.1 2005/12/30 23:03:06 agc Exp $
+
+--- io/open.c 2005/12/30 11:07:04 1.1
++++ io/open.c 2005/12/30 11:08:47
+@@ -584,7 +584,11 @@
+ {
+ struct xfs_fsop_counts fscounts;
+ struct xfs_fsop_geom fsgeo;
++#if (defined(__NetBSD__) && (__NetBSD_Version__ >= 299000900))
++ struct statvfs st;
++#else
+ struct statfs st;
++#endif
+
+ printf(_("fd.path = \"%s\"\n"), file->name);
+ if (platform_fstatfs(file->fd, &st) < 0) {
diff --git a/sysutils/xfsprogs/patches/patch-ak b/sysutils/xfsprogs/patches/patch-ak
new file mode 100644
index 00000000000..e6b0a2ab5e1
--- /dev/null
+++ b/sysutils/xfsprogs/patches/patch-ak
@@ -0,0 +1,16 @@
+$NetBSD: patch-ak,v 1.1.1.1 2005/12/30 23:03:06 agc Exp $
+
+--- quota/free.c 2005/12/30 11:12:11 1.1
++++ quota/free.c 2005/12/30 11:13:16
+@@ -70,7 +70,11 @@
+ {
+ struct xfs_fsop_counts fscounts;
+ struct xfs_fsop_geom fsgeo;
++#if (defined(__NetBSD__) && (__NetBSD_Version__ >= 299000900))
++ struct statvfs st;
++#else
+ struct statfs st;
++#endif
+ __uint64_t logsize, count, free;
+ int fd;
+
diff --git a/sysutils/xfsprogs/patches/patch-al b/sysutils/xfsprogs/patches/patch-al
new file mode 100644
index 00000000000..09b4d68b942
--- /dev/null
+++ b/sysutils/xfsprogs/patches/patch-al
@@ -0,0 +1,50 @@
+$NetBSD: patch-al,v 1.1.1.1 2005/12/30 23:03:06 agc Exp $
+
+--- /dev/null 2005-12-30 11:15:43.000000000 +0000
++++ quota/netbsd.c 2005-12-30 11:16:48.000000000 +0000
+@@ -0,0 +1,45 @@
++/*
++ * Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it would be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
++ *
++ * Further, this software is distributed without any warranty that it is
++ * free of the rightful claim of any third person regarding infringement
++ * or the like. Any license provided herein, whether implied or
++ * otherwise, applies only to this software file. Patent licenses, if
++ * any, provided herein do not apply to combinations of this program with
++ * other software, or any other product whatsoever.
++ *
++ * You should have received a copy of the GNU General Public License along
++ * with this program; if not, write the Free Software Foundation, Inc., 59
++ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
++ *
++ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
++ * Mountain View, CA 94043, or:
++ *
++ * http://www.sgi.com
++ *
++ * For further information regarding this notice, see:
++ *
++ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
++ */
++
++#include "quota.h"
++
++int
++xfsquotactl(
++ int command,
++ const char *device,
++ uint type,
++ uint id,
++ void *addr)
++{
++ errno = -ENOSYS;
++ return -1;
++}