From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 7 09:17:03 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7F0D316A4CE; Wed, 7 Jul 2004 09:17:03 +0000 (GMT) Received: from n33.kp.t-systems-sfr.com (n33.kp.t-systems-sfr.com [129.247.16.33]) by mx1.FreeBSD.org (Postfix) with ESMTP id 880A843D41; Wed, 7 Jul 2004 09:17:02 +0000 (GMT) (envelope-from harti@freebsd.org) Received: from n81.sp.op.dlr.de (n81g.sp.op.dlr.de [129.247.163.1]) i679H0j410136; Wed, 7 Jul 2004 11:17:01 +0200 Received: from zeus.nt.op.dlr.de (zeus.nt.op.dlr.de [129.247.173.3]) i679H0D245134; Wed, 7 Jul 2004 11:17:00 +0200 Received: from beagle.kn.op.dlr.de (opkndnwsbsd178 [129.247.173.178]) by zeus.nt.op.dlr.de (8.11.7+Sun/8.9.1) with ESMTP id i679GxV25859; Wed, 7 Jul 2004 11:16:59 +0200 (MET DST) Date: Wed, 7 Jul 2004 11:17:00 +0200 (CEST) From: Harti Brandt X-X-Sender: brandt@beagle.kn.op.dlr.de To: Ruslan Ermilov In-Reply-To: <20040707080739.GB66260@ip.net.ua> Message-ID: <20040707110933.I3576@beagle.kn.op.dlr.de> References: <20040707095457.J3232@beagle.kn.op.dlr.de> <20040707080739.GB66260@ip.net.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: hackers@freebsd.org Subject: Re: make installworld for non-root user X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Harti Brandt List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2004 09:17:03 -0000 On Wed, 7 Jul 2004, Ruslan Ermilov wrote: RE>On Wed, Jul 07, 2004 at 09:57:52AM +0200, Harti Brandt wrote: RE>> RE>> Hi all, RE>> RE>> is there an easy way for a non-root user to test the installworld target? RE>> I came up with RE>> RE>> make SHAREOWN=harti SHAREGRP=harti LIBOWN=harti LIBGRP=harti \ RE>> NOFSCHG=yes INFOMODE=644 INFOOWN=harti INFOGRP=harti MANOWN=harti \ RE>> MANGRP=harti BINOWN=harti BINGRP=harti DESTDIR=/t/scratch/harti/root/ \ RE>> installworld RE>> RE>> but that one breaks in libexec/pt_chown (which has a hard-coded RE>> BINOWN=root). RE>> RE>> Perhaps I can't see the obvious solution? RE>> RE>Many bits hardcode owners/groups/modes/flags, but it's still RE>possible to install as non-root. In fact, buildworld already RE>does this for you -- it uses src/tools/install.sh as INSTALL RE>to do it (see the BMAKEENV setting in Makefile.inc1). So it seems that: make SHAREOWN=harti SHAREGRP=harti INSTALL="sh `pwd`/release/install.sh" \ DESTDIR="/somewhere" installworld almost works. Almost, because bsd.lib.mk contains SHLINSTALLFLAGS += -fschg That case is not handled in install.sh and should probably read SHLINSTALLFLAGS += -f schg Additionally I had to add -fschg) shift;; to install.sh, because it seems that the installworld target uses the currently installed mk files not those from src/share/mk. The SHAREOWN SHAREGRP is needed because share/zoneinfo/Makefile passes these directly to zic. This could probably be fixed by calling zic during buildworld and just install the compiled files during installworld. Thanks for your help, harti