Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Jun 2017 08:10:00 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Baho Utot <baho-utot@columbus.rr.com>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: Building base source
Message-ID:  <20170611081000.0916e602.freebsd@edvax.de>
In-Reply-To: <9c41c5df-9874-3e37-8f8c-f58c63419887@columbus.rr.com>
References:  <e4198baf-27e2-2e25-c9b5-9f4dbaccde7e@columbus.rr.com> <44y3t19e5i.fsf@lowell-desk.lan> <872fe20f-fece-9980-2c8f-10e9492ab786@columbus.rr.com> <20170610052351.000ca108.freebsd@edvax.de> <df541c25-2a05-f3b9-9da6-138c55d7e73f@columbus.rr.com> <20170611001151.d3d76bf8.freebsd@edvax.de> <9c41c5df-9874-3e37-8f8c-f58c63419887@columbus.rr.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 10 Jun 2017 21:30:11 -0400, Baho Utot wrote:
> 
> 
> On 06/10/17 18:11, Polytropon wrote:
> > On Sat, 10 Jun 2017 09:40:37 -0400, Baho Utot wrote:
> >>
> >>
> >> On 06/09/17 23:23, Polytropon wrote:
> >>> On Fri, 9 Jun 2017 16:01:25 -0400, Baho Utot wrote:
> >>>>
> >>>>
> >>>> On 06/09/17 15:03, Lowell Gilbert wrote:
> >>>>> Baho Utot <baho-utot@columbus.rr.com> writes:
> >>>>>
> >>>>>> I am experimenting with building the base source.
> >>>>>>
> >>>>>> What do I need to set (which knobs) to be able to build the base
> >>>>>> source and have the binaries built into a home directory.
> >>>>>>
> >>>>>> The source will be in /usr/src but I want all the binaries and all
> >>>>>> other files produced by the build to goto in
> >>>>>> /usr/home/FreeBSD/base/target.
> >>>>>>
> >>>>>> Will it be a copy of want is installed in the / (root) filesystem?
> >>>>>
> >>>>> https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html
> >>>>>
> >>>>
> >>>> I have already looked at that.  That is why I have the questions.  I
> >>>> want to build the base as a user and have it install its stuff into a
> >>>> subdirectory.
> >>>
> >>> There are two variables that you will need to set: the directory
> >>> where the build happens, and the one where the result from that
> >>> build will be written to. The solution is quite simple, and of
> >>> course already present in the build infrastructure:
> >>>
> >>> Set MAKEOBJDIRPREFIX and DESTDIR to locations where your $USER
> >>> has write access.
> >>>
> >>>
> >>>
> >>
> >> I want to build with a user so if I make a mistake ( very likely ) it
> >> will not damage the running system.  I have found that make
> >> installkernel and installworld requires root user because it sets the
> >> user as root perms regardless of where the install is going.
> > 
> > I think the main problem here is things like setuid; those
> > tasks cannot be performed by a non-root user. Maybe you can
> > check if a memebership in the groups wheel or operator is
> > sufficient? In worst case, use su, sudo, or super (while
> > having MAKEOBJDIRPREFIX and DESTDIR set to non-system
> > locations).
> > 
> > 
> 
> The problem is that make installworld wants to chown to root:wheel which 
> will not fly if you are not root.
> 
> The setuid may be an additional issue.  In linux one could still setuid 
> will still not being root.

That is a precise answer, thank you. It illustrates very well
the difference between the security concepts implemented in
FreeBSD vs. in Linux. The install* targets require root access
(because that's what they do: they install stuff to the location
given in DESTDIR, and doing "root only stuff" belongs to that
task). It seems to be impossible to run the install* targets
as a non-root user (except you modify the parts that require
root permissions manually).




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



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