From sacadmin Fri Jul 20 18:08:45 2007
Received: from sunmail4.Singapore.Sun.COM (sunmail4.Singapore.Sun.COM [129.158.71.19])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id l6L18iiG014519
	for <psarc@sac.eng.Sun.COM>; Fri, 20 Jul 2007 18:08:45 -0700 (PDT)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail4.Singapore.Sun.COM (8.13.4+Sun/8.13.3/ENSMAIL,v2.2) with ESMTP id l6L16TGZ004157;
	Sat, 21 Jul 2007 09:06:34 +0800 (SGT)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0JLI00E038EXFR00@nwk-avmta-1.sfbay.Sun.COM>; Fri,
 20 Jul 2007 18:06:33 -0700 (PDT)
Received: from jurassic.eng.sun.com ([129.146.17.57])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JLI008NL8EXGSD0@nwk-avmta-1.sfbay.Sun.COM>; Fri,
 20 Jul 2007 18:06:33 -0700 (PDT)
Received: from tethys (tethys.SFBay.Sun.COM [129.146.226.92])
	by jurassic.eng.sun.com (8.13.8+Sun/8.13.8) with SMTP id l6L16M1H921192; Fri,
 20 Jul 2007 18:06:22 -0700 (PDT)
Date: Fri, 20 Jul 2007 18:05:19 -0700 (PDT)
From: Jerry Gilliam <jg@jurassic.sfbay.sun.com>
Subject: 2007/423: remdrv -C
To: psarc@sun.com
Cc: jerry.gilliam@sun.com, jan.setje-eilers@sun.com, vikram.hegde@sun.com,
        chris.horne@sun.com
Reply-to: Jerry Gilliam <jg@jurassic.sfbay.sun.com>
Message-id: <200707210106.l6L16M1H921192@jurassic.eng.sun.com>
MIME-version: 1.0
X-Mailer: dtmail 1.3.0 @(#)CDE Version 1.7_64 SunOS 5.11 sun4u sparc
Content-type: TEXT/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-MD5: UILr7oWs/I1oSBIMDvymUQ==
X-PMX-Version: 5.2.0.264296
Status: RO
Content-Length: 4426


I am submitting this fast-track on behalf of myself with timeout
set to 07/27/2007.   The project desires patch/minor binding for
an additional flag and behavior for rem_drv(1M).


Background:
	Before devfs, Solaris relied on statically-applied attributes
	(ownership and permissions) for the persistence of device per-node
	attributes.  With devfs, the attributes for a device node are
	now derived from either the dynamic devfs filesystem or
	from the underlying attribute persistence in the backing
	store.

	Devfs-derived attributes are determined by matching
	the device against the patterns in /etc/minor_perm, or
	by default, the default attributes (root, sys, 0600).
	For any device for which non-default attributes are desired,
	an explicit setattr may be done, and this is persisted
	in the backing store.  The attributes specified for a
	device node for which a backing store attribute node
	is discovered are always given precedence.

	The attribute backing store is not easily visible to the
	administrator as it is covered by the dynamic nature of
	/devices in normal operation.  We were concerned that
	removing a driver could leave dangling attribute nodes
	in the backing store and unintentionally permit those
	attributes to be reapplied to future devices.  Accordingly,
	as part of devfs we modified rem_drv(1M) to remove all underlying
	attribute nodes bound to the driver being removed.  This,
	unfortunately, in retrospect has turned out to be a mistake.
	The standard way of performing upgrade, both for Solaris
	upgrade and for unbundled and 3rd party packages, is to
	perform a rem_drv(1M) followed by add_drv(1M) to upgrade
	a driver;  removing attribute nodes during rem_drv(1M)
	causes device attributes persisted in the backing store
	to be lost.  The change made to rem_drv(1M) to clean up
	backing store nodes has introduced a regression in upgrade,
	and a customer has noticed this (6525121).

Problem:
	It is straightforward to modify rem_drv(1M) to not clean
	up attribute nodes.  Perserving the attributes of nodes for
	a driver being removed is how rem_drv(1M) has always operated
	in Solaris and correcting this will address the upgrade regression.

	However for some administrative purposes the ideal behavior
	may be to remove all persisted attributes for nodes being
	removed.  This may be the case when reprovisioning a
	machine, for example.

Proposal:
	The proposal is to add a -C flag to rem_drv(1M), to cause
	it to perform the cleanup of persisted attribute nodes
	for a driver being removed.  The -C flag for cleanup
	is analogous to the devfsadm -C flag.


    NAME
         rem_drv - remove a device driver from the system
    
    SYNOPSIS
-         rem_drv [-b basedir] device_driver
+         rem_drv [-C] [-b basedir] device_driver
    
    
    DESCRIPTION
         The rem_drv command  informs  the  system  that  the  device
         driver  device_driver  is  no  longer  valid.  If  possible,
         rem_drv unloads  device_driver  from  memory.  rem_drv  also
         updates the system driver configuration files.
    
         If rem_drv has been executed, the next time  the  system  is
         rebooted  it  automatically  performs a reconfiguration boot
         (see kernel(1M)).
    
    OPTIONS
         The following options are supported:
        
+         -C	Remove dangling device attribute nodes bound to the driver
+		being removed.  This will cause any device ownership
+		or permissions customizations made to any node
+		to not be preserved if the driver is added back.
+		Recommended for use when reprovisioning a machine
+		from one configuration or use to another where
+		past administrative customizations may not be desired.

         -b basedir    Sets the path to the  root  directory  of  the
                       diskless client. Used on the server to execute
                       rem_drv for a client. The client machine  must
                       be rebooted to unload the driver.
    
                       Note -
                         The root file system of any non-global zones
                         must  not  be referenced with the -b option.
                         Doing so might damage the global zone's file
                         system, might compromise the security of the
                         global zone, and might damage the non-global
                         zone's file system. See zones(5).


From sacadmin Fri Jul 27 13:21:18 2007
Received: from sunmail2sca.sfbay.sun.com (sunmail2sca.SFBay.Sun.COM [129.145.155.234])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id l6RKLIiF002058
	for <psarc@sac.eng.sun.com>; Fri, 27 Jul 2007 13:21:18 -0700 (PDT)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail2sca.sfbay.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id l6RKJ8qS019062;
	Fri, 27 Jul 2007 13:19:08 -0700 (PDT)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0JLU00005TRWR100@nwk-avmta-1.sfbay.Sun.COM>; Fri,
 27 Jul 2007 13:19:08 -0700 (PDT)
Received: from jurassic.eng.sun.com ([129.146.56.144])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JLU00GF0TRW2A50@nwk-avmta-1.sfbay.Sun.COM>; Fri,
 27 Jul 2007 13:19:08 -0700 (PDT)
Received: from tethys (tethys.SFBay.Sun.COM [129.146.226.92])
	by jurassic.eng.sun.com (8.13.8+Sun/8.13.8) with SMTP id l6RKIiBt350614; Fri,
 27 Jul 2007 13:18:44 -0700 (PDT)
Date: Fri, 27 Jul 2007 13:17:37 -0700 (PDT)
From: Jerry Gilliam <jg@jurassic.sfbay.sun.com>
Subject: Re:  2007/423: remdrv -C
To: psarc@sun.com
Cc: jan.setje-eilers@sun.com, vikram.hegde@sun.com, chris.horne@sun.com
Reply-to: Jerry Gilliam <jg@jurassic.sfbay.sun.com>
Message-id: <200707272018.l6RKIiBt350614@jurassic.eng.sun.com>
MIME-version: 1.0
X-Mailer: dtmail 1.3.0 @(#)CDE Version 1.7_64 SunOS 5.11 sun4u sparc
Content-type: TEXT/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-MD5: wHA1STkafeh+IrXZJQxJXQ==
X-PMX-Version: 5.2.0.264296
Status: RO
Content-Length: 69


This case has timed out with no comments so approved/closed.


-jg


