NetBSD Problem Report #47990

From Wolfgang.Stukenbrock@nagler-company.com  Wed Jul  3 13:45:52 2013
Return-Path: <Wolfgang.Stukenbrock@nagler-company.com>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id C2D2E716A0
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  3 Jul 2013 13:45:51 +0000 (UTC)
Message-Id: <20130703134543.08E05123B93@test-s0.nagler-company.com>
Date: Wed,  3 Jul 2013 15:45:42 +0200 (CEST)
From: Wolfgang.Stukenbrock@nagler-company.com
Reply-To: Wolfgang.Stukenbrock@nagler-company.com
To: gnats-bugs@gnats.NetBSD.org
Subject: gpt biosboot should have "-l <label>" option
X-Send-Pr-Version: 3.95

>Number:         47990
>Category:       bin
>Synopsis:       gpt biosboot should have "-l <label>" option
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    jnemeth
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 03 13:50:00 +0000 2013
>Closed-Date:    Mon Jul 19 04:58:01 +0000 2021
>Last-Modified:  Mon Jul 19 04:58:01 +0000 2021
>Originator:     Dr. Wolfgang Stukenbrock
>Release:        NetBSD 6.1
>Organization:
Dr. Nagler & Company GmbH
>Environment:


System: NetBSD test-s0 5.1.2 NetBSD 5.1.2 (NSW-WS) #3: Fri Dec 21 15:15:43 CET 2012 wgstuken@test-s0:/usr/src/sys/arch/amd64/compile/NSW-WS amd64
Architecture: x86_64
Machine: amd64
>Description:
	When automating disk setup it would be nice to havethe ability to
	select the GPT-partition to boot from by the label assigned to it.
	Currently only the index is available for partition selection.
	Of cause that can be extracted from the output of "gpt show -l", but
	that is an avoidable additional command in automisation.

	The manual for gpt mentions that feedback to the commandline
	interface is welcome in order to integrade user wishes.
>How-To-Repeat:
	Stumbled over while writing a setup script.
>Fix:
	Add "-l <label>" option to gpt command.

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: bin-bug-people->jnemeth
Responsible-Changed-By: jnemeth@NetBSD.org
Responsible-Changed-When: Fri, 26 Sep 2014 22:04:13 +0000
Responsible-Changed-Why:
I've been working on gpt(8).


State-Changed-From-To: open->analyzed
State-Changed-By: jnemeth@NetBSD.org
State-Changed-When: Mon, 29 Sep 2014 06:00:32 +0000
State-Changed-Why:
I added a -L label selector option to several commands.  I chose -L as -l
was already in use.  This needs pullup.


From: "John Nemeth" <jnemeth@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/47990 CVS commit: src/sbin/gpt
Date: Mon, 29 Sep 2014 05:56:43 +0000

 Module Name:	src
 Committed By:	jnemeth
 Date:		Mon Sep 29 05:56:43 UTC 2014

 Modified Files:
 	src/sbin/gpt: biosboot.c gpt.8 label.c remove.c type.c

 Log Message:
 PR/47990 - Dr. Wolfgang Stukenbrock -- add "-L <label>" as selector option


 To generate a diff of this commit:
 cvs rdiff -u -r1.8 -r1.9 src/sbin/gpt/biosboot.c
 cvs rdiff -u -r1.31 -r1.32 src/sbin/gpt/gpt.8
 cvs rdiff -u -r1.14 -r1.15 src/sbin/gpt/label.c
 cvs rdiff -u -r1.12 -r1.13 src/sbin/gpt/remove.c
 cvs rdiff -u -r1.1 -r1.2 src/sbin/gpt/type.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Soren Jacobsen" <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/47990 CVS commit: [netbsd-7] src/sbin/gpt
Date: Tue, 2 Jun 2015 19:49:38 +0000

 Module Name:	src
 Committed By:	snj
 Date:		Tue Jun  2 19:49:38 UTC 2015

 Modified Files:
 	src/sbin/gpt [netbsd-7]: Makefile add.c backup.c biosboot.c create.c
 	    destroy.c gpt.8 gpt.c gpt.h label.c map.c migrate.c recover.c
 	    remove.c resize.c restore.c set.c show.c unset.c
 Added Files:
 	src/sbin/gpt [netbsd-7]: drvctl.c gpt_uuid.c gpt_uuid.h resizedisk.c
 	    type.c

 Log Message:
 Pull up following revision(s) (requested by jnemeth in ticket #774):
 	sbin/gpt/Makefile: revisions 1.9-1.13
 	sbin/gpt/add.c: revisions 1.25-1.27
 	sbin/gpt/backup.c: revisions 1.2-1.8
 	sbin/gpt/biosboot.c: revisions 1.8-1.14
 	sbin/gpt/create.c: revisions 1.8-1.12
 	sbin/gpt/destroy.c: revisions 1.5-1.6
 	sbin/gpt/drvctl.c: revision 1.1
 	sbin/gpt/gpt.8: revisions 1.29-1.36
 	sbin/gpt/gpt.c: revisions 1.29-1.40
 	sbin/gpt/gpt.h: revisions 1.12-1.18
 	sbin/gpt/gpt_uuid.c: revisions 1.1-1.10
 	sbin/gpt/gpt_uuid.h: revisions 1.1-1.3
 	sbin/gpt/label.c: revisions 1.15-1.18
 	sbin/gpt/map.c: revision 1.7
 	sbin/gpt/migrate.c: revisions 1.15-1.21
 	sbin/gpt/recover.c: revision 1.5
 	sbin/gpt/remove.c: revisions 1.13-1.16
 	sbin/gpt/resize.c: revisions 1.9-1.11
 	sbin/gpt/resizedisk.c: revisions 1.1-1.6
 	sbin/gpt/restore.c: revisions 1.2-1.7
 	sbin/gpt/set.c: revisions 1.3-1.5
 	sbin/gpt/show.c: revision 1.16-1.21
 	sbin/gpt/type.c: revisions 1.1-1.6
 	sbin/gpt/unset.c: revisions 1.3-1.5
 - record the sector size of the disk
 - correct confusion with end_cylinder and end_sector in MBRs
 --
 - dump all partitions, not just ones that are in use
 - while here, squash a memory leak
      It shouldn't be necessary to backup unused partitions, however
 the partition GUID is created at the time the GPT is created and
 is never changed.  It shouldn't matter if the GUID of an unused
 partition changes, but there may be some special case where it
 does.  Since it isn't a big deal to record the unused partitions,
 might as well do it.
 --
 Initial cut of gpt restore.  This functions correctly in testing,
 but isn't all that pretty.  It has minimal error testing and may
 leak memory.  It also only works with empty disks.  If passed "-F"
 flag, it will blank the disk for you.
 --
 document the new restore subcommand
 --
 - make gpt_gpt() available for use directly by subcommands
 - create new resizedisk disk subcommand for relocating backup GPT
 --
 Fix compile error observed on i386. Use PRIu64.
 --
 no C99isms in tool code
 --
 - handle a GPT that isn't an exact multiple of a sector
 - adjust PMBR size, in case new disk is a different size
 - don't leak as much memory
 - clean up error handling somewhat
 --
 PR/44218 - David Young -- add "type" subcommand to change a partition type
 --
 PR/47990 - Dr. Wolfgang Stukenbrock -- add "-L <label>" as selector option
 --
 minor toolification: need libprop...
 --
 more toolification
 --
 more toolification changes
 --
 remove compat defines.
 --
 Add internal uuid support, since the linux+macos versions of the library
 are different than than *bsd ones, and others might not have it at all.
 --
 Check size of correct buffer.  Note, just being pedantic as the buffer
 being checked is the same size as the one that should have been checked.
 --
 correctly show partition type in the new world order
 --
 actually return the uuid when parsing one that is in numeric format
 --
 using random values for hdr->hdr_guid does not work very well
 --
 oops, forgot to update end of data area
 --
 It's HAVE_NBTOOL_CONFIG_H, not HAVE_NBTOOLS_CONFIG_H
 --
 Fix tools build on !NetBSD.
 --
 include <sys/endian.h> for both the non-tools build,
 and the tools build on a host where the file exists.
 Fixes a build problem on FreeBSD, reported by Herbert J. Skuhra, where
 tools/compat's configure detected that be32dec() and friends were
 available in the host's <sys/endian.h>, so tools/compat did not provide
 its own versions.
 --
 "0" is not guaranteed to be unique
 --
 provide a copy of the kernel uuid generator (with portable API calls) for
 tools.
 --
 Allow specifying sector and media size on the command line.
 --
 Remove trailing whitespace.
 --
 Make gpt(8) generate v4 (random) uuids.
 Don't needlessly leak your date/time and MAC address when you edit
 the disk.
 Read from /dev/urandom rather than calling arc4random or anything,
 since this is a tool.  (Cygwin seems to have /dev/urandom, but yell
 if this breaks the build on your exotic platform because it lacks
 /dev/urandom.)
 ok apb
 --
 Paranoia: choke noisily on EOF from /dev/urandom.
 --
 Report the argument instead of (null) when opendisk fails.
 --
 handle constness
 --
 handle constness better
 --
 Add some more common partition types.
 --
 Bump date for previous.
 --
 Fix handling of -t option for the type command.
 Match any type, when no option is given, just like for the label command.
 --
 Factor out the getdisksize() drvctl method, and provide an alternative that
 directly uses the disk ioctl's instead of relying on the drvctl device driver
 which is currently not mandatory.


 To generate a diff of this commit:
 cvs rdiff -u -r1.8 -r1.8.2.1 src/sbin/gpt/Makefile
 cvs rdiff -u -r1.24 -r1.24.4.1 src/sbin/gpt/add.c
 cvs rdiff -u -r1.1 -r1.1.6.1 src/sbin/gpt/backup.c
 cvs rdiff -u -r1.7 -r1.7.4.1 src/sbin/gpt/biosboot.c src/sbin/gpt/create.c
 cvs rdiff -u -r1.4 -r1.4.20.1 src/sbin/gpt/destroy.c src/sbin/gpt/recover.c
 cvs rdiff -u -r0 -r1.1.2.2 src/sbin/gpt/drvctl.c
 cvs rdiff -u -r1.28 -r1.28.4.1 src/sbin/gpt/gpt.8
 cvs rdiff -u -r1.28 -r1.28.2.1 src/sbin/gpt/gpt.c
 cvs rdiff -u -r1.11 -r1.11.2.1 src/sbin/gpt/gpt.h
 cvs rdiff -u -r0 -r1.10.2.2 src/sbin/gpt/gpt_uuid.c
 cvs rdiff -u -r0 -r1.3.2.2 src/sbin/gpt/gpt_uuid.h
 cvs rdiff -u -r1.14 -r1.14.4.1 src/sbin/gpt/label.c src/sbin/gpt/migrate.c
 cvs rdiff -u -r1.6 -r1.6.4.1 src/sbin/gpt/map.c
 cvs rdiff -u -r1.12 -r1.12.4.1 src/sbin/gpt/remove.c
 cvs rdiff -u -r1.8 -r1.8.6.1 src/sbin/gpt/resize.c
 cvs rdiff -u -r0 -r1.6.2.2 src/sbin/gpt/resizedisk.c src/sbin/gpt/type.c
 cvs rdiff -u -r1.1 -r1.1.2.1 src/sbin/gpt/restore.c
 cvs rdiff -u -r1.2 -r1.2.6.1 src/sbin/gpt/set.c src/sbin/gpt/unset.c
 cvs rdiff -u -r1.15 -r1.15.4.1 src/sbin/gpt/show.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: jnemeth@NetBSD.org
Subject: Re: bin/47990 (gpt biosboot should have "-l <label>" option)
Date: Sat, 16 Jun 2018 23:38:38 +0000

 On Mon, Sep 29, 2014 at 06:00:35AM +0000, jnemeth@NetBSD.org wrote:
  > Synopsis: gpt biosboot should have "-l <label>" option
  > 
  > State-Changed-From-To: open->analyzed
  > State-Changed-By: jnemeth@NetBSD.org
  > State-Changed-When: Mon, 29 Sep 2014 06:00:32 +0000
  > State-Changed-Why:
  > I added a -L label selector option to several commands.  I chose -L as -l
  > was already in use.  This needs pullup.

 pullup-7 was done; it predates pullup-8; any reason not to close this?

 -- 
 David A. Holland
 dholland@netbsd.org

From: John Nemeth <jnemeth@cue.bc.ca>
To: gnats-bugs@NetBSD.org, jnemeth@NetBSD.org, gnats-admin@netbsd.org,
        netbsd-bugs@netbsd.org, Wolfgang.Stukenbrock@nagler-company.com
Cc: 
Subject: Re: bin/47990 (gpt biosboot should have "-l <label>" option)
Date: Sat, 16 Jun 2018 19:32:35 -0700

 On Jun 16, 11:40pm, David Holland wrote:
 }
 } The following reply was made to PR bin/47990; it has been noted by GNATS.
 } 
 } From: David Holland <dholland-bugs@netbsd.org>
 } To: gnats-bugs@NetBSD.org
 } Cc: jnemeth@NetBSD.org
 } Subject: Re: bin/47990 (gpt biosboot should have "-l <label>" option)
 } Date: Sat, 16 Jun 2018 23:38:38 +0000
 } 
 }  On Mon, Sep 29, 2014 at 06:00:35AM +0000, jnemeth@NetBSD.org wrote:
 }   > Synopsis: gpt biosboot should have "-l <label>" option
 }   > 
 }   > State-Changed-From-To: open->analyzed
 }   > State-Changed-By: jnemeth@NetBSD.org
 }   > State-Changed-When: Mon, 29 Sep 2014 06:00:32 +0000
 }   > State-Changed-Why:
 }   > I added a -L label selector option to several commands.  I chose -L as -l
 }   > was already in use.  This needs pullup.
 }  
 }  pullup-7 was done; it predates pullup-8; any reason not to close this?

      I have to look at gpt(8) and see if I want to do a mass pullup
 to 6.  There have been a lot of changes, some of which depend on
 kernel changes, so it may not be very easy to do.  But, I should
 still look.

 }-- End of excerpt from David Holland

State-Changed-From-To: analyzed->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Mon, 19 Jul 2021 04:58:01 +0000
State-Changed-Why:
it's too late for more pullups to -6


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.