Skip to content

Commit

Permalink
OS-4357 nictagadm should not produce errors on SmartOS where USB key …
Browse files Browse the repository at this point in the history
…is missing
  • Loading branch information
joshwilsdon committed Jun 1, 2015
1 parent 95690db commit e19eef7
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/nictagadm
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,15 @@ function find_config_paths()
USB_CONFIG="${USB_MNT}/config"

if [[ -f ${USB_CONFIG_COPY} ]]; then
HAVE_USB=true
CONF_FILES="${USB_CONFIG_COPY} ${USB_CONFIG}"
# SmartOS w/o SDC does not have /mnt/usbkey, so when smartos=true, we'll
# not try to mount / umount a USB Key that won't exist. (OS-4357)
if [[ ${SYSINFO_Bootparam_smartos} == "true" ]]; then
HAVE_USB=
CONF_FILES="${USB_CONFIG_COPY}"
else
HAVE_USB=true
CONF_FILES="${USB_CONFIG_COPY} ${USB_CONFIG}"
fi
CONF=${USB_CONFIG_COPY}
verbose "Using config files: ${CONF_FILES}"
elif [[ -f ${USB_CONFIG} ]]; then
Expand Down Expand Up @@ -882,11 +889,12 @@ OPTIND=1

# Wait until after the VERBOSE has been set:
load_sdc_config
load_sdc_sysinfo
find_config_paths
trap cleanup EXIT

# If we netbooted, ensure that the tags conf file is initialized
[[ -z ${HAVE_USB} ]] && tag_conf_init
# If we have no /usbkey, ensure that the tags conf file is initialized
[[ -z ${HAVE_USB} && ! -f ${USB_CONFIG_COPY} ]] && tag_conf_init

for c in $CMD_LIST; do
if [[ "$1" -eq $c ]]; then
Expand Down

0 comments on commit e19eef7

Please sign in to comment.