Lines 502-507
Link Here
|
502 |
elog "http://wiki.gentoo.org/wiki/Udev" |
502 |
elog "http://wiki.gentoo.org/wiki/Udev" |
503 |
elog "http://wiki.gentoo.org/wiki/Udev/upgrade" |
503 |
elog "http://wiki.gentoo.org/wiki/Udev/upgrade" |
504 |
|
504 |
|
|
|
505 |
# If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null, |
506 |
# do the same for 80-net-setup-link.rules to keep the old behavior |
507 |
local net_move=no |
508 |
local net_name_slot_sym=0 |
509 |
local net_rules_path="${ROOT}"/etc/udev/rules.d |
510 |
local net_name_slot="${net_rules_path}"/80-net-name-slot.rules |
511 |
local net_setup_link="${net_rules_path}"/80-net-setup-link.rules |
512 |
if [[ -e ${net_setup_link} ]]; then |
513 |
net_move=no |
514 |
else |
515 |
[[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]] && net_move=yes |
516 |
if [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then |
517 |
net_move=yes |
518 |
net_name_slot_sym=1 |
519 |
fi |
520 |
fi |
521 |
if [[ ${net_move} == yes ]]; then |
522 |
ebegin "Because empty ${net_name_slot} was detected, we're adding ${net_setup_link}" |
523 |
|
524 |
if [[ ${net_name_slot_sym} ]]; then |
525 |
ln -nfs /dev/null "${net_setup_link}" |
526 |
else |
527 |
cp "${net_name_slot}" "${net_setup_link}" |
528 |
fi |
529 |
eend $? |
530 |
fi |
531 |
|
505 |
# Update hwdb database in case the format is changed by udev version. |
532 |
# Update hwdb database in case the format is changed by udev version. |
506 |
if has_version 'sys-apps/hwids[udev]'; then |
533 |
if has_version 'sys-apps/hwids[udev]'; then |
507 |
udevadm hwdb --update --root="${ROOT%/}" |
534 |
udevadm hwdb --update --root="${ROOT%/}" |