svn commit: r251688 - in stable/9/usr.sbin/makefs: . compat

Brooks Davis brooks at FreeBSD.org
Thu Jun 13 17:13:16 UTC 2013


Author: brooks
Date: Thu Jun 13 17:13:15 2013
New Revision: 251688
URL: http://svnweb.freebsd.org/changeset/base/251688

Log:
  MFC r250407:
  
  Remove duplicated copies of various NetBSD compatibility shims used by
  makefs and use libnetbsd, contrib/mtree, and contrib/mknod instead.
  
  Sponsored by:	DARPA, AFRL

Deleted:
  stable/9/usr.sbin/makefs/compat/
  stable/9/usr.sbin/makefs/getid.c
Modified:
  stable/9/usr.sbin/makefs/Makefile
  stable/9/usr.sbin/makefs/makefs.h
  stable/9/usr.sbin/makefs/walk.c
Directory Properties:
  stable/9/usr.sbin/makefs/   (props changed)

Modified: stable/9/usr.sbin/makefs/Makefile
==============================================================================
--- stable/9/usr.sbin/makefs/Makefile	Thu Jun 13 15:45:54 2013	(r251687)
+++ stable/9/usr.sbin/makefs/Makefile	Thu Jun 13 17:13:15 2013	(r251688)
@@ -5,7 +5,6 @@ PROG=	makefs
 CFLAGS+=-I${.CURDIR}
 
 SRCS=	cd9660.c ffs.c \
-	getid.c \
 	makefs.c \
 	mtree.c \
 	walk.c
@@ -15,19 +14,28 @@ WARNS?=	2
 
 .include "${.CURDIR}/cd9660/Makefile.inc"
 .include "${.CURDIR}/ffs/Makefile.inc"
-.include "${.CURDIR}/compat/Makefile.inc"
 
 CFLAGS+=-DHAVE_STRUCT_STAT_ST_FLAGS=1
 CFLAGS+=-DHAVE_STRUCT_STAT_ST_GEN=1
 
-.PATH:	${.CURDIR}/../mtree
-CFLAGS+=-I${.CURDIR}/../mtree
-SRCS+=	misc.c spec.c
+.PATH: ${.CURDIR}/../../contrib/mtree
+CFLAGS+=-I${.CURDIR}/../../contrib/mtree
+SRCS+=	getid.c misc.c spec.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
+CFLAGS+=	-I${.CURDIR}/../../lib/libnetbsd
+LIBNETBSDDIR=	${.OBJDIR}/../../lib/libnetbsd
+LIBNETBSD=	${LIBNETBSDDIR}/libnetbsd.a
+DPADD+=		${LIBNETBSD}
+LDADD+=		${LIBNETBSD}
+
+DPADD+=  ${LIBSBUF} ${LIBUTIL}
+LDADD+=  -lsbuf -lutil
 
 .include <bsd.prog.mk>

Modified: stable/9/usr.sbin/makefs/makefs.h
==============================================================================
--- stable/9/usr.sbin/makefs/makefs.h	Thu Jun 13 15:45:54 2013	(r251687)
+++ stable/9/usr.sbin/makefs/makefs.h	Thu Jun 13 17:13:15 2013	(r251688)
@@ -282,22 +282,4 @@ void   ffs_fragacct_swap(struct fs *, in
 
 fsinode *link_check(fsinode *);
 
-/*
- * Declarations for compat routines.
- */
-long long strsuftoll(const char *, const char *, long long, long long);
-long long strsuftollx(const char *, const char *,
-                       long long, long long, char *, size_t);
-
-struct passwd;
-int uid_from_user(const char *, uid_t *);
-int pwcache_userdb(int (*)(int), void (*)(void),
-               struct passwd * (*)(const char *), struct passwd * (*)(uid_t));
-struct group;
-int gid_from_group(const char *, gid_t *);
-int pwcache_groupdb(int (*)(int), void (*)(void),
-               struct group * (*)(const char *), struct group * (*)(gid_t));
-
-int setup_getid(const char *dir);
-
 #endif	/* _MAKEFS_H */

Modified: stable/9/usr.sbin/makefs/walk.c
==============================================================================
--- stable/9/usr.sbin/makefs/walk.c	Thu Jun 13 15:45:54 2013	(r251687)
+++ stable/9/usr.sbin/makefs/walk.c	Thu Jun 13 17:13:15 2013	(r251688)
@@ -304,7 +304,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);
@@ -320,33 +320,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-stable-9 mailing list