1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-22 20:41:26 +00:00

New port for utilities for manipulating XFS filesystems.

Originally ported by Alexander Kabaev <kan@freebsd.org> as part
of the XFS for FreeBSD project ( http://people.freebsd.org/~rodrigc/xfs/ )
and handed over to me for maintainership.

PR:		ports/81789
Approved by:	demon (ports mentor), das (mentor)
This commit is contained in:
Craig Rodrigues 2005-06-08 13:42:57 +00:00
parent b2dbdac021
commit ea28ca5ce9
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=137055
11 changed files with 334 additions and 0 deletions

View File

@ -0,0 +1,44 @@
# New ports collection makefile for: xfsprogs
# Date created: Wed Jun 1 21:48:59 EDT 2005
# Whom: Craig Rodrigues <rodrigc@FreeBSD.org>
#
# $FreeBSD$
#
PORTNAME= xfsprogs
PORTVERSION= 2.6.25
CATEGORIES= sysutils
MASTER_SITES= ftp://oss.sgi.com/projects/xfs/cmd_tars/
DISTNAME= ${PORTNAME}-${PORTVERSION}
EXTRACT_SUFX= .src.tar.gz
MAINTAINER= rodrigc@FreeBSD.ORG
COMMENT= A set of utilities and library to manipulate an xfs filesystem
USE_REINPLACE= yes
USE_GMAKE= yes
USE_GETTEXT= yes
USE_AUTOTOOLS= yes
USE_AUTOCONF_VER= 259
GNU_CONFIGURE= yes
CONFIGURE_ENV+= INSTALL="${INSTALL} ${_BINOWNGRP}" \
CFLAGS="${CFLAGS}" \
LIBTOOL=${LIBTOOL}
MAKE_ENV+= INSTALL="${INSTALL} ${_BINOWNGRP}"
CONFIGURE_ARGS+= --disable-shared --enable-readline
ALL_TARGET=
MAN5= xfs.5
MAN8= fsck.xfs.8 mkfs.xfs.8 xfs_admin.8 xfs_bmap.8 xfs_check.8 \
xfs_copy.8 xfs_db.8 xfs_freeze.8 xfs_growfs.8 xfs_info.8 \
xfs_io.8 xfs_logprint.8 xfs_mkfile.8 xfs_ncheck.8 \
xfs_repair.8 xfs_rtcp.8
pre-configure:
${RM} -f ${WRKSRC}/configure
post-configure:
${FIND} ${WRKSRC} -name "configure" | ${XARGS} ${REINPLACE_CMD} -e \
's|-lpthread|${PTHREAD_LIBS}|g'
.include <bsd.port.mk>

View File

@ -0,0 +1,2 @@
MD5 (xfsprogs-2.6.25.src.tar.gz) = 65fbf692f348b57f21edd4813733d9ae
SIZE (xfsprogs-2.6.25.src.tar.gz) = 850024

View File

@ -0,0 +1,11 @@
--- Makefile.orig Thu Dec 23 13:35:01 2004
+++ Makefile Thu Dec 23 13:35:08 2004
@@ -44,7 +44,7 @@
Logs/* built .census install.* install-dev.* *.gz
SUBDIRS = include libxfs libxlog libhandle libdisk \
- copy db fsck growfs io imap logprint mkfile mkfs repair rtcp \
+ db fsck growfs io imap logprint mkfile mkfs repair rtcp \
m4 man doc po debian build
default: $(CONFIGURE)

View File

@ -0,0 +1,28 @@
--- aclocal.m4.orig Tue Oct 12 20:26:01 2004
+++ aclocal.m4 Thu Dec 23 14:52:43 2004
@@ -107,7 +107,7 @@
tar=$TAR
AC_SUBST(tar)
if test -z "$ZIP"; then
- AC_PATH_PROG(ZIP, gzip,, /bin:/usr/local/bin:/usr/freeware/bin)
+ AC_PATH_PROG(ZIP, gzip,, /bin:/usr/local/bin:/usr/freeware/bin:/usr/bin)
fi
zip=$ZIP
@@ -148,14 +148,14 @@
if test "$enable_gettext" = yes; then
if test -z "$MSGFMT"; then
- AC_PATH_PROG(MSGFMT, msgfmt,, /usr/bin:/usr/freeware/bin)
+ AC_PATH_PROG(MSGFMT, msgfmt,, /usr/bin:/usr/freeware/bin:$PATH)
fi
msgfmt=$MSGFMT
AC_SUBST(msgfmt)
AC_PACKAGE_NEED_UTILITY($1, "$msgfmt", msgfmt, gettext)
if test -z "$MSGMERGE"; then
- AC_PATH_PROG(MSGMERGE, msgmerge,, /usr/bin:/usr/freeware/bin)
+ AC_PATH_PROG(MSGMERGE, msgmerge,, /usr/bin:/usr/freeware/bin:$PATH)
fi
msgmerge=$MSGMERGE
AC_SUBST(msgmerge)

View File

@ -0,0 +1,11 @@
--- include/builddefs.in.orig Thu Dec 23 13:38:50 2004
+++ include/builddefs.in Thu Dec 23 13:39:02 2004
@@ -113,7 +113,7 @@
PCFLAGS = -I/usr/local/include
endif
-GCFLAGS = -O1 $(OPTIMIZER) $(DEBUG) -funsigned-char -fno-strict-aliasing -Wall \
+GCFLAGS = $(OPTIMIZER) $(DEBUG) -funsigned-char -fno-strict-aliasing -Wall \
-DVERSION=\"$(PKG_VERSION)\" -DLOCALEDIR=\"$(PKG_LOCALE_DIR)\" \
-DPACKAGE=\"$(PKG_NAME)\" -I$(TOPDIR)/include

View File

@ -0,0 +1,11 @@
--- include/buildmacros.orig Sat Aug 16 01:41:15 2003
+++ include/buildmacros Sat Aug 16 01:41:48 2003
@@ -54,8 +54,6 @@
$(LFILES:.l=.o) \
$(YFILES:%.y=%.tab.o)
-INSTALL = $(TOPDIR)/install-sh -o $(PKG_USER) -g $(PKG_GROUP)
-
SHELL = /bin/sh
IMAGES_DIR = $(TOPDIR)/all-images
DIST_DIR = $(TOPDIR)/dist

View File

@ -0,0 +1,11 @@
--- fsck/Makefile.orig Tue Aug 19 15:39:28 2003
+++ fsck/Makefile Tue Aug 19 15:41:13 2003
@@ -35,7 +35,7 @@
LTCOMMAND = fsck.xfs
CFILES = xfs_fsck.c
-LCFLAGS = -s -O3
+LCFLAGS = -s
LLDFLAGS += -static
default: $(LTCOMMAND)

View File

@ -0,0 +1,179 @@
--- libdisk/fstype.c.orig Tue Aug 19 15:29:58 2003
+++ libdisk/fstype.c Tue Aug 19 15:31:13 2003
@@ -63,6 +63,28 @@
return (a>>8) | (a<<8);
}
+#define blksize 512
+static int
+read_dev(int fd, void *buf, size_t len)
+{
+ char block[blksize];
+ size_t ret;
+ size_t readlen = len - len % blksize;
+
+ ret = read(fd, buf, readlen);
+ if (ret != readlen)
+ return ret;
+
+ if (readlen == len)
+ return ret;
+
+ ret = read(fd, block, blksize);
+ if (ret != blksize)
+ return ret;
+
+ memcpy((char*)buf + readlen, block, len - readlen);
+ return len;
+}
/*
Probes the device and attempts to determine the type of filesystem
contained within.
@@ -120,7 +142,7 @@
(block sizes larger than 2K will be null padded) */
for (bs = 1; bs < 16; bs++) {
lseek(fd, bs*2048+32768, SEEK_SET);
- if (read(fd, (char *)&isosb, sizeof(isosb)) != sizeof(isosb))
+ if (read_dev(fd, (char *)&isosb, sizeof(isosb)) != sizeof(isosb))
return 0;
if (isosb.id[0])
break;
@@ -130,7 +152,7 @@
for (j = 1; j < 64; j++) {
if (j > 1) {
lseek(fd, j*bs*2048+32768, SEEK_SET);
- if (read(fd, (char *)&isosb, sizeof(isosb))
+ if (read_dev(fd, (char *)&isosb, sizeof(isosb))
!= sizeof(isosb))
return 0;
}
@@ -212,7 +234,9 @@
undesired side effects - first check that `device' refers
to a block device or ordinary file */
if (stat (device, &statbuf) ||
- !(S_ISBLK(statbuf.st_mode) || S_ISREG(statbuf.st_mode)))
+ !(S_ISBLK(statbuf.st_mode) ||
+ S_ISREG(statbuf.st_mode) ||
+ S_ISCHR(statbuf.st_mode)))
return 0;
fd = open(device, O_RDONLY);
@@ -225,7 +249,7 @@
if (!type) {
/* block 0 */
if (lseek(fd, 0, SEEK_SET) != 0
- || read(fd, (char *) &xsb, sizeof(xsb)) != sizeof(xsb))
+ || read_dev(fd, (char *) &xsb, sizeof(xsb)) != sizeof(xsb))
goto try_iso9660;
/* Gyorgy Kovesdi: none of my photocds has a readable block 0 */
@@ -262,7 +286,7 @@
if (!type) {
/* sector 1 */
if (lseek(fd, 512 , SEEK_SET) != 512
- || read(fd, (char *) &svsb, sizeof(svsb)) != sizeof(svsb))
+ || read_dev(fd, (char *) &svsb, sizeof(svsb)) != sizeof(svsb))
goto io_error;
if (sysvmagic(svsb) == SYSV_SUPER_MAGIC )
type = "sysv";
@@ -271,7 +295,7 @@
if (!type) {
/* block 1 */
if (lseek(fd, 1024, SEEK_SET) != 1024 ||
- read(fd, (char *) &sb, sizeof(sb)) != sizeof(sb))
+ read_dev(fd, (char *) &sb, sizeof(sb)) != sizeof(sb))
goto io_error;
/* ext2 has magic in little-endian on disk, so "swapped" is
@@ -311,7 +335,7 @@
if (!type) {
/* block 3 */
if (lseek(fd, 0xc00, SEEK_SET) != 0xc00
- || read(fd, (char *) &adfssb, sizeof(adfssb)) != sizeof(adfssb))
+ || read_dev(fd, (char *) &adfssb, sizeof(adfssb)) != sizeof(adfssb))
goto io_error;
/* only a weak test */
@@ -326,7 +350,7 @@
/* block 8 */
if (lseek(fd, 8192, SEEK_SET) != 8192
- || read(fd, (char *) &ufssb, sizeof(ufssb)) != sizeof(ufssb))
+ || read_dev(fd, (char *) &ufssb, sizeof(ufssb)) != sizeof(ufssb))
goto io_error;
mag = ufsmagic(ufssb);
@@ -338,7 +362,7 @@
/* block 8 */
if (lseek(fd, REISERFS_OLD_DISK_OFFSET_IN_BYTES, SEEK_SET) !=
REISERFS_OLD_DISK_OFFSET_IN_BYTES
- || read(fd, (char *) &reiserfssb, sizeof(reiserfssb)) !=
+ || read_dev(fd, (char *) &reiserfssb, sizeof(reiserfssb)) !=
sizeof(reiserfssb))
goto io_error;
if (is_reiserfs_magic_string(&reiserfssb))
@@ -348,7 +372,7 @@
if (!type) {
/* block 8 */
if (lseek(fd, 0x2000, SEEK_SET) != 0x2000
- || read(fd, (char *) &hpfssb, sizeof(hpfssb)) != sizeof(hpfssb))
+ || read_dev(fd, (char *) &hpfssb, sizeof(hpfssb)) != sizeof(hpfssb))
goto io_error;
if (hpfsmagic(hpfssb) == HPFS_SUPER_MAGIC)
@@ -358,7 +382,7 @@
if (!type) {
/* block 32 */
if (lseek(fd, JFS_SUPER1_OFF, SEEK_SET) != JFS_SUPER1_OFF
- || read(fd, (char *) &jfssb, sizeof(jfssb)) != sizeof(jfssb))
+ || read_dev(fd, (char *) &jfssb, sizeof(jfssb)) != sizeof(jfssb))
goto io_error;
if (!strncmp(jfssb.s_magic, JFS_MAGIC, 4))
type = "jfs";
@@ -368,7 +392,7 @@
/* block 32 */
try_iso9660:
if (lseek(fd, 0x8000, SEEK_SET) != 0x8000
- || read(fd, (char *) &isosb, sizeof(isosb)) != sizeof(isosb))
+ || read_dev(fd, (char *) &isosb, sizeof(isosb)) != sizeof(isosb))
goto io_error;
if (strncmp(isosb.hs.id, HS_STANDARD_ID, sizeof(isosb.hs.id)) == 0) {
@@ -388,7 +412,7 @@
/* block 64 */
if (lseek(fd, REISERFS_DISK_OFFSET_IN_BYTES, SEEK_SET) !=
REISERFS_DISK_OFFSET_IN_BYTES
- || read(fd, (char *) &reiserfssb, sizeof(reiserfssb)) !=
+ || read_dev(fd, (char *) &reiserfssb, sizeof(reiserfssb)) !=
sizeof(reiserfssb))
goto io_error;
if (is_reiserfs_magic_string(&reiserfssb))
@@ -396,6 +420,19 @@
}
if (!type) {
+ int mag;
+
+ /* block 64 */
+ if (lseek(fd, 65536, SEEK_SET) != 65536
+ || read_dev(fd, (char *) &ufssb, sizeof(ufssb)) != sizeof(ufssb))
+ goto io_error;
+
+ mag = ufsmagic(ufssb);
+ if (mag == UFS2_SUPER_MAGIC_LE || mag == UFS2_SUPER_MAGIC_BE)
+ type = "ufs2";
+ }
+
+ if (!type) {
/* perhaps the user tries to mount the swap space
on a new disk; warn her before she does mke2fs on it */
int pagesize = getpagesize();
@@ -408,7 +445,7 @@
if (rd > sizeof(buf))
rd = sizeof(buf);
if (lseek(fd, 0, SEEK_SET) != 0
- || read(fd, buf, rd) != rd)
+ || read_dev(fd, buf, rd) != rd)
goto io_error;
if (may_be_swap(buf+pagesize) ||
may_be_swap(buf+4096) || may_be_swap(buf+8192))

View File

@ -0,0 +1,11 @@
--- libdisk/fstype.h.orig Tue Aug 19 15:30:08 2003
+++ libdisk/fstype.h Tue Aug 19 15:31:13 2003
@@ -135,6 +135,8 @@
/* From jj@sunsite.ms.mff.cuni.cz Mon Mar 23 15:19:05 1998 */
#define UFS_SUPER_MAGIC_LE 0x00011954
#define UFS_SUPER_MAGIC_BE 0x54190100
+#define UFS2_SUPER_MAGIC_LE 0x19540119
+#define UFS2_SUPER_MAGIC_BE 0x19015419
struct ufs_super_block {
u_char s_dummy[0x55c];
u_char s_magic[4];

View File

@ -0,0 +1,3 @@
Set of utilities and library to manipulate an XFS filesystem.
WWW: http://oss.sgi.com/projects/xfs/

View File

@ -0,0 +1,23 @@
bin/xfs_admin
bin/xfs_db
bin/xfs_check
bin/xfs_ncheck
bin/xfs_freeze
bin/xfs_growfs
bin/xfs_info
bin/xfs_io
bin/xfs_bmap
bin/xfs_logprint
bin/xfs_mkfile
bin/xfs_rtcp
sbin/fsck.xfs
sbin/mkfs.xfs
sbin/xfs_repair
%%PORTDOCS%%%%DOCSDIR%%/PORTING
%%PORTDOCS%%%%DOCSDIR%%/CHANGES.gz
%%PORTDOCS%%%%DOCSDIR%%/CREDITS
%%PORTDOCS%%%%DOCSDIR%%/README.LVM
%%PORTDOCS%%%%DOCSDIR%%/README.quota
%%PORTDOCS%%%%DOCSDIR%%/COPYING
%%PORTDOCS%%%%DOCSDIR%%/README
%%PORTDOCS%%@dirrm %%DOCSDIR%%