diff --git a/systemd-mini.changes b/systemd-mini.changes index f8a5332..6947b0b 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Apr 30 12:14:32 UTC 2014 - werner@suse.de + +- Update udev-generate-peristent-rule.sh from latest git + ------------------------------------------------------------------- Wed Apr 30 10:55:54 UTC 2014 - werner@suse.de diff --git a/systemd.changes b/systemd.changes index f8a5332..6947b0b 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Apr 30 12:14:32 UTC 2014 - werner@suse.de + +- Update udev-generate-peristent-rule.sh from latest git + ------------------------------------------------------------------- Wed Apr 30 10:55:54 UTC 2014 - werner@suse.de diff --git a/udev-generate-peristent-rule.sh b/udev-generate-peristent-rule.sh index 89956e1..8ffdd56 100644 --- a/udev-generate-peristent-rule.sh +++ b/udev-generate-peristent-rule.sh @@ -192,6 +192,18 @@ valid_mac() echo $valid_macaddr } +valid_dev_type() +{ + local dev_type="$1" + + case "$dev_type" in + [0-32]) + echo "$dev_type" ;; + *) + echo "invalid" ;; + esac +} + generate_comment() { local pci_id="$1" @@ -272,6 +284,10 @@ list_adapters() for _dev in $SYSPATH/*; do if [ -L "$_dev/device" ]; then + local _dev_type="$(cat $_dev/type 2>/dev/null)" + if [ "$(valid_dev_type $_dev_type)" == "invalid" ]; then + continue; + fi _dev="$(basename $_dev 2>/dev/null)" netdev[$count]="$_dev" count=$((count + 1)) @@ -445,6 +461,9 @@ dev_type="$(get_type $path)" if [ -z "$dev_type" ]; then log_error "unable to retrieve dev_type for interface $interface." exit 1 +elif [ "$(valid_dev_type $dev_type)" == "invalid" ]; then + log_info "$interface not a supported device." + exit 1 fi [ "$use_verbose" -eq 1 ] && echo "I: TYPE=$dev_type"