[Glibc-bsd-commits] r3367 - in trunk/ufsutils/debian: . patches
Guillem Jover
guillem at alioth.debian.org
Mon May 30 20:20:35 UTC 2011
Author: guillem
Date: 2011-05-30 20:20:35 +0000 (Mon, 30 May 2011)
New Revision: 3367
Modified:
trunk/ufsutils/debian/changelog
trunk/ufsutils/debian/patches/00_include.patch
trunk/ufsutils/debian/patches/00_mount.patch
trunk/ufsutils/debian/patches/00_param.patch
trunk/ufsutils/debian/patches/01_libufs.patch
trunk/ufsutils/debian/patches/02_bsdlabel.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/99_makefiles.patch
trunk/ufsutils/debian/rules
Log:
New ufsutils upstream version (based on FreeBSD 8.2)
Modified: trunk/ufsutils/debian/changelog
===================================================================
--- trunk/ufsutils/debian/changelog 2011-05-30 19:49:46 UTC (rev 3366)
+++ trunk/ufsutils/debian/changelog 2011-05-30 20:20:35 UTC (rev 3367)
@@ -1,9 +1,10 @@
-ufsutils (7.3-2) UNRELEASED; urgency=low
+ufsutils (8.2-1) UNRELEASED; urgency=low
[ Robert Millan ]
* Set ufsutils-udeb to kfreebsd-any.
[ Guillem Jover ]
+ * New upstream version (based on FreeBSD 8.2)
* Now using Standards-Version 3.9.2 (no changes needed).
* Switch to source format “3.0 (quilt)”.
- Remove quilt from Build-Depends.
Modified: trunk/ufsutils/debian/patches/00_include.patch
===================================================================
--- trunk/ufsutils/debian/patches/00_include.patch 2011-05-30 19:49:46 UTC (rev 3366)
+++ trunk/ufsutils/debian/patches/00_include.patch 2011-05-30 20:20:35 UTC (rev 3367)
@@ -1,7 +1,8 @@
---
- sys/sys/disklabel.h | 3 ++-
- sys/sys/ucred.h | 2 ++
- 2 files changed, 4 insertions(+), 1 deletion(-)
+ sys/sys/disklabel.h | 3 -
+ sys/sys/endian.h | 142 ++++++++++++++++++++++++++++++++++++++++++++++++++++
+ sys/sys/ucred.h | 2
+ 3 files changed, 146 insertions(+), 1 deletion(-)
--- a/sys/sys/disklabel.h
+++ b/sys/sys/disklabel.h
@@ -27,3 +28,148 @@
/*
* Credentials.
+--- /dev/null
++++ b/sys/sys/endian.h
+@@ -0,0 +1,142 @@
++/*-
++ * Copyright (c) 2002 Thomas Moestl <tmm at FreeBSD.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.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
++ *
++ * $FreeBSD$
++ */
++
++#ifndef _SYS_ENDIAN_H_
++#define _SYS_ENDIAN_H_
++
++#include <endian.h>
++
++/* Alignment-agnostic encode/decode bytestream to/from little/big endian. */
++
++static __inline uint16_t
++be16dec(const void *pp)
++{
++ uint8_t const *p = (uint8_t const *)pp;
++
++ return ((p[0] << 8) | p[1]);
++}
++
++static __inline uint32_t
++be32dec(const void *pp)
++{
++ uint8_t const *p = (uint8_t const *)pp;
++
++ return (((unsigned)p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]);
++}
++
++static __inline uint64_t
++be64dec(const void *pp)
++{
++ uint8_t const *p = (uint8_t const *)pp;
++
++ return (((uint64_t)be32dec(p) << 32) | be32dec(p + 4));
++}
++
++static __inline uint16_t
++le16dec(const void *pp)
++{
++ uint8_t const *p = (uint8_t const *)pp;
++
++ return ((p[1] << 8) | p[0]);
++}
++
++static __inline uint32_t
++le32dec(const void *pp)
++{
++ uint8_t const *p = (uint8_t const *)pp;
++
++ return (((unsigned)p[3] << 24) | (p[2] << 16) | (p[1] << 8) | p[0]);
++}
++
++static __inline uint64_t
++le64dec(const void *pp)
++{
++ uint8_t const *p = (uint8_t const *)pp;
++
++ return (((uint64_t)le32dec(p + 4) << 32) | le32dec(p));
++}
++
++static __inline void
++be16enc(void *pp, uint16_t u)
++{
++ uint8_t *p = (uint8_t *)pp;
++
++ p[0] = (u >> 8) & 0xff;
++ p[1] = u & 0xff;
++}
++
++static __inline void
++be32enc(void *pp, uint32_t u)
++{
++ uint8_t *p = (uint8_t *)pp;
++
++ p[0] = (u >> 24) & 0xff;
++ p[1] = (u >> 16) & 0xff;
++ p[2] = (u >> 8) & 0xff;
++ p[3] = u & 0xff;
++}
++
++static __inline void
++be64enc(void *pp, uint64_t u)
++{
++ uint8_t *p = (uint8_t *)pp;
++
++ be32enc(p, (uint32_t)(u >> 32));
++ be32enc(p + 4, (uint32_t)(u & 0xffffffffU));
++}
++
++static __inline void
++le16enc(void *pp, uint16_t u)
++{
++ uint8_t *p = (uint8_t *)pp;
++
++ p[0] = u & 0xff;
++ p[1] = (u >> 8) & 0xff;
++}
++
++static __inline void
++le32enc(void *pp, uint32_t u)
++{
++ uint8_t *p = (uint8_t *)pp;
++
++ p[0] = u & 0xff;
++ p[1] = (u >> 8) & 0xff;
++ p[2] = (u >> 16) & 0xff;
++ p[3] = (u >> 24) & 0xff;
++}
++
++static __inline void
++le64enc(void *pp, uint64_t u)
++{
++ uint8_t *p = (uint8_t *)pp;
++
++ le32enc(p, (uint32_t)(u & 0xffffffffU));
++ le32enc(p + 4, (uint32_t)(u >> 32));
++}
++
++#endif /* _SYS_ENDIAN_H_ */
Modified: trunk/ufsutils/debian/patches/00_mount.patch
===================================================================
--- trunk/ufsutils/debian/patches/00_mount.patch 2011-05-30 19:49:46 UTC (rev 3366)
+++ trunk/ufsutils/debian/patches/00_mount.patch 2011-05-30 20:20:35 UTC (rev 3367)
@@ -37,15 +37,15 @@
#define STATFS_VERSION 0x20030518 /* current version number */
struct statfs {
uint32_t f_version; /* structure version number */
-@@ -224,6 +221,7 @@ void __mnt_vnode_markerfree(str
+@@ -220,6 +217,7 @@ void __mnt_vnode_markerfree(str
} while (0)
#endif /* _KERNEL */
+#endif
/*
- * User specifiable flags.
-@@ -404,6 +402,7 @@ struct nfs_public {
+ * User specifiable flags, stored in mnt_flag.
+@@ -415,6 +413,7 @@ struct nfs_public {
char *np_index; /* Index file */
};
@@ -53,7 +53,7 @@
/*
* Filesystem configuration information. One of these exists for each
* type of filesystem supported by the kernel. These are searched at
-@@ -441,6 +440,7 @@ struct ovfsconf {
+@@ -452,6 +451,7 @@ struct ovfsconf {
int vfc_flags;
};
#endif
@@ -61,7 +61,7 @@
/*
* NB: these flags refer to IMPLEMENTATION properties, not properties of
-@@ -505,6 +505,7 @@ struct vfsquery {
+@@ -517,6 +517,7 @@ struct vfsquery {
#define VQ_FLAG4000 0x4000 /* placeholder */
#define VQ_FLAG8000 0x8000 /* placeholder */
@@ -69,7 +69,7 @@
#ifdef _KERNEL
/* Point a sysctl request at a vfsidctl's data. */
#define VCTLTOREQ(vc, req) \
-@@ -766,5 +767,5 @@ int getvfsbyname(const char *, struct xv
+@@ -794,5 +795,5 @@ int getvfsbyname(const char *, struct xv
__END_DECLS
#endif /* _KERNEL */
Modified: trunk/ufsutils/debian/patches/00_param.patch
===================================================================
--- trunk/ufsutils/debian/patches/00_param.patch 2011-05-30 19:49:46 UTC (rev 3366)
+++ trunk/ufsutils/debian/patches/00_param.patch 2011-05-30 20:20:35 UTC (rev 3367)
@@ -12,7 +12,7 @@
#include <sys/_null.h>
#define BSD 199506 /* System version (year & month). */
-@@ -71,6 +72,9 @@
+@@ -77,6 +78,9 @@
* MAXLOGNAME should be == UT_NAMESIZE+1 (see <utmp.h>)
*/
#include <sys/syslimits.h>
@@ -22,7 +22,7 @@
#define MAXCOMLEN 19 /* max command name remembered */
#define MAXINTERP 32 /* max interpreter file name length */
-@@ -83,6 +87,7 @@
+@@ -89,6 +93,7 @@
#define MAXHOSTNAMELEN 256 /* max hostname size */
#define SPECNAMELEN 63 /* max length of devicename */
@@ -30,7 +30,7 @@
/* More types and definitions used throughout the kernel. */
#ifdef _KERNEL
#include <sys/cdefs.h>
-@@ -106,6 +111,7 @@
+@@ -116,6 +121,7 @@
#ifndef _KERNEL
#include <sys/limits.h>
#endif
@@ -38,9 +38,9 @@
#ifndef _NO_NAMESPACE_POLLUTION
-@@ -183,7 +189,9 @@
- #define PCATCH 0x100 /* OR'd with pri for tsleep to check signals */
+@@ -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" */
@@ -48,7 +48,7 @@
#define NBBY 8 /* number of bits in a byte */
#define NBPW sizeof(int) /* number of bytes per word (integer) */
-@@ -258,6 +266,7 @@
+@@ -263,6 +271,7 @@
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))
@@ -56,9 +56,9 @@
#ifdef _KERNEL
/*
* Basic byte order function prototypes for non-inline functions.
-@@ -305,4 +314,5 @@ __END_DECLS
- #define ctodb(db) /* calculates pages to devblks */ \
- ((db) << (PAGE_SHIFT - DEV_BSHIFT))
+@@ -317,4 +326,5 @@ __END_DECLS
+ #define member2struct(s, m, x) \
+ ((struct s *)(void *)((char *)(x) - offsetof(struct s, m)))
+#endif
#endif /* _SYS_PARAM_H_ */
Modified: trunk/ufsutils/debian/patches/01_libufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/01_libufs.patch 2011-05-30 19:49:46 UTC (rev 3366)
+++ trunk/ufsutils/debian/patches/01_libufs.patch 2011-05-30 20:20:35 UTC (rev 3367)
@@ -1,23 +1,24 @@
---
- lib/libufs/Makefile | 29 ++++++++++-------------------
+ lib/libufs/Makefile | 30 ++++++++++--------------------
+ lib/libufs/block.c | 4 ++++
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, 21 insertions(+), 21 deletions(-)
+ 6 files changed, 25 insertions(+), 22 deletions(-)
--- a/lib/libufs/type.c
+++ b/lib/libufs/type.c
-@@ -108,7 +108,7 @@ again: if ((ret = stat(name, &st)) < 0)
- */
- name = oname;
- }
-- if (ret >= 0 && S_ISCHR(st.st_mode)) {
-+ if (ret >= 0 && (S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode) || S_ISREG(st.st_mode))) {
+@@ -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) {
-@@ -131,8 +131,10 @@ again: if ((ret = stat(name, &st)) < 0)
+@@ -134,8 +134,10 @@ again: if ((ret = stat(name, &st)) < 0)
ERROR(disk, "could not find special device");
return (-1);
}
@@ -40,7 +41,7 @@
/*
* Each disk drive contains some number of filesystems.
* A filesystem consists of a number of cylinder groups.
-@@ -502,7 +505,7 @@ struct cg {
+@@ -504,7 +507,7 @@ struct cg {
* Turn filesystem block numbers into disk block addresses.
* This maps filesystem blocks to device size blocks.
*/
@@ -73,7 +74,7 @@
* practice this seems unlikely. So, we define the type doff_t as a 32-bit
--- a/lib/libufs/Makefile
+++ b/lib/libufs/Makefile
-@@ -1,26 +1,17 @@
+@@ -1,27 +1,17 @@
# $FreeBSD$
LIB= ufs
@@ -86,6 +87,7 @@
-MAN= bread.3 cgread.3 libufs.3 sbread.3 ufs_disk_close.3
-MLINKS+= bread.3 bwrite.3
+-MLINKS+= bread.3 berase.3
-MLINKS+= cgread.3 cgread1.3
-MLINKS+= cgread.3 cgwrite1.3
-MLINKS+= sbread.3 sbwrite.3
@@ -110,3 +112,26 @@
-
-.include <bsd.lib.mk>
+include ../../Makefile.common
+--- 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>
+
+@@ -151,8 +153,10 @@ berase(struct uufsd *disk, ufs2_daddr_t
+ ERROR(disk, "failed to open disk for writing");
+ return(rv);
+ }
++#ifdef HAVE_BSD_DISKLABEL
+ ioarg[0] = blockno * disk->d_bsize;
+ ioarg[1] = size;
+ rv = ioctl(disk->d_fd, DIOCGDELETE, ioarg);
++#endif
+ return (rv);
+ }
Modified: trunk/ufsutils/debian/patches/02_bsdlabel.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_bsdlabel.ufs.patch 2011-05-30 19:49:46 UTC (rev 3366)
+++ trunk/ufsutils/debian/patches/02_bsdlabel.ufs.patch 2011-05-30 20:20:35 UTC (rev 3367)
@@ -1,7 +1,7 @@
---
sbin/bsdlabel/Makefile | 16 ++++++----------
- sbin/bsdlabel/bsdlabel.c | 21 +++++++++++++++++++--
- 2 files changed, 25 insertions(+), 12 deletions(-)
+ sbin/bsdlabel/bsdlabel.c | 13 +++++++++++--
+ 2 files changed, 17 insertions(+), 12 deletions(-)
--- a/sbin/bsdlabel/bsdlabel.c
+++ b/sbin/bsdlabel/bsdlabel.c
@@ -14,8 +14,8 @@
+#endif
#define DKTYPENAMES
#define FSTYPENAMES
- #include <sys/disklabel.h>
-@@ -68,7 +70,7 @@ __FBSDID("$FreeBSD$");
+ #define MAXPARTITIONS 26
+@@ -69,7 +71,7 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
#include <string.h>
#include <stdio.h>
@@ -24,20 +24,7 @@
#include <stdlib.h>
#include <signal.h>
#include <stdarg.h>
-@@ -476,8 +478,12 @@ readlabel(int flag)
- err(1, specname);
- if (is_file)
- get_file_parms(f);
-+#if HAVE_BSD_DISKLABEL
- else if ((ioctl(f, DIOCGMEDIASIZE, &mediasize) != 0) ||
- (ioctl(f, DIOCGSECTORSIZE, &secsize) != 0)) {
-+#else
-+ else {
-+#endif
- err(4, "cannot get disk geometry");
- }
- if (mediasize > (off_t)0xffffffff * secsize)
-@@ -665,10 +671,12 @@ editit(void)
+@@ -720,10 +722,12 @@ editit(void)
omask = sigblock(sigmask(SIGINT)|sigmask(SIGQUIT)|sigmask(SIGHUP));
while ((pid = fork()) < 0) {
@@ -50,20 +37,7 @@
if (errno != EAGAIN) {
warn("fork");
return(0);
-@@ -1426,8 +1434,12 @@ getvirginlabel(void)
-
- if (is_file)
- get_file_parms(f);
-+#if HAVE_BSD_DISKLABEL
- else if ((ioctl(f, DIOCGMEDIASIZE, &mediasize) != 0) ||
- (ioctl(f, DIOCGSECTORSIZE, &secsize) != 0)) {
-+#else
-+ else {
-+#endif
- close (f);
- return (NULL);
- }
-@@ -1443,13 +1455,18 @@ getvirginlabel(void)
+@@ -1508,13 +1512,18 @@ getvirginlabel(void)
* to get any good ideas from the device, construct something
* which is IBM-PC friendly.
*/
@@ -97,12 +71,12 @@
-LINKS= ${BINDIR}/bsdlabel ${BINDIR}/disklabel
-MLINKS= bsdlabel.8 disklabel.8
-.endif
-+SRCS= bsdlabel.c ../../libdisklabel/geom_bsd_enc.c
++SRCS= bsdlabel.c ../../sys/geom/geom_bsd_enc.c
+MAN = bsdlabel.8:bsdlabel.8
- DPADD= ${LIBGEOM}
- LDADD= -lgeom
-@@ -19,7 +13,9 @@ LDADD= -lgeom
+ DPADD= ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF}
+ LDADD= -lgeom -lbsdxml -lsbuf
+@@ -19,7 +13,9 @@ LDADD= -lgeom -lbsdxml -lsbuf
.include <bsd.prog.mk>
test: ${PROG}
Modified: trunk/ufsutils/debian/patches/02_fsck.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_fsck.ufs.patch 2011-05-30 19:49:46 UTC (rev 3366)
+++ trunk/ufsutils/debian/patches/02_fsck.ufs.patch 2011-05-30 20:20:35 UTC (rev 3367)
@@ -1,16 +1,16 @@
---
- sbin/fsck_ffs/Makefile | 27 ++++++++++------------
+ sbin/fsck_ffs/Makefile | 27 ++++++++++++-------------
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/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 | 56 +++++++++++++++++++++++++++++++++++++++++-----
+ 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, 105 insertions(+), 30 deletions(-)
+ sbin/fsck_ffs/setup.c | 14 +++++++++++++
+ sbin/fsck_ffs/utilities.c | 6 +++--
+ 11 files changed, 102 insertions(+), 26 deletions(-)
--- a/sbin/fsck_ffs/gjournal.c
+++ b/sbin/fsck_ffs/gjournal.c
@@ -57,7 +57,7 @@
.Nd file system consistency check and interactive repair
.Sh SYNOPSIS
.Nm
-@@ -341,5 +341,4 @@ are fully enumerated and explained in Ap
+@@ -349,5 +349,4 @@ are fully enumerated and explained in Ap
.Xr fstab 5 ,
.Xr fsck 8 ,
.Xr fsdb 8 ,
@@ -97,7 +97,7 @@
if (!preen) {
printf("\n***** FILE SYSTEM MARKED %s *****\n",
markclean ? "CLEAN" : "DIRTY");
-@@ -593,7 +598,7 @@ getpathname(char *namebuf, ino_t curdir,
+@@ -639,7 +644,7 @@ getpathname(char *namebuf, ino_t curdir,
}
void
@@ -106,7 +106,7 @@
{
ckfini(0);
-@@ -606,7 +611,7 @@ catch(int sig __unused)
+@@ -652,7 +657,7 @@ catch(int sig __unused)
* so that reboot sequence may be interrupted.
*/
void
@@ -115,7 +115,7 @@
{
printf("returning to single-user after file system check\n");
returntosingle = 1;
-@@ -675,11 +680,13 @@ pfatal(const char *fmt, ...)
+@@ -721,11 +726,13 @@ pfatal(const char *fmt, ...)
* Force foreground fsck to clean up inconsistency.
*/
if (bkgrdflag) {
@@ -129,7 +129,7 @@
fprintf(stdout, "CANNOT RUN IN BACKGROUND\n");
ckfini(0);
exit(EEXIT);
-@@ -696,6 +703,7 @@ pfatal(const char *fmt, ...)
+@@ -742,6 +749,7 @@ pfatal(const char *fmt, ...)
/*
* Force foreground fsck to clean up inconsistency.
*/
@@ -137,7 +137,7 @@
if (bkgrdflag) {
cmd.value = FS_NEEDSFSCK;
cmd.size = 1;
-@@ -703,6 +711,7 @@ pfatal(const char *fmt, ...)
+@@ -749,6 +757,7 @@ pfatal(const char *fmt, ...)
&cmd, sizeof cmd) == -1)
pwarn("CANNOT SET FS_NEEDSFSCK FLAG\n");
}
@@ -194,7 +194,7 @@
#include "fsck.h"
-static void usage(void) __dead2;
-+static void usage(char *progname);
++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);
@@ -204,21 +204,21 @@
int
main(int argc, char *argv[])
-@@ -78,11 +90,12 @@ main(int argc, char *argv[])
- struct rlimit rlimit;
+@@ -79,10 +91,12 @@ main(int argc, char *argv[])
struct itimerval itimerval;
int ret = 0;
-+ char *progname = argv[0];
++ setprogname(argv[0]);
++
sync();
skipclean = 1;
- damagedflag = 0;
-- while ((ch = getopt(argc, argv, "b:Bc:CdDfFm:npy")) != -1) {
-+ while ((ch = getopt(argc, argv, "ab:Bc:CdDfFm:npy")) != -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;
-@@ -130,6 +143,7 @@ main(int argc, char *argv[])
+@@ -126,6 +140,7 @@ main(int argc, char *argv[])
yflag = 0;
break;
@@ -226,22 +226,7 @@
case 'p':
preen++;
/*FALLTHROUGH*/
-@@ -144,20 +158,22 @@ main(int argc, char *argv[])
- break;
-
- default:
-- usage();
-+ usage(progname);
- }
- }
- argc -= optind;
- argv += optind;
-
- if (!argc)
-- usage();
-+ usage(progname);
-
- if (signal(SIGINT, SIG_IGN) != SIG_IGN)
+@@ -157,7 +172,9 @@ main(int argc, char *argv[])
(void)signal(SIGINT, catch);
if (ckclean)
(void)signal(SIGQUIT, catchquit);
@@ -251,7 +236,7 @@
if (bkgrdflag) {
signal(SIGALRM, alarmhandler);
itimerval.it_interval.tv_sec = 5;
-@@ -204,8 +220,10 @@ checkfilesys(char *filesys)
+@@ -204,8 +221,10 @@ checkfilesys(char *filesys)
ufs2_daddr_t n_ffree, n_bfree;
struct dups *dp;
struct statfs *mntp;
@@ -262,7 +247,7 @@
ufs2_daddr_t blks;
struct iovec *iov;
char errmsg[255];
-@@ -227,10 +245,14 @@ checkfilesys(char *filesys)
+@@ -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.
*/
@@ -277,7 +262,7 @@
filesys = blockcheck(filesys);
/*
* If -F flag specified, check to see whether a background check
-@@ -248,8 +270,10 @@ checkfilesys(char *filesys)
+@@ -247,8 +270,10 @@ checkfilesys(char *filesys)
if ((sblock.fs_flags & FS_DOSOFTDEP) == 0)
exit(5); /* Not running soft updates */
size = MIBSIZE;
@@ -288,7 +273,7 @@
if ((mntp == NULL && sblock.fs_clean == 1) ||
(mntp != NULL && (sblock.fs_flags & FS_UNCLEAN) == 0))
exit(7); /* Filesystem clean, report it now */
-@@ -262,6 +286,7 @@ checkfilesys(char *filesys)
+@@ -261,6 +286,7 @@ checkfilesys(char *filesys)
if ((fsreadfd = open(filesys, O_RDONLY)) < 0 || readsb(0) == 0)
exit(3); /* Cannot read superblock */
close(fsreadfd);
@@ -296,7 +281,7 @@
if ((sblock.fs_flags & FS_GJOURNAL) != 0) {
//printf("GJournaled file system detected on %s.\n",
// filesys);
-@@ -279,6 +304,7 @@ checkfilesys(char *filesys)
+@@ -278,6 +304,7 @@ checkfilesys(char *filesys)
"CANNOT RUN FAST FSCK\n");
}
}
@@ -304,7 +289,7 @@
}
/*
* If we are to do a background check:
-@@ -287,6 +313,7 @@ checkfilesys(char *filesys)
+@@ -286,6 +313,7 @@ checkfilesys(char *filesys)
* return created snapshot file
* if not found, clear bkgrdflag and proceed with normal fsck
*/
@@ -312,7 +297,7 @@
if (bkgrdflag) {
if (mntp == NULL) {
bkgrdflag = 0;
-@@ -374,6 +401,7 @@ checkfilesys(char *filesys)
+@@ -368,6 +396,7 @@ checkfilesys(char *filesys)
filesys = snapname;
}
}
@@ -320,7 +305,7 @@
switch (setup(filesys)) {
case 0:
-@@ -381,7 +409,9 @@ checkfilesys(char *filesys)
+@@ -375,7 +404,9 @@ checkfilesys(char *filesys)
pfatal("CAN'T CHECK FILE SYSTEM.");
return (0);
case -1:
@@ -330,7 +315,7 @@
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",
-@@ -401,8 +431,10 @@ checkfilesys(char *filesys)
+@@ -395,8 +426,10 @@ checkfilesys(char *filesys)
*/
if (preen == 0) {
printf("** Last Mounted on %s\n", sblock.fs_fsmnt);
@@ -341,7 +326,7 @@
printf("** Phase 1 - Check Blocks and Sizes\n");
}
pass1();
-@@ -501,8 +533,13 @@ checkfilesys(char *filesys)
+@@ -495,8 +528,13 @@ checkfilesys(char *filesys)
/*
* Check to see if the file system is mounted read-write.
*/
@@ -355,16 +340,16 @@
ckfini(resolved);
for (cylno = 0; cylno < sblock.fs_ncg; cylno++)
-@@ -545,6 +582,8 @@ chkdoreload(struct statfs *mntp)
+@@ -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) {
- /*
- * XXX: Need to kick out MNT_ROOTFS until we fix
-@@ -573,8 +612,12 @@ chkdoreload(struct statfs *mntp)
+ 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);
@@ -377,26 +362,17 @@
/*
* Get the mount point information for name.
*/
-@@ -614,13 +657,14 @@ getmntpt(const char *name)
+@@ -601,6 +645,7 @@ getmntpt(const char *name)
statfsp = NULL;
return (statfsp);
}
+#endif
static void
--usage(void)
-+usage(char *progname)
- {
- (void) fprintf(stderr,
- "usage: %s [-BCFpfny] [-b block] [-c level] [-m mode] "
- "filesystem ...\n",
-- getprogname());
-+ progname);
- exit(1);
- }
+ usage(void)
--- a/sbin/fsck_ffs/pass1.c
+++ b/sbin/fsck_ffs/pass1.c
-@@ -319,9 +319,11 @@ checkinode(ino_t inumber, struct inodesc
+@@ -357,9 +357,11 @@ checkinode(ino_t inumber, struct inodesc
inoinfo(inumber)->ino_type = IFTODT(mode);
badblk = dupblk = 0;
idesc->id_number = inumber;
Modified: trunk/ufsutils/debian/patches/02_fsdb.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_fsdb.ufs.patch 2011-05-30 19:49:46 UTC (rev 3366)
+++ trunk/ufsutils/debian/patches/02_fsdb.ufs.patch 2011-05-30 20:20:35 UTC (rev 3367)
@@ -1,9 +1,9 @@
---
- sbin/fsdb/Makefile | 20 +++++++++-----------
+ sbin/fsdb/Makefile | 19 ++++++++-----------
sbin/fsdb/fsdb.8 | 2 +-
sbin/fsdb/fsdb.c | 14 +++++++++++++-
sbin/fsdb/fsdbutil.c | 13 ++++++++++++-
- 4 files changed, 35 insertions(+), 14 deletions(-)
+ 4 files changed, 34 insertions(+), 14 deletions(-)
--- a/sbin/fsdb/fsdb.8
+++ b/sbin/fsdb/fsdb.8
Modified: trunk/ufsutils/debian/patches/02_growfs.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_growfs.ufs.patch 2011-05-30 19:49:46 UTC (rev 3366)
+++ trunk/ufsutils/debian/patches/02_growfs.ufs.patch 2011-05-30 20:20:35 UTC (rev 3367)
@@ -1,7 +1,7 @@
---
- sbin/growfs/Makefile | 20 ++++++++++++--------
+ sbin/growfs/Makefile | 16 ++++++++++------
sbin/growfs/growfs.c | 8 +++++++-
- 2 files changed, 19 insertions(+), 9 deletions(-)
+ 2 files changed, 17 insertions(+), 7 deletions(-)
--- a/sbin/growfs/growfs.c
+++ b/sbin/growfs/growfs.c
@@ -17,7 +17,7 @@
#include <stdio.h>
#include <paths.h>
-@@ -1929,10 +1929,12 @@ get_dev_size(int fd, int *size)
+@@ -1925,10 +1925,12 @@ get_dev_size(int fd, int *size)
int sectorsize;
off_t mediasize;
@@ -30,7 +30,7 @@
if (sectorsize <= 0)
errx(1, "bogus sectorsize: %d", sectorsize);
-@@ -2288,9 +2290,11 @@ return_disklabel(int fd, struct disklabe
+@@ -2285,9 +2287,11 @@ return_disklabel(int fd, struct disklabe
}
lp->d_checksum=sum;
@@ -42,7 +42,7 @@
}
free(lp);
-@@ -2314,8 +2318,10 @@ get_disklabel(int fd)
+@@ -2311,8 +2315,10 @@ get_disklabel(int fd)
if (!lab)
errx(1, "malloc failed");
@@ -55,29 +55,26 @@
--- a/sbin/growfs/Makefile
+++ b/sbin/growfs/Makefile
-@@ -6,14 +6,17 @@
+@@ -6,12 +6,16 @@
#GFSDBG=
-PROG= growfs
-+PROG= growfs.ufs
++PROG= growfs.ufs
SRCS= growfs.c
-MAN= growfs.8
+MAN= growfs.8:growfs.ufs.8
--WARNS?= 6
+-.if defined(GFSDBG)
+-SRCS+= debug.c
+-.endif
+ifdef GFSDBG
+SRCS += debug.c
+ALL_CFLAGS = -DFS_DEBUG
+endif
-+
-+WARNS = 6
-+LDADD += -L../../lib/libufs -lufs
-+INCLUDES =
--.if defined(GFSDBG)
--SRCS+= debug.c
--.endif
--
-.include <bsd.prog.mk>
++LDADD += -L../../lib/libufs -lufs
++INCLUDES =
++
+include ../../Makefile.common
Modified: trunk/ufsutils/debian/patches/02_mkfs.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_mkfs.ufs.patch 2011-05-30 19:49:46 UTC (rev 3366)
+++ trunk/ufsutils/debian/patches/02_mkfs.ufs.patch 2011-05-30 20:20:35 UTC (rev 3367)
@@ -1,8 +1,9 @@
---
- sbin/newfs/Makefile | 23 +++++++++++++----------
+ sbin/newfs/Makefile | 22 ++++++++++------------
sbin/newfs/mkfs.c | 1 +
- sbin/newfs/newfs.c | 21 +++++++++++++++++----
- 3 files changed, 31 insertions(+), 14 deletions(-)
+ sbin/newfs/newfs.8 | 4 ++--
+ sbin/newfs/newfs.c | 22 ++++++++++++++++++----
+ 4 files changed, 31 insertions(+), 18 deletions(-)
--- a/sbin/newfs/mkfs.c
+++ b/sbin/newfs/mkfs.c
@@ -16,53 +17,55 @@
#include <sys/types.h>
--- a/sbin/newfs/newfs.c
+++ b/sbin/newfs/newfs.c
-@@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$");
+@@ -55,7 +55,9 @@ __FBSDID("$FreeBSD$");
*/
#include <sys/param.h>
#include <sys/stat.h>
--#include <sys/disk.h>
++#ifdef HAVE_BSD_DISKLABEL
+ #include <sys/disk.h>
++#endif
#include <sys/disklabel.h>
#include <sys/file.h>
#include <sys/mount.h>
-@@ -140,6 +139,7 @@ struct uufsd disk; /* libufs disk struc
- static char device[MAXPATHLEN];
- static char *disktype;
- static int unlabeled;
-+static char *progname;
-
- static struct disklabel *getdisklabel(char *s);
- static void rewritelabel(char *s, struct disklabel *lp);
-@@ -156,6 +156,8 @@ main(int argc, char *argv[])
- int ch, i;
+@@ -133,6 +135,8 @@ main(int argc, char *argv[])
off_t mediasize;
+ char part_name; /* partition name, default to full disk */
-+ progname = argv[0];
++ setprogname(argv[0]);
+
+ part_name = 'c';
+ reserved = 0;
while ((ch = getopt(argc, argv,
- "EJL:NO:RS:T:Ua:b:c:d:e:f:g:h:i:lm:no:s:")) != -1)
- switch (ch) {
-@@ -297,12 +299,19 @@ main(int argc, char *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)
- errx(1, "%s: not a character-special device", 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)
- ioctl(disk.d_fd, DIOCGSECTORSIZE, §orsize);
-- if (sectorsize && !ioctl(disk.d_fd, DIOCGMEDIASIZE, &mediasize)) {
+ if (sectorsize == 0)
+ if (ioctl(disk.d_fd, DIOCGSECTORSIZE, §orsize) == -1)
+ sectorsize = 0; /* back out on error for safety */
+- if (sectorsize && ioctl(disk.d_fd, DIOCGMEDIASIZE, &mediasize) != -1)
+#else
-+ sectorsize = 512;
++ sectorsize = 512;
+#endif
-+ mediasize = get_block_device_size(disk.d_fd);
-+ if (sectorsize && mediasize) {
- if (fssize == 0)
- fssize = mediasize / sectorsize;
- else if (fssize > mediasize / sectorsize)
-@@ -375,7 +384,7 @@ main(int argc, char *argv[])
++ 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);
@@ -71,64 +74,51 @@
if (realsectorsize != DEV_BSIZE)
pp->p_size /= realsectorsize / DEV_BSIZE;
if (!Nflag && bcmp(pp, &oldpartition, sizeof(oldpartition)))
-@@ -388,6 +397,7 @@ main(int argc, char *argv[])
- struct disklabel *
- getdisklabel(char *s)
- {
+@@ -415,8 +425,10 @@ getdisklabel(char *s)
+ return &lab;
+ }
+
+#if HAVE_BSD_DISKLABEL
- static struct disklabel lab;
- struct disklabel *lp;
-
-@@ -399,6 +409,7 @@ getdisklabel(char *s)
- if (lp != NULL)
- return (lp);
- }
+ if (ioctl(disk.d_fd, DIOCGDINFO, (char *)&lab) != -1)
+ return (&lab);
+#endif
- return (NULL);
- }
-
-@@ -409,8 +420,10 @@ rewritelabel(char *s, struct disklabel *
+ unlabeled++;
+ if (disktype) {
+ lp = getdiskbyname(disktype);
+@@ -441,8 +453,10 @@ rewritelabel(char *s, struct disklabel *
+ errx(1, "cannot write label");
return;
- lp->d_checksum = 0;
- lp->d_checksum = dkcksum(lp);
+ }
+#if HAVE_BSD_DISKLABEL
- if (ioctl(disk.d_fd, DIOCWDINFO, (char *)lp) < 0)
+ if (ioctl(disk.d_fd, DIOCWDINFO, (char *)lp) == -1)
warn("ioctl (WDINFO): %s: can't rewrite disk label", s);
+#endif
}
static void
-@@ -418,7 +431,7 @@ usage()
- {
- fprintf(stderr,
- "usage: %s [ -fsoptions ] special-device%s\n",
-- getprogname(),
-+ progname,
- " [device-type]");
- fprintf(stderr, "where fsoptions are:\n");
- fprintf(stderr, "\t-J Enable journaling via gjournal\n");
--- a/sbin/newfs/Makefile
+++ b/sbin/newfs/Makefile
-@@ -1,17 +1,19 @@
+@@ -1,20 +1,18 @@
# @(#)Makefile 8.2 (Berkeley) 3/27/94
# $FreeBSD$
+-.PATH: ${.CURDIR}/../../sys/geom
+-
-PROG= newfs
-DPADD= ${LIBUFS}
-LDADD= -lufs
--SRCS= newfs.c mkfs.c
--WARNS?= 2
+-SRCS= newfs.c mkfs.c geom_bsd_enc.c
+-
++PROG= mkfs.ufs
++SRCS= newfs.c mkfs.c ../../sys/geom/geom_bsd_enc.c
+ WARNS?= 2
-MAN= newfs.8
-+PROG = mkfs.ufs
-+SRCS = newfs.c mkfs.c
-+WARNS ?= 2
-+MAN = newfs.8:mkfs.ufs.8
++MAN= newfs.8:mkfs.ufs.8
++
++LDADD += -L../../lib/libufs -lufs -L../../port -lport -lbsd
++INCLUDES = -I../../lib/libufs -include ../../port/blockdev.h
-.include <bsd.prog.mk>
-+LDADD += -L../../lib/libufs -lufs -L../../port -lport -lbsd
-+INCLUDES = -I../../lib/libufs \
-+ -include ../../port/blockdev.h
-+
+include ../../Makefile.common
test: ${PROG}
@@ -139,3 +129,18 @@
+ sh ${CURDIR}/runtest00.sh | tee _.test
+ diff --ignore-matching-lines=FreeBSD _.test ${CURDIR}/ref.test
echo All Tests Passed
+--- 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.
Modified: trunk/ufsutils/debian/patches/02_tunefs.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_tunefs.ufs.patch 2011-05-30 19:49:46 UTC (rev 3366)
+++ trunk/ufsutils/debian/patches/02_tunefs.ufs.patch 2011-05-30 20:20:35 UTC (rev 3367)
@@ -22,7 +22,7 @@
#include <ufs/ffs/fs.h>
@@ -84,8 +91,12 @@ main(int argc, char *argv[])
- int mflag, mvalue, nflag, oflag, ovalue, pflag, sflag, svalue;
+ int mflag, mvalue, Nflag, nflag, oflag, ovalue, pflag, sflag, svalue;
int ch, found_arg, i;
const char *chg[2];
+#ifdef HAVE_BSD_MOUNT
@@ -34,7 +34,7 @@
if (argc < 3)
usage();
-@@ -241,9 +252,11 @@ main(int argc, char *argv[])
+@@ -253,9 +264,11 @@ main(int argc, char *argv[])
goto err;
if (disk.d_name != special) {
special = disk.d_name;
@@ -46,7 +46,7 @@
}
if (pflag) {
-@@ -402,6 +415,7 @@ main(int argc, char *argv[])
+@@ -440,6 +453,7 @@ main(int argc, char *argv[])
if (sbwrite(&disk, Aflag) == -1)
goto err;
ufs_disk_close(&disk);
@@ -54,7 +54,7 @@
if (active) {
bzero(&args, sizeof(args));
if (mount("ufs", on,
-@@ -409,6 +423,7 @@ main(int argc, char *argv[])
+@@ -447,6 +461,7 @@ main(int argc, char *argv[])
err(9, "%s: reload", special);
warnx("file system reloaded");
}
Modified: trunk/ufsutils/debian/patches/99_makefiles.patch
===================================================================
--- trunk/ufsutils/debian/patches/99_makefiles.patch 2011-05-30 19:49:46 UTC (rev 3366)
+++ trunk/ufsutils/debian/patches/99_makefiles.patch 2011-05-30 20:20:35 UTC (rev 3367)
@@ -1,7 +1,7 @@
---
- Makefile | 28 +++++++++++++++++
- Makefile.common | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 120 insertions(+)
+ Makefile | 27 ++++++++++++++++
+ Makefile.common | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 118 insertions(+)
--- /dev/null
+++ b/Makefile
Modified: trunk/ufsutils/debian/rules
===================================================================
--- trunk/ufsutils/debian/rules 2011-05-30 19:49:46 UTC (rev 3366)
+++ trunk/ufsutils/debian/rules 2011-05-30 20:20:35 UTC (rev 3367)
@@ -30,10 +30,11 @@
get-orig-source:
rm -rf $(ORIGDIR)
- mkdir -p $(ORIGDIR)/sys/sys
+ mkdir -p $(ORIGDIR)/sys/sys $(ORIGDIR)/sys/geom
for i in sbin/badsect sbin/dump sbin/dumpfs sbin/fsck_ffs sbin/fsdb \
sbin/growfs sbin/newfs sbin/tunefs sbin/bsdlabel \
sbin/sunlabel sbin/ffsinfo sbin/mount lib/libufs 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 \
More information about the Glibc-bsd-commits
mailing list