From nork@FreeBSD.org  Tue Jul 22 17:25:41 2008
Return-Path: <nork@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2FD40106566C
	for <FreeBSD-gnats-submit@FreeBSD.org>; Tue, 22 Jul 2008 17:25:41 +0000 (UTC)
	(envelope-from nork@FreeBSD.org)
Received: from sakura.ninth-nine.com (unknown [IPv6:2001:2f0:104:80a0:230:48ff:fe41:2455])
	by mx1.freebsd.org (Postfix) with ESMTP id ABF9C8FC1C
	for <FreeBSD-gnats-submit@FreeBSD.org>; Tue, 22 Jul 2008 17:25:35 +0000 (UTC)
	(envelope-from nork@FreeBSD.org)
Received: from nadesico.ninth-nine.com (nadesico.ninth-nine.com [219.127.74.122]) by sakura.ninth-nine.com (8.14.1/8.14.1/NinthNine) with SMTP id m6MHPY1H065101 for <FreeBSD-gnats-submit@freebsd.org>; Wed, 23 Jul 2008 02:25:34 +0900 (JST) (envelope-from Message-Id: <20080723022533.f8e4cca6.nork@FreeBSD.org>
Date: Wed, 23 Jul 2008 02:25:33 +0900
From: Norikatsu Shigemura <nork@FreeBSD.org>
To: FreeBSD-gnats-submit@FreeBSD.org
Subject: Add zfs/zpool to rescue programs.

>Number:         125878
>Category:       bin
>Synopsis:       [patch] [request] Add zfs/zpool to rescue programs.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gavin
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 22 17:30:01 UTC 2008
>Closed-Date:    Sun May 29 23:04:10 UTC 2011
>Last-Modified:  Sun Mar 17 04:33:32 UTC 2013
>Originator:     Norikatsu Shigemura
>Release:        FreeBSD 8.0-CURRENT i386
>Organization:
Personal
>Environment:
System: FreeBSD melfina.ninth-nine.com 8.0-CURRENT FreeBSD 8.0-CURRENT #66: Sun Jul 20 07:29:09 JST 2008 nork@melfina.ninth-nine.com:/usr/obj/usr/src/sys/MELFINA i386


>Description:
	When fixit on zfs environment with single user mode or liveFS,
	to trouble-shoot zfs related issue, I think that zfs and zpool
	commands should be installed in /rescue.

>How-To-Repeat:
	N/A, but I rarely used static link version zfs and zpool:-).
	Because I missed zpool import, so I broke libc.so, libutil.so
	and many shared libraries:-(.
>Fix:
	I hope to MFC to 7-stable, too.


--- patch begins here ---
--- rescue/rescue/Makefile.orig	2008-06-26 11:57:33.932668000 +0900
+++ rescue/rescue/Makefile	2008-07-20 21:59:16.108381889 +0900
@@ -72,7 +72,7 @@
 CRUNCH_PROGS_bin= cat chflags chio chmod cp date dd df echo 	\
 	 ed expr getfacl hostname kenv kill ln ls mkdir mv pax ps pwd 	\
 	 realpath rm rmdir setfacl sh stty sync test
-CRUNCH_LIBS+= -lcrypt -ledit -lkvm -ll -lm -ltermcap -lutil
+CRUNCH_LIBS+= -lcrypt -ledit -lkvm -ll -ltermcap -lutil
 .if ${MK_OPENSSL} != "no"
 CRUNCH_LIBS+= -lcrypto
 .endif
@@ -135,6 +135,11 @@
 CRUNCH_PROGS_sbin+= ipf
 .endif
 
+.if ${MK_ZFS} != "no"
+CRUNCH_PROGS_sbin+= zfs
+CRUNCH_PROGS_sbin+= zpool
+.endif
+
 # crunchgen does not like C++ programs; this should be fixed someday
 # CRUNCH_PROGS+= devd
 
@@ -142,6 +147,9 @@
 .if ${MK_IPX} != "no"
 CRUNCH_LIBS+= -lipx
 .endif
+.if ${MK_ZFS} != "no"
+CRUNCH_LIBS+= -lzfs -lnvpair -luutil -lavl
+.endif
 CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv -lmd -lreadline -lsbuf -lufs -lz
 
 .if ${MACHINE_ARCH} == "i386"
@@ -179,6 +187,10 @@
 CRUNCH_SRCDIR_ilmid= $(.CURDIR)/../../sbin/atm/ilmid
 CRUNCH_SRCDIR_rtquery= $(.CURDIR)/../../sbin/routed/rtquery
 CRUNCH_SRCDIR_ipf= $(.CURDIR)/../../sbin/ipf/ipf
+.if ${MK_ZFS} != "no"
+CRUNCH_SRCDIR_zfs= ${.CURDIR}/../../cddl/sbin/zfs
+CRUNCH_SRCDIR_zpool= ${.CURDIR}/../../cddl/sbin/zpool
+.endif
 CRUNCH_ALIAS_reboot= fastboot halt fasthalt
 CRUNCH_ALIAS_restore= rrestore
 CRUNCH_ALIAS_dump= rdump
@@ -223,6 +235,9 @@
 CRUNCH_ALIAS_chown= chgrp
 
 ##################################################################
+CRUNCH_LIBS+= -lm
+
+##################################################################
 #  The following is pretty nearly a generic crunchgen-handling makefile
 #
 
--- patch ends here ---
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->pjd 
Responsible-Changed-By: nork 
Responsible-Changed-When: Wed Jul 23 03:54:43 UTC 2008 
Responsible-Changed-Why:  
Over to ZFS specialist. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=125878 
Responsible-Changed-From-To: pjd->nork 
Responsible-Changed-By: pjd 
Responsible-Changed-When: wto 17 lut 20:36:54 2009 UTC 
Responsible-Changed-Why:  
Norikatsu, I fully agree that having zpool and zfs utilities in 
/rescue/ is very desired, but I'm not setup to test it right now. 
Could you handle the commit? I fully support the idea, so feel free 
to put me in approved by line. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=125878 
Responsible-Changed-From-To: nork->kmacy 
Responsible-Changed-By: kmacy 
Responsible-Changed-When: Sat May 23 00:25:30 UTC 2009 
Responsible-Changed-Why:  


this seems to have been forgotten, pick up for the benefit of ZFS root users 

http://www.freebsd.org/cgi/query-pr.cgi?pr=125878 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/125878: commit references a PR
Date: Sat, 23 May 2009 00:47:36 +0000 (UTC)

 Author: kmacy
 Date: Sat May 23 00:47:23 2009
 New Revision: 192617
 URL: http://svn.freebsd.org/changeset/base/192617
 
 Log:
   Add zfs/zpool to rescue programs
   
   PR:		bin/125878
   Submitted by:	nork@
   MFC after:	3 days
 
 Modified:
   head/rescue/rescue/Makefile
 
 Modified: head/rescue/rescue/Makefile
 ==============================================================================
 --- head/rescue/rescue/Makefile	Sat May 23 00:40:17 2009	(r192616)
 +++ head/rescue/rescue/Makefile	Sat May 23 00:47:23 2009	(r192617)
 @@ -72,7 +72,7 @@ CRUNCH_SRCDIRS+= bin
  CRUNCH_PROGS_bin= cat chflags chio chmod cp date dd df echo 	\
  	 ed expr getfacl hostname kenv kill ln ls mkdir mv	\
  	 pkill ps pwd realpath rm rmdir setfacl sh stty sync test
 -CRUNCH_LIBS+= -lcrypt -ledit -lkvm -ll -lm -ltermcap -lutil
 +CRUNCH_LIBS+= -lcrypt -ledit -lkvm -ll -ltermcap -lutil
  
  # Additional options for specific programs
  CRUNCH_ALIAS_test= [
 @@ -128,6 +128,10 @@ CRUNCH_PROGS_sbin+= ping6
  .if ${MK_IPFILTER} != "no"
  CRUNCH_PROGS_sbin+= ipf
  .endif
 +.if ${MK_ZFS} != "no"
 +CRUNCH_PROGS_sbin+= zfs
 +CRUNCH_PROGS_sbin+= zpool
 +.endif
  
  # crunchgen does not like C++ programs; this should be fixed someday
  # CRUNCH_PROGS+= devd
 @@ -136,6 +140,9 @@ CRUNCH_LIBS+= -lalias -lcam -lcurses -ld
  .if ${MK_IPX} != "no"
  CRUNCH_LIBS+= -lipx
  .endif
 +.if ${MK_ZFS} != "no"
 +CRUNCH_LIBS+= -lzfs -lnvpair -luutil -lavl
 +.endif
  CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv -lmd -lreadline -lsbuf -lufs -lz
  
  .if ${MACHINE_ARCH} == "i386"
 @@ -173,6 +180,10 @@ CRUNCH_SRCDIR_fore_dnld= $(.CURDIR)/../.
  CRUNCH_SRCDIR_ilmid= $(.CURDIR)/../../sbin/atm/ilmid
  CRUNCH_SRCDIR_rtquery= $(.CURDIR)/../../sbin/routed/rtquery
  CRUNCH_SRCDIR_ipf= $(.CURDIR)/../../sbin/ipf/ipf
 +.if ${MK_ZFS} != "no"
 +CRUNCH_SRCDIR_zfs= ${.CURDIR}/../../cddl/sbin/zfs
 +CRUNCH_SRCDIR_zpool= ${.CURDIR}/../../cddl/sbin/zpool
 +.endif
  CRUNCH_ALIAS_reboot= fastboot halt fasthalt
  CRUNCH_ALIAS_restore= rrestore
  CRUNCH_ALIAS_dump= rdump
 @@ -218,6 +229,8 @@ CRUNCH_PROGS_usr.sbin= chroot
  
  CRUNCH_PROGS_usr.sbin+= chown
  CRUNCH_ALIAS_chown= chgrp
 +##################################################################
 +CRUNCH_LIBS+= -lm
  
  ##################################################################
  #  The following is pretty nearly a generic crunchgen-handling makefile
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->patched 
State-Changed-By: kmacy 
State-Changed-When: Sat May 23 00:53:50 UTC 2009 
State-Changed-Why:  

patch committed 

http://www.freebsd.org/cgi/query-pr.cgi?pr=125878 
Responsible-Changed-From-To: kmacy->closed 
Responsible-Changed-By: gavin 
Responsible-Changed-When: Sun May 29 22:30:25 UTC 2011 
Responsible-Changed-Why:  
This was fixed in HEAD and merged to stable/7.  Nothing more to do. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=125878 
State-Changed-From-To: patched->closed 
State-Changed-By: gavin 
State-Changed-When: Sun May 29 23:03:33 UTC 2011 
State-Changed-Why:  
This was fixed in HEAD and merged to stable/7.  Nothing more to do. 


Responsible-Changed-From-To: closed->gavin 
Responsible-Changed-By: gavin 
Responsible-Changed-When: Sun May 29 23:03:33 UTC 2011 
Responsible-Changed-Why:  
Oops. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=125878 
>Unformatted:
