Alan Pevec
2009-May-27 14:39 UTC
[Ovirt-devel] [PATCH node] REPOST Joey's and Darryl's ovirt-config-* patches
This is a repost of patches for ovirt-config-* ACK to all. Pushed.
Alan Pevec
2009-May-27 14:39 UTC
[Ovirt-devel] [PATCH node] add nic link status and blink identify option
From: Joey Boggs <jboggs at redhat.com> --- scripts/ovirt-config-networking | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking index 46f74da..143c985 100755 --- a/scripts/ovirt-config-networking +++ b/scripts/ovirt-config-networking @@ -52,6 +52,22 @@ function configure_interface if [ -z "$AUTO" ]; then while true; do printf "\n" + LINK=`ethtool $NIC| grep "Link detected"`:u + [ -z "$LINK" ] && return + if echo $LINK | grep -q "Link detected: yes" ; then + NICSTATUS="ACTIVE" + else + NICSTATUS="INACTIVE" + fi + echo "NIC is: $NICSTATUS" + + read -ep "Help identify $NIC by blinking lights for 10 seconds ([Y]es/[N]o)?" + case $REPLY in + Y|y) + ethtool --identify $NIC 10 + ;; + esac + read -ep "Enable IPv4 support ([S]tatic IP, [D]HCP, [N]o or [A]bort)? " case $REPLY in D|d) -- 1.6.0.6
Alan Pevec
2009-May-27 14:39 UTC
[Ovirt-devel] [PATCH node] update o-c-networking, o-c-storage menu options to be more clear
From: Joey Boggs <jboggs at redhat.com> --- scripts/ovirt-config-networking | 4 ++-- scripts/ovirt-config-storage | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking index 143c985..e8a8624 100755 --- a/scripts/ovirt-config-networking +++ b/scripts/ovirt-config-networking @@ -279,13 +279,13 @@ else while true; do printf "\n\n Networking Configuration\n\n" >&2 - select NIC in $NICS "DNS" "NTP" "Save & Exit" + select NIC in $NICS "DNS" "NTP" "Save And Return To Menu" do printf "\n" case "$NIC" in "DNS") configure_dns "$OVIRT_DNS"; break ;; "NTP") configure_ntp "$OVIRT_NTP"; break ;; - "Save & Exit") break 2;; + "Save And Return To Menu") break 2;; *) if [[ -n "${NIC}" ]] && [[ "${NICS}" =~ "${NIC}" ]]; then configure_interface $NIC $IFACE_NUMBER diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index 716b8fb..7efa299 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -531,19 +531,20 @@ if [ "$1" == "AUTO" ]; then log "Missing device parameter: unable to partition any disk" fi else - OPTIONS="Configure Review Partition Quit" + OPTIONS="\"Configure\" \"Review\" \"Commit Changes And Quit\" \"Return To Menu\"" + eval set $OPTIONS PS3="Choose an option: " while true; do printf "\n\n Storage Configuration\n\n" >&2 - select OPTION in $OPTIONS + select OPTION in "$@" do case "$OPTION" in "Configure") do_configure ; break ;; "Review") do_review ; break ;; - "Partition") do_confirm ; break ;; - "Quit") printf "\nExiting.\n"; exit ;; + "Commit Changes And Quit") do_confirm ; break ;; + "Return To Menu") printf "\nExiting.\n"; exit ;; esac done done -- 1.6.0.6
Alan Pevec
2009-May-27 14:39 UTC
[Ovirt-devel] [PATCH node] Restricts network configuration to a single NIC.
From: Darryl L. Pierce <dpierce at redhat.com> If an existing set of configuration files exist they are deleted. While in the configuration menu, only one NIC is configured. If the user selects a second network card to configure then the previous configuration is discarded and only the new one saved. Signed-off-by: Darryl L. Pierce <dpierce at redhat.com> --- scripts/ovirt-config-networking | 45 ++++++++++++++++++++++++++++++++------- 1 files changed, 37 insertions(+), 8 deletions(-) diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking index e8a8624..d964ee8 100755 --- a/scripts/ovirt-config-networking +++ b/scripts/ovirt-config-networking @@ -18,6 +18,7 @@ trap 'exit $?' 1 2 13 15 CONFIG_FILE_ROOT="/files/etc/sysconfig/network-scripts/ifcfg" NTP_CONFIG_FILE="/etc/ntp.conf" +CONFIGURED_NIC="" function configure_interface { @@ -31,6 +32,17 @@ function configure_interface PREFIX=$OVIRT_IP_PREFIX fi + if [[ -n "${CONFIGURED_NIC}" ]]; then + printf "This will delete the current configuration for ${CONFIGURED_NIC}.\n" + read -ep "Continue? (y/N) " + case $REPLY in + N|n) printf "\nAborting...\n"; return;; + esac + fi + + rm -rf $WORKDIR/* + CONFIGURED_NIC=$NIC + local BRIDGE=br$NIC local IF_FILENAME="$WORKDIR/augtool-$NIC" local BR_FILENAME="$WORKDIR/augtool-$BRIDGE" @@ -85,7 +97,7 @@ function configure_interface BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/GATEWAY $GATEWAY" fi ;; - A|a) return ;; + A|a) CONFIGURED_NIC=""; return ;; esac printf "\n" @@ -107,7 +119,7 @@ function configure_interface BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6FORWARDING no" BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6AUTOCONF yes" ;; - A|a) return ;; + A|a) CONFIGURED_NIC=""; return;; esac printf "\n" @@ -122,7 +134,7 @@ function configure_interface break ;; N|n) BR_CONFIG=$BR_CONFIG_BASE ;; - A|a) return ;; + A|a) CONFIGURED_NIC=""; return;; esac done else @@ -278,14 +290,23 @@ else while true; do printf "\n\n Networking Configuration\n\n" >&2 - - select NIC in $NICS "DNS" "NTP" "Save And Return To Menu" + printf "***** WARNING *****\n" + printf "Configuring the network will destroy any existing networking\n" + printf "configuration on this system.\n" + printf "***** WARNING *****\n" + + DNS="DNS" + NTP="NTP" + Abort="Abort" + Save="Save And Return To Menu" + select NIC in $NICS "$DNS" "$NTP" "$Abort" "$Save" do printf "\n" case "$NIC" in - "DNS") configure_dns "$OVIRT_DNS"; break ;; - "NTP") configure_ntp "$OVIRT_NTP"; break ;; - "Save And Return To Menu") break 2;; + "$DNS") configure_dns "$OVIRT_DNS"; break ;; + "$NTP") configure_ntp "$OVIRT_NTP"; break ;; + "$Abort") rm -f "${WORKDIR}"/augtool-*; exit 99;; + "$Save") break 2;; *) if [[ -n "${NIC}" ]] && [[ "${NICS}" =~ "${NIC}" ]]; then configure_interface $NIC $IFACE_NUMBER @@ -303,6 +324,14 @@ start_log net_configured=0 if ls "$WORKDIR"/augtool-* > /dev/null 2>&1 ; then log "Configuring network" + + # delete existing scripts + for script in /etc/sysconfig/network-scripts/ifcfg-*; do + if [[ ! "${script}" =~ ifcfg-lo ]]; then + ovirt_safe_delete_config $script + fi + done + config="$WORKDIR"/config-augtool cat "$WORKDIR"/augtool-* > $config \ && augtool $config -- 1.6.0.6
Alan Pevec
2009-May-27 14:39 UTC
[Ovirt-devel] [PATCH node] Fixes when more than one UDI is returned while getting a drive's size.
From: Darryl L. Pierce <dpierce at redhat.com> If more than one UDI is returned, they are delimited by a carriage return. That is changed to a space, then the lot is iterated over. Each UDI is tested to see if it has the property "block.is_volume=false". If so then that UDI is for the underlying block device and not a logical volume on the device. Signed-off-by: Darryl L. Pierce <dpierce at redhat.com> --- scripts/ovirt-config-storage | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index 7efa299..cc9248b 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -43,6 +43,16 @@ get_drive_size() local size local udi=$(hal-find-by-property --key block.device --string $drive) + # if more than one UDI was found then iterate over them to find the base device + if [[ "${udi}" =~ \$ ]]; then + udi=$(echo $udi | sed 's/\$/ /g') + for found in ${udi}; do + if [[ "false" == $(hal-get-property --udi $found --key block.is_volume) ]]; then + udi=$found + break + fi + done + fi if [ -z "$udi" ]; then # If hal didn't find the device, it could be a virtio block device # In this case, use sfdisk -s to get the size @@ -50,7 +60,7 @@ get_drive_size() size=$(echo "scale=0; $size * 1024" | bc -l) else size=$(hal-get-property --udi "$udi" --key storage.size) - if [ $size -eq 0 ]; then + if [[ "${size}" == "0" ]]; then # disk is probably hot-swappable, use different HAL key size=$(hal-get-property --udi "$udi" --key storage.removable.media_size) fi -- 1.6.0.6
Reasonably Related Threads
- [PATCH node] Rerunning network config resets all network config. bz#507393
- Obsoletes previous patch
- [PATCH node] Make all yes/no prompts consistent. rhbz#508778
- Final follow up patch to add warning for NTP...
- [PATCH node] validify ipv4/ipv6 static/dhcp choice else loop