Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Jan 2012 12:17:57 +0100
From:      Luigi Rizzo <rizzo@iet.unipi.it>
To:        Aleksandr Rybalko <ray@dlink.ua>
Cc:        Garrett Cooper <yanegomi@gmail.com>, current@freebsd.org
Subject:   Re: kernel config files outside of sys/${ARCH}/conf ?
Message-ID:  <20120112111757.GA12063@onelab2.iet.unipi.it>
In-Reply-To: <20120112122250.03176f4a.ray@dlink.ua>
References:  <20120112081139.GA9921@onelab2.iet.unipi.it> <20120112101653.57decd32@ernst.jennejohn.org> <20120112100601.GA11325@onelab2.iet.unipi.it> <CAGH67wSLFQaBZfcXiVLUBoe7NS0Gu_MbHwxyLPhHj1GTX3jFPA@mail.gmail.com> <20120112101739.GA11498@onelab2.iet.unipi.it> <20120112122250.03176f4a.ray@dlink.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jan 12, 2012 at 12:22:50PM +0200, Aleksandr Rybalko wrote:
> On Thu, 12 Jan 2012 11:17:39 +0100
> Luigi Rizzo <rizzo@iet.unipi.it> wrote:
> 
> >> On Thu, Jan 12, 2012 at 01:55:39AM -0800, Garrett Cooper wrote:
> >> > On Thu, Jan 12, 2012 at 2:06 AM, Luigi Rizzo <rizzo@iet.unipi.it>
> >> > wrote:
> >> > > On Thu, Jan 12, 2012 at 10:16:53AM +0100, Gary Jennejohn wrote:
> >> > >> On Thu, 12 Jan 2012 09:11:39 +0100
> >> > >> Luigi Rizzo <rizzo@iet.unipi.it> wrote:
> >> > >>
> >> > >> > usr/sbin/config assumes that the kernel config file
> >> > >> > lives in ${src_base}/sys/${arch}/conf , which means that
> >> > >> > if you need to build a custom kernel one needs RW
> >> > >> > access to that directory.
> >> > >> >
> >> > >> > Any idea on how we can enable config to work in a
> >> > >> > generic directory ?
> >> > >> >
> >> > >> > I scanned the source code usr.sbin/config and found that
> >> > >> > it uses hardwired paths -- specifically, it looks for
> >> > >> > the kernel source tree in "../.." and has multiple
> >> > >> > hardwired paths such as "../../conf/".
> >> > >> > There is also a somewhat undocumented access to a
> >> > >> > file called DEFAULTS that extends the configuration you pass.
> >> > >> >
> >> > >> > Any objections to the addition of a "-s" option to config(8)
> >> > >> > to specify the location of the source tree ?
> >> > >> >
> >> > >>
> >> > >> Seems like a good idea to me as long as the old behavior is
> >> > >> kept.
> >> > >
> >> > > of course :)
> >> > 
> >> >     Why not just set KERNCONFDIR?
> >> 
> >> The variable does not seem to be used by usr/sbin/config
> >> 
> >> cheers
> >> luigi
> >> _______________________________________________
> >> freebsd-current@freebsd.org mailing list
> >> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> >> To unsubscribe, send any mail to
> >> "freebsd-current-unsubscribe@freebsd.org"
> 
> Hi,
> 
> ZRouter.org use just full path to config file 
> make KERNCONF=/path/to/config buildkernel

It does not work:

    > ls -l /home/luigi/FreeBSD/pico9/qemu/PICOBSD.amd64
    -rw-r--r--  1 luigi  wheel  4285 Jan 12 11:32 /home/luigi/FreeBSD/pico9/qemu/PICOBSD.amd64
    > make KERNCONF=/home/luigi/FreeBSD/pico9/qemu/PICOBSD.amd64 buildkernel
    ERROR: Missing kernel configuration file(s) (/home/luigi/FreeBSD/pico9/qemu/PICOBSD.amd64).

As i said, the hardwired paths in config suggest that there is
a requirement that the config lives under the source tree and
cannot be in a completely arbitrary position. My tests confirm that.
So, KERNCONF=/path/to/config only works for certain values of
/path/to/config .

Of course i may be wrong but if you have direct experience
in building a kernel whose config file name is /tmp/NOT_GENERIC
please let me know how you do it.

cheers
luigi



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