From e3942eb3d123e6fb9d1249b9bf13727c4d1fb07e806ab1827445b21b6214ac9d Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Wed, 30 Apr 2014 13:17:33 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=612 --- systemd-mini.changes | 5 +++++ systemd.changes | 5 +++++ udev-generate-peristent-rule.sh | 19 +++++++++++++++++++ 3 files changed, 29 insertions(+) diff --git a/systemd-mini.changes b/systemd-mini.changes index f8a5332c..6947b0b8 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 f8a5332c..6947b0b8 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 89956e18..8ffdd567 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"