I am paurea, but this is nemo's old patch to make the kernel serve its configuration file so that it can be recreated after. Reference: /n/sources/patch/applied/serveconf Date: Mon Jan 17 16:03:31 CET 2011 Signed-off-by: nemo@lsub.org --- /sys/src/9/port/portmkfile Mon Jan 17 16:01:53 2011 +++ /sys/src/9/port/portmkfile Mon Jan 17 16:01:50 2011 @@ -50,6 +50,11 @@ $CONF.c: ../port/mkdevc $CONF rc ../port/mkdevc $CONF > $CONF.c + {echo 'uchar configfile[]={' + xd -1x $CONF | + sed -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g' + echo 0, + echo '};'} >> $CONF.c errstr.h: ../port/mkerrstr ../port/error.h rc ../port/mkerrstr > errstr.h --- /sys/src/9/port/devcons.c Mon Jan 17 16:02:00 2011 +++ /sys/src/9/port/devcons.c Mon Jan 17 16:01:56 2011 @@ -594,6 +594,7 @@ Qtime, Quser, Qzero, + Qconfig, }; enum @@ -625,6 +626,7 @@ "time", {Qtime}, NUMSIZE+3*VLNUMSIZE, 0664, "user", {Quser}, 0, 0666, "zero", {Qzero}, 0, 0444, + "config", {Qconfig, 0, 0}, 0, 0444, }; int @@ -747,6 +749,7 @@ char tmp[256]; /* must be >= 18*NUMSIZE (Qswap) */ int i, k, id, send; vlong offset = off; + extern char configfile[]; if(n <= 0) return n; @@ -863,6 +866,10 @@ case Qnull: return 0; + case Qconfig: + return readstr((ulong)offset, buf, n, configfile); + + case Qsysstat: b = smalloc(conf.nmach*(NUMSIZE*11+1) + 1); /* +1 for NUL */ bp = b; @@ -1041,6 +1048,10 @@ return userwrite(a, n); case Qnull: + break; + + case Qconfig: + error(Eperm); break; case Qreboot: --- /sys/man/3/cons Mon Jan 17 16:02:10 2011 +++ /sys/man/3/cons Mon Jan 17 16:02:04 2011 @@ -6,6 +6,7 @@ .B bind #c /dev .B /dev/bintime +.B /dev/config .B /dev/cons .B /dev/consctl .B /dev/cputime @@ -111,6 +112,10 @@ file contains a textual representation of the operating system's version and parameters. At the moment, it contains one field: the 9P protocol version, currently .BR 2000 . +.PP +The +.B config +file contains a copy of the kernel configuration file used to build the kernel. .PP The .B kmesg