Merge "Make bash troubleshooting configurable"

This commit is contained in:
Jenkins 2013-06-19 22:22:45 +00:00 committed by Gerrit Code Review
commit 0e4b0556ed
3 changed files with 12 additions and 10 deletions

View File

@ -1,7 +1,6 @@
if [ -z "$ISCSI_TARGET_IQN" ]; then
echo "iscsi_target_iqn is not defined"
echo "Starting troubleshooting shell."
bash
troubleshoot
fi
t=0
@ -15,16 +14,14 @@ done
if [ -z "$target_disk" ]; then
echo "Could not find disk to use."
echo "Starting troubleshooting shell."
bash
troubleshoot
fi
echo "start iSCSI target on $target_disk"
start_iscsi_target "$ISCSI_TARGET_IQN" "$target_disk" ALL
if [ $? -ne 0 ]; then
echo "Failed to start iscsi target."
echo "Starting troubleshooting shell."
bash
troubleshoot
fi
echo "request boot server to deploy image"

View File

@ -188,4 +188,10 @@ function stop_iscsi_target() {
killall tgtd
}
function troubleshoot() {
if [ "$TROUBLESHOOT" == 1 ]; then
echo "Starting troubleshooting shell."
bash
fi
}

View File

@ -47,6 +47,7 @@ readonly DISK=$(get_kernel_parameter disk)
readonly DEPLOYMENT_ID=$(get_kernel_parameter deployment_id)
readonly DEPLOYMENT_KEY=$(get_kernel_parameter deployment_key)
readonly ISCSI_TARGET_IQN=$(get_kernel_parameter iscsi_target_iqn)
readonly TROUBLESHOOT=$(get_kernel_parameter troubleshoot)
mount -t sysfs none /sys
@ -110,8 +111,7 @@ while ! BOOT_INTERFACE=$(find_interface "$BOOT_MAC_ADDRESS"); do
done
if [ -z "$BOOT_INTERFACE" ]; then
echo "could not find an interface owns MAC=$BOOT_MAC_ADDRESS"
echo "Starting troubleshooting shell."
bash
troubleshoot
fi
readonly BOOT_INTERFACE
@ -123,8 +123,7 @@ if [ $? -ne 0 ]; then
ifconfig "$BOOT_INTERFACE" up
if [ $? -ne 0 ]; then
echo "Failed to up $BOOT_INTERFACE"
echo "Starting troubleshooting shell."
bash
troubleshoot
fi
fi
ifconfig "$BOOT_INTERFACE" "$BOOT_IP_ADDRESS" netmask "$BOOT_NETMASK"