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

Re: email-address embedded in homemade kernels



D-Man wrote:
> 
> On Mon, Feb 12, 2001 at 11:31:57PM +0100, Diego Biurrun wrote:
> | Hello!
> |
> | I was wondering if it is possible to embed my email address into
> | homegrown kernels. My current kernel greets me with
> |
> |
> | Linux version 2.2.19pre6 (root@silver) ....
> |
> |
> | but I would much prefer something like
> |
> |
> | Linux version 2.2.19pre6 (diego@biurrun.de) ....
> |
> |
> 
> I don't think it is hard-coded into the kernel.  I believe it is
> specified in a file in /etc (that gets read on boot).  I know that if
> you change the name of localhost in /etc/hosts and reboot your
> greeting will show the new host name.

I think you're confusing the getty greeting (found in /etc/issue) with
the actual kernel print-out (shown by dmesg).  The latter _is_ hardcoded
into the kernel.

When this message is displayed the kernel doesn't even know what disks
you have let alone what filesystem resides on them, so it is impossible
for him to look up any file in /etc.

Anyway, to the original question: Grepping through the kernel sources
shows that this printout is done in linux/init/main.c by
__start_kernel() using the string linux_banner.  This is in turn defined
in linux/init/version.c like this

const char *linux_banner = 
	"Linux version " UTS_RELEASE " (" LINUX_COMPILE_BY "@"
	LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION "\n";

Grepping the kernel sources for LINUX_COMPILE_BY and LINUX_COMPILE_HOST
shows (among others) the following entries:

Makefile:       @echo \#define LINUX_COMPILE_BY \"`whoami`\" >> .ver
Makefile:       @echo \#define LINUX_COMPILE_HOST \"`hostname`\" >> .ver

Thus, changing the above lines in the top-level Makefile into 

@echo \#define LINUX_COMPILE_BY \"diego\" >> .ver
@echo \#define LINUX_COMPILE_HOST \"biurrun.de\" >> .ver

should yield the desired result.

This is untested though.

Cheers,
Viktor
-- 
Viktor Rosenfeld
WWW: http://www.informatik.hu-berlin.de/~rosenfel/
Geek Code (3.1):
  GCS/SS d-@ s+: a20 C++@ UL++$ P+ L+++ E--- W++ N++ o? K? !W O? M? V?
  PS++@ PE+(-) Y+ P?(+++) t+ 5+ X- R? !tv b+ DI+ D- G e>+++ h-- r- !y+



Reply to: