From 726380b62deaafadc45247d30208822055fd0275 Mon Sep 17 00:00:00 2001 From: Sebastian Schmelzer Date: Mon, 4 Oct 2010 13:22:24 +0200 Subject: add netconsole stuff --- src/boot-env/OpenSLX/MakeInitRamFS/Engine/Base.pm | 2 +- .../distro-specs/ubuntu/functions-default | 23 ++++++++++++++++++++-- src/initramfs/stage3-stuff/etc/functions | 5 +++++ 3 files changed, 27 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/boot-env/OpenSLX/MakeInitRamFS/Engine/Base.pm b/src/boot-env/OpenSLX/MakeInitRamFS/Engine/Base.pm index b09543dc..24b999e4 100644 --- a/src/boot-env/OpenSLX/MakeInitRamFS/Engine/Base.pm +++ b/src/boot-env/OpenSLX/MakeInitRamFS/Engine/Base.pm @@ -232,7 +232,7 @@ sub _copyKernelModules # (some of these modules do not exist on all distros, so they will be # filtered out again by the respective distro object): my @kernelModules = qw( - af_packet unix hid hid-bright usbhid uhci-hcd ohci-hcd vesafb fbcon + af_packet unix hid hid-bright usbhid uhci-hcd ohci-hcd vesafb fbcon netconsole ); push @kernelModules, @{ $self->{'suggested-kernel-modules'} }; diff --git a/src/initramfs/distro-specs/ubuntu/functions-default b/src/initramfs/distro-specs/ubuntu/functions-default index 51027c90..316f8c5c 100644 --- a/src/initramfs/distro-specs/ubuntu/functions-default +++ b/src/initramfs/distro-specs/ubuntu/functions-default @@ -36,6 +36,20 @@ postinit () { fi } +config_netconsole () { + local MY_IP=$1 + local MY_OLDDEV=$2 + local MY_DEV=$3 + local T_IP=$4 + local T_MAC=$(arp -n |grep $T_IP| awk '{print $5}') + # FIXME: we need to set a valid ip for ethx if we use the bridge config + # from the virtualization plugins + [ "$MY_OLDDEV" = "$MY_DEV" ] || ip a a $MY_IP dev $MY_OLDDEV + modprobe netconsole netconsole=4444@$MY_IP/$MY_OLDDEV,514@$T_IP/$T_MAC + dmesg -n 8 +} + + # distro specific function called from servconfig script config_distro () { # runlevel system changed significantly compared to pre 9.10 sys-v-init @@ -76,8 +90,13 @@ export PATH=\"\$PATH:/var/opt/openslx/bin\"" >>/mnt/etc/profile } # initial boot looks different since ubuntu upstart +# (executed after plugin config in stage3) initial_boot () { - : + # fix depenencies of upstart files (remove network stuff) + upstart_set_starton rc-sysinit filesystem + upstart_set_starton autofs filesystem + upstart_set_starton portmap filesystem + } upstart_set_starton () { @@ -101,7 +120,7 @@ upstart_set_starton () { sed -e 's/start on.*$/start on ##starton##/' \ -i $script_path # replace placeholder with our new value - sed -e "s,##starton##,$starton," + sed -e "s,##starton##,$starton," \ -i $script_path else error "Script: ${script} does not exist. Skipping modification.." nonfatal} diff --git a/src/initramfs/stage3-stuff/etc/functions b/src/initramfs/stage3-stuff/etc/functions index 3985bd57..066d2756 100644 --- a/src/initramfs/stage3-stuff/etc/functions +++ b/src/initramfs/stage3-stuff/etc/functions @@ -29,6 +29,10 @@ postinit () { config_distro () { : } +# setup netconsole +config_netconsole () { +: +} ############################################################################# # produce error message and if $2 is empty run (debug) shell @@ -574,6 +578,7 @@ fi # execute all shell scripts in the given init-hook folder runinithook () { local hook=$1 +echo "[openslx] run: $hook" > /dev/kmsg if [ -d /etc/init-hooks/$hook ]; then for hook_script in /etc/init-hooks/$hook/*.sh; do if [ -e $hook_script ]; then -- cgit v1.2.3-55-g7522