From owner-freebsd-hackers@freebsd.org Sat Jul 20 07:11:48 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A294EB6A4B for ; Sat, 20 Jul 2019 07:11:48 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C9F57047A for ; Sat, 20 Jul 2019 07:11:47 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x6K7Bc87098402; Sat, 20 Jul 2019 00:11:38 -0700 (PDT) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: (from freebsd-rwg@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x6K7Baca098401; Sat, 20 Jul 2019 00:11:36 -0700 (PDT) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201907200711.x6K7Baca098401@gndrsh.dnsmgr.net> Subject: Re: build custom kernel under FreeBSD 12 In-Reply-To: To: Norbert Koch Date: Sat, 20 Jul 2019 00:11:36 -0700 (PDT) CC: freebsd-hackers@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 8C9F57047A X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [2.18 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.59)[0.594,0]; NEURAL_HAM_LONG(-0.01)[-0.015,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.67)[0.668,0]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: gndrsh.dnsmgr.net]; RCPT_COUNT_TWO(0.00)[2]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.04)[ip: (0.15), ipnet: 69.59.192.0/19(0.07), asn: 13868(0.05), country: US(-0.05)] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 07:11:48 -0000 > 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 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 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