From 18bcb9c15bd055a13b834b909eb98ab886568ccd Mon Sep 17 00:00:00 2001 From: mlelstv Date: Fri, 5 Jun 2015 05:03:21 +0000 Subject: [PATCH] Support wedge names. --- usr.sbin/installboot/Makefile | 6 ++++-- usr.sbin/installboot/installboot.c | 16 +++++++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/usr.sbin/installboot/Makefile b/usr.sbin/installboot/Makefile index a3a012ede4bb..99629b832bc2 100644 --- a/usr.sbin/installboot/Makefile +++ b/usr.sbin/installboot/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.48 2014/02/24 07:23:44 skrll Exp $ +# $NetBSD: Makefile,v 1.49 2015/06/05 05:03:21 mlelstv Exp $ # .include @@ -7,7 +7,6 @@ PROG= installboot MAN= installboot.8 SRCS= installboot.c sum.c machines.c fstypes.c - ARCH_XLAT= amd64-i386.c news68k-news.c newsmips-news.c ARCH_XLAT+= sun2-sun68k.c sun3-sun68k.c @@ -49,4 +48,7 @@ COPTS.${f}.c+= -Wno-pointer-sign .endfor .endif +LDADD+= -lutil +DPADD+= ${LIBUTIL} + .include diff --git a/usr.sbin/installboot/installboot.c b/usr.sbin/installboot/installboot.c index 4de3603f5169..395894619e3b 100644 --- a/usr.sbin/installboot/installboot.c +++ b/usr.sbin/installboot/installboot.c @@ -1,4 +1,4 @@ -/* $NetBSD: installboot.c,v 1.36 2011/11/03 20:46:41 martin Exp $ */ +/* $NetBSD: installboot.c,v 1.37 2015/06/05 05:03:21 mlelstv Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -35,9 +35,10 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: installboot.c,v 1.36 2011/11/03 20:46:41 martin Exp $"); +__RCSID("$NetBSD: installboot.c,v 1.37 2015/06/05 05:03:21 mlelstv Exp $"); #endif /* !__lint */ +#include #include #include @@ -50,6 +51,7 @@ __RCSID("$NetBSD: installboot.c,v 1.36 2011/11/03 20:46:41 martin Exp $"); #include #include #include +#include #include "installboot.h" @@ -105,6 +107,9 @@ main(int argc, char *argv[]) char *p; const char *op; ib_flags unsupported_flags; + char specname[MAXPATHLEN]; + char rawname[MAXPATHLEN]; + const char *special, *raw; setprogname(argv[0]); params = &installboot_params; @@ -229,7 +234,12 @@ main(int argc, char *argv[]) params->stage2 = argv[2]; } - params->filesystem = argv[0]; + special = getfsspecname(specname, sizeof(specname), argv[0]); + raw = getdiskrawname(rawname, sizeof(rawname), special); + if (raw != NULL) + special = raw; + + params->filesystem = special; if (params->flags & IB_NOWRITE) { op = "only"; mode = O_RDONLY;