Dr. Werner Fink 2014-04-30 13:17:33 +00:00 committed by Git OBS Bridge
parent b2594a462d
commit e40cfb30ad
3 changed files with 29 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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"