Benutzer-Werkzeuge


    Warning: Undefined array key "REMOTE_USER" in /usr/local/www/wiki.freifunk-bielefeld.de/lib/tpl/starter/main.php on line 62
  • Admin

  • Warning: Undefined array key "REMOTE_USER" in /usr/local/www/wiki.freifunk-bielefeld.de/lib/tpl/starter/tpl_functions.php on line 50

    Warning: Undefined array key "REMOTE_USER" in /usr/local/www/wiki.freifunk-bielefeld.de/lib/tpl/starter/tpl_functions.php on line 77
  • Registrieren

Webseiten-Werkzeuge


  • Der Kernel soll beim booten die email-Adresse info@freifunk-bielefeld.de anzeigen anstatt user@hostname vom eigenen System. Dafür müssen zwei Wrapper unter /usr/local/bin erstellt werden:

/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