/usr/local/bin/whoami

#!/bin/sh

# username to return to the kernel build scripts/mkcompile_h
LINUX_COMPILE_BY="info"

# get the current path and remove the directory containing this script so the real
# command can be called and its output filtered
DIRNAME=$(dirname $0)
NEWPATH=$(IFS=:; for dir in $PATH; do if [ "$dir" != "$DIRNAME" ]; then echo -n "${dir}:"; fi; done)

# calling process ID, required to see if it is the kernel build calling or not
if ps -p $PPID -o args= | grep -q mkcompile_h; then
  echo $LINUX_COMPILE_BY
  exit 0
fi

# execute the system command otherwise
PATH=$NEWPATH whoami "$@"

/usr/local/bin/hostname

#!/bin/sh

# username to return to the kernel build scripts/mkcompile_h
LINUX_COMPILE_HOST="freifunk-bielefeld.de"

# get the current path and remove the directory containing this script so the real
# command can be called and its output filtered
DIRNAME=$(dirname $0)
NEWPATH=$(IFS=:; for dir in $PATH; do if [ "$dir" != "$DIRNAME" ]; then echo -n "${dir}:"; fi; done)

# calling process ID, required to see if it is the kernel build calling or not
if ps -p $PPID -o args= | grep -q mkcompile_h; then 
  echo $LINUX_COMPILE_HOST
  exit 0
fi

# execute the system command otherwise
PATH=$NEWPATH hostname

Zuletzt noch beide Dateien ausführbar machen:

chmod a+x /usr/local/bin/whoami
chmod a+x /usr/local/bin/hostname

Jetzt das OpenWRT-Image bauen. :-)

Quelle: http://tjworld.net/wiki/Linux/Kernel/Build/CustomiseVersionString