Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Jul 2019 00:11:36 -0700 (PDT)
From:      "Rodney W. Grimes" <freebsd-rwg@gndrsh.dnsmgr.net>
To:        Norbert Koch <nkoch@demig.de>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: build custom kernel under FreeBSD 12
Message-ID:  <201907200711.x6K7Baca098401@gndrsh.dnsmgr.net>
In-Reply-To: <d3aa06b6-9fb8-41ba-07e0-61211556e9bf@demig.de>

next in thread | previous in thread | raw e-mail | index | archive | help
> I did some more testing.
>=20
> When I copy the src tree and set $MAKEOBJDIRPREFIX accordingly, I can
> run "make kernel-toolchain && make buildkernel" without problems.
>=20
> The permission denied error comes only when I symlink /usr/src/* and only
> copy sys/ to my local directory. So, my idea is that? FreeBSD12 differs
> from 11 and 10 by using something like realpath in either some Makefile
> or make itself.

It is most likely the munging of relative paths that
use to be ../../foo into ${SRCTP}/foo that is the change
causing issues with what you are doing.  SRCTOP is probably
changing values depnding on what location a submake was
started from.

> *****************************************
> * demig Prozessautomatisierung GmbH     *
> *                                       *
> * Anschrift:          Haardtstrasse 40  *
> *                       D-57076 Siegen  *
> * Registergericht:     Siegen HRB 2819  *
> * Geschaeftsfuehrer:   Joachim Herbst,  *
> *                        Winfried Held  *
> * Telefon:              +49 271 772020  *
> * Telefax:              +49 271 74704   *
> * E-Mail:                info@demig.de  *
> *                  http://www.demig.de  *
> *****************************************
> Am 2019-07-19 um 09:28 schrieb Gary Jennejohn:
> > On Fri, 19 Jul 2019 08:40:05 +0200
> > Norbert Koch <nkoch@demig.de> wrote:
> >
> >> Here is a typescript:
> >>
> >> =1B12.0-RELEASE-p7 (3) nk@entw-pr4 [~/src/kernel/src] $ export
> >> MAKEOBJDIRPREFIX=3D`realpath tmp`
> >> 12.0-RELEASE-p7 (3) nk@entw-pr4 [~/src/kernel/src] $ echo $MAKEOBJDIRP=
REFIX
> >> /usr/home/nk/src/kernel/src/tmp
> >>
> >> =1B12.0-RELEASE-p7 (3) nk@entw-pr4 [~/src/kernel/src] $ make buildkern=
el
> >> make[1]: "/usr/home/nk/src/kernel/src/Makefile.inc1" line 341:
> >> SYSTEM_COMPILER: Determined that CC=3Dcc matches the source tree. Not
> >> bootstrapping a cross-compiler.
> >> make[1]: "/usr/home/nk/src/kernel/src/Makefile.inc1" line 348:
> >> SYSTEM_LINKER: libclang will be built for bootstrapping a cross-linker.
> >>
> >> --------------------------------------------------------------
> >>   >>> Kernel build for GENERIC started on Fri Jul 19 08:34:27 CEST 2019
> >> --------------------------------------------------------------
> >> =3D=3D=3D> GENERIC
> >> mkdir -p /usr/src/sys
> >>
> >> --------------------------------------------------------------
> >>   >>> stage 1: configuring the kernel
> >> --------------------------------------------------------------
> >> cd /usr/home/nk/src/kernel/src/sys/i386/conf;
> >> PATH=3D/usr/src/tmp/legacy/usr/sbin:/usr/src/tmp/legacy/usr/bin:/usr/s=
rc/tmp/legacy/bin:/usr/src/tmp/usr/sbin:/usr/src/tmp/usr/bin:/sbin:/bin:/us=
r/sbin:/usr/bin
> >> config__ -d /usr/src/sys/GENERIC__ -I
> >> '/usr/home/nk/src/kernel/src/sys/i386/conf'
> >> '/usr/home/nk/src/kernel/src/sys/i386/conf/GENERIC'
> >> config: /usr/src/sys/GENERIC: Permission denied
> >> *** Error code 2
> >>
> >> Stop.
> >> make[1]: stopped in /usr/home/nk/src/kernel/src
> >> *** Error code 1
> >>
> >> Stop.
> >> make: stopped in /usr/home/nk/src/kernel/src
> >>
> > It's peculiar that you have a mix of /usr/src and /usr/home/nk/src.
> > Looking at /usr/src/Makefile.inc1 it would appear that you may also
> > have to set KRNLOBJDIR to /usr/home/nk/src/kernel/src.
> >
> > Does the tmp directory really exist?  Seems like a weird choice.
> >
> > I did what Ryan suggested and was able to make build{kernel,world}
> > from /usr/src with no problem.  But I haven't modified the kernel
> > sources.
> >
> >> Am 2019-07-18 um 19:22 schrieb Ryan Stone:
> >>> How are you setting MAKEOBJDIRPREFIX?  It needs to be set in your
> >>> environment, i.e.
> >>>
> >>> $ export MAKEOBJDIRPREFIX=3D$HOME/obj
> >>> $ make buildkernel
> >>>
> >>> Trying 'make MAKEOBJDIRPREFIX=3D$HOME/obj buildkernel' will fail in
> >>> strange ways due to how make passes arguments to sub-makes.
> >>>
> >>> On Thu, Jul 18, 2019 at 9:53 AM Norbert Koch <nkoch@demig.de> wrote:
> >>>> Hello.
> >>>>
> >>>> I am obviously too stupid to figure out how to build a custom kernel
> >>>> as non-root user in a non-standard directory.
> >>>> Under FreeBSD9/10/11 I could put src/ under my own directory
> >>>> and start a kernel-compilation by just setting $MAKEOBJDIRPREFIX
> >>>> accordingly. Doing this under FreeBSD12 gives me 'permission denied'
> >>>> with 'config -d /usr/src/sys/GENERIC ...'. Seems like ${KRNLOBJDIR} =
is
> >>>> not set correctly while the other parameters to config are.
> >>>> I see that Makefiles differ between 12 and older releases.
> >>>> ${OBJTOP} vs. ${OBJTREE}?
> >>>>
> >>>> So, what am I doing wrong?
> >>>>
> >>>> Thank you for any help.
>=20
> --=20
> Dipl.-Ing. Norbert Koch
> Entwicklung Prozessregler
>=20
>=20
> _______________________________________________
> freebsd-hackers@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
>=20
>=20

--=20
Rod Grimes                                                 rgrimes@freebsd.=
org



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