FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Kernel

 
 
LinkBack Thread Tools
 
Old 06-05-2010, 09:44 PM
Steffen Maier
 
Default Get netdev name without CONFIG_SYSFS_DEPRECATED_V2 in linuxrc.s390 (#596826)

Linuxrc.s390 used to read the symlink net:<netdev> to get the name
of the just configured network device of type lcs or ctc.
This symlink only exists if the kernel is compiled with
CONFIG_SYSFS_DEPRECATED_V2.
Since more recent kernel are built without that option, we read
the content of directory 'net' which is another directory having the
name of the network device.
---
loader/linuxrc.s390 | 13 +++----------
1 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/loader/linuxrc.s390 b/loader/linuxrc.s390
index 7755e1d..093e38d 100644
--- a/loader/linuxrc.s390
+++ b/loader/linuxrc.s390
@@ -640,18 +640,11 @@ function set_device_online() {
fi
done
if [ "$NETTYPE" = "lcs" -o "$NETTYPE" = "ctc" ]; then
- # KH FIXME: Workaround for missing sysfs interface
- # DEVICE=$(cat /sys/devices/lcs/${SUBCHANNELS//,*/}/if_name)
- # replaced with flexible solution:
- # https://bugzilla.redhat.com/show_bug.cgi?id=204803#c9
- # "sys/bus/ccwgroup/devices/${SUBCHANNEL}/net:*
- # for lcs after setting online"
- if [ ! -h /sys/devices/${sysnettype}/$SCH_R_DEVBUSID/net:* ]; then
- echo $"Device $SUBCHANNELS does not have required sysfs attribute 'net:*'"
+ if [ ! -d /sys/devices/${sysnettype}/$SCH_R_DEVBUSID/net ]; then
+ echo $"Device $SUBCHANNELS does not have required sysfs directory 'net'"
return 1
fi
- DEVICE=$(echo /sys/devices/${sysnettype}/$SCH_R_DEVBUSID/net:*)
- DEVICE=${DEVICE//*:/}
+ DEVICE=$(ls /sys/devices/${sysnettype}/$SCH_R_DEVBUSID/net/)
if [ "$DEVICE" = "" ]; then
echo $"Could not get device name for $SUBCHANNELS"
return 1
--
1.7.0.4


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 06-11-2010, 08:42 PM
David Cantrell
 
Default Get netdev name without CONFIG_SYSFS_DEPRECATED_V2 in linuxrc.s390 (#596826)

Ack, applying.

On Sat, 5 Jun 2010, Steffen Maier wrote:


Linuxrc.s390 used to read the symlink net:<netdev> to get the name
of the just configured network device of type lcs or ctc.
This symlink only exists if the kernel is compiled with
CONFIG_SYSFS_DEPRECATED_V2.
Since more recent kernel are built without that option, we read
the content of directory 'net' which is another directory having the
name of the network device.
---
loader/linuxrc.s390 | 13 +++----------
1 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/loader/linuxrc.s390 b/loader/linuxrc.s390
index 7755e1d..093e38d 100644
--- a/loader/linuxrc.s390
+++ b/loader/linuxrc.s390
@@ -640,18 +640,11 @@ function set_device_online() {
fi
done
if [ "$NETTYPE" = "lcs" -o "$NETTYPE" = "ctc" ]; then
- # KH FIXME: Workaround for missing sysfs interface
- # DEVICE=$(cat /sys/devices/lcs/${SUBCHANNELS//,*/}/if_name)
- # replaced with flexible solution:
- # https://bugzilla.redhat.com/show_bug.cgi?id=204803#c9
- # "sys/bus/ccwgroup/devices/${SUBCHANNEL}/net:*
- # for lcs after setting online"
- if [ ! -h /sys/devices/${sysnettype}/$SCH_R_DEVBUSID/net:* ]; then
- echo $"Device $SUBCHANNELS does not have required sysfs attribute 'net:*'"
+ if [ ! -d /sys/devices/${sysnettype}/$SCH_R_DEVBUSID/net ]; then
+ echo $"Device $SUBCHANNELS does not have required sysfs directory 'net'"
return 1
fi
- DEVICE=$(echo /sys/devices/${sysnettype}/$SCH_R_DEVBUSID/net:*)
- DEVICE=${DEVICE//*:/}
+ DEVICE=$(ls /sys/devices/${sysnettype}/$SCH_R_DEVBUSID/net/)
if [ "$DEVICE" = "" ]; then
echo $"Could not get device name for $SUBCHANNELS"
return 1



--
David Cantrell <dcantrell@redhat.com>
Red Hat / Honolulu, HI

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 01:02 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org