Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Jul 2004 12:57:57 +0300
From:      Ruslan Ermilov <ru@freebsd.org>
To:        Harti Brandt <harti@freebsd.org>
Cc:        hackers@freebsd.org
Subject:   Re: make installworld for non-root user
Message-ID:  <20040707095757.GA67252@ip.net.ua>
In-Reply-To: <20040707110933.I3576@beagle.kn.op.dlr.de>
References:  <20040707095457.J3232@beagle.kn.op.dlr.de> <20040707080739.GB66260@ip.net.ua> <20040707110933.I3576@beagle.kn.op.dlr.de>

next in thread | previous in thread | raw e-mail | index | archive | help

--tKW2IUtsqtDRztdT
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Jul 07, 2004 at 11:17:00AM +0200, Harti Brandt wrote:
> On Wed, 7 Jul 2004, Ruslan Ermilov wrote:
>=20
> RE>On Wed, Jul 07, 2004 at 09:57:52AM +0200, Harti Brandt wrote:
> RE>>=20
> RE>> Hi all,
> RE>>=20
> RE>> is there an easy way for a non-root user to test the installworld ta=
rget?
> RE>> I came up with
> RE>>=20
> RE>> make SHAREOWN=3Dharti SHAREGRP=3Dharti LIBOWN=3Dharti LIBGRP=3Dharti=
 \
> RE>> NOFSCHG=3Dyes INFOMODE=3D644 INFOOWN=3Dharti INFOGRP=3Dharti MANOWN=
=3Dharti \
> RE>> MANGRP=3Dharti BINOWN=3Dharti BINGRP=3Dharti DESTDIR=3D/t/scratch/ha=
rti/root/ \
> RE>> installworld
> RE>>=20
> RE>> but that one breaks in libexec/pt_chown (which has a hard-coded=20
> RE>> BINOWN=3Droot).
> RE>>=20
> RE>> Perhaps I can't see the obvious solution?
> RE>>=20
> 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).
>=20
> So it seems that:
>=20
> make SHAREOWN=3Dharti SHAREGRP=3Dharti INSTALL=3D"sh `pwd`/release/instal=
l.sh" \
> DESTDIR=3D"/somewhere" installworld
>=20
> almost works. Almost, because bsd.lib.mk contains
>=20
> SHLINSTALLFLAGS +=3D -fschg
>=20
> That case is not handled in install.sh and should probably read
>=20
> SHLINSTALLFLAGS +=3D -f schg
>=20
Rather I've fixed install.sh (committed):

%%%
Index: install.sh
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/tools/install.sh,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- install.sh	6 Feb 2004 11:00:13 -0000	1.6
+++ install.sh	7 Jul 2004 09:38:14 -0000	1.7
@@ -33,6 +33,7 @@
     case $1 in
     -[bCcMpSs]) shift;;
     -[Bfgmo]) shift; shift;;
+    -[Bfgmo]*) shift;;
     *) break;
     esac
 done
%%%

> Additionally I had to add
>=20
>  -fschg) shift;;
>=20
> to install.sh, because it seems that the installworld target uses the=20
> currently installed mk files not those from src/share/mk.
>=20
Not until you call installworld with "make -fMakefile.inc1 ...".
Normally, src/Makefile is used and it calls installworld with
-m${.CURDIR}/share/mk.  You can verify with ``make -n installworld''.

> The SHAREOWN SHAREGRP is needed because share/zoneinfo/Makefile passes=20
> these directly to zic. This could probably be fixed by calling zic
> during buildworld and just install the compiled files during installworld.
>=20
Yes, I've been thinking of doing this for some years now.  I will see if
I can fix it easily, now that I have a good reason for it. ;)


Cheers,
--=20
Ruslan Ermilov
ru@FreeBSD.org
FreeBSD committer

--tKW2IUtsqtDRztdT
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFA68klqRfpzJluFF4RAvl9AJ9lw5LJUQlNZ6jUrQuoWowbvD4nAwCfQIUI
ODXi4wmNrLwkpDJTfsME8Tw=
=Zdeb
-----END PGP SIGNATURE-----

--tKW2IUtsqtDRztdT--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040707095757.GA67252>