On Sun, Oct 16, 2016 at 11:54:44AM +0200, Sebastien Marie wrote:
> Hi,
> 
> Since the switch to the new way to build kernels, the identification
> string of kernels starts to be too "generic" (and unhelpfull for bug
> report).
> 
> $ ftp http://ftp.fr.openbsd.org/pub/OpenBSD/snapshots/amd64/bsd{,.mp,.rd}
> $ what bsd*
> bsd
>         OpenBSD 6.0-current (obj) #0: Sat Oct 15 18:10:15 MDT 2016
> bsd.mp
>         OpenBSD 6.0-current (obj) #0: Sat Oct 15 18:15:26 MDT 2016
> bsd.rd
>         OpenBSD 6.0-current (obj) #0: Sat Oct 15 18:20:06 MDT 2016
>         PD KSH v5.2.14 99/07/13.2
> 
> All the kernels are "obj" instead of "GENERIC", "GENERIC.MP" and
> "RAMDISK".
> 
> The identification string comes from /sys/conf/newvers.sh, which is
> started by Makefile for generating vers.c in obj/ directory.
> 
>     40  touch version
>     41  v=`cat version` u=${USER-root} d=`pwd` h=`hostname` t=`date`
>     42  id=`basename "${d}"`
>     ...
>     75  const char ostype[] = "${ost}";
>     76  const char osrelease[] = "${osr}";
>     77  const char osversion[] = "${id}#${v}";
>     78  const char sccs[] =
>     79      "    @(#)${ost} ${osr}" STATUS " (${id}) #${v}: ${t}\n";
>     80  const char version[512] =
>     81      "${ost} ${osr}" STATUS " (${id}) #${v}: ${t}\n    
> ${u}@${h}:${d}\n";
> 
> I think newvers.sh should be adapted to the new way, but I dunno what is
> the better way to achieve it (explicit parameter instead of guessing ?).
> 
> Thanks.
> -- 
> Sebastien Marie

Thanks, this was pointed out by jsg@ as well, and I currently have the
following patch in my trees.  Perhaps an explicit parameter is better,
but this seems to work well enough:

Index: newvers.sh
===================================================================
RCS file: /var/cvs/src/sys/conf/newvers.sh,v
retrieving revision 1.148
diff -u -p -r1.148 newvers.sh
--- newvers.sh  1 Sep 2016 14:12:07 -0000       1.148
+++ newvers.sh  15 Oct 2016 01:11:18 -0000
@@ -38,7 +38,7 @@ then
 fi
 
 touch version
-v=`cat version` u=${USER-root} d=`pwd` h=`hostname` t=`date`
+v=`cat version` u=${USER-root} d=${PWD%/obj} h=`hostname` t=`date`
 id=`basename "${d}"`
 
 # additional things which need version number upgrades:

Reply via email to