From owner-freebsd-current@FreeBSD.ORG Tue Jan 25 19:12:03 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F152D16A4CF for ; Tue, 25 Jan 2005 19:12:02 +0000 (GMT) Received: from postfix3-2.free.fr (postfix3-2.free.fr [213.228.0.169]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9C4AD43D48 for ; Tue, 25 Jan 2005 19:12:02 +0000 (GMT) (envelope-from tataz@tataz.chchile.org) Received: from tatooine.tataz.chchile.org (vol75-8-82-233-239-98.fbx.proxad.net [82.233.239.98]) by postfix3-2.free.fr (Postfix) with ESMTP id D2E76C027; Tue, 25 Jan 2005 20:12:01 +0100 (CET) Received: by tatooine.tataz.chchile.org (Postfix, from userid 1000) id 4F70D407C; Tue, 25 Jan 2005 20:11:49 +0100 (CET) Date: Tue, 25 Jan 2005 20:11:49 +0100 From: Jeremie Le Hen To: Julian Elischer Message-ID: <20050125191149.GJ59685@obiwan.tataz.chchile.org> References: <20050121151747.GA36660@obiwan.tataz.chchile.org> <50158.208.4.77.66.1106323175.squirrel@208.4.77.66> <41F1AA9B.4070603@elischer.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41F1AA9B.4070603@elischer.org> User-Agent: Mutt/1.5.6i cc: freebsd-current@freebsd.org cc: Jeremie Le Hen Subject: Re: Cannot install kernel as user X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2005 19:12:03 -0000 > It's also useful when doing a build inside a jail as flags cannot be > changed insode a jail. > > I got around it by replacing 'chflags' in the jail by a shell script the > does nothing :-). I thought over how getting neatly rid of this. I would like to introduce a `INSTALL_AS_USER' variable, as it exists in ports/Mk/bsd.port.mk. However I don't want to duplicate this code : %%% .if exists(${DESTDIR}${KODIR}) -thiskernel=`sysctl -n kern.bootfile` ; \ if [ "`dirname "$$thiskernel"`" != ${DESTDIR}${KODIR} ] ; then \ chflags -R noschg ${DESTDIR}${KODIR} ; \ rm -rf ${DESTDIR}${KODIR} ; \ else \ if [ -d ${DESTDIR}${KODIR}.old ] ; then \ chflags -R noschg ${DESTDIR}${KODIR}.old ; \ rm -rf ${DESTDIR}${KODIR}.old ; \ fi ; \ mv ${DESTDIR}${KODIR} ${DESTDIR}${KODIR}.old ; \ sysctl kern.bootfile=${DESTDIR}${KODIR}.old/"`basename "$$thiskernel"`" ; \ fi .endif %%% Your workaround might be a good start : create a dummy chflags(8) which will be used when INSTALL_AS_USER is set. Of course this will need to introduce an internal variable, say ${CHFLAGS}. My problem is actually that I don't know where to make this dummy chflags(8) live in the source tree. Ideas ? Regards, -- Jeremie Le Hen jeremie@le-hen.org