[Ovirt-devel] [PATCH] add netconsole autoinstall parameter

Joey Boggs jboggs at redhat.com
Thu Jul 21 19:15:26 UTC 2011


Signed-off-by: Joey Boggs <jboggs at redhat.com>
---
 scripts/ovirt-config-logging |   11 +++++++++++
 scripts/ovirt-early          |    6 +++++-
 2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/scripts/ovirt-config-logging b/scripts/ovirt-config-logging
index 233df67..e296ac4 100755
--- a/scripts/ovirt-config-logging
+++ b/scripts/ovirt-config-logging
@@ -174,6 +174,13 @@ function prompt_user {
     done
 }
 
+function ovirt_netconsole {
+    augtool <<EOF
+set /files/etc/sysconfig/netconsole/SYSLOGADDR $OVIRT_NETCONSOLE_SERVER
+set /files/etc/sysconfig/netconsole/SYSLOGPORT $OVIRT_NETCONSOLE_PORT
+EOF
+    ovirt_store_config /etc/sysconfig/netconsole
+}
 # AUTO for auto-install
 if [ "$1" = "AUTO" ]; then
     if [ -z "$OVIRT_SYSLOG_SERVER" -o -z "$OVIRT_SYSLOG_PORT" ]; then
@@ -189,6 +196,10 @@ if [ "$1" = "AUTO" ]; then
         printf "\nUsing default syslog server '$OVIRT_SYSLOG_SERVER:$OVIRT_SYSLOG_PORT'.\n"
         ovirt_rsyslog $OVIRT_SYSLOG_SERVER $OVIRT_SYSLOG_PORT udp
     fi
+    if [ -n "$OVIRT_NETCONSOLE_SERVER" -a -n "$OVIRT_NETCONSOLE_PORT" ]; then
+        printf "\nConfiguring netconsole server..."
+        ovirt_netconsole
+    fi
 else
     printf "\n\n Logging Configuration\n\n"
     prompt_user
diff --git a/scripts/ovirt-early b/scripts/ovirt-early
index 250bb3f..51a017c 100755
--- a/scripts/ovirt-early
+++ b/scripts/ovirt-early
@@ -548,6 +548,10 @@ start_ovirt_early () {
             i=${i#syslog=}
             eval $(printf $i|awk -F: '{print "syslog_server="$1; print "syslog_port="$2;}')
             ;;
+            netconsole=*)
+            i=${i#netconsole=}
+            eval $(printf $i|awk -F: '{print "netconsole_server="$1; print "netconsole_port="$2;}')
+            ;;
             collectd=*)
             i=${i#collectd=}
             eval $(printf $i|awk -F: '{print "collectd_server="$1; print "collectd_port="$2;}')
@@ -661,7 +665,7 @@ start_ovirt_early () {
 
     # save boot parameters as defaults for ovirt-config-*
 
-    params="bootif init init_app vol_boot_size vol_swap_size vol_root_size vol_config_size vol_logging_size vol_data_size vol_swap2_size vol_data2_size crypt_swap crypt_swap2 upgrade standalone overcommit ip_address ip_netmask ip_gateway ipv6 dns ntp vlan ssh_pwauth syslog_server syslog_port collectd_server collectd_port bootparams hostname firstboot rhn_url rhn_ca_cert rhn_username rhn_password rhn_profile rhn_activationkey rhn_proxy rhn_proxyuser rhn_proxypassword runtime_mode kdump_nfs iscsi_name snmp_password install"
+    params="bootif init init_app vol_boot_size vol_swap_size vol_root_size vol_config_size vol_logging_size vol_data_size vol_swap2_size vol_data2_size crypt_swap crypt_swap2 upgrade standalone overcommit ip_address ip_netmask ip_gateway ipv6 dns ntp vlan ssh_pwauth syslog_server syslog_port collectd_server collectd_port bootparams hostname firstboot rhn_url rhn_ca_cert rhn_username rhn_password rhn_profile rhn_activationkey rhn_proxy rhn_proxyuser rhn_proxypassword runtime_mode kdump_nfs iscsi_name snmp_password install netconsole_server netconsole_port"
     # mount /config unless firstboot is forced
     if [ "$firstboot" != "1" ]; then
         mount_config
-- 
1.7.5.4




More information about the ovirt-devel mailing list