2 thoughts on “Get your name in the kernel!”

  1. I figured I’d give you more info on the username/etc on the compile for
    the kernel, like you were saying.

    First of all, there is more than one place where your user@host like when
    you build a kernel. Several apps built when you rebuild the world
    (named for example, check out named -v) tag on your username and hostname,
    along with the date, for future reference. Also, the IRC client EPIC does
    the same thing, at startup it will echo back ‘Compiled by ..’, and will
    show you the user@host it was compiled at.

    So what does this all mean?

    It’s quite simple actually. The compiles can detect these things by
    various means, for example, a kernel build checks out its working
    directory. So whether you use make buildkernel, which uses the /usr/obj
    staging area, or the regular process, which uses /sys/compile staging
    area, you’ll see that. ‘su’ by itself is akin to ‘su -m’ (if you read the
    manual pages), as is ‘su -‘ equal to ‘su -l’. The -m option to su invokes
    your current shell, instead of the target users, and leaves most of the
    environment intact (including the USER variable used during compiles),
    whereas -l simulates a new login, calling the target users shell, and
    discarding or resetting certain environment variables for the new shell.

    Normally, when running around as a normal user, I’ll use my ‘xyst’ login
    (although recently I’ve been using gregp for similar purposes), when I
    make the world, or a kernel for that matter, I’ll usually use ‘su – gregp’
    to go back to my gregp login (simulating its environment conditions) and
    then use ‘su’, so that it’s name gets put on the kernel. It’s all about
    the environment.

    Hope that helps.

  2. (posted by Dan Langille)

    In your article, you talked about how to get your name in your
    kernel when performing a uname -a. I’ve played around with
    this as well and in fact, you can change quite a bit of the text.
    You just need to edit the right file prior to compiling your kernel.

    After editing my kernel file, named KERNEL, and doing the
    config KERNEL, change directory to ../../compile/KERNEL.
    Once there, use vi, or your editor of choice, and make your
    changes to the file vers.c You can edit the name (as you were
    doing), the version number and even the OS name (why would
    anyone want to hide the fact they run the best operating system
    available?). Then proceed with the remainder of compiling your
    kernel, make depend && make && make install.

    Anyway, thought this might tie into your article and allow you to
    customize some aspects of the system output.

    If I’m mistaken in what you were attempting to do, then I apologize for not reading the article thoroughly

Leave a Comment

Scroll to Top