svn commit: r241232 - projects/mtree/usr.sbin/makefs

Brooks Davis brooks at FreeBSD.org
Fri Oct 5 19:02:08 UTC 2012


Author: brooks
Date: Fri Oct  5 19:02:07 2012
New Revision: 241232
URL: http://svn.freebsd.org/changeset/base/241232

Log:
  Teach makefs about netbsd's mtree.  This makes the -F option usable in
  practice.

Modified:
  projects/mtree/usr.sbin/makefs/Makefile
  projects/mtree/usr.sbin/makefs/walk.c

Modified: projects/mtree/usr.sbin/makefs/Makefile
==============================================================================
--- projects/mtree/usr.sbin/makefs/Makefile	Fri Oct  5 18:42:50 2012	(r241231)
+++ projects/mtree/usr.sbin/makefs/Makefile	Fri Oct  5 19:02:07 2012	(r241232)
@@ -20,14 +20,22 @@ WARNS?=	2
 CFLAGS+=-DHAVE_STRUCT_STAT_ST_FLAGS=1
 CFLAGS+=-DHAVE_STRUCT_STAT_ST_GEN=1
 
-.PATH:	${.CURDIR}/../mtree
-CFLAGS+=-I${.CURDIR}/../mtree
+.PATH:	${.CURDIR}/../../contrib/mtree
+CFLAGS+=-I${.CURDIR}/../../contrib/mtree
 SRCS+=	misc.c spec.c
 
+.PATH:	${.CURDIR}/../nmtree
+CFLAGS+=-I${.CURDIR}/../nmtree
+SRCS+=	util.c
+
+.PATH:	${.CURDIR}/../../contrib/mknod
+CFLAGS+=-I${.CURDIR}/../../contrib/mknod
+SRCS+=	pack_dev.c
+
 .PATH:	${.CURDIR}/../../sys/ufs/ffs
 SRCS+=	ffs_tables.c
 
 DPADD=  ${LIBSBUF}
-LDADD=  -lsbuf
+LDADD=  -lsbuf -lutil
 
 .include <bsd.prog.mk>

Modified: projects/mtree/usr.sbin/makefs/walk.c
==============================================================================
--- projects/mtree/usr.sbin/makefs/walk.c	Fri Oct  5 18:42:50 2012	(r241231)
+++ projects/mtree/usr.sbin/makefs/walk.c	Fri Oct  5 19:02:07 2012	(r241232)
@@ -305,7 +305,7 @@ apply_specfile(const char *specfile, con
 	if ((fp = fopen(specfile, "r")) == NULL)
 		err(1, "Can't open `%s'", specfile);
 	TIMER_START(start);
-	root = mtree_readspec(fp);
+	root = spec(fp);
 	TIMER_RESULTS(start, "spec");
 	if (fclose(fp) == EOF)
 		err(1, "Can't close `%s'", specfile);
@@ -321,33 +321,6 @@ apply_specfile(const char *specfile, con
 
 }
 
-static u_int
-nodetoino(u_int type)
-{
-
-	switch (type) {
-	case F_BLOCK:
-		return S_IFBLK;
-	case F_CHAR:
-		return S_IFCHR;
-	case F_DIR:
-		return S_IFDIR;
-	case F_FIFO:
-		return S_IFIFO;
-	case F_FILE:
-		return S_IFREG;
-	case F_LINK:
-		return S_IFLNK;
-	case F_SOCK:
-		return S_IFSOCK;
-	default:
-		printf("unknown type %d", type);
-		abort();
-	}
-	/* NOTREACHED */
-}
-
-
 static void
 apply_specdir(const char *dir, NODE *specnode, fsnode *dirnode, int speconly)
 {


More information about the svn-src-projects mailing list