Let 'gpt add' suggest a collect device name so that opendisk(3) called by

dkctl(8) succeeds.
This commit is contained in:
uebayasi 2009-02-07 18:12:22 +00:00
parent 0edd7181ba
commit cede8f9855
3 changed files with 6 additions and 4 deletions

View File

@ -29,7 +29,7 @@
__FBSDID("$FreeBSD: src/sbin/gpt/add.c,v 1.14 2006/06/22 22:05:28 marcel Exp $");
#endif
#ifdef __RCSID
__RCSID("$NetBSD: add.c,v 1.7 2009/02/07 17:21:44 uebayasi Exp $");
__RCSID("$NetBSD: add.c,v 1.8 2009/02/07 18:12:22 uebayasi Exp $");
#endif
#include <sys/types.h>
@ -164,7 +164,7 @@ add(int fd)
#ifdef __NetBSD__
printf("Partition added, use:\n");
printf("\tdkctl %s addwedge dk<N> %" PRIu64 " %" PRIu64 " <type>\n",
device_name, map->map_start, map->map_size);
device_arg, map->map_start, map->map_size);
printf("to create a wedge for it\n");
#endif
}

View File

@ -31,7 +31,7 @@
__FBSDID("$FreeBSD: src/sbin/gpt/gpt.c,v 1.16 2006/07/07 02:44:23 marcel Exp $");
#endif
#ifdef __RCSID
__RCSID("$NetBSD: gpt.c,v 1.8 2008/02/24 18:38:10 christos Exp $");
__RCSID("$NetBSD: gpt.c,v 1.9 2009/02/07 18:12:22 uebayasi Exp $");
#endif
#include <sys/param.h>
@ -60,6 +60,7 @@ __RCSID("$NetBSD: gpt.c,v 1.8 2008/02/24 18:38:10 christos Exp $");
#include "gpt.h"
char device_path[MAXPATHLEN];
const char *device_arg;
char *device_name;
off_t mediasz;
@ -661,7 +662,7 @@ gpt_open(const char *dev)
mode = readonly ? O_RDONLY : O_RDWR|O_EXCL;
device_name = device_path;
device_arg = dev;
#ifdef __FreeBSD__
strlcpy(device_path, dev, sizeof(device_path));
if ((fd = open(device_path, mode)) != -1)

View File

@ -73,6 +73,7 @@ struct mbr {
#define MBR_SIG 0xAA55
};
extern const char *device_arg;
extern char *device_name;
extern off_t mediasz;
extern u_int parts;