Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: src/BUILDING doesn't document installing kernel



On Sat, 8 Mar 2008, Alan Barrett wrote:

> > And maybe build.sh should have option to install kernel
> > (installkernel=...).
>
> Sure, if we can figure out what it should do.

I suspect as simple as

installkernel()
{
        getkernelconf $1
        ${runcmd} cd "${kernelbuildpath}"
        ${runcmd} "${makewrapper}" install ||
            bomb "Failed to make install in ${kernelbuildpath}"
        ${runcmd} cd "${TOP}"
}

would do the job..

While we are on this (kinda :), I noticed recently while chatting to
Donald Hayford that build.sh does not properly handle the built kernels
during kernel= and releasekernel=; it uses awk to probe for 'config xxx'
lines but doesn't follow include statements or take not of 'no config
xxx'. After investigating some, it seems that there is a kernelnames
target in sys/conf/Makefile.kern.inc that can be used to list the actual
targets, so the patch below converts build.sh to use that (though I'm not
sure if its right :)

There is another issue, in that releasekernel= does not have quite the
same result as 'build.sh release' does with default kernel conf files, in
that there is no kern-NAME.tgz archive produced (is that a kernel set?)

My fu is not really great here, but it seems that if the sets/release
stuff was in sys/conf/Makefile.kern.inc rather than etc/Makefile, it would
be possible to have build.sh use the make system to do the job instead of
handling it separately?

iain

--- /usr/src/build.sh   2008-02-29 18:18:40.000000000 +0000
+++ build.sh    2008-03-08 18:54:07.000000000 +0000
@@ -1235,16 +1235,17 @@
            bomb "Failed to make depend in ${kernelbuildpath}"
        ${runcmd} "${makewrapper}" ${parallel} all ||
            bomb "Failed to make all in ${kernelbuildpath}"
-       ${runcmd} cd "${TOP}"

        if [ "${runcmd}" != "echo" ]; then
                statusmsg "Kernels built from ${kernelconf}:"
-               kernlist=$(awk '$1 == "config" { print $2 }' ${kernelconfpath})
-               for kern in ${kernlist:-netbsd}; do
-                       [ -f "${kernelbuildpath}/${kern}" ] && \
+               kernlist=$("${makewrapper}" kernelnames)
+               for kern in ${kernlist}; do
+                       [ -f "${kern}" ] && \
                            echo "  ${kernelbuildpath}/${kern}"
                done | tee -a "${results}"
        fi
+
+       ${runcmd} cd "${TOP}"
 }

 releasekernel()
@@ -1252,8 +1253,8 @@
        getkernelconf $1
        kernelreldir="${RELEASEDIR}/${MACHINE}/binary/kernel"
        ${runcmd} mkdir -p "${kernelreldir}"
-       kernlist=$(awk '$1 == "config" { print $2 }' ${kernelconfpath})
-       for kern in ${kernlist:-netbsd}; do
+       kernlist=$("${makewrapper}" -f ${kernelbuildpath}/Makefile kernelnames)
+       for kern in ${kernlist}; do
                builtkern="${kernelbuildpath}/${kern}"
                [ -f "${builtkern}" ] || continue
                releasekern="${kernelreldir}/${kern}-${kernelconfname}.gz"


Home | Main Index | Thread Index | Old Index