From owner-svn-src-all@FreeBSD.ORG Sun Oct 9 16:22:31 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B06D6106564A; Sun, 9 Oct 2011 16:22:31 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8688A8FC1B; Sun, 9 Oct 2011 16:22:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p99GMVjk017742; Sun, 9 Oct 2011 16:22:31 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p99GMVW9017736; Sun, 9 Oct 2011 16:22:31 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201110091622.p99GMVW9017736@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 9 Oct 2011 16:22:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226169 - in head/usr.sbin/makefs: . ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Oct 2011 16:22:31 -0000 Author: nwhitehorn Date: Sun Oct 9 16:22:31 2011 New Revision: 226169 URL: http://svn.freebsd.org/changeset/base/226169 Log: Add support to makefs(8) to add UFS labels to images. Submitted by: avg MFC after: 3 days Modified: head/usr.sbin/makefs/ffs.c head/usr.sbin/makefs/ffs.h head/usr.sbin/makefs/ffs/mkfs.c head/usr.sbin/makefs/makefs.8 Modified: head/usr.sbin/makefs/ffs.c ============================================================================== --- head/usr.sbin/makefs/ffs.c Sun Oct 9 14:12:17 2011 (r226168) +++ head/usr.sbin/makefs/ffs.c Sun Oct 9 16:22:31 2011 (r226169) @@ -236,6 +236,9 @@ ffs_parse_opts(const char *option, fsinf goto leave_ffs_parse_opts; } rv = 1; + } else if (strcmp(var, "label") == 0) { + strlcpy(ffs_opts->label, val, sizeof(ffs_opts->label)); + rv = 1; } else rv = set_option(ffs_options, var, val); Modified: head/usr.sbin/makefs/ffs.h ============================================================================== --- head/usr.sbin/makefs/ffs.h Sun Oct 9 14:12:17 2011 (r226168) +++ head/usr.sbin/makefs/ffs.h Sun Oct 9 16:22:31 2011 (r226169) @@ -40,7 +40,11 @@ #ifndef _FFS_H #define _FFS_H +#include +#include + typedef struct { + char label[MAXVOLLEN]; /* volume name/label */ int bsize; /* block size */ int fsize; /* fragment size */ int cpg; /* cylinders per group */ Modified: head/usr.sbin/makefs/ffs/mkfs.c ============================================================================== --- head/usr.sbin/makefs/ffs/mkfs.c Sun Oct 9 14:12:17 2011 (r226168) +++ head/usr.sbin/makefs/ffs/mkfs.c Sun Oct 9 16:22:31 2011 (r226169) @@ -139,7 +139,9 @@ ffs_mkfs(const char *fsys, const fsinfo_ avgfpdir = ffs_opts->avgfpdir; bbsize = BBSIZE; sbsize = SBLOCKSIZE; - + + strlcpy(sblock.fs_volname, ffs_opts->label, sizeof(sblock.fs_volname)); + if (Oflag == 0) { sblock.fs_old_inodefmt = FS_42INODEFMT; sblock.fs_maxsymlinklen = 0; Modified: head/usr.sbin/makefs/makefs.8 ============================================================================== --- head/usr.sbin/makefs/makefs.8 Sun Oct 9 14:12:17 2011 (r226168) +++ head/usr.sbin/makefs/makefs.8 Sun Oct 9 16:22:31 2011 (r226169) @@ -242,6 +242,8 @@ Block size. Bytes per inode. .It Sy fsize Fragment size. +.It Sy label +Label name of the image. .It Sy maxbpg Maximum blocks per file in a cylinder group. .It Sy minfree