* udev
@ 2004-08-08 22:47 Luke Kenneth Casson Leighton
2004-08-09 12:36 ` udev Luke Kenneth Casson Leighton
2004-08-09 12:40 ` udev Marco d'Itri
0 siblings, 2 replies; 20+ messages in thread
From: Luke Kenneth Casson Leighton @ 2004-08-08 22:47 UTC (permalink / raw)
To: SE-Linux, Linux Hotplug Dev List
[-- Attachment #1: Type: text/plain, Size: 1951 bytes --]
okay, combination of patches and mods.
1) xattr one which is up on http://hands.com/~lkcl/selinux/2.6.6
2) remove stuff which tells mount 'fscontext=' option to bog off
if it supports xattrs.
don't know if this patch is needed, don't care either.
ItWorksForMe(tm) hey for all i know i missed out an option
which makes it unnecessary to stop fscontext=....device_t
from working.
3) make mount take option fscontext=....device_t .... /dev
4) patch /etc/init.d/udev _and_ /etc/init.d/modutils to call a
little program /sbin/restoredevicefiles.
the horrible hack to make extra nodes in /dev needs to have
a restorecon done on each node so created: quickest way is
to do them all at once.
5) restoredevicefiles greps everything in /dev hey i just noticed
it only does /dev/* not /dev/*/* oh well.
i also had to copy /usr/bin/cut to /bin/cut hey there's probably
a way to do it with sed or something.
okayyy...
so, one this isn't going to deal with is drivers that don't do
/sys yet: those nodes aren't going to be generating hotplug events
and so consequently their contexts will be wrong.
e.g. /dev/nvidiactl with nvidia's 2.6 driver: i got away with this
one by putting it in /etc/modutils, hence /sbin/restoredevicefiles
catches it.
e.g. /dev/ppp does something weird:
pon a.usb.converter.with.serial.modem.on.it requests that i manually
do a mknod /dev/ppp, even though this is a 2.6.7 driver!
apparently this is a possible race condition unrelated to selinux.
i think that's it.
l.
--
--
Information I post is with honesty, integrity, and the expectation that
you will take full responsibility if acting on the information contained,
and that, should you find it to be flawed or even mildly useful, you
will act with both honesty and integrity in return - and tell me.
--
<a href="http://lkcl.net"> lkcl.net </a> <br />
<a href="mailto:lkcl@lkcl.net"> lkcl@lkcl.net </a> <br />
[-- Attachment #2: g --]
[-- Type: text/plain, Size: 1095 bytes --]
--- /etc/init.d/modutils.orig 2004-08-08 23:37:21.000000000 +0100
+++ /etc/init.d/modutils 2004-08-08 23:37:26.000000000 +0100
@@ -37,5 +37,10 @@
modprobe -a -t boot \*
fi
+# all devices created we must do the security contexts on them, oh dear.
+if [ -x /sbin/restoredevicefiles ]; then
+ /sbin/restoredevicefiles
+fi
+
exit 0
--- /etc/init.d/udev.orig 2004-08-08 23:30:25.000000000 +0100
+++ /etc/init.d/udev 2004-08-08 23:39:22.000000000 +0100
@@ -57,7 +57,7 @@
[ -d /.dev ] && mount --bind /dev /.dev
echo -n "Mounting a tmpfs over /dev..."
- mount -n -o size=$tmpfs_size,mode=0755 -t tmpfs none /dev
+ mount -n -o fscontext=system_u:object_r:device_t,size=$tmpfs_size,mode=0755 -t tmpfs none /dev
echo "done."
}
@@ -96,6 +96,11 @@
echo -n "Creating initial device nodes..."
$UDEVSTART
make_extra_nodes
+ # all extra nodes created we must do the security contexts on them, oh dear.
+ if [ -x /sbin/restoredevicefiles ]; then
+ /sbin/restoredevicefiles
+ fi
+
echo "done."
;;
remove)
@@ -133,3 +138,4 @@
exit 0
+
[-- Attachment #3: selinux-hooks.patch --]
[-- Type: text/plain, Size: 1110 bytes --]
Index: security/selinux/hooks.c
===================================================================
RCS file: /cvsroot/selinux/nsa/linux-2.6/security/selinux/hooks.c,v
retrieving revision 1.15
diff -u -u -r1.15 hooks.c
--- security/selinux/hooks.c 27 Jul 2004 17:43:11 -0000 1.15
+++ security/selinux/hooks.c 8 Aug 2004 21:39:46 -0000
@@ -385,6 +385,14 @@
break;
case Opt_fscontext:
+ /* lkcl: allow fscontext on file systems with xattr
+ * in order to be able to mount an xattr-enabled tmpfs
+ * on /dev with a different fscontext.
+ * reason: shmfs and tmpfs are mapped to two types
+ * but we need a third (e.g. udevfs_t) in order to
+ * not interfere with / have-to-add-to either tmp_t
+ * or shmfs_t
+ *
if (sbsec->behavior != SECURITY_FS_USE_XATTR) {
rc = -EINVAL;
printk(KERN_WARNING "SELinux: "
@@ -392,6 +400,7 @@
" this filesystem type\n");
goto out_free;
}
+ */
if (seen & (Opt_context|Opt_fscontext)) {
rc = -EINVAL;
printk(KERN_WARNING SEL_MOUNT_FAIL_MSG);
[-- Attachment #4: restoredevicefiles --]
[-- Type: text/plain, Size: 652 bytes --]
#!/bin/sh
#
# lkcl 2004aug08
#
# restore contexts on anything in /dev which has the default device_t
# file context.
#
# some things are meant to have device_t: hey, we set them too, makes
# no odds.
#
# we pass all of the devs to restorecon on one line because restorecon
# caches the lookups of the filecontexts: doing a restorecon one at a
# time takes 1/4 sec per device/dir/symlink...
devs=''
#for x in `ls -altrZ /dev/ | grep -v initctl | grep device_t | grep -v "_device_t" | cut -c64-`; do
for x in `ls -altrZ /dev/ | grep device_t | grep -v "_device_t" | cut -c64-`; do
echo $x
devs="$devs /dev/$x"
done;
echo $devs
/sbin/restorecon $devs
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: udev
2004-08-08 22:47 udev Luke Kenneth Casson Leighton
@ 2004-08-09 12:36 ` Luke Kenneth Casson Leighton
2004-08-09 12:40 ` udev Marco d'Itri
1 sibling, 0 replies; 20+ messages in thread
From: Luke Kenneth Casson Leighton @ 2004-08-09 12:36 UTC (permalink / raw)
To: SE-Linux, Linux Hotplug Dev List
these additions make it hardly necessary to add anything stackingly
significant to the selinux policy files.
in particular, no special exceptions for /dev/* because it's already
device_t by default (fscontext=....default_t)
no special stuff like having to create a udevfs_t and then going
through the policy looking for ways to add support for it *whew*.
no need to add "allow .... tmpfs_t or shmfs_t ... " stuff.
i _have_ had to add a few bits and pieces to allow init_t and initrc_t
access to /dev prior to /etc/init.d/udev starting.
i wish i knew if it was okay to swap the order of /etc/init.d/modutils
and /etc/init.d/udev.
l.
On Sun, Aug 08, 2004 at 11:47:37PM +0100, Luke Kenneth Casson Leighton wrote:
> okay, combination of patches and mods.
>
> 1) xattr one which is up on http://hands.com/~lkcl/selinux/2.6.6
>
> 2) remove stuff which tells mount 'fscontext=' option to bog off
> if it supports xattrs.
>
> don't know if this patch is needed, don't care either.
> ItWorksForMe(tm) hey for all i know i missed out an option
> which makes it unnecessary to stop fscontext=....device_t
> from working.
>
> 3) make mount take option fscontext=....device_t .... /dev
>
> 4) patch /etc/init.d/udev _and_ /etc/init.d/modutils to call a
> little program /sbin/restoredevicefiles.
>
> the horrible hack to make extra nodes in /dev needs to have
> a restorecon done on each node so created: quickest way is
> to do them all at once.
>
> 5) restoredevicefiles greps everything in /dev hey i just noticed
> it only does /dev/* not /dev/*/* oh well.
>
> i also had to copy /usr/bin/cut to /bin/cut hey there's probably
> a way to do it with sed or something.
-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: udev
2004-08-08 22:47 udev Luke Kenneth Casson Leighton
2004-08-09 12:36 ` udev Luke Kenneth Casson Leighton
@ 2004-08-09 12:40 ` Marco d'Itri
1 sibling, 0 replies; 20+ messages in thread
From: Marco d'Itri @ 2004-08-09 12:40 UTC (permalink / raw)
To: linux-hotplug
On Aug 09, Luke Kenneth Casson Leighton <lkcl@lkcl.net> wrote:
> 4) patch /etc/init.d/udev _and_ /etc/init.d/modutils to call a
> little program /sbin/restoredevicefiles.
I do not understand the point of running restoredevicefiles in the
modutils init script (which is ignored anyway on debian systems running
a 2.6 kernel).
--
ciao, |
Marco | [7477 sbpYhjZjM6uaE]
-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: udev
@ 2005-08-11 18:28 Greg KH
2005-08-11 18:29 ` udev Mike
` (11 more replies)
0 siblings, 12 replies; 20+ messages in thread
From: Greg KH @ 2005-08-11 18:28 UTC (permalink / raw)
To: linux-hotplug
On Thu, Aug 11, 2005 at 02:29:35PM -0400, Mike wrote:
> hey;
>
> I've setup Raid1 on two SATA drives on my FC3 system. as well there are
> several other SATA drives in the system that are not in the raid. I
> wanted to make static mappings to the /dev devices. I've created a rules
> file and according to the logs its reading the rules files I created.
>
> ...
> Aug 09 21:34:42 localhost udev[10536]: configured rule in
> '/etc/udev/rules.d/10-udev.rules' at line 4 applied, 'sdd' becomes '%k'
> Aug 09 21:34:42 localhost udev[10536]: creating device node '/dev/sdd'
> ...
>
> but if I remove on of the drives from the system. It will read the rules
> file only up to where the non present drive is then switch to the
> defaults which removes the satic maps and breaks the raid.
What does running udevtest show for that situation?
thanks,
greg k-h
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 20+ messages in thread
* udev
2005-08-11 18:28 udev Greg KH
@ 2005-08-11 18:29 ` Mike
2005-08-11 19:16 ` udev Greg KH
` (10 subsequent siblings)
11 siblings, 0 replies; 20+ messages in thread
From: Mike @ 2005-08-11 18:29 UTC (permalink / raw)
To: linux-hotplug
hey;
I've setup Raid1 on two SATA drives on my FC3 system. as well there are
several other SATA drives in the system that are not in the raid. I
wanted to make static mappings to the /dev devices. I've created a rules
file and according to the logs its reading the rules files I created.
...
Aug 09 21:34:42 localhost udev[10536]: configured rule in
'/etc/udev/rules.d/10-udev.rules' at line 4 applied, 'sdd' becomes '%k'
Aug 09 21:34:42 localhost udev[10536]: creating device node '/dev/sdd'
...
but if I remove on of the drives from the system. It will read the rules
file only up to where the non present drive is then switch to the
defaults which removes the satic maps and breaks the raid.
rules file:
BUS="scsi", ID="0:0:0:0", KERNEL="sda", NAME="%k"
BUS="scsi", ID="1:0:0:0", KERNEL="sdb", NAME="%k"
BUS="scsi", ID="1:0:0:0", KERNEL="sdb", NAME="%k"
BUS="scsi", ID="2:0:0:0", KERNEL="sdc", NAME="%k"
BUS="scsi", ID="3:0:0:0", KERNEL="sdd", NAME="%k"
BUS="scsi", ID="4:0:0:0", KERNEL="sde", NAME="%k"
BUS="scsi", ID="5:0:0:0", KERNEL="sdf", NAME="%k"
BUS="scsi", ID="6:0:0:0", KERNEL="sdg", NAME="%k"
If I'm doing something wrong or in anyone has and suggestions
thanks
Mike
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: udev
2005-08-11 18:28 udev Greg KH
2005-08-11 18:29 ` udev Mike
@ 2005-08-11 19:16 ` Greg KH
2005-08-11 19:21 ` udev Mike
` (9 subsequent siblings)
11 siblings, 0 replies; 20+ messages in thread
From: Greg KH @ 2005-08-11 19:16 UTC (permalink / raw)
To: linux-hotplug
On Thu, Aug 11, 2005 at 03:21:15PM -0400, Mike wrote:
> running udev on each disk gave me
>
> [root@localhost udev-065]# udevtest /sys/block/sdb
> version 039
> looking at '/block/sdb'
> configured rule in '/etc/udev/rules.d/10-udev.rules' at line 2 applied,
> added
> symlink 'raid11'
> configured rule in '/etc/udev/rules.d/10-udev.rules' at line 2 applied,
> 'sdb'
> becomes '%k'
> creating device node '/dev/sdb', major = '8', minor = '16', mode =
> '060660', uid
> = '0', gid = '6'
>
> for all the disk that were present. I removed sda before running the
> test. The sda drive returns looking at /block/sda and dosn't go any further.
I'm not sure I understand the problem then. Your example file did not
have a symlink in it, yet udevtest shows it applying one above...
thanks,
greg k-h
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: udev
2005-08-11 18:28 udev Greg KH
2005-08-11 18:29 ` udev Mike
2005-08-11 19:16 ` udev Greg KH
@ 2005-08-11 19:21 ` Mike
2005-08-11 19:36 ` udev Kay Sievers
` (8 subsequent siblings)
11 siblings, 0 replies; 20+ messages in thread
From: Mike @ 2005-08-11 19:21 UTC (permalink / raw)
To: linux-hotplug
running udev on each disk gave me
[root@localhost udev-065]# udevtest /sys/block/sdb
version 039
looking at '/block/sdb'
configured rule in '/etc/udev/rules.d/10-udev.rules' at line 2 applied,
added
symlink 'raid11'
configured rule in '/etc/udev/rules.d/10-udev.rules' at line 2 applied,
'sdb'
becomes '%k'
creating device node '/dev/sdb', major = '8', minor = '16', mode =
'060660', uid
= '0', gid = '6'
for all the disk that were present. I removed sda before running the
test. The sda drive returns looking at /block/sda and dosn't go any further.
thanks
Mike
Greg KH wrote:
> On Thu, Aug 11, 2005 at 02:29:35PM -0400, Mike wrote:
>
>>hey;
>>
>>I've setup Raid1 on two SATA drives on my FC3 system. as well there are
>>several other SATA drives in the system that are not in the raid. I
>>wanted to make static mappings to the /dev devices. I've created a rules
>>file and according to the logs its reading the rules files I created.
>>
>>...
>>Aug 09 21:34:42 localhost udev[10536]: configured rule in
>>'/etc/udev/rules.d/10-udev.rules' at line 4 applied, 'sdd' becomes '%k'
>>Aug 09 21:34:42 localhost udev[10536]: creating device node '/dev/sdd'
>>...
>>
>>but if I remove on of the drives from the system. It will read the rules
>>file only up to where the non present drive is then switch to the
>>defaults which removes the satic maps and breaks the raid.
>
>
> What does running udevtest show for that situation?
>
> thanks,
>
> greg k-h
>
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: udev
2005-08-11 18:28 udev Greg KH
` (2 preceding siblings ...)
2005-08-11 19:21 ` udev Mike
@ 2005-08-11 19:36 ` Kay Sievers
2005-08-12 15:33 ` udev Mike
` (7 subsequent siblings)
11 siblings, 0 replies; 20+ messages in thread
From: Kay Sievers @ 2005-08-11 19:36 UTC (permalink / raw)
To: linux-hotplug
On Thu, Aug 11, 2005 at 03:21:15PM -0400, Mike wrote:
> running udev on each disk gave me
>
> [root@localhost udev-065]# udevtest /sys/block/sdb
> version 039
> looking at '/block/sdb'
> configured rule in '/etc/udev/rules.d/10-udev.rules' at line 2 applied,
> added
> symlink 'raid11'
> configured rule in '/etc/udev/rules.d/10-udev.rules' at line 2 applied,
> 'sdb'
> becomes '%k'
> creating device node '/dev/sdb', major = '8', minor = '16', mode =
> '060660', uid
> = '0', gid = '6'
>
> for all the disk that were present. I removed sda before running the
> test. The sda drive returns looking at /block/sda and dosn't go any further.
I don't think that you can rely on the scsi enumeration to make stable
nodes, but I'm not entirely sure in your case.
Better try to read some persistent data from the drive itself like the
serial number. You may look at the persistent device naming rules:
http://kernel.org/git/gitweb.cgi?p=linux/hotplug/udev.git;a=blob;h“08f5068df7c1b2e0c994c63489069af054b362;hb‘7fd445bd9ade720776f661a4ad7c4b2202d6f0;f=etc/udev/gentoo/udev.rules#l246
and see if you can get unique properties from your drive with ata_id
or scsi_id.
Good luck,
Kay
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: udev
2005-08-11 18:28 udev Greg KH
` (3 preceding siblings ...)
2005-08-11 19:36 ` udev Kay Sievers
@ 2005-08-12 15:33 ` Mike
2005-08-12 18:03 ` udev Greg KH
` (6 subsequent siblings)
11 siblings, 0 replies; 20+ messages in thread
From: Mike @ 2005-08-12 15:33 UTC (permalink / raw)
To: linux-hotplug
The main problem I was having is that when the system starts and all the
drives are there udev used my rules file and everything works. The
moment the system starts and say sdc is missing, it will read the file
and apply the rules for sda and sdb, but not apply it to any other the
drives from that point on. The default system takes over, so a drive
that I need to be sdd ends up being sdc.
I had though about that, but wouldn't you have to regenerate the file
each time if there was a drive change? I figured the SCSI enumeration
would work the best, in the event of a fail the new drive can be plugged
in to the same particular channel and in be labeled correctly. I'll take
a look further in to the using the scsi_id
thanks
mike
Kay Sievers wrote:
> On Thu, Aug 11, 2005 at 03:21:15PM -0400, Mike wrote:
>
>>running udev on each disk gave me
>>
>>[root@localhost udev-065]# udevtest /sys/block/sdb
>>version 039
>>looking at '/block/sdb'
>>configured rule in '/etc/udev/rules.d/10-udev.rules' at line 2 applied,
>>added
>>symlink 'raid11'
>>configured rule in '/etc/udev/rules.d/10-udev.rules' at line 2 applied,
>>'sdb'
>>becomes '%k'
>>creating device node '/dev/sdb', major = '8', minor = '16', mode =
>>'060660', uid
>>= '0', gid = '6'
>>
>>for all the disk that were present. I removed sda before running the
>>test. The sda drive returns looking at /block/sda and dosn't go any further.
>
>
> I don't think that you can rely on the scsi enumeration to make stable
> nodes, but I'm not entirely sure in your case.
>
> Better try to read some persistent data from the drive itself like the
> serial number. You may look at the persistent device naming rules:
> http://kernel.org/git/gitweb.cgi?p=linux/hotplug/udev.git;a=blob;hÒ08f5068df7c1b2e0c994c63489069af054b362;hbÔ7fd445bd9ade720776f661a4ad7c4b2202d6f0;f=etc/udev/gentoo/udev.rules#l246
>
> and see if you can get unique properties from your drive with ata_id
> or scsi_id.
>
> Good luck,
> Kay
>
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: udev
2005-08-11 18:28 udev Greg KH
` (4 preceding siblings ...)
2005-08-12 15:33 ` udev Mike
@ 2005-08-12 18:03 ` Greg KH
2009-11-02 11:10 ` udev Oleg Puchinin
` (5 subsequent siblings)
11 siblings, 0 replies; 20+ messages in thread
From: Greg KH @ 2005-08-12 18:03 UTC (permalink / raw)
To: linux-hotplug
On Fri, Aug 12, 2005 at 11:33:09AM -0400, Mike wrote:
> The main problem I was having is that when the system starts and all the
> drives are there udev used my rules file and everything works. The
> moment the system starts and say sdc is missing, it will read the file
> and apply the rules for sda and sdb, but not apply it to any other the
> drives from that point on. The default system takes over, so a drive
> that I need to be sdd ends up being sdc.
>
> I had though about that, but wouldn't you have to regenerate the file
> each time if there was a drive change? I figured the SCSI enumeration
> would work the best, in the event of a fail the new drive can be plugged
> in to the same particular channel and in be labeled correctly. I'll take
> a look further in to the using the scsi_id
Yes, use scsi_id, or a sysfs attribute. Not the scsi enumerated number,
that will change all the time.
good luck,
greg k-h
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 20+ messages in thread
* udev
2005-08-11 18:28 udev Greg KH
` (5 preceding siblings ...)
2005-08-12 18:03 ` udev Greg KH
@ 2009-11-02 11:10 ` Oleg Puchinin
2009-11-02 11:50 ` udev Oleg Puchinin
` (4 subsequent siblings)
11 siblings, 0 replies; 20+ messages in thread
From: Oleg Puchinin @ 2009-11-02 11:10 UTC (permalink / raw)
To: linux-hotplug
Hello !
My name is Oleg. I am from Russia.
I build linux from scratch. Currently my system have busybox and libc.
I install udev, but it's not work.
$ /sbin/udevd --daemon
run, but do nothing (/dev/ is clean)
sysfs mounted to /sys
tmpfs mounted ot /dev
Please, helpl my.
Oleg.
^ permalink raw reply [flat|nested] 20+ messages in thread
* udev
2005-08-11 18:28 udev Greg KH
` (6 preceding siblings ...)
2009-11-02 11:10 ` udev Oleg Puchinin
@ 2009-11-02 11:50 ` Oleg Puchinin
2009-11-02 14:35 ` udev Andrey Borzenkov
` (3 subsequent siblings)
11 siblings, 0 replies; 20+ messages in thread
From: Oleg Puchinin @ 2009-11-02 11:50 UTC (permalink / raw)
To: linux-hotplug
Здравуствуйте !
Простите, что на русском, с английским туго.
Так вот. Собираю свою систему (с нуля). Установил busybox и libc.
Затем установил в / udev . Пробую запускать
$ /sbin/udevd --daemon
Запускается, но /dev остается девственно пустым. Подскажите,
пожалуйста , в чем может быть проблема ?
sysfs смонтирован на /sys
proc на /proc
tmpfs на /dev
Олег.
ЪТХ╨{.nг+┴╥÷╝┴╜├+%┼кЪ╠Ищ╤\x17╔┼wЪ╨{.nг+┴╥╔┼{╠Ч\x1a-╕[═Ч)М┘ФХw*\x1fjg╛╠╗\x1e╤┴ ▌┼щ╒jЪ╬\a╚ЧG╚²ИЪ╒╦\f╒╥╕j:+v┴╗┼wХjьm╤÷ЪЧЬ\x1e╞Ы\x1e╝w╔Ч┼ЮЧfё╒╥h ▐Б²ЗЪ├ы╔
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: udev
2005-08-11 18:28 udev Greg KH
` (7 preceding siblings ...)
2009-11-02 11:50 ` udev Oleg Puchinin
@ 2009-11-02 14:35 ` Andrey Borzenkov
2009-11-02 16:57 ` udev Alan Jenkins
` (2 subsequent siblings)
11 siblings, 0 replies; 20+ messages in thread
From: Andrey Borzenkov @ 2009-11-02 14:35 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: Text/Plain, Size: 565 bytes --]
On Monday 02 of November 2009 14:10:56 Oleg Puchinin wrote:
> Hello !
> My name is Oleg. I am from Russia.
> I build linux from scratch. Currently my system have busybox and
> libc. I install udev, but it's not work.
> $ /sbin/udevd --daemon
> run, but do nothing (/dev/ is clean)
> sysfs mounted to /sys
> tmpfs mounted ot /dev
>
udevd only responds to external events. To force udevd to (re-)create
nodes for devices that already exist run "udevadm trigger". You can
further fine tune which devices will be triggered; look at udevadm
manual.
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: udev
2005-08-11 18:28 udev Greg KH
` (8 preceding siblings ...)
2009-11-02 14:35 ` udev Andrey Borzenkov
@ 2009-11-02 16:57 ` Alan Jenkins
2011-03-22 19:48 ` Udev Paulo Eliseu Weber
2011-03-22 19:58 ` Udev Kay Sievers
11 siblings, 0 replies; 20+ messages in thread
From: Alan Jenkins @ 2009-11-02 16:57 UTC (permalink / raw)
To: linux-hotplug
On 11/2/09, Andrey Borzenkov <arvidjaar@mail.ru> wrote:
> On Monday 02 of November 2009 14:10:56 Oleg Puchinin wrote:
>> Hello !
>> My name is Oleg. I am from Russia.
>> I build linux from scratch. Currently my system have busybox and
>> libc. I install udev, but it's not work.
>> $ /sbin/udevd --daemon
>> run, but do nothing (/dev/ is clean)
>> sysfs mounted to /sys
>> tmpfs mounted ot /dev
>>
>
> udevd only responds to external events. To force udevd to (re-)create
> nodes for devices that already exist run "udevadm trigger". You can
> further fine tune which devices will be triggered; look at udevadm
> manual.
You probably also want to wait for the device nodes to be created,
using udevadm settle.
Alan
^ permalink raw reply [flat|nested] 20+ messages in thread
* UDEV.
@ 2010-08-18 9:51 Тима
2010-08-18 12:49 ` UDEV Greg KH
` (2 more replies)
0 siblings, 3 replies; 20+ messages in thread
From: Тима @ 2010-08-18 9:51 UTC (permalink / raw)
To: linux-hotplug
Hello All!
My name is Tima, I'm embedded software developer.
I'm working on driver for Satellite Digital Video Receiver.
May I ask some question about UDEV?
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: UDEV.
2010-08-18 9:51 UDEV Тима
@ 2010-08-18 12:49 ` Greg KH
2010-08-19 15:27 ` UDEV Greg KH
2010-08-24 12:50 ` UDEV Greg KH
2 siblings, 0 replies; 20+ messages in thread
From: Greg KH @ 2010-08-18 12:49 UTC (permalink / raw)
To: linux-hotplug
On Wed, Aug 18, 2010 at 01:51:11PM +0400, ???? wrote:
> Hello All!
> My name is Tima, I'm embedded software developer.
> I'm working on driver for Satellite Digital Video Receiver.
>
> May I ask some question about UDEV?
You never have to ask the question "can I ask a question?" :)
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: UDEV.
2010-08-18 9:51 UDEV Тима
2010-08-18 12:49 ` UDEV Greg KH
@ 2010-08-19 15:27 ` Greg KH
2010-08-24 12:50 ` UDEV Greg KH
2 siblings, 0 replies; 20+ messages in thread
From: Greg KH @ 2010-08-19 15:27 UTC (permalink / raw)
To: linux-hotplug
A: No.
Q: Should I include quotations after my reply?
http://daringfireball.net/2007/07/on_top
On Thu, Aug 19, 2010 at 07:07:40PM +0400, ???? wrote:
> Thanks.
> My question (I think) is very easy. But I could not find answer in the Internet, and did not get it on forum.
> My aim is to make UDEV create device node automatically on loading module.
> I tied rule:
> KERNEL="math", NAME="math"
> meaning my device name (register char dev) is "math" and the node name I want is "math".
> But nothing happens.
> Is there any possibility to make such rule?
> Maybe I do not export some required information to SysFS?
> If you need module code I can send it to you with Makefile.
Yes, please post your kernel code. You need to hook into the driver
model to properly be able to have udev pick up your device information.
Have you done that?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: UDEV.
2010-08-18 9:51 UDEV Тима
2010-08-18 12:49 ` UDEV Greg KH
2010-08-19 15:27 ` UDEV Greg KH
@ 2010-08-24 12:50 ` Greg KH
2 siblings, 0 replies; 20+ messages in thread
From: Greg KH @ 2010-08-24 12:50 UTC (permalink / raw)
To: linux-hotplug
On Tue, Aug 24, 2010 at 01:27:15PM +0400, Тима wrote:
> >
> > A: No.
> > Q: Should I include quotations after my reply?
> >
> > http://daringfireball.net/2007/07/on_top
> >
> > On Thu, Aug 19, 2010 at 07:07:40PM +0400, ???? wrote:
> > > Thanks.
> > > My question (I think) is very easy. But I could not find answer in the Internet, and did not get it on forum.
> > > My aim is to make UDEV create device node automatically on loading module.
> > > I tied rule:
> > > KERNEL="math", NAME="math"
> > > meaning my device name (register char dev) is "math" and the node name I want is "math".
> > > But nothing happens.
> > > Is there any possibility to make such rule?
> > > Maybe I do not export some required information to SysFS?
> > > If you need module code I can send it to you with Makefile.
> >
> > Yes, please post your kernel code. You need to hook into the driver
> > model to properly be able to have udev pick up your device information.
> > Have you done that?
> >
> > thanks,
> >
> > greg k-h
>
> Yes, here is my code.
> (Sorry for comments in russian. If you need something to understand -
> ask me and I'll translate it.) I want kernel to make, for example,
> /dev/math on loading this module. What should I add to this code or to
> UDEV rules?
You need to tie into a class somehow.
The easiest way to do this is to make your driver a 'misc' device and
call misc_register() to get a minor number and register your
file_operations structure. That infrastructure will then set up
everything properly so that udev will automatically create your device
node.
If you don't want to do that, then you need to create your own 'struct
class' and register a device with it after you register your chardev.
See the kernel for lots of examples of how to do this.
Hope this helps,
greg k-h
^ permalink raw reply [flat|nested] 20+ messages in thread
* Udev
2005-08-11 18:28 udev Greg KH
` (9 preceding siblings ...)
2009-11-02 16:57 ` udev Alan Jenkins
@ 2011-03-22 19:48 ` Paulo Eliseu Weber
2011-03-22 19:58 ` Udev Kay Sievers
11 siblings, 0 replies; 20+ messages in thread
From: Paulo Eliseu Weber @ 2011-03-22 19:48 UTC (permalink / raw)
To: linux-hotplug
Hello,
I wonder which version of Udev is compatible with kernel 2.6.16 (Debian).
Thanks.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Udev
2005-08-11 18:28 udev Greg KH
` (10 preceding siblings ...)
2011-03-22 19:48 ` Udev Paulo Eliseu Weber
@ 2011-03-22 19:58 ` Kay Sievers
11 siblings, 0 replies; 20+ messages in thread
From: Kay Sievers @ 2011-03-22 19:58 UTC (permalink / raw)
To: linux-hotplug
On Tue, Mar 22, 2011 at 20:48, Paulo Eliseu Weber
<pauloe.weber@yahoo.com.br> wrote:
> I wonder which version of Udev is compatible with kernel 2.6.16 (Debian).
This is the upstream development list, where almost nobody runs such
old stuff anymore. Please try if the Debian guys know anything about
it, there are much more distro specific dependencies than kernel ones.
Kay
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2011-03-22 19:58 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-11 18:28 udev Greg KH
2005-08-11 18:29 ` udev Mike
2005-08-11 19:16 ` udev Greg KH
2005-08-11 19:21 ` udev Mike
2005-08-11 19:36 ` udev Kay Sievers
2005-08-12 15:33 ` udev Mike
2005-08-12 18:03 ` udev Greg KH
2009-11-02 11:10 ` udev Oleg Puchinin
2009-11-02 11:50 ` udev Oleg Puchinin
2009-11-02 14:35 ` udev Andrey Borzenkov
2009-11-02 16:57 ` udev Alan Jenkins
2011-03-22 19:48 ` Udev Paulo Eliseu Weber
2011-03-22 19:58 ` Udev Kay Sievers
-- strict thread matches above, loose matches on Subject: below --
2010-08-18 9:51 UDEV Тима
2010-08-18 12:49 ` UDEV Greg KH
2010-08-19 15:27 ` UDEV Greg KH
2010-08-24 12:50 ` UDEV Greg KH
2004-08-08 22:47 udev Luke Kenneth Casson Leighton
2004-08-09 12:36 ` udev Luke Kenneth Casson Leighton
2004-08-09 12:40 ` udev Marco d'Itri
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).