config(8) "kernel building" instructions lead to bad kernel name (which breaks relink) (6.3)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

config(8) "kernel building" instructions lead to bad kernel name (which breaks relink) (6.3)

Il Ka
Hi,
config(8) gives following example to build kernel

# cd /somedir
# cp /usr/src/sys/arch/somearch/conf/SOMEFILE .
# vi SOMEFILE (to make any changes)
# config -s /usr/src/sys -b . SOMEFILE
# make

It will produce kernel named "somedir":
kern.version will have (somedir) ...:/somedir
kern.osversion will be somedir#1

I believe that is because of "-b ." config option.

Default is ../compile/SOMEFILE which is ok, but can't be used
if I rebuild kernel from readonly sources (or just want to build it in my
homedir).

The main problem is that "make install" installs relink stuff to
/usr/share/relink/kernel/SOMEFILE
while /usr/libexec/reorder_kernel reads "kern.osversion" and uses
/usr/share/relink/kernel/somedir

You reboot, and oops: "relinking failed".
Since "reorder_kernel" does not have man page, user will have to read its
source to understand
why make failed to find "newbsd" target:)

I suggest following fix:
-# cd /somedir
+# mkdir /somedir/SOMEFILE
+# cd /somedir/SOMEFILE

It also may be good idea to document how config creates kernel
identification in config(8).
Documenting reorder_kernel (or relink?) is, probably also worth doing

Ilya