You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
(40) |
Apr
(76) |
May
(31) |
Jun
(39) |
Jul
(44) |
Aug
(87) |
Sep
(32) |
Oct
(23) |
Nov
(36) |
Dec
(10) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(49) |
Sep
(14) |
Oct
|
Nov
|
Dec
(1) |
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(63) |
Aug
(95) |
Sep
(39) |
Oct
(61) |
Nov
(75) |
Dec
(118) |
2009 |
Jan
(25) |
Feb
(37) |
Mar
(20) |
Apr
(15) |
May
(14) |
Jun
(48) |
Jul
(82) |
Aug
(160) |
Sep
(94) |
Oct
(55) |
Nov
(59) |
Dec
(4) |
2010 |
Jan
(5) |
Feb
(17) |
Mar
(6) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
|
2011 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
(1) |
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
(1) |
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: Vanger <fa...@gm...> - 2006-03-21 16:23:23
|
Well, yes, I thought it is a known fact. It may be interesting, that 2.6 kernel needs 32 MBs of memory minimum. While 2.4 kernel runs good on the machines with 16MBs on board. Why is it - I have a strong feeling, that it is something with sheduler(). It was complicated to use the resources of modern computers more efficiently. I didn't do benchmarkings too, but modern computer (Athlon64 2800+) seems to run faster on 2.6 kernel, then on 2.4. I'm risking to be severly beaten, but this is the same situation as with Win98 and WinXP kernels ;) . 2006/3/20, HQX Net <hq...@gm...>: > FWIW, I have the same feeling with 5.1 std in my P1 233 - 64 ram. > But I am (was?) uncertain of whether it is true or just my imagination, I > couldn' t put my finger on it, and I never did any benchmarking. > > > On 3/20/06, Marcel Beekman <ma...@we...> wrote: > > > > Hi, > > > > I have been testing and optimizing services for VL 5.1 std, VL 5.0.1 SO= HO > > and VL 5.1.1 SOHO. With newer machines Amd 700 / PIII the 2.6 kernel wo= rks > > fine and there is no noticable loss of speed. However with slower machi= nes > > the 2.6 kernel is slowing things down. I can't figure out where the > > problem is. On my testing laptop PII 266Mhz, 64 MB VL 5.1 std (IceWm) i= s > > way to slow. With a stripped down 5.0.1 SOHO (IceWm) it runs fine for > > browsing/e-mail/typing letters/the gimp/programming with Gambas. > > > > Regards, > > > > Marcel (webmouse) > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by xPML, a groundbreaking scripting > > language > > that extends applications into web and mobile media. Attend the live > > webcast > > and join the prime developer group breaking into this new coding > > territory! > > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D110944&bid=3D241720&dat= =3D121642 > > _______________________________________________ > > Vectorlinux-devel mailing list > > Vec...@li... > > https://lists.sourceforge.net/lists/listinfo/vectorlinux-devel > > > > |
From: HQX N. <hq...@gm...> - 2006-03-20 10:46:45
|
FWIW, I have the same feeling with 5.1 std in my P1 233 - 64 ram. But I am (was?) uncertain of whether it is true or just my imagination, I couldn' t put my finger on it, and I never did any benchmarking. On 3/20/06, Marcel Beekman <ma...@we...> wrote: > > Hi, > > I have been testing and optimizing services for VL 5.1 std, VL 5.0.1 SOHO > and VL 5.1.1 SOHO. With newer machines Amd 700 / PIII the 2.6 kernel work= s > fine and there is no noticable loss of speed. However with slower machine= s > the 2.6 kernel is slowing things down. I can't figure out where the > problem is. On my testing laptop PII 266Mhz, 64 MB VL 5.1 std (IceWm) is > way to slow. With a stripped down 5.0.1 SOHO (IceWm) it runs fine for > browsing/e-mail/typing letters/the gimp/programming with Gambas. > > Regards, > > Marcel (webmouse) > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting > language > that extends applications into web and mobile media. Attend the live > webcast > and join the prime developer group breaking into this new coding > territory! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D110944&bid=3D241720&dat= =3D121642 > _______________________________________________ > Vectorlinux-devel mailing list > Vec...@li... > https://lists.sourceforge.net/lists/listinfo/vectorlinux-devel > |
From: Marcel B. <ma...@we...> - 2006-03-20 09:42:30
|
Hi, I have been testing and optimizing services for VL 5.1 std, VL 5.0.1 SOHO and VL 5.1.1 SOHO. With newer machines Amd 700 / PIII the 2.6 kernel works fine and there is no noticable loss of speed. However with slower machines the 2.6 kernel is slowing things down. I can't figure out where the problem is. On my testing laptop PII 266Mhz, 64 MB VL 5.1 std (IceWm) is way to slow. With a stripped down 5.0.1 SOHO (IceWm) it runs fine for browsing/e-mail/typing letters/the gimp/programming with Gambas. Regards, Marcel (webmouse) |
From: Sriram D. <sri...@gm...> - 2006-03-17 00:25:47
|
hi ukbill, i remember this was proposed on the forum some tiem ago. I totally agree with you on this one. example: when firefox or soem KDE apps crash.. we ge= t a dialog box which allows you to send any info. if we have an option like that in vasm, which can collect system diagnostics from time to time or whe= n ever you want it. we can have a reference and also it is easy for any one t= o flaunch vasm, chose their option and save the file or send it to some location , if sending email is possible. while we are at it, is there a "Dashboard" for the next major version of V= L ? like 6.0 ? like what are our priorities, when do we know we have a good RC? what are the major activities in terms of features etc../ who are the people who own it/ how do we track etc? i think having an easy diagnostic and feedback tool is essential and shoul= d be on the top of such a priority list. cheers ram On 3/15/06, HQX Net <hq...@gm...> wrote: > > Hi, > Thank you inviting me to the list, this is UKBill for those wondering > about the mail address. > > Coders probably will not like this idea, but it has been lurking my > mind from some time now. > > Taking John's request further and looking at making forum support > easier, how about a little "Help/About" application that would... > > * Run in CLI and TUI mode, ala VASM > * Tell the user which version he/she is running > * Give a remainder about the included Docs > * Ask what the problem is related to (cards, services, ??), then > --> collect some data (lsmod, lspci, chip speed, mem amount, etc), > --> dump it to a file and instruct the user to post this file to the > forum. > * It should also give some help about how to handle that file in a > b0rked situation, such as no X working, no network, etc. We all now > that newcomers often dont know how to past from terminals etc. > > Regards. > UKB. > > > > Good morning! > > > > With the proliferation of different versions of VL (live, SOHO, > standard, > > deluxe and permutations thereof), I would like to request that the > > /etc/vector-version file clearly state the version as specifically as > > possible. For example, if the release is VL standard 5.1 Live RC2, we > could > > state VectorLinux 5.1 LiveRC2 as the version. For a SOHO release, we > should > > state something like this: VectorLinux 5.1 SOHO Live3 or VectorLinux 5.= 1 > > SOHO . Finally, for a Deluxe version we should state the version as > > VectorLinux 5.1 SOHO Deluxe. > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting > language > that extends applications into web and mobile media. Attend the live > webcast > and join the prime developer group breaking into this new coding > territory! > http://sel.as-us.falkag.net/sel?cmdlnk&kid=110944&bid$1720&dat=121642 > _______________________________________________ > Vectorlinux-devel mailing list > Vec...@li... > https://lists.sourceforge.net/lists/listinfo/vectorlinux-devel > |
From: HQX N. <hq...@gm...> - 2006-03-16 01:37:32
|
Hi, Thank you inviting me to the list, this is UKBill for those wondering about the mail address. Coders probably will not like this idea, but it has been lurking my mind from some time now. Taking John's request further and looking at making forum support easier, how about a little "Help/About" application that would... * Run in CLI and TUI mode, ala VASM * Tell the user which version he/she is running * Give a remainder about the included Docs * Ask what the problem is related to (cards, services, ??), then --> collect some data (lsmod, lspci, chip speed, mem amount, etc), --> dump it to a file and instruct the user to post this file to the forum. * It should also give some help about how to handle that file in a b0rked situation, such as no X working, no network, etc. We all now that newcomers often dont know how to past from terminals etc. Regards. UKB. > Good morning! > > With the proliferation of different versions of VL (live, SOHO, standard, > deluxe and permutations thereof), I would like to request that the > /etc/vector-version file clearly state the version as specifically as > possible. For example, if the release is VL standard 5.1 Live RC2, we cou= ld > state VectorLinux 5.1 LiveRC2 as the version. For a SOHO release, we shou= ld > state something like this: VectorLinux 5.1 SOHO Live3 or VectorLinux 5.1 > SOHO . Finally, for a Deluxe version we should state the version as > VectorLinux 5.1 SOHO Deluxe. |
From: Jose J. R. <jo...@gm...> - 2006-03-12 19:19:34
|
On 3/12/06, John B <joh...@gm...> wrote: > Good morning! > > With the proliferation of different versions of VL (live, SOHO, standard, > deluxe and permutations thereof), I would like to request that the > /etc/vector-version file clearly state the version as specifically as > possible. For example, if the release is VL standard 5.1 Live RC2, we cou= ld > state VectorLinux 5.1 LiveRC2 as the version. For a SOHO release, we shou= ld > state something like this: VectorLinux 5.1 SOHO Live3 or VectorLinux 5.1 > SOHO . Finally, for a Deluxe version we should state the version as > VectorLinux 5.1 SOHO Deluxe. I discussed a related issue a while back with some of you (sorry, bad memory, lol), regarding a way to implement version-related package dependency. By this I mean that a package has a dep on SOHO 5.1, for example, and will not install on SOHO 5.0, etc. The solution proposed at the time, IIRC, was a dummy package with the VL version, which could be used as a dep inside the app packages. A problem remaining with this is that some packages should install to both Standard and SOHO versions, while others might not be designed that way. If the neccesary SOHO packages are deps of the package, then it should pull them into Standard and work, but sometimes Standard has some basic differences with the corresponding SOHO that might defeat this. Solutions to this that come to mind are: 1) Establishing separate package repos for Std and SOHO, 2) working from the "base" VL we've been discussing for 6.0 and not changing anything critical that comes from it before release of both Std and SOHO. Regards, Joe1962 |
From: John B <joh...@gm...> - 2006-03-12 16:28:37
|
Good morning! With the proliferation of different versions of VL (live, SOHO, standard, deluxe and permutations thereof), I would like to request that the /etc/vector-version file clearly state the version as specifically as possible. For example, if the release is VL standard 5.1 Live RC2, we could state VectorLinux 5.1 LiveRC2 as the version. For a SOHO release, we should state something like this: VectorLinux 5.1 SOHO Live3 or VectorLinux 5.1SOH= O . Finally, for a Deluxe version we should state the version as VectorLinux 5.1 SOHO Deluxe. The reason I am bringing this up is that helping new users will be easier i= f we can tell them to type cat /etc/vector-version in a terminal and have the= m post the result in the forum, rather than telling them to just "guess" at what they downloaded. Truth be told, some users aren't sure whether they downloaded VL or not. This particular thread from the forum is a great example of why this e-mail: http://www.vectorlinux.com/forum/viewtopic.php?p=3D58502#58502 The OP in that thread claims to be using VL Deluxe, yet the symptoms he's posting don't necessarily reflect that, unless he's using a deluxe version of 5.1 standard. Thanks for your consideration, John |
From: uel a. <ue...@gm...> - 2006-03-12 07:36:12
|
sorry I forgot to mention that I tried first on a 2.6.15.6 with the exact same results [root@vector/usr/src/linux-2.6.15.6]# patch -p1 <uevent* patching file drivers/base/class.c Hunk #1 FAILED at 442. 1 out of 1 hunk FAILED -- saving rejects to file drivers/base/class.c.rej missing header for unified diff at line 23 of patch can't find file to patch at input line 23 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- | { | kobj_set_kset_s(class_dev, class_obj_subsys); | -------------------------- On 3/11/06, Tony Brijeski <tb...@gm...> wrote: > > looks like it might require at least a 2.6.15 kernel but I'm trying to > confirm that. If that is the case, then we should just wait a couple wee= ks > and have 2.6.16 that already has it included. > > > > On 3/11/06, Tony Brijeski <tb...@gm...> wrote: > > > > I'm looking into it now. Will let you know what I come up with. You > > are patching correctly but something is wrong with the patch. > > > > > > > > > > On 3/11/06, uel archuletta <ue...@gm...> wrote: > > > > > > I tried to patch the kernel like this > > > [root@vector/usr/src/linux-2.6.13-Uevent]# patch -p1 <uevent* > > > patching file drivers/base/class.c > > > Hunk #1 FAILED at 442. > > > 1 out of 1 hunk FAILED -- saving rejects to file > > > drivers/base/class.c.rej > > > missing header for unified diff at line 23 of patch > > > can't find file to patch at input line 23 > > > Perhaps you used the wrong -p or --strip option? > > > The text leading up to this was: > > > -------------------------- > > > > > > | { > > > | kobj_set_kset_s(class_dev, class_obj_subsys); > > > | > > > -------------------------- > > > any ideas what I am doing wrong? > > > > > > > > > > > > On 3/9/06, Tony Brijeski <tb...@gm...> wrote: > > > > > > > > You just have to make sure you enable uevent in the kernel. > > > > > > > > I also forgot to mention you must keep hotplug from running - it is > > > > in the sysvinit section. Just chmod 644 the hotplug script and tha= t should > > > > work. > > > > > > > > I would recommend renaming rc.udev to rc.udev.orig and create the > > > > new rc.udev with the 5 or so lines needed to set udev up for uevent= . > > > > > > > > Regards, > > > > Tony > > > > > > > > > > > > > > > > On 3/9/06, Sriram Durbha <sri...@gm...> wrote: > > > > > > > > > > hi folks, > > > > > the kernel is at 2.6.16-rc5 now .. i hope it will be ready in a > > > > > few weeks time. > > > > > would i be missing something tony is doing if i just took the > > > > > 2.6.16-rc5 kernel and follwed the other instructions abt hot/cold > > > > > plog removal ? > > > > > cheers > > > > > ram > > > > > > > > > > > > > > > On 3/9/06, Tony Brijeski < tb...@gm...> wrote: > > > > > > > > > > > > Here is the patch. It adds a uevent to each block,char or bus > > > > > > device that you simply do the echo to at bootup. > > > > > > > > > > > > You have to remove udevstart starting from rc.udev. > > > > > > You also have to remove hotplug from the kernel. > > > > > > > > > > > > echo "/dev/null" > /proc/sys/kernel/hotplug > > > > > > > > > > > > You must remove hotplug before you start udev. > > > > > > > > > > > > This is how I would change rc.udev: > > > > > > > > > > > > put the echo "/dev/null" statement at the top. > > > > > > comment out all the udev stuff and jsut put this: > > > > > > > > > > > > /sbin/udevd --daemon > > > > > > > > > > > > Now add the for statements to echo the uevents. > > > > > > > > > > > > This should set everything up. > > > > > > > > > > > > Hotplug won't be needed as the kernel will send a uevent to ude= v > > > > > > and get things going that way. > > > > > > > > > > > > This, IMHO, is the way to go as it makes hotplugging and > > > > > > coldplugging a thing of the past and just leaves everything up = to udev > > > > > > rules. > > > > > > > > > > > > You can leave udev at the version it is now and see how it > > > > > > works. > > > > > > > > > > > > After you patch the kernel, a "make oldconfig" should offer you > > > > > > the new option of sending uevents from the kernel. > > > > > > > > > > > > This whole method will be the easiest to manage as udev will be > > > > > > a one-stop shop for everything and then we can just concentrate= on the udev > > > > > > rules to add function and improve device support and config. > > > > > > > > > > > > If this works, I would only offer this fix to those that have > > > > > > config problems today to see if it works for them. Making this= mass > > > > > > deployment might create a headache if we encounter other issues= . > > > > > > > > > > > > I am a huge proponent of the "if it ain't broke don't fix it" > > > > > > mentality. > > > > > > > > > > > > Moving forward, we need to upgrade udev to the latest anyway. > > > > > > > > > > > > Patch below between the hash lines > > > > > > > > > > > > ------------------------------------- > > > > > > > > > > > > > > > > > > diff --git a/drivers/base/class.c b/drivers/base/class.c > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --- a/drivers/base/class.c > > > > > > +++ b/drivers/base/class.c > > > > > > > > > > > > @@ -442,6 +442,13 @@ static ssize_t show_dev(struct class_dev > > > > > > =09return print_dev_t(buf, class_dev->devt); > > > > > > } > > > > > > > > > > > > +static ssize_t store_uevent(struct class_device *class_dev, > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > +=09=09=09 const char *buf, size_t count) > > > > > > > > > > > > +{ > > > > > > +=09kobject_hotplug(&class_dev->kobj, KOBJ_ADD); > > > > > > +=09return count; > > > > > > +} > > > > > > + > > > > > > void class_device_initialize(struct class_device *class_dev) > > > > > > > > > > > > > > > > > > { > > > > > > > > > > > > > > > > > > =09kobj_set_kset_s(class_dev, class_obj_subsys); > > > > > > > > > > > > > > > > > > @@ -497,6 +504,12 @@ int class_device_add(struct class_device > > > > > > > > > > > > =09=09goto register_done; > > > > > > > > > > > > =09/* add the needed attributes to this device */ > > > > > > +=09class_dev->uevent_attr.attr.name =3D "uevent"; > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > +=09class_dev->uevent_attr.attr.mode =3D S_IWUSR; > > > > > > > > > > > > +=09class_dev->uevent_attr.attr.owner =3D parent->owner; > > > > > > > > > > > > +=09class_dev->uevent_attr.store =3D store_uevent; > > > > > > +=09class_device_create_file(class_dev, &class_dev->uevent_attr= ); > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > + > > > > > > =09if (MAJOR(class_dev->devt)) { > > > > > > > > > > > > =09=09struct class_device_attribute *attr; > > > > > > =09=09attr =3D kzalloc(sizeof(*attr), GFP_KERNEL); > > > > > > > > > > > > @@ -505,12 +518,10 @@ int class_device_add(struct class_device > > > > > > > > > > > > > > > > > > > > > > > > =09=09=09kobject_del(&class_dev->kobj); > > > > > > > > > > > > > > > > > > =09=09=09goto register_done; > > > > > > > > > > > > =09=09} > > > > > > - > > > > > > =09=09attr->attr.name > > > > > > > > > > > > > > > > > > =3D "dev"; > > > > > > > > > > > > =09=09attr->attr.mode > > > > > > =3D S_IRUGO; > > > > > > > > > > > > =09=09attr->attr.owner > > > > > > =3D parent->owner; > > > > > > =09=09attr->show =3D show_dev; > > > > > > -=09=09attr->store =3D NULL; > > > > > > =09=09class_device_create_file(class_dev, attr); > > > > > > > > > > > > > > > > > > > > > > > > =09=09class_dev->devt_attr =3D attr; > > > > > > > > > > > > > > > > > > =09} > > > > > > @@ -620,6 +631,7 @@ void class_device_del(struct class_devic > > > > > > > > > > > > > > > > > > =09=09sysfs_remove_link(&class_dev->kobj, "device"); > > > > > > =09=09sysfs_remove_link(&class_dev->dev->kobj, class_name); > > > > > > =09} > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > +=09class_device_remove_file(class_dev, &class_dev->uevent_attr= ); > > > > > > > > > > > > > > > > > > =09if (class_dev->devt_attr) > > > > > > =09=09class_device_remove_file(class_dev, class_dev->devt_attr= ); > > > > > > =09class_device_remove_attrs(class_dev); > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > diff --git a/drivers/base/core.c b/drivers/base/core.c > > > > > > > > > > > > --- a/drivers/base/core.c > > > > > > > > > > > > > > > > > > +++ b/drivers/base/core.c > > > > > > @@ -154,6 +154,13 @@ static struct kset_hotplug_ops device_ho > > > > > > =09.hotplug =3D=09dev_hotplug, > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > }; > > > > > > > > > > > > +static ssize_t store_uevent(struct device *dev, struct device_= attribute *attr, > > > > > > > > > > > > > > > > > > > > > > > > +=09=09=09 const char *buf, size_t count) > > > > > > +{ > > > > > > +=09kobject_hotplug(&dev->kobj, KOBJ_ADD); > > > > > > > > > > > > +=09return count; > > > > > > > > > > > > > > > > > > > > > > > > +} > > > > > > + > > > > > > /** > > > > > > *=09device_subsys - structure to be registered with kobject c= ore. > > > > > > */ > > > > > > > > > > > > @@ -258,6 +265,14 @@ int device_add(struct device *dev) > > > > > > > > > > > > > > > > > > > > > > > > =09if ((error =3D kobject_add(&dev->kobj))) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > =09=09goto Error; > > > > > > + > > > > > > +=09dev->uevent_attr.attr.name =3D "uevent"; > > > > > > +=09dev->uevent_attr.attr.mode =3D S_IWUSR; > > > > > > > > > > > > +=09if (dev->driver) > > > > > > +=09=09dev->uevent_attr.attr.owner =3D dev->driver->owner; > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > +=09dev->uevent_attr.store =3D store_uevent; > > > > > > +=09device_create_file(dev, &dev->uevent_attr); > > > > > > + > > > > > > =09kobject_hotplug(&dev->kobj, KOBJ_ADD); > > > > > > > > > > > > =09if ((error =3D device_pm_add(dev))) > > > > > > =09=09goto PMError; > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > @@ -349,6 +364,7 @@ void device_del(struct device * dev) > > > > > > > > > > > > =09if (parent) > > > > > > =09=09klist_del(&dev->knode_parent); > > > > > > +=09device_remove_file(dev, &dev->uevent_attr); > > > > > > > > > > > > > > > > > > =09/* Notify the platform of the removal, in case they > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > =09 * need to do anything... > > > > > > diff --git a/drivers/block/genhd.c b/drivers/block/genhd.c > > > > > > --- a/drivers/block/genhd.c > > > > > > +++ b/drivers/block/genhd.c > > > > > > > > > > > > @@ -337,10 +337,30 @@ static ssize_t disk_attr_show(struct kob > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > =09return ret; > > > > > > } > > > > > > > > > > > > +static ssize_t disk_attr_store(struct kobject * kobj, struct a= ttribute * attr, > > > > > > +=09=09=09 const char *page, size_t count) > > > > > > > > > > > > +{ > > > > > > +=09struct gendisk *disk =3D to_disk(kobj); > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > +=09struct disk_attribute *disk_attr =3D > > > > > > > > > > > > > > > > > > +=09=09container_of(attr,struct disk_attribute,attr); > > > > > > +=09ssize_t ret =3D 0; > > > > > > + > > > > > > +=09if (disk_attr->store) > > > > > > +=09=09ret =3D disk_attr->store(disk, page, count); > > > > > > > > > > > > +=09return ret; > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > +} > > > > > > + > > > > > > static struct sysfs_ops disk_sysfs_ops =3D { > > > > > > > > > > > > > > > > > > =09.show=09=3D &disk_attr_show, > > > > > > +=09.store=09=3D &disk_attr_store, > > > > > > }; > > > > > > > > > > > > +static ssize_t disk_uevent_store(struct gendisk * disk, > > > > > > > > > > > > > > > > > > +=09=09=09=09 const char *buf, size_t count) > > > > > > > > > > > > > > > > > > +{ > > > > > > +=09kobject_hotplug(&disk->kobj, KOBJ_ADD); > > > > > > > > > > > > > > > > > > +=09return count; > > > > > > +} > > > > > > static ssize_t disk_dev_read(struct gendisk * disk, char *page= ) > > > > > > { > > > > > > =09dev_t base =3D MKDEV(disk->major, disk->first_minor); > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > @@ -382,6 +402,10 @@ static ssize_t disk_stats_read(struct ge > > > > > > > > > > > > > > > > > > =09=09jiffies_to_msecs(disk_stat_read(disk, io_ticks)), > > > > > > =09=09jiffies_to_msecs(disk_stat_read(disk, time_in_queue))); > > > > > > } > > > > > > +static struct disk_attribute disk_attr_uevent =3D { > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > +=09.attr =3D {.name =3D "uevent", .mode =3D S_IWUSR }, > > > > > > > > > > > > > > > > > > +=09.store=09=3D disk_uevent_store > > > > > > +}; > > > > > > static struct disk_attribute disk_attr_dev =3D { > > > > > > =09.attr =3D {.name =3D "dev", .mode =3D S_IRUGO }, > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > =09.show=09=3D disk_dev_read > > > > > > @@ -404,6 +428,7 @@ static struct disk_attribute disk_attr_s > > > > > > > > > > > > > > > > > > }; > > > > > > > > > > > > static struct attribute * default_attrs[] =3D { > > > > > > +=09&disk_attr_uevent.attr, > > > > > > =09&disk_attr_dev.attr, > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > =09&disk_attr_range.attr, > > > > > > =09&disk_attr_removable.attr, > > > > > > diff --git a/fs/partitions/check.c b/fs/partitions/check.c > > > > > > > > > > > > > > > > > > --- a/fs/partitions/check.c > > > > > > +++ b/fs/partitions/check.c > > > > > > @@ -192,6 +192,7 @@ check_partition(struct gendisk *hd, stru > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > struct part_attribute { > > > > > > =09struct attribute attr; > > > > > > =09ssize_t (*show)(struct hd_struct *,char *); > > > > > > > > > > > > > > > > > > +=09ssize_t (*store)(struct hd_struct *,const char *, size_t); > > > > > > }; > > > > > > > > > > > > static ssize_t > > > > > > > > > > > > > > > > > > > > > > > > @@ -201,14 +202,33 @@ part_attr_show(struct kobject * kobj, st > > > > > > > > > > > > > > > > > > =09struct part_attribute * part_attr =3D container_of(attr,str= uct part_attribute,attr); > > > > > > > > > > > > > > > > > > =09ssize_t ret =3D 0; > > > > > > =09if (part_attr->show) > > > > > > > > > > > > > > > > > > > > > > > > -=09=09ret =3D part_attr->show(p,page); > > > > > > +=09=09ret =3D part_attr->show(p, page); > > > > > > > > > > > > > > > > > > +=09return ret; > > > > > > +} > > > > > > +static ssize_t > > > > > > +part_attr_store(struct kobject * kobj, struct attribute * attr= , > > > > > > > > > > > > > > > > > > +=09=09const char *page, size_t count) > > > > > > > > > > > > > > > > > > > > > > > > +{ > > > > > > +=09struct hd_struct * p =3D container_of(kobj,struct hd_struct= ,kobj); > > > > > > > > > > > > > > > > > > +=09struct part_attribute * part_attr =3D container_of(attr,str= uct part_attribute,attr); > > > > > > +=09ssize_t ret =3D 0; > > > > > > > > > > > > > > > > > > + > > > > > > +=09if (part_attr->store) > > > > > > > > > > > > > > > > > > > > > > > > +=09=09ret =3D part_attr->store(p, page, count); > > > > > > =09return ret; > > > > > > > > > > > > > > > > > > } > > > > > > > > > > > > static struct sysfs_ops part_sysfs_ops =3D { > > > > > > =09.show=09=3D=09part_attr_show, > > > > > > +=09.store=09=3D=09part_attr_store, > > > > > > > > > > > > > > > > > > }; > > > > > > > > > > > > +static ssize_t part_uevent_store(struct hd_struct * p, > > > > > > +=09=09=09=09 const char *page, size_t count) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > +{ > > > > > > +=09kobject_hotplug(&p->kobj, KOBJ_ADD); > > > > > > +=09return count; > > > > > > +} > > > > > > static ssize_t part_dev_read(struct hd_struct * p, char *page) > > > > > > > > > > > > > > > > > > { > > > > > > =09struct gendisk *disk =3D container_of(p-> > > > > > > > > > > > > kobj.parent > > > > > > > > > > > > ,struct gendisk,kobj); > > > > > > > > > > > > @@ -229,6 +249,10 @@ static ssize_t part_stat_read(struct hd_ > > > > > > =09=09 p->reads, (unsigned long long)p->read_sectors, > > > > > > > > > > > > > > > > > > =09=09 p->writes, (unsigned long long)p->write_sectors); > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > } > > > > > > +static struct part_attribute part_attr_uevent =3D { > > > > > > > > > > > > +=09.attr =3D {.name =3D "uevent", .mode =3D S_IWUSR }, > > > > > > +=09.store=09=3D part_uevent_store > > > > > > > > > > > > > > > > > > +}; > > > > > > static struct part_attribute part_attr_dev =3D { > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > =09.attr =3D {.name =3D "dev", .mode =3D S_IRUGO }, > > > > > > > > > > > > =09.show=09=3D part_dev_read > > > > > > @@ -247,6 +271,7 @@ static struct part_attribute part_attr_s > > > > > > }; > > > > > > > > > > > > > > > > > > static struct attribute * default_attrs[] =3D { > > > > > > > > > > > > +=09&part_attr_uevent.attr, > > > > > > =09&part_attr_dev.attr, > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > =09&part_attr_start.attr, > > > > > > =09&part_attr_size.attr, > > > > > > diff --git a/include/linux/device.h b/include/linux/device.h > > > > > > > > > > > > --- a/include/linux/device.h > > > > > > > > > > > > +++ b/include/linux/device.h > > > > > > @@ -190,6 +190,18 @@ struct class_attribute class_attr_##_nam > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > extern int class_create_file(struct class *, const struct clas= s_attribute *); > > > > > > extern void class_remove_file(struct class *, const struct cla= ss_attribute *); > > > > > > > > > > > > > > > > > > > > > > > > +struct class_device_attribute { > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > +=09struct attribute=09attr; > > > > > > > > > > > > +=09ssize_t (*show)(struct class_device *, char * buf); > > > > > > +=09ssize_t (*store)(struct class_device *, const char * buf, s= ize_t count); > > > > > > +}; > > > > > > + > > > > > > > > > > > > +#define CLASS_DEVICE_ATTR(_name,_mode,_show,_store)=09=09\ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > +struct class_device_attribute class_device_attr_##_name =3D = =09\ > > > > > > > > > > > > +=09__ATTR(_name,_mode,_show,_store) > > > > > > + > > > > > > +extern int class_device_create_file(struct class_device *, > > > > > > > > > > > > +=09=09=09=09 const struct class_device_attribute *); > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > struct class_device { > > > > > > =09struct list_head=09node; > > > > > > > > > > > > @@ -198,6 +210,7 @@ struct class_device { > > > > > > =09struct class=09=09* class;=09/* required */ > > > > > > =09dev_t=09=09=09devt;=09=09/* dev_t, creates the sysfs "dev" = */ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > =09struct class_device_attribute *devt_attr; > > > > > > > > > > > > +=09struct class_device_attribute uevent_attr; > > > > > > > > > > > > =09struct device=09=09* dev;=09=09/* not necessary, but nice t= o have */ > > > > > > =09void=09=09=09* class_data;=09/* class-specific data */ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > @@ -228,18 +241,6 @@ extern int class_device_rename(struct cl > > > > > > > > > > > > extern struct class_device * class_device_get(struct class_dev= ice *); > > > > > > > > > > > > extern void class_device_put(struct class_device *); > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -struct class_device_attribute { > > > > > > > > > > > > -=09struct attribute=09attr; > > > > > > -=09ssize_t (*show)(struct class_device *, char * buf); > > > > > > > > > > > > -=09ssize_t (*store)(struct class_device *, const char * buf, s= ize_t count); > > > > > > > > > > > > -}; > > > > > > - > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -#define CLASS_DEVICE_ATTR(_name,_mode,_show,_store)=09=09\ > > > > > > > > > > > > -struct class_device_attribute class_device_attr_##_name =3D = =09\ > > > > > > -=09__ATTR(_name,_mode,_show,_store) > > > > > > > > > > > > - > > > > > > -extern int class_device_create_file(struct class_device *, > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -=09=09=09=09 const struct class_device_attribute *); > > > > > > > > > > > > extern void class_device_remove_file(struct class_device *, > > > > > > =09=09=09=09 const struct class_device_attribute *); > > > > > > > > > > > > extern int class_device_create_bin_file(struct class_device *, > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > @@ -266,6 +267,20 @@ extern struct class_device *class_device > > > > > > > > > > > > extern void class_device_destroy(struct class *cls, dev_t devt= ); > > > > > > > > > > > > > > > > > > +/* interface for exporting device attributes */ > > > > > > > > > > > > > > > > > > +struct device_attribute { > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > +=09struct attribute=09attr; > > > > > > +=09ssize_t (*show)(struct device *dev, struct device_attribute= *attr, > > > > > > > > > > > > +=09=09=09char *buf); > > > > > > +=09ssize_t (*store)(struct device *dev, struct device_attribut= e *attr, > > > > > > > > > > > > > > > > > > +=09=09=09 const char *buf, size_t count); > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > +}; > > > > > > + > > > > > > +#define DEVICE_ATTR(_name,_mode,_show,_store) \ > > > > > > +struct device_attribute dev_attr_##_name =3D __ATTR(_name,_mod= e,_show,_store) > > > > > > > > > > > > + > > > > > > +extern int device_create_file(struct device *device, struct de= vice_attribute * entry); > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > +extern void device_remove_file(struct device * dev, struct dev= ice_attribute * attr); > > > > > > struct device { > > > > > > =09struct klist=09=09klist_children; > > > > > > > > > > > > =09struct klist_node=09knode_parent;=09=09/* node in sibling l= ist */ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > @@ -275,6 +290,7 @@ struct device { > > > > > > > > > > > > > > > > > > =09struct kobject kobj; > > > > > > =09char=09bus_id[BUS_ID_SIZE];=09/* position on parent bus */ > > > > > > +=09struct device_attribute uevent_attr; > > > > > > > > > > > > > > > > > > =09struct semaphore=09sem;=09/* semaphore to synchronize calls= to > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > =09=09=09=09=09 * its driver. > > > > > > > > > > > > @@ -343,23 +359,6 @@ extern int device_attach(struct device > > > > > > extern void driver_attach(struct device_driver * drv); > > > > > > > > > > > > > > > > > > > > > > > > -/* driverfs interface for exporting device attributes */ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > - > > > > > > -struct device_attribute { > > > > > > > > > > > > -=09struct attribute=09attr; > > > > > > -=09ssize_t (*show)(struct device *dev, struct device_attribute= *attr, > > > > > > -=09=09=09char *buf); > > > > > > > > > > > > -=09ssize_t (*store)(struct device *dev, struct device_attribut= e *attr, > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -=09=09=09 const char *buf, size_t count); > > > > > > > > > > > > -}; > > > > > > - > > > > > > -#define DEVICE_ATTR(_name,_mode,_show,_store) \ > > > > > > -struct device_attribute dev_attr_##_name =3D __ATTR(_name,_mod= e,_show,_store) > > > > > > > > > > > > - > > > > > > - > > > > > > > > > > > > -extern int device_create_file(struct device *device, struct de= vice_attribute * entry); > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -extern void device_remove_file(struct device * dev, struct dev= ice_attribute * attr); > > > > > > - > > > > > > /* > > > > > > * Platform "fixup" functions - allow the platform to have the= ir say > > > > > > > > > > > > > > > > > > * about devices and actions that the general device layer doe= sn't > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > diff --git a/include/linux/genhd.h b/include/linux/genhd.h > > > > > > --- a/include/linux/genhd.h > > > > > > +++ b/include/linux/genhd.h > > > > > > > > > > > > @@ -132,6 +132,7 @@ struct gendisk { > > > > > > > > > > > > struct disk_attribute { > > > > > > =09struct attribute attr; > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > =09ssize_t (*show)(struct gendisk *, char *); > > > > > > +=09ssize_t (*store)(struct gendisk *, const char *, size_t); > > > > > > > > > > > > }; > > > > > > > > > > > > /* > > > > > > --------------------------------------- > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On 3/9/06, John B < joh...@gm...> wrote: > > > > > > > > > > > > > > > > > > > > > On 3/9/06, Tony Brijeski < tb...@gm...> wrote: > > > > > > > > > > > > > > > Found a better patch but it is for the kernel. The uevent > > > > > > > > patch. It will be included in the 2.6.16 kernel so it migh= t > > > > > > > > be best to just wait till 2.6.16 goes stable. > > > > > > > > > > > > > > > > These 3 lines will then replace the whole udevstart/coldplu= g > > > > > > > > issue and much better than udevsynthesize. > > > > > > > > > > > > > > > > for i in /sys/block/*/*/uevent; do echo 1 > $i; done > > > > > > > > for i in /sys/class/*/*/uevent; do echo 1 > $i; done > > > > > > > > for i in /sys/bus/*/devices/*/uevent; do echo 1 > $i; don= e > > > > > > > > > > > > > > > > Let me know what you folks think. I can patch the stock > > > > > > > > kernel we use if we want to play with it before 2.6.16 come= s > > > > > > > > out. > > > > > > > > > > > > > > > > > > > > > > Tony, > > > > > > > > > > > > > > I wouldn't mind playing around with a pre-2.6.16 kernel > > > > > > > patched with this patch. FWIW, I have the source for 2.6.13si= tting on my box. If you can let me know via a unified diff which file(s) > > > > > > > need to be patched, I'll roll my own 2.6.13 kernel for my box > > > > > > > and see how well it works for me. ;-) > > > > > > > > > > > > > > Thanks, > > > > > > > John > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > |
From: Tony B. <tb...@gm...> - 2006-03-12 05:39:36
|
looks like it might require at least a 2.6.15 kernel but I'm trying to confirm that. If that is the case, then we should just wait a couple weeks and have 2.6.16 that already has it included. On 3/11/06, Tony Brijeski <tb...@gm...> wrote: > > I'm looking into it now. Will let you know what I come up with. You are > patching correctly but something is wrong with the patch. > > > > > On 3/11/06, uel archuletta <ue...@gm...> wrote: > > > > I tried to patch the kernel like this > > [root@vector/usr/src/linux-2.6.13-Uevent]# patch -p1 <uevent* > > patching file drivers/base/class.c > > Hunk #1 FAILED at 442. > > 1 out of 1 hunk FAILED -- saving rejects to file > > drivers/base/class.c.rej > > missing header for unified diff at line 23 of patch > > can't find file to patch at input line 23 > > Perhaps you used the wrong -p or --strip option? > > The text leading up to this was: > > -------------------------- > > > > | { > > | kobj_set_kset_s(class_dev, class_obj_subsys); > > | > > -------------------------- > > any ideas what I am doing wrong? > > > > > > > > On 3/9/06, Tony Brijeski <tb...@gm...> wrote: > > > > > > You just have to make sure you enable uevent in the kernel. > > > > > > I also forgot to mention you must keep hotplug from running - it is i= n > > > the sysvinit section. Just chmod 644 the hotplug script and that sho= uld > > > work. > > > > > > I would recommend renaming rc.udev to rc.udev.orig and create the new > > > rc.udev with the 5 or so lines needed to set udev up for uevent. > > > > > > Regards, > > > Tony > > > > > > > > > > > > On 3/9/06, Sriram Durbha <sri...@gm...> wrote: > > > > > > > > hi folks, > > > > the kernel is at 2.6.16-rc5 now .. i hope it will be ready in a > > > > few weeks time. > > > > would i be missing something tony is doing if i just took the > > > > 2.6.16-rc5 kernel and follwed the other instructions abt hot/cold > > > > plog removal ? > > > > cheers > > > > ram > > > > > > > > > > > > On 3/9/06, Tony Brijeski < tb...@gm...> wrote: > > > > > > > > > > Here is the patch. It adds a uevent to each block,char or bus > > > > > device that you simply do the echo to at bootup. > > > > > > > > > > You have to remove udevstart starting from rc.udev. > > > > > You also have to remove hotplug from the kernel. > > > > > > > > > > echo "/dev/null" > /proc/sys/kernel/hotplug > > > > > > > > > > You must remove hotplug before you start udev. > > > > > > > > > > This is how I would change rc.udev: > > > > > > > > > > put the echo "/dev/null" statement at the top. > > > > > comment out all the udev stuff and jsut put this: > > > > > > > > > > /sbin/udevd --daemon > > > > > > > > > > Now add the for statements to echo the uevents. > > > > > > > > > > This should set everything up. > > > > > > > > > > Hotplug won't be needed as the kernel will send a uevent to udev > > > > > and get things going that way. > > > > > > > > > > This, IMHO, is the way to go as it makes hotplugging and > > > > > coldplugging a thing of the past and just leaves everything up to= udev > > > > > rules. > > > > > > > > > > You can leave udev at the version it is now and see how it works. > > > > > > > > > > After you patch the kernel, a "make oldconfig" should offer you > > > > > the new option of sending uevents from the kernel. > > > > > > > > > > This whole method will be the easiest to manage as udev will be a > > > > > one-stop shop for everything and then we can just concentrate on = the udev > > > > > rules to add function and improve device support and config. > > > > > > > > > > If this works, I would only offer this fix to those that have > > > > > config problems today to see if it works for them. Making this m= ass > > > > > deployment might create a headache if we encounter other issues. > > > > > > > > > > I am a huge proponent of the "if it ain't broke don't fix it" > > > > > mentality. > > > > > > > > > > Moving forward, we need to upgrade udev to the latest anyway. > > > > > > > > > > Patch below between the hash lines > > > > > > > > > > ------------------------------------- > > > > > > > > > > > > > > > diff --git a/drivers/base/class.c b/drivers/base/class.c > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --- a/drivers/base/class.c > > > > > +++ b/drivers/base/class.c > > > > > > > > > > @@ -442,6 +442,13 @@ static ssize_t show_dev(struct class_dev > > > > > =09return print_dev_t(buf, class_dev->devt); > > > > > } > > > > > > > > > > +static ssize_t store_uevent(struct class_device *class_dev, > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > +=09=09=09 const char *buf, size_t count) > > > > > > > > > > +{ > > > > > +=09kobject_hotplug(&class_dev->kobj, KOBJ_ADD); > > > > > +=09return count; > > > > > +} > > > > > + > > > > > void class_device_initialize(struct class_device *class_dev) > > > > > > > > > > { > > > > > > > > > > > > > > > =09kobj_set_kset_s(class_dev, class_obj_subsys); > > > > > > > > > > > > > > > @@ -497,6 +504,12 @@ int class_device_add(struct class_device > > > > > > > > > > =09=09goto register_done; > > > > > > > > > > =09/* add the needed attributes to this device */ > > > > > +=09class_dev->uevent_attr.attr.name =3D "uevent"; > > > > > > > > > > > > > > > > > > > > > > > > > +=09class_dev->uevent_attr.attr.mode =3D S_IWUSR; > > > > > > > > > > +=09class_dev->uevent_attr.attr.owner =3D parent->owner; > > > > > > > > > > +=09class_dev->uevent_attr.store =3D store_uevent; > > > > > +=09class_device_create_file(class_dev, &class_dev->uevent_attr); > > > > > > > > > > > > > > > > > > > > > > > > > + > > > > > =09if (MAJOR(class_dev->devt)) { > > > > > > > > > > =09=09struct class_device_attribute *attr; > > > > > =09=09attr =3D kzalloc(sizeof(*attr), GFP_KERNEL); > > > > > > > > > > @@ -505,12 +518,10 @@ int class_device_add(struct class_device > > > > > > > > > > > > > > > =09=09=09kobject_del(&class_dev->kobj); > > > > > > > > > > > > > > > =09=09=09goto register_done; > > > > > > > > > > =09=09} > > > > > - > > > > > =09=09attr->attr.name > > > > > > > > > > =3D "dev"; > > > > > > > > > > =09=09attr->attr.mode > > > > > =3D S_IRUGO; > > > > > > > > > > =09=09attr->attr.owner > > > > > =3D parent->owner; > > > > > =09=09attr->show =3D show_dev; > > > > > -=09=09attr->store =3D NULL; > > > > > =09=09class_device_create_file(class_dev, attr); > > > > > > > > > > > > > > > =09=09class_dev->devt_attr =3D attr; > > > > > > > > > > > > > > > =09} > > > > > @@ -620,6 +631,7 @@ void class_device_del(struct class_devic > > > > > > > > > > > > > > > =09=09sysfs_remove_link(&class_dev->kobj, "device"); > > > > > =09=09sysfs_remove_link(&class_dev->dev->kobj, class_name); > > > > > =09} > > > > > > > > > > > > > > > > > > > > > > > > > +=09class_device_remove_file(class_dev, &class_dev->uevent_attr); > > > > > > > > > > > > > > > =09if (class_dev->devt_attr) > > > > > =09=09class_device_remove_file(class_dev, class_dev->devt_attr); > > > > > =09class_device_remove_attrs(class_dev); > > > > > > > > > > > > > > > > > > > > diff --git a/drivers/base/core.c b/drivers/base/core.c > > > > > > > > > > --- a/drivers/base/core.c > > > > > > > > > > > > > > > +++ b/drivers/base/core.c > > > > > @@ -154,6 +154,13 @@ static struct kset_hotplug_ops device_ho > > > > > =09.hotplug =3D=09dev_hotplug, > > > > > > > > > > > > > > > > > > > > }; > > > > > > > > > > +static ssize_t store_uevent(struct device *dev, struct device_at= tribute *attr, > > > > > > > > > > > > > > > > > > > > +=09=09=09 const char *buf, size_t count) > > > > > +{ > > > > > +=09kobject_hotplug(&dev->kobj, KOBJ_ADD); > > > > > +=09return count; > > > > > > > > > > > > > > > > > > > > +} > > > > > + > > > > > /** > > > > > *=09device_subsys - structure to be registered with kobject cor= e. > > > > > */ > > > > > > > > > > @@ -258,6 +265,14 @@ int device_add(struct device *dev) > > > > > > > > > > > > > > > > > > > > =09if ((error =3D kobject_add(&dev->kobj))) > > > > > > > > > > > > > > > > > > > > =09=09goto Error; > > > > > + > > > > > +=09dev->uevent_attr.attr.name =3D "uevent"; > > > > > +=09dev->uevent_attr.attr.mode =3D S_IWUSR; > > > > > > > > > > +=09if (dev->driver) > > > > > +=09=09dev->uevent_attr.attr.owner =3D dev->driver->owner; > > > > > > > > > > > > > > > > > > > > > > > > > +=09dev->uevent_attr.store =3D store_uevent; > > > > > +=09device_create_file(dev, &dev->uevent_attr); > > > > > + > > > > > =09kobject_hotplug(&dev->kobj, KOBJ_ADD); > > > > > > > > > > =09if ((error =3D device_pm_add(dev))) > > > > > =09=09goto PMError; > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > @@ -349,6 +364,7 @@ void device_del(struct device * dev) > > > > > > > > > > =09if (parent) > > > > > =09=09klist_del(&dev->knode_parent); > > > > > +=09device_remove_file(dev, &dev->uevent_attr); > > > > > > > > > > > > > > > =09/* Notify the platform of the removal, in case they > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > =09 * need to do anything... > > > > > diff --git a/drivers/block/genhd.c b/drivers/block/genhd.c > > > > > --- a/drivers/block/genhd.c > > > > > +++ b/drivers/block/genhd.c > > > > > > > > > > @@ -337,10 +337,30 @@ static ssize_t disk_attr_show(struct kob > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > =09return ret; > > > > > } > > > > > > > > > > +static ssize_t disk_attr_store(struct kobject * kobj, struct att= ribute * attr, > > > > > +=09=09=09 const char *page, size_t count) > > > > > > > > > > +{ > > > > > +=09struct gendisk *disk =3D to_disk(kobj); > > > > > > > > > > > > > > > > > > > > +=09struct disk_attribute *disk_attr =3D > > > > > > > > > > > > > > > +=09=09container_of(attr,struct disk_attribute,attr); > > > > > +=09ssize_t ret =3D 0; > > > > > + > > > > > +=09if (disk_attr->store) > > > > > +=09=09ret =3D disk_attr->store(disk, page, count); > > > > > > > > > > +=09return ret; > > > > > > > > > > > > > > > > > > > > +} > > > > > + > > > > > static struct sysfs_ops disk_sysfs_ops =3D { > > > > > > > > > > > > > > > =09.show=09=3D &disk_attr_show, > > > > > +=09.store=09=3D &disk_attr_store, > > > > > }; > > > > > > > > > > +static ssize_t disk_uevent_store(struct gendisk * disk, > > > > > > > > > > > > > > > +=09=09=09=09 const char *buf, size_t count) > > > > > > > > > > > > > > > +{ > > > > > +=09kobject_hotplug(&disk->kobj, KOBJ_ADD); > > > > > > > > > > > > > > > +=09return count; > > > > > +} > > > > > static ssize_t disk_dev_read(struct gendisk * disk, char *page) > > > > > { > > > > > =09dev_t base =3D MKDEV(disk->major, disk->first_minor); > > > > > > > > > > > > > > > > > > > > > > > > > @@ -382,6 +402,10 @@ static ssize_t disk_stats_read(struct ge > > > > > > > > > > > > > > > =09=09jiffies_to_msecs(disk_stat_read(disk, io_ticks)), > > > > > =09=09jiffies_to_msecs(disk_stat_read(disk, time_in_queue))); > > > > > } > > > > > +static struct disk_attribute disk_attr_uevent =3D { > > > > > > > > > > > > > > > > > > > > > > > > > +=09.attr =3D {.name =3D "uevent", .mode =3D S_IWUSR }, > > > > > > > > > > > > > > > +=09.store=09=3D disk_uevent_store > > > > > +}; > > > > > static struct disk_attribute disk_attr_dev =3D { > > > > > =09.attr =3D {.name =3D "dev", .mode =3D S_IRUGO }, > > > > > > > > > > > > > > > > > > > > > > > > > =09.show=09=3D disk_dev_read > > > > > @@ -404,6 +428,7 @@ static struct disk_attribute disk_attr_s > > > > > > > > > > > > > > > }; > > > > > > > > > > static struct attribute * default_attrs[] =3D { > > > > > +=09&disk_attr_uevent.attr, > > > > > =09&disk_attr_dev.attr, > > > > > > > > > > > > > > > > > > > > > > > > > =09&disk_attr_range.attr, > > > > > =09&disk_attr_removable.attr, > > > > > diff --git a/fs/partitions/check.c b/fs/partitions/check.c > > > > > > > > > > > > > > > --- a/fs/partitions/check.c > > > > > +++ b/fs/partitions/check.c > > > > > @@ -192,6 +192,7 @@ check_partition(struct gendisk *hd, stru > > > > > > > > > > > > > > > > > > > > > > > > > struct part_attribute { > > > > > =09struct attribute attr; > > > > > =09ssize_t (*show)(struct hd_struct *,char *); > > > > > > > > > > > > > > > +=09ssize_t (*store)(struct hd_struct *,const char *, size_t); > > > > > }; > > > > > > > > > > static ssize_t > > > > > > > > > > > > > > > @@ -201,14 +202,33 @@ part_attr_show(struct kobject * kobj, st > > > > > > > > > > > > > > > =09struct part_attribute * part_attr =3D container_of(attr,struc= t part_attribute,attr); > > > > > > > > > > > > > > > =09ssize_t ret =3D 0; > > > > > =09if (part_attr->show) > > > > > > > > > > > > > > > -=09=09ret =3D part_attr->show(p,page); > > > > > +=09=09ret =3D part_attr->show(p, page); > > > > > > > > > > > > > > > +=09return ret; > > > > > +} > > > > > +static ssize_t > > > > > +part_attr_store(struct kobject * kobj, struct attribute * attr, > > > > > > > > > > > > > > > +=09=09const char *page, size_t count) > > > > > > > > > > > > > > > +{ > > > > > +=09struct hd_struct * p =3D container_of(kobj,struct hd_struct,k= obj); > > > > > > > > > > > > > > > +=09struct part_attribute * part_attr =3D container_of(attr,struc= t part_attribute,attr); > > > > > +=09ssize_t ret =3D 0; > > > > > > > > > > > > > > > + > > > > > +=09if (part_attr->store) > > > > > > > > > > > > > > > +=09=09ret =3D part_attr->store(p, page, count); > > > > > =09return ret; > > > > > > > > > > > > > > > } > > > > > > > > > > static struct sysfs_ops part_sysfs_ops =3D { > > > > > =09.show=09=3D=09part_attr_show, > > > > > +=09.store=09=3D=09part_attr_store, > > > > > > > > > > > > > > > }; > > > > > > > > > > +static ssize_t part_uevent_store(struct hd_struct * p, > > > > > +=09=09=09=09 const char *page, size_t count) > > > > > > > > > > > > > > > > > > > > > > > > > +{ > > > > > +=09kobject_hotplug(&p->kobj, KOBJ_ADD); > > > > > +=09return count; > > > > > +} > > > > > static ssize_t part_dev_read(struct hd_struct * p, char *page) > > > > > > > > > > > > > > > { > > > > > =09struct gendisk *disk =3D container_of(p-> > > > > > kobj.parent > > > > > > > > > > ,struct gendisk,kobj); > > > > > > > > > > @@ -229,6 +249,10 @@ static ssize_t part_stat_read(struct hd_ > > > > > =09=09 p->reads, (unsigned long long)p->read_sectors, > > > > > > > > > > > > > > > =09=09 p->writes, (unsigned long long)p->write_sectors); > > > > > > > > > > > > > > > > > > > > } > > > > > +static struct part_attribute part_attr_uevent =3D { > > > > > > > > > > +=09.attr =3D {.name =3D "uevent", .mode =3D S_IWUSR }, > > > > > +=09.store=09=3D part_uevent_store > > > > > > > > > > > > > > > +}; > > > > > static struct part_attribute part_attr_dev =3D { > > > > > > > > > > > > > > > > > > > > =09.attr =3D {.name =3D "dev", .mode =3D S_IRUGO }, > > > > > > > > > > =09.show=09=3D part_dev_read > > > > > @@ -247,6 +271,7 @@ static struct part_attribute part_attr_s > > > > > }; > > > > > > > > > > > > > > > static struct attribute * default_attrs[] =3D { > > > > > > > > > > +=09&part_attr_uevent.attr, > > > > > =09&part_attr_dev.attr, > > > > > > > > > > > > > > > > > > > > > > > > > =09&part_attr_start.attr, > > > > > =09&part_attr_size.attr, > > > > > diff --git a/include/linux/device.h b/include/linux/device.h > > > > > > > > > > --- a/include/linux/device.h > > > > > > > > > > +++ b/include/linux/device.h > > > > > @@ -190,6 +190,18 @@ struct class_attribute class_attr_##_nam > > > > > > > > > > > > > > > > > > > > > > > > > extern int class_create_file(struct class *, const struct class_= attribute *); > > > > > extern void class_remove_file(struct class *, const struct class= _attribute *); > > > > > > > > > > > > > > > > > > > > +struct class_device_attribute { > > > > > > > > > > > > > > > > > > > > +=09struct attribute=09attr; > > > > > > > > > > +=09ssize_t (*show)(struct class_device *, char * buf); > > > > > +=09ssize_t (*store)(struct class_device *, const char * buf, siz= e_t count); > > > > > +}; > > > > > + > > > > > > > > > > +#define CLASS_DEVICE_ATTR(_name,_mode,_show,_store)=09=09\ > > > > > > > > > > > > > > > > > > > > > > > > > +struct class_device_attribute class_device_attr_##_name =3D =09\ > > > > > > > > > > +=09__ATTR(_name,_mode,_show,_store) > > > > > + > > > > > +extern int class_device_create_file(struct class_device *, > > > > > > > > > > +=09=09=09=09 const struct class_device_attribute *); > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > struct class_device { > > > > > =09struct list_head=09node; > > > > > > > > > > @@ -198,6 +210,7 @@ struct class_device { > > > > > =09struct class=09=09* class;=09/* required */ > > > > > =09dev_t=09=09=09devt;=09=09/* dev_t, creates the sysfs "dev" */ > > > > > > > > > > > > > > > > > > > > > > > > > =09struct class_device_attribute *devt_attr; > > > > > > > > > > +=09struct class_device_attribute uevent_attr; > > > > > > > > > > =09struct device=09=09* dev;=09=09/* not necessary, but nice to = have */ > > > > > =09void=09=09=09* class_data;=09/* class-specific data */ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > @@ -228,18 +241,6 @@ extern int class_device_rename(struct cl > > > > > > > > > > extern struct class_device * class_device_get(struct class_devic= e *); > > > > > > > > > > extern void class_device_put(struct class_device *); > > > > > > > > > > > > > > > > > > > > > > > > > -struct class_device_attribute { > > > > > > > > > > -=09struct attribute=09attr; > > > > > -=09ssize_t (*show)(struct class_device *, char * buf); > > > > > > > > > > -=09ssize_t (*store)(struct class_device *, const char * buf, siz= e_t count); > > > > > > > > > > -}; > > > > > - > > > > > > > > > > > > > > > > > > > > -#define CLASS_DEVICE_ATTR(_name,_mode,_show,_store)=09=09\ > > > > > > > > > > -struct class_device_attribute class_device_attr_##_name =3D =09\ > > > > > -=09__ATTR(_name,_mode,_show,_store) > > > > > > > > > > - > > > > > -extern int class_device_create_file(struct class_device *, > > > > > > > > > > > > > > > > > > > > > > > > > -=09=09=09=09 const struct class_device_attribute *); > > > > > > > > > > extern void class_device_remove_file(struct class_device *, > > > > > =09=09=09=09 const struct class_device_attribute *); > > > > > > > > > > extern int class_device_create_bin_file(struct class_device *, > > > > > > > > > > > > > > > > > > > > > > > > > @@ -266,6 +267,20 @@ extern struct class_device *class_device > > > > > > > > > > extern void class_device_destroy(struct class *cls, dev_t devt); > > > > > > > > > > > > > > > +/* interface for exporting device attributes */ > > > > > > > > > > +struct device_attribute { > > > > > > > > > > > > > > > > > > > > > > > > > +=09struct attribute=09attr; > > > > > +=09ssize_t (*show)(struct device *dev, struct device_attribute *= attr, > > > > > > > > > > +=09=09=09char *buf); > > > > > +=09ssize_t (*store)(struct device *dev, struct device_attribute = *attr, > > > > > > > > > > +=09=09=09 const char *buf, size_t count); > > > > > > > > > > > > > > > > > > > > > > > > > +}; > > > > > + > > > > > +#define DEVICE_ATTR(_name,_mode,_show,_store) \ > > > > > +struct device_attribute dev_attr_##_name =3D __ATTR(_name,_mode,= _show,_store) > > > > > > > > > > + > > > > > +extern int device_create_file(struct device *device, struct devi= ce_attribute * entry); > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > +extern void device_remove_file(struct device * dev, struct devic= e_attribute * attr); > > > > > struct device { > > > > > =09struct klist=09=09klist_children; > > > > > > > > > > =09struct klist_node=09knode_parent;=09=09/* node in sibling lis= t */ > > > > > > > > > > > > > > > > > > > > > > > > > @@ -275,6 +290,7 @@ struct device { > > > > > > > > > > > > > > > =09struct kobject kobj; > > > > > =09char=09bus_id[BUS_ID_SIZE];=09/* position on parent bus */ > > > > > +=09struct device_attribute uevent_attr; > > > > > > > > > > > > > > > =09struct semaphore=09sem;=09/* semaphore to synchronize calls t= o > > > > > > > > > > > > > > > > > > > > > > > > > =09=09=09=09=09 * its driver. > > > > > > > > > > @@ -343,23 +359,6 @@ extern int device_attach(struct device > > > > > extern void driver_attach(struct device_driver * drv); > > > > > > > > > > > > > > > > > > > > -/* driverfs interface for exporting device attributes */ > > > > > > > > > > > > > > > > > > > > > > > > > - > > > > > -struct device_attribute { > > > > > > > > > > -=09struct attribute=09attr; > > > > > -=09ssize_t (*show)(struct device *dev, struct device_attribute *= attr, > > > > > -=09=09=09char *buf); > > > > > > > > > > -=09ssize_t (*store)(struct device *dev, struct device_attribute = *attr, > > > > > > > > > > > > > > > > > > > > > > > > > -=09=09=09 const char *buf, size_t count); > > > > > > > > > > -}; > > > > > - > > > > > -#define DEVICE_ATTR(_name,_mode,_show,_store) \ > > > > > -struct device_attribute dev_attr_##_name =3D __ATTR(_name,_mode,= _show,_store) > > > > > > > > > > - > > > > > - > > > > > -extern int device_create_file(struct device *device, struct devi= ce_attribute * entry); > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -extern void device_remove_file(struct device * dev, struct devic= e_attribute * attr); > > > > > - > > > > > /* > > > > > * Platform "fixup" functions - allow the platform to have their= say > > > > > > > > > > * about devices and actions that the general device layer doesn= 't > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > diff --git a/include/linux/genhd.h b/include/linux/genhd.h > > > > > --- a/include/linux/genhd.h > > > > > +++ b/include/linux/genhd.h > > > > > @@ -132,6 +132,7 @@ struct gendisk { > > > > > > > > > > struct disk_attribute { > > > > > =09struct attribute attr; > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > =09ssize_t (*show)(struct gendisk *, char *); > > > > > +=09ssize_t (*store)(struct gendisk *, const char *, size_t); > > > > > }; > > > > > > > > > > /* > > > > > --------------------------------------- > > > > > > > > > > > > > > > > > > > > > > > > > On 3/9/06, John B < joh...@gm...> wrote: > > > > > > > > > > > > > > > > > > On 3/9/06, Tony Brijeski < tb...@gm...> wrote: > > > > > > > > > > > > > Found a better patch but it is for the kernel. The uevent > > > > > > > patch. It will be included in the 2.6.16 kernel so it might > > > > > > > be best to just wait till 2.6.16 goes stable. > > > > > > > > > > > > > > These 3 lines will then replace the whole udevstart/coldplug > > > > > > > issue and much better than udevsynthesize. > > > > > > > > > > > > > > for i in /sys/block/*/*/uevent; do echo 1 > $i; done > > > > > > > for i in /sys/class/*/*/uevent; do echo 1 > $i; done > > > > > > > for i in /sys/bus/*/devices/*/uevent; do echo 1 > $i; done > > > > > > > > > > > > > > Let me know what you folks think. I can patch the stock > > > > > > > kernel we use if we want to play with it before 2.6.16 comes > > > > > > > out. > > > > > > > > > > > > > > > > > > > Tony, > > > > > > > > > > > > I wouldn't mind playing around with a pre-2.6.16 kernel patched > > > > > > with this patch. FWIW, I have the source for 2.6.13 sitting on > > > > > > my box. If you can let me know via a unified diff which file(s)= need to be > > > > > > patched, I'll roll my own 2.6.13 kernel for my box and see how > > > > > > well it works for me. ;-) > > > > > > > > > > > > Thanks, > > > > > > John > > > > > > > > > > > > > > > > > > > > > > > > > > |
From: Tony B. <tb...@gm...> - 2006-03-12 04:18:47
|
I'm looking into it now. Will let you know what I come up with. You are patching correctly but something is wrong with the patch. On 3/11/06, uel archuletta <ue...@gm...> wrote: > > I tried to patch the kernel like this > [root@vector/usr/src/linux-2.6.13-Uevent]# patch -p1 <uevent* > patching file drivers/base/class.c > Hunk #1 FAILED at 442. > 1 out of 1 hunk FAILED -- saving rejects to file drivers/base/class.c.rej > missing header for unified diff at line 23 of patch > can't find file to patch at input line 23 > Perhaps you used the wrong -p or --strip option? > The text leading up to this was: > -------------------------- > > | { > | kobj_set_kset_s(class_dev, class_obj_subsys); > | > -------------------------- > any ideas what I am doing wrong? > > > > On 3/9/06, Tony Brijeski <tb...@gm...> wrote: > > > > You just have to make sure you enable uevent in the kernel. > > > > I also forgot to mention you must keep hotplug from running - it is in > > the sysvinit section. Just chmod 644 the hotplug script and that shoul= d > > work. > > > > I would recommend renaming rc.udev to rc.udev.orig and create the new > > rc.udev with the 5 or so lines needed to set udev up for uevent. > > > > Regards, > > Tony > > > > > > > > On 3/9/06, Sriram Durbha <sri...@gm...> wrote: > > > > > > hi folks, > > > the kernel is at 2.6.16-rc5 now .. i hope it will be ready in a few > > > weeks time. > > > would i be missing something tony is doing if i just took the > > > 2.6.16-rc5 kernel and follwed the other instructions abt hot/cold plo= g > > > removal ? > > > cheers > > > ram > > > > > > > > > On 3/9/06, Tony Brijeski < tb...@gm...> wrote: > > > > > > > > Here is the patch. It adds a uevent to each block,char or bus > > > > device that you simply do the echo to at bootup. > > > > > > > > You have to remove udevstart starting from rc.udev. > > > > You also have to remove hotplug from the kernel. > > > > > > > > echo "/dev/null" > /proc/sys/kernel/hotplug > > > > > > > > You must remove hotplug before you start udev. > > > > > > > > This is how I would change rc.udev: > > > > > > > > put the echo "/dev/null" statement at the top. > > > > comment out all the udev stuff and jsut put this: > > > > > > > > /sbin/udevd --daemon > > > > > > > > Now add the for statements to echo the uevents. > > > > > > > > This should set everything up. > > > > > > > > Hotplug won't be needed as the kernel will send a uevent to udev an= d > > > > get things going that way. > > > > > > > > This, IMHO, is the way to go as it makes hotplugging and > > > > coldplugging a thing of the past and just leaves everything up to u= dev > > > > rules. > > > > > > > > You can leave udev at the version it is now and see how it works. > > > > > > > > After you patch the kernel, a "make oldconfig" should offer you the > > > > new option of sending uevents from the kernel. > > > > > > > > This whole method will be the easiest to manage as udev will be a > > > > one-stop shop for everything and then we can just concentrate on th= e udev > > > > rules to add function and improve device support and config. > > > > > > > > If this works, I would only offer this fix to those that have confi= g > > > > problems today to see if it works for them. Making this mass deplo= yment > > > > might create a headache if we encounter other issues. > > > > > > > > I am a huge proponent of the "if it ain't broke don't fix it" > > > > mentality. > > > > > > > > Moving forward, we need to upgrade udev to the latest anyway. > > > > > > > > Patch below between the hash lines > > > > > > > > ------------------------------------- > > > > > > > > > > > > diff --git a/drivers/base/class.c b/drivers/base/class.c > > > > > > > > > > > > > > > > > > > > --- a/drivers/base/class.c > > > > +++ b/drivers/base/class.c > > > > > > > > @@ -442,6 +442,13 @@ static ssize_t show_dev(struct class_dev > > > > =09return print_dev_t(buf, class_dev->devt); > > > > } > > > > > > > > +static ssize_t store_uevent(struct class_device *class_dev, > > > > > > > > > > > > > > > > > > > > +=09=09=09 const char *buf, size_t count) > > > > > > > > +{ > > > > +=09kobject_hotplug(&class_dev->kobj, KOBJ_ADD); > > > > +=09return count; > > > > +} > > > > + > > > > void class_device_initialize(struct class_device *class_dev) > > > > { > > > > > > > > > > > > =09kobj_set_kset_s(class_dev, class_obj_subsys); > > > > > > > > > > > > @@ -497,6 +504,12 @@ int class_device_add(struct class_device > > > > > > > > =09=09goto register_done; > > > > > > > > =09/* add the needed attributes to this device */ > > > > +=09class_dev->uevent_attr.attr.name =3D "uevent"; > > > > > > > > > > > > > > > > +=09class_dev->uevent_attr.attr.mode =3D S_IWUSR; > > > > > > > > +=09class_dev->uevent_attr.attr.owner =3D parent->owner; > > > > > > > > +=09class_dev->uevent_attr.store =3D store_uevent; > > > > +=09class_device_create_file(class_dev, &class_dev->uevent_attr); > > > > > > > > > > > > > > > > + > > > > =09if (MAJOR(class_dev->devt)) { > > > > > > > > =09=09struct class_device_attribute *attr; > > > > =09=09attr =3D kzalloc(sizeof(*attr), GFP_KERNEL); > > > > > > > > @@ -505,12 +518,10 @@ int class_device_add(struct class_device > > > > > > > > =09=09=09kobject_del(&class_dev->kobj); > > > > > > > > > > > > =09=09=09goto register_done; > > > > > > > > =09=09} > > > > - > > > > =09=09attr->attr.name > > > > =3D "dev"; > > > > > > > > =09=09attr->attr.mode > > > > =3D S_IRUGO; > > > > > > > > =09=09attr->attr.owner > > > > =3D parent->owner; > > > > =09=09attr->show =3D show_dev; > > > > -=09=09attr->store =3D NULL; > > > > =09=09class_device_create_file(class_dev, attr); > > > > > > > > =09=09class_dev->devt_attr =3D attr; > > > > > > > > > > > > =09} > > > > @@ -620,6 +631,7 @@ void class_device_del(struct class_devic > > > > > > > > > > > > =09=09sysfs_remove_link(&class_dev->kobj, "device"); > > > > =09=09sysfs_remove_link(&class_dev->dev->kobj, class_name); > > > > =09} > > > > > > > > > > > > > > > > +=09class_device_remove_file(class_dev, &class_dev->uevent_attr); > > > > > > > > > > > > =09if (class_dev->devt_attr) > > > > =09=09class_device_remove_file(class_dev, class_dev->devt_attr); > > > > =09class_device_remove_attrs(class_dev); > > > > > > > > > > > > diff --git a/drivers/base/core.c b/drivers/base/core.c > > > > > > > > --- a/drivers/base/core.c > > > > > > > > > > > > +++ b/drivers/base/core.c > > > > @@ -154,6 +154,13 @@ static struct kset_hotplug_ops device_ho > > > > =09.hotplug =3D=09dev_hotplug, > > > > > > > > > > > > }; > > > > > > > > +static ssize_t store_uevent(struct device *dev, struct device_attr= ibute *attr, > > > > > > > > > > > > > > > > +=09=09=09 const char *buf, size_t count) > > > > +{ > > > > +=09kobject_hotplug(&dev->kobj, KOBJ_ADD); > > > > +=09return count; > > > > > > > > > > > > +} > > > > + > > > > /** > > > > *=09device_subsys - structure to be registered with kobject core. > > > > */ > > > > > > > > @@ -258,6 +265,14 @@ int device_add(struct device *dev) > > > > > > > > > > > > > > > > =09if ((error =3D kobject_add(&dev->kobj))) > > > > > > > > > > > > =09=09goto Error; > > > > + > > > > +=09dev->uevent_attr.attr.name =3D "uevent"; > > > > +=09dev->uevent_attr.attr.mode =3D S_IWUSR; > > > > > > > > +=09if (dev->driver) > > > > +=09=09dev->uevent_attr.attr.owner =3D dev->driver->owner; > > > > > > > > > > > > > > > > +=09dev->uevent_attr.store =3D store_uevent; > > > > +=09device_create_file(dev, &dev->uevent_attr); > > > > + > > > > =09kobject_hotplug(&dev->kobj, KOBJ_ADD); > > > > > > > > =09if ((error =3D device_pm_add(dev))) > > > > =09=09goto PMError; > > > > > > > > > > > > > > > > > > > > @@ -349,6 +364,7 @@ void device_del(struct device * dev) > > > > > > > > =09if (parent) > > > > =09=09klist_del(&dev->knode_parent); > > > > +=09device_remove_file(dev, &dev->uevent_attr); > > > > > > > > > > > > =09/* Notify the platform of the removal, in case they > > > > > > > > > > > > > > > > > > > > =09 * need to do anything... > > > > diff --git a/drivers/block/genhd.c b/drivers/block/genhd.c > > > > --- a/drivers/block/genhd.c > > > > +++ b/drivers/block/genhd.c > > > > > > > > @@ -337,10 +337,30 @@ static ssize_t disk_attr_show(struct kob > > > > > > > > > > > > > > > > > > > > =09return ret; > > > > } > > > > > > > > +static ssize_t disk_attr_store(struct kobject * kobj, struct attri= bute * attr, > > > > +=09=09=09 const char *page, size_t count) > > > > > > > > +{ > > > > +=09struct gendisk *disk =3D to_disk(kobj); > > > > > > > > > > > > +=09struct disk_attribute *disk_attr =3D > > > > > > > > > > > > +=09=09container_of(attr,struct disk_attribute,attr); > > > > +=09ssize_t ret =3D 0; > > > > + > > > > +=09if (disk_attr->store) > > > > +=09=09ret =3D disk_attr->store(disk, page, count); > > > > > > > > +=09return ret; > > > > > > > > > > > > +} > > > > + > > > > static struct sysfs_ops disk_sysfs_ops =3D { > > > > > > > > > > > > =09.show=09=3D &disk_attr_show, > > > > +=09.store=09=3D &disk_attr_store, > > > > }; > > > > > > > > +static ssize_t disk_uevent_store(struct gendisk * disk, > > > > > > > > +=09=09=09=09 const char *buf, size_t count) > > > > > > > > > > > > +{ > > > > +=09kobject_hotplug(&disk->kobj, KOBJ_ADD); > > > > > > > > > > > > +=09return count; > > > > +} > > > > static ssize_t disk_dev_read(struct gendisk * disk, char *page) > > > > { > > > > =09dev_t base =3D MKDEV(disk->major, disk->first_minor); > > > > > > > > > > > > > > > > @@ -382,6 +402,10 @@ static ssize_t disk_stats_read(struct ge > > > > > > > > > > > > =09=09jiffies_to_msecs(disk_stat_read(disk, io_ticks)), > > > > =09=09jiffies_to_msecs(disk_stat_read(disk, time_in_queue))); > > > > } > > > > +static struct disk_attribute disk_attr_uevent =3D { > > > > > > > > > > > > > > > > +=09.attr =3D {.name =3D "uevent", .mode =3D S_IWUSR }, > > > > > > > > > > > > +=09.store=09=3D disk_uevent_store > > > > +}; > > > > static struct disk_attribute disk_attr_dev =3D { > > > > =09.attr =3D {.name =3D "dev", .mode =3D S_IRUGO }, > > > > > > > > > > > > > > > > =09.show=09=3D disk_dev_read > > > > @@ -404,6 +428,7 @@ static struct disk_attribute disk_attr_s > > > > > > > > > > > > }; > > > > > > > > static struct attribute * default_attrs[] =3D { > > > > +=09&disk_attr_uevent.attr, > > > > =09&disk_attr_dev.attr, > > > > > > > > > > > > > > > > =09&disk_attr_range.attr, > > > > =09&disk_attr_removable.attr, > > > > diff --git a/fs/partitions/check.c b/fs/partitions/check.c > > > > > > > > > > > > --- a/fs/partitions/check.c > > > > +++ b/fs/partitions/check.c > > > > @@ -192,6 +192,7 @@ check_partition(struct gendisk *hd, stru > > > > > > > > > > > > > > > > struct part_attribute { > > > > =09struct attribute attr; > > > > =09ssize_t (*show)(struct hd_struct *,char *); > > > > > > > > > > > > +=09ssize_t (*store)(struct hd_struct *,const char *, size_t); > > > > }; > > > > > > > > static ssize_t > > > > > > > > @@ -201,14 +202,33 @@ part_attr_show(struct kobject * kobj, st > > > > > > > > > > > > =09struct part_attribute * part_attr =3D container_of(attr,struct = part_attribute,attr); > > > > > > > > > > > > =09ssize_t ret =3D 0; > > > > =09if (part_attr->show) > > > > > > > > -=09=09ret =3D part_attr->show(p,page); > > > > +=09=09ret =3D part_attr->show(p, page); > > > > > > > > > > > > +=09return ret; > > > > +} > > > > +static ssize_t > > > > +part_attr_store(struct kobject * kobj, struct attribute * attr, > > > > > > > > > > > > +=09=09const char *page, size_t count) > > > > > > > > +{ > > > > +=09struct hd_struct * p =3D container_of(kobj,struct hd_struct,kob= j); > > > > > > > > > > > > +=09struct part_attribute * part_attr =3D container_of(attr,struct = part_attribute,attr); > > > > +=09ssize_t ret =3D 0; > > > > > > > > > > > > + > > > > +=09if (part_attr->store) > > > > > > > > +=09=09ret =3D part_attr->store(p, page, count); > > > > =09return ret; > > > > > > > > > > > > } > > > > > > > > static struct sysfs_ops part_sysfs_ops =3D { > > > > =09.show=09=3D=09part_attr_show, > > > > +=09.store=09=3D=09part_attr_store, > > > > > > > > > > > > }; > > > > > > > > +static ssize_t part_uevent_store(struct hd_struct * p, > > > > +=09=09=09=09 const char *page, size_t count) > > > > > > > > > > > > > > > > +{ > > > > +=09kobject_hotplug(&p->kobj, KOBJ_ADD); > > > > +=09return count; > > > > +} > > > > static ssize_t part_dev_read(struct hd_struct * p, char *page) > > > > > > > > > > > > { > > > > =09struct gendisk *disk =3D container_of(p->kobj.parent > > > > > > > > ,struct gendisk,kobj); > > > > > > > > @@ -229,6 +249,10 @@ static ssize_t part_stat_read(struct hd_ > > > > =09=09 p->reads, (unsigned long long)p->read_sectors, > > > > > > > > > > > > =09=09 p->writes, (unsigned long long)p->write_sectors); > > > > > > > > > > > > } > > > > +static struct part_attribute part_attr_uevent =3D { > > > > > > > > +=09.attr =3D {.name =3D "uevent", .mode =3D S_IWUSR }, > > > > +=09.store=09=3D part_uevent_store > > > > > > > > > > > > +}; > > > > static struct part_attribute part_attr_dev =3D { > > > > > > > > > > > > =09.attr =3D {.name =3D "dev", .mode =3D S_IRUGO }, > > > > > > > > =09.show=09=3D part_dev_read > > > > @@ -247,6 +271,7 @@ static struct part_attribute part_attr_s > > > > }; > > > > > > > > > > > > static struct attribute * default_attrs[] =3D { > > > > > > > > +=09&part_attr_uevent.attr, > > > > =09&part_attr_dev.attr, > > > > > > > > > > > > > > > > =09&part_attr_start.attr, > > > > =09&part_attr_size.attr, > > > > diff --git a/include/linux/device.h b/include/linux/device.h > > > > > > > > --- a/include/linux/device.h > > > > > > > > +++ b/include/linux/device.h > > > > @@ -190,6 +190,18 @@ struct class_attribute class_attr_##_nam > > > > > > > > > > > > > > > > extern int class_create_file(struct class *, const struct class_at= tribute *); > > > > extern void class_remove_file(struct class *, const struct class_a= ttribute *); > > > > > > > > > > > > > > > > +struct class_device_attribute { > > > > > > > > > > > > +=09struct attribute=09attr; > > > > > > > > +=09ssize_t (*show)(struct class_device *, char * buf); > > > > +=09ssize_t (*store)(struct class_device *, const char * buf, size_= t count); > > > > +}; > > > > + > > > > > > > > +#define CLASS_DEVICE_ATTR(_name,_mode,_show,_store)=09=09\ > > > > > > > > > > > > > > > > +struct class_device_attribute class_device_attr_##_name =3D =09\ > > > > > > > > +=09__ATTR(_name,_mode,_show,_store) > > > > + > > > > +extern int class_device_create_file(struct class_device *, > > > > > > > > +=09=09=09=09 const struct class_device_attribute *); > > > > > > > > > > > > > > > > > > > > struct class_device { > > > > =09struct list_head=09node; > > > > > > > > @@ -198,6 +210,7 @@ struct class_device { > > > > =09struct class=09=09* class;=09/* required */ > > > > =09dev_t=09=09=09devt;=09=09/* dev_t, creates the sysfs "dev" */ > > > > > > > > > > > > > > > > =09struct class_device_attribute *devt_attr; > > > > > > > > +=09struct class_device_attribute uevent_attr; > > > > > > > > =09struct device=09=09* dev;=09=09/* not necessary, but nice to ha= ve */ > > > > =09void=09=09=09* class_data;=09/* class-specific data */ > > > > > > > > > > > > > > > > > > > > @@ -228,18 +241,6 @@ extern int class_device_rename(struct cl > > > > > > > > extern struct class_device * class_device_get(struct class_device = *); > > > > > > > > extern void class_device_put(struct class_device *); > > > > > > > > > > > > > > > > -struct class_device_attribute { > > > > > > > > -=09struct attribute=09attr; > > > > -=09ssize_t (*show)(struct class_device *, char * buf); > > > > > > > > -=09ssize_t (*store)(struct class_device *, const char * buf, size_= t count); > > > > > > > > -}; > > > > - > > > > > > > > > > > > -#define CLASS_DEVICE_ATTR(_name,_mode,_show,_store)=09=09\ > > > > > > > > -struct class_device_attribute class_device_attr_##_name =3D =09\ > > > > -=09__ATTR(_name,_mode,_show,_store) > > > > > > > > - > > > > -extern int class_device_create_file(struct class_device *, > > > > > > > > > > > > > > > > -=09=09=09=09 const struct class_device_attribute *); > > > > > > > > extern void class_device_remove_file(struct class_device *, > > > > =09=09=09=09 const struct class_device_attribute *); > > > > > > > > extern int class_device_create_bin_file(struct class_device *, > > > > > > > > > > > > > > > > @@ -266,6 +267,20 @@ extern struct class_device *class_device > > > > > > > > extern void class_device_destroy(struct class *cls, dev_t devt); > > > > > > > > > > > > +/* interface for exporting device attributes */ > > > > > > > > +struct device_attribute { > > > > > > > > > > > > > > > > +=09struct attribute=09attr; > > > > +=09ssize_t (*show)(struct device *dev, struct device_attribute *at= tr, > > > > > > > > +=09=09=09char *buf); > > > > +=09ssize_t (*store)(struct device *dev, struct device_attribute *a= ttr, > > > > > > > > +=09=09=09 const char *buf, size_t count); > > > > > > > > > > > > > > > > +}; > > > > + > > > > +#define DEVICE_ATTR(_name,_mode,_show,_store) \ > > > > +struct device_attribute dev_attr_##_name =3D __ATTR(_name,_mode,_s= how,_store) > > > > > > > > + > > > > +extern int device_create_file(struct device *device, struct device= _attribute * entry); > > > > > > > > > > > > > > > > > > > > +extern void device_remove_file(struct device * dev, struct device_= attribute * attr); > > > > struct device { > > > > =09struct klist=09=09klist_children; > > > > > > > > =09struct klist_node=09knode_parent;=09=09/* node in sibling list = */ > > > > > > > > > > > > > > > > @@ -275,6 +290,7 @@ struct device { > > > > > > > > > > > > =09struct kobject kobj; > > > > =09char=09bus_id[BUS_ID_SIZE];=09/* position on parent bus */ > > > > +=09struct device_attribute uevent_attr; > > > > > > > > > > > > =09struct semaphore=09sem;=09/* semaphore to synchronize calls to > > > > > > > > > > > > > > > > =09=09=09=09=09 * its driver. > > > > > > > > @@ -343,23 +359,6 @@ extern int device_attach(struct device > > > > extern void driver_attach(struct device_driver * drv); > > > > > > > > > > > > > > > > -/* driverfs interface for exporting device attributes */ > > > > > > > > > > > > > > > > - > > > > -struct device_attribute { > > > > > > > > -=09struct attribute=09attr; > > > > -=09ssize_t (*show)(struct device *dev, struct device_attribute *at= tr, > > > > -=09=09=09char *buf); > > > > > > > > -=09ssize_t (*store)(struct device *dev, struct device_attribute *a= ttr, > > > > > > > > > > > > > > > > -=09=09=09 const char *buf, size_t count); > > > > > > > > -}; > > > > - > > > > -#define DEVICE_ATTR(_name,_mode,_show,_store) \ > > > > -struct device_attribute dev_attr_##_name =3D __ATTR(_name,_mode,_s= how,_store) > > > > > > > > - > > > > - > > > > -extern int device_create_file(struct device *device, struct device= _attribute * entry); > > > > > > > > > > > > > > > > > > > > -extern void device_remove_file(struct device * dev, struct device_= attribute * attr); > > > > - > > > > /* > > > > * Platform "fixup" functions - allow the platform to have their s= ay > > > > > > > > * about devices and actions that the general device layer doesn't > > > > > > > > > > > > > > > > > > > > diff --git a/include/linux/genhd.h b/include/linux/genhd.h > > > > --- a/include/linux/genhd.h > > > > +++ b/include/linux/genhd.h > > > > @@ -132,6 +132,7 @@ struct gendisk { > > > > > > > > struct disk_attribute { > > > > =09struct attribute attr; > > > > > > > > > > > > > > > > > > > > =09ssize_t (*show)(struct gendisk *, char *); > > > > +=09ssize_t (*store)(struct gendisk *, const char *, size_t); > > > > }; > > > > > > > > /* > > > > --------------------------------------- > > > > > > > > > > > > > > > > > > > > On 3/9/06, John B < joh...@gm...> wrote: > > > > > > > > > > > > > > > On 3/9/06, Tony Brijeski < tb...@gm...> wrote: > > > > > > > > > > > Found a better patch but it is for the kernel. The uevent > > > > > > patch. It will be included in the 2.6.16 kernel so it might be > > > > > > best to just wait till 2.6.16 goes stable. > > > > > > > > > > > > These 3 lines will then replace the whole udevstart/coldplug > > > > > > issue and much better than udevsynthesize. > > > > > > > > > > > > for i in /sys/block/*/*/uevent; do echo 1 > $i; done > > > > > > for i in /sys/class/*/*/uevent; do echo 1 > $i; done > > > > > > for i in /sys/bus/*/devices/*/uevent; do echo 1 > $i; done > > > > > > > > > > > > Let me know what you folks think. I can patch the stock kernel > > > > > > we use if we want to play with it before 2.6.16 comes out. > > > > > > > > > > > > > > > > Tony, > > > > > > > > > > I wouldn't mind playing around with a pre-2.6.16 kernel patched > > > > > with this patch. FWIW, I have the source for 2.6.13 sitting on my > > > > > box. If you can let me know via a unified diff which file(s) need= to be > > > > > patched, I'll roll my own 2.6.13 kernel for my box and see how > > > > > well it works for me. ;-) > > > > > > > > > > Thanks, > > > > > John > > > > > > > > > > > > > > > > > > > |
From: uel a. <ue...@gm...> - 2006-03-11 17:42:06
|
I tried to patch the kernel like this [root@vector/usr/src/linux-2.6.13-Uevent]# patch -p1 <uevent* patching file drivers/base/class.c Hunk #1 FAILED at 442. 1 out of 1 hunk FAILED -- saving rejects to file drivers/base/class.c.rej missing header for unified diff at line 23 of patch can't find file to patch at input line 23 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- | { | kobj_set_kset_s(class_dev, class_obj_subsys); | -------------------------- any ideas what I am doing wrong? On 3/9/06, Tony Brijeski <tb...@gm...> wrote: > > You just have to make sure you enable uevent in the kernel. > > I also forgot to mention you must keep hotplug from running - it is in th= e > sysvinit section. Just chmod 644 the hotplug script and that should work= . > > I would recommend renaming rc.udev to rc.udev.orig and create the new > rc.udev with the 5 or so lines needed to set udev up for uevent. > > Regards, > Tony > > > > On 3/9/06, Sriram Durbha <sri...@gm...> wrote: > > > > hi folks, > > the kernel is at 2.6.16-rc5 now .. i hope it will be ready in a few > > weeks time. > > would i be missing something tony is doing if i just took the > > 2.6.16-rc5 kernel and follwed the other instructions abt hot/cold plog > > removal ? > > cheers > > ram > > > > > > On 3/9/06, Tony Brijeski < tb...@gm...> wrote: > > > > > > Here is the patch. It adds a uevent to each block,char or bus device > > > that you simply do the echo to at bootup. > > > > > > You have to remove udevstart starting from rc.udev. > > > You also have to remove hotplug from the kernel. > > > > > > echo "/dev/null" > /proc/sys/kernel/hotplug > > > > > > You must remove hotplug before you start udev. > > > > > > This is how I would change rc.udev: > > > > > > put the echo "/dev/null" statement at the top. > > > comment out all the udev stuff and jsut put this: > > > > > > /sbin/udevd --daemon > > > > > > Now add the for statements to echo the uevents. > > > > > > This should set everything up. > > > > > > Hotplug won't be needed as the kernel will send a uevent to udev and > > > get things going that way. > > > > > > This, IMHO, is the way to go as it makes hotplugging and coldplugging > > > a thing of the past and just leaves everything up to udev rules. > > > > > > You can leave udev at the version it is now and see how it works. > > > > > > After you patch the kernel, a "make oldconfig" should offer you the > > > new option of sending uevents from the kernel. > > > > > > This whole method will be the easiest to manage as udev will be a > > > one-stop shop for everything and then we can just concentrate on the = udev > > > rules to add function and improve device support and config. > > > > > > If this works, I would only offer this fix to those that have config > > > problems today to see if it works for them. Making this mass deploym= ent > > > might create a headache if we encounter other issues. > > > > > > I am a huge proponent of the "if it ain't broke don't fix it" > > > mentality. > > > > > > Moving forward, we need to upgrade udev to the latest anyway. > > > > > > Patch below between the hash lines > > > > > > ------------------------------------- > > > > > > > > > diff --git a/drivers/base/class.c b/drivers/base/class.c > > > > > > > > > > > > --- a/drivers/base/class.c > > > +++ b/drivers/base/class.c > > > > > > @@ -442,6 +442,13 @@ static ssize_t show_dev(struct class_dev > > > =09return print_dev_t(buf, class_dev->devt); > > > } > > > > > > +static ssize_t store_uevent(struct class_device *class_dev, > > > > > > > > > > > > +=09=09=09 const char *buf, size_t count) > > > > > > +{ > > > +=09kobject_hotplug(&class_dev->kobj, KOBJ_ADD); > > > +=09return count; > > > +} > > > + > > > void class_device_initialize(struct class_device *class_dev) > > > { > > > > > > =09kobj_set_kset_s(class_dev, class_obj_subsys); > > > > > > > > > @@ -497,6 +504,12 @@ int class_device_add(struct class_device > > > > > > =09=09goto register_done; > > > > > > =09/* add the needed attributes to this device */ > > > +=09class_dev->uevent_attr.attr.name =3D "uevent"; > > > > > > > > > +=09class_dev->uevent_attr.attr.mode =3D S_IWUSR; > > > > > > +=09class_dev->uevent_attr.attr.owner =3D parent->owner; > > > > > > +=09class_dev->uevent_attr.store =3D store_uevent; > > > +=09class_device_create_file(class_dev, &class_dev->uevent_attr); > > > > > > > > > + > > > =09if (MAJOR(class_dev->devt)) { > > > > > > =09=09struct class_device_attribute *attr; > > > =09=09attr =3D kzalloc(sizeof(*attr), GFP_KERNEL); > > > > > > @@ -505,12 +518,10 @@ int class_device_add(struct class_device > > > =09=09=09kobject_del(&class_dev->kobj); > > > > > > > > > =09=09=09goto register_done; > > > > > > =09=09} > > > - > > > =09=09attr->attr.name =3D "dev"; > > > > > > =09=09attr->attr.mode > > > =3D S_IRUGO; > > > > > > =09=09attr->attr.owner > > > =3D parent->owner; > > > =09=09attr->show =3D show_dev; > > > -=09=09attr->store =3D NULL; > > > =09=09class_device_create_file(class_dev, attr); > > > =09=09class_dev->devt_attr =3D attr; > > > > > > > > > =09} > > > @@ -620,6 +631,7 @@ void class_device_del(struct class_devic > > > > > > > > > =09=09sysfs_remove_link(&class_dev->kobj, "device"); > > > =09=09sysfs_remove_link(&class_dev->dev->kobj, class_name); > > > =09} > > > > > > > > > +=09class_device_remove_file(class_dev, &class_dev->uevent_attr); > > > > > > > > > =09if (class_dev->devt_attr) > > > =09=09class_device_remove_file(class_dev, class_dev->devt_attr); > > > =09class_device_remove_attrs(class_dev); > > > > > > diff --git a/drivers/base/core.c b/drivers/base/core.c > > > > > > --- a/drivers/base/core.c > > > > > > > > > +++ b/drivers/base/core.c > > > @@ -154,6 +154,13 @@ static struct kset_hotplug_ops device_ho > > > =09.hotplug =3D=09dev_hotplug, > > > > > > }; > > > > > > +static ssize_t store_uevent(struct device *dev, struct device_attrib= ute *attr, > > > > > > > > > > > > +=09=09=09 const char *buf, size_t count) > > > +{ > > > +=09kobject_hotplug(&dev->kobj, KOBJ_ADD); > > > +=09return count; > > > > > > +} > > > + > > > /** > > > *=09device_subsys - structure to be registered with kobject core. > > > */ > > > > > > @@ -258,6 +265,14 @@ int device_add(struct device *dev) > > > > > > > > > > > > =09if ((error =3D kobject_add(&dev->kobj))) > > > > > > =09=09goto Error; > > > + > > > +=09dev->uevent_attr.attr.name =3D "uevent"; > > > +=09dev->uevent_attr.attr.mode =3D S_IWUSR; > > > > > > +=09if (dev->driver) > > > +=09=09dev->uevent_attr.attr.owner =3D dev->driver->owner; > > > > > > > > > +=09dev->uevent_attr.store =3D store_uevent; > > > +=09device_create_file(dev, &dev->uevent_attr); > > > + > > > =09kobject_hotplug(&dev->kobj, KOBJ_ADD); > > > > > > =09if ((error =3D device_pm_add(dev))) > > > =09=09goto PMError; > > > > > > > > > > > > @@ -349,6 +364,7 @@ void device_del(struct device * dev) > > > > > > =09if (parent) > > > =09=09klist_del(&dev->knode_parent); > > > +=09device_remove_file(dev, &dev->uevent_attr); > > > > > > > > > =09/* Notify the platform of the removal, in case they > > > > > > > > > > > > =09 * need to do anything... > > > diff --git a/drivers/block/genhd.c b/drivers/block/genhd.c > > > --- a/drivers/block/genhd.c > > > +++ b/drivers/block/genhd.c > > > > > > @@ -337,10 +337,30 @@ static ssize_t disk_attr_show(struct kob > > > > > > > > > > > > =09return ret; > > > } > > > > > > +static ssize_t disk_attr_store(struct kobject * kobj, struct attribu= te * attr, > > > +=09=09=09 const char *page, size_t count) > > > > > > +{ > > > +=09struct gendisk *disk =3D to_disk(kobj); > > > > > > +=09struct disk_attribute *disk_attr =3D > > > > > > > > > +=09=09container_of(attr,struct disk_attribute,attr); > > > +=09ssize_t ret =3D 0; > > > + > > > +=09if (disk_attr->store) > > > +=09=09ret =3D disk_attr->store(disk, page, count); > > > > > > +=09return ret; > > > > > > +} > > > + > > > static struct sysfs_ops disk_sysfs_ops =3D { > > > > > > > > > =09.show=09=3D &disk_attr_show, > > > +=09.store=09=3D &disk_attr_store, > > > }; > > > > > > +static ssize_t disk_uevent_store(struct gendisk * disk, > > > > > > +=09=09=09=09 const char *buf, size_t count) > > > > > > +{ > > > +=09kobject_hotplug(&disk->kobj, KOBJ_ADD); > > > > > > > > > +=09return count; > > > +} > > > static ssize_t disk_dev_read(struct gendisk * disk, char *page) > > > { > > > =09dev_t base =3D MKDEV(disk->major, disk->first_minor); > > > > > > > > > @@ -382,6 +402,10 @@ static ssize_t disk_stats_read(struct ge > > > > > > > > > =09=09jiffies_to_msecs(disk_stat_read(disk, io_ticks)), > > > =09=09jiffies_to_msecs(disk_stat_read(disk, time_in_queue))); > > > } > > > +static struct disk_attribute disk_attr_uevent =3D { > > > > > > > > > +=09.attr =3D {.name =3D "uevent", .mode =3D S_IWUSR }, > > > > > > > > > +=09.store=09=3D disk_uevent_store > > > +}; > > > static struct disk_attribute disk_attr_dev =3D { > > > =09.attr =3D {.name =3D "dev", .mode =3D S_IRUGO }, > > > > > > > > > =09.show=09=3D disk_dev_read > > > @@ -404,6 +428,7 @@ static struct disk_attribute disk_attr_s > > > > > > > > > }; > > > > > > static struct attribute * default_attrs[] =3D { > > > +=09&disk_attr_uevent.attr, > > > =09&disk_attr_dev.attr, > > > > > > > > > =09&disk_attr_range.attr, > > > =09&disk_attr_removable.attr, > > > diff --git a/fs/partitions/check.c b/fs/partitions/check.c > > > > > > > > > --- a/fs/partitions/check.c > > > +++ b/fs/partitions/check.c > > > @@ -192,6 +192,7 @@ check_partition(struct gendisk *hd, stru > > > > > > > > > struct part_attribute { > > > =09struct attribute attr; > > > =09ssize_t (*show)(struct hd_struct *,char *); > > > > > > > > > +=09ssize_t (*store)(struct hd_struct *,const char *, size_t); > > > }; > > > > > > static ssize_t > > > @@ -201,14 +202,33 @@ part_attr_show(struct kobject * kobj, st > > > > > > > > > =09struct part_attribute * part_attr =3D container_of(attr,struct pa= rt_attribute,attr); > > > > > > > > > =09ssize_t ret =3D 0; > > > =09if (part_attr->show) > > > -=09=09ret =3D part_attr->show(p,page); > > > +=09=09ret =3D part_attr->show(p, page); > > > > > > > > > +=09return ret; > > > +} > > > +static ssize_t > > > +part_attr_store(struct kobject * kobj, struct attribute * attr, > > > > > > > > > +=09=09const char *page, size_t count) > > > +{ > > > +=09struct hd_struct * p =3D container_of(kobj,struct hd_struct,kobj)= ; > > > > > > > > > +=09struct part_attribute * part_attr =3D container_of(attr,struct pa= rt_attribute,attr); > > > +=09ssize_t ret =3D 0; > > > > > > > > > + > > > +=09if (part_attr->store) > > > +=09=09ret =3D part_attr->store(p, page, count); > > > =09return ret; > > > > > > > > > } > > > > > > static struct sysfs_ops part_sysfs_ops =3D { > > > =09.show=09=3D=09part_attr_show, > > > +=09.store=09=3D=09part_attr_store, > > > > > > > > > }; > > > > > > +static ssize_t part_uevent_store(struct hd_struct * p, > > > +=09=09=09=09 const char *page, size_t count) > > > > > > > > > +{ > > > +=09kobject_hotplug(&p->kobj, KOBJ_ADD); > > > +=09return count; > > > +} > > > static ssize_t part_dev_read(struct hd_struct * p, char *page) > > > > > > > > > { > > > =09struct gendisk *disk =3D container_of(p->kobj.parent > > > ,struct gendisk,kobj); > > > > > > @@ -229,6 +249,10 @@ static ssize_t part_stat_read(struct hd_ > > > =09=09 p->reads, (unsigned long long)p->read_sectors, > > > > > > > > > =09=09 p->writes, (unsigned long long)p->write_sectors); > > > > > > } > > > +static struct part_attribute part_attr_uevent =3D { > > > > > > +=09.attr =3D {.name =3D "uevent", .mode =3D S_IWUSR }, > > > +=09.store=09=3D part_uevent_store > > > > > > > > > +}; > > > static struct part_attribute part_attr_dev =3D { > > > > > > =09.attr =3D {.name =3D "dev", .mode =3D S_IRUGO }, > > > > > > =09.show=09=3D part_dev_read > > > @@ -247,6 +271,7 @@ static struct part_attribute part_attr_s > > > }; > > > > > > > > > static struct attribute * default_attrs[] =3D { > > > > > > +=09&part_attr_uevent.attr, > > > =09&part_attr_dev.attr, > > > > > > > > > =09&part_attr_start.attr, > > > =09&part_attr_size.attr, > > > diff --git a/include/linux/device.h b/include/linux/device.h > > > > > > --- a/include/linux/device.h > > > > > > +++ b/include/linux/device.h > > > @@ -190,6 +190,18 @@ struct class_attribute class_attr_##_nam > > > > > > > > > extern int class_create_file(struct class *, const struct class_attr= ibute *); > > > extern void class_remove_file(struct class *, const struct class_att= ribute *); > > > > > > > > > > > > +struct class_device_attribute { > > > > > > +=09struct attribute=09attr; > > > > > > +=09ssize_t (*show)(struct class_device *, char * buf); > > > +=09ssize_t (*store)(struct class_device *, const char * buf, size_t = count); > > > +}; > > > + > > > > > > +#define CLASS_DEVICE_ATTR(_name,_mode,_show,_store)=09=09\ > > > > > > > > > +struct class_device_attribute class_device_attr_##_name =3D =09\ > > > > > > +=09__ATTR(_name,_mode,_show,_store) > > > + > > > +extern int class_device_create_file(struct class_device *, > > > > > > +=09=09=09=09 const struct class_device_attribute *); > > > > > > > > > > > > struct class_device { > > > =09struct list_head=09node; > > > > > > @@ -198,6 +210,7 @@ struct class_device { > > > =09struct class=09=09* class;=09/* required */ > > > =09dev_t=09=09=09devt;=09=09/* dev_t, creates the sysfs "dev" */ > > > > > > > > > =09struct class_device_attribute *devt_attr; > > > > > > +=09struct class_device_attribute uevent_attr; > > > > > > =09struct device=09=09* dev;=09=09/* not necessary, but nice to have= */ > > > =09void=09=09=09* class_data;=09/* class-specific data */ > > > > > > > > > > > > @@ -228,18 +241,6 @@ extern int class_device_rename(struct cl > > > > > > extern struct class_device * class_device_get(struct class_device *)= ; > > > > > > extern void class_device_put(struct class_device *); > > > > > > > > > -struct class_device_attribute { > > > > > > -=09struct attribute=09attr; > > > -=09ssize_t (*show)(struct class_device *, char * buf); > > > > > > -=09ssize_t (*store)(struct class_device *, const char * buf, size_t = count); > > > > > > -}; > > > - > > > > > > -#define CLASS_DEVICE_ATTR(_name,_mode,_show,_store)=09=09\ > > > > > > -struct class_device_attribute class_device_attr_##_name =3D =09\ > > > -=09__ATTR(_name,_mode,_show,_store) > > > > > > - > > > -extern int class_device_create_file(struct class_device *, > > > > > > > > > -=09=09=09=09 const struct class_device_attribute *); > > > > > > extern void class_device_remove_file(struct class_device *, > > > =09=09=09=09 const struct class_device_attribute *); > > > > > > extern int class_device_create_bin_file(struct class_device *, > > > > > > > > > @@ -266,6 +267,20 @@ extern struct class_device *class_device > > > > > > extern void class_device_destroy(struct class *cls, dev_t devt); > > > > > > > > > +/* interface for exporting device attributes */ > > > > > > +struct device_attribute { > > > > > > > > > +=09struct attribute=09attr; > > > +=09ssize_t (*show)(struct device *dev, struct device_attribute *attr= , > > > > > > +=09=09=09char *buf); > > > +=09ssize_t (*store)(struct device *dev, struct device_attribute *att= r, > > > > > > +=09=09=09 const char *buf, size_t count); > > > > > > > > > +}; > > > + > > > +#define DEVICE_ATTR(_name,_mode,_show,_store) \ > > > +struct device_attribute dev_attr_##_name =3D __ATTR(_name,_mode,_sho= w,_store) > > > > > > + > > > +extern int device_create_file(struct device *device, struct device_a= ttribute * entry); > > > > > > > > > > > > +extern void device_remove_file(struct device * dev, struct device_at= tribute * attr); > > > struct device { > > > =09struct klist=09=09klist_children; > > > > > > =09struct klist_node=09knode_parent;=09=09/* node in sibling list */ > > > > > > > > > @@ -275,6 +290,7 @@ struct device { > > > > > > > > > =09struct kobject kobj; > > > =09char=09bus_id[BUS_ID_SIZE];=09/* position on parent bus */ > > > +=09struct device_attribute uevent_attr; > > > > > > > > > =09struct semaphore=09sem;=09/* semaphore to synchronize calls to > > > > > > > > > =09=09=09=09=09 * its driver. > > > > > > @@ -343,23 +359,6 @@ extern int device_attach(struct device > > > extern void driver_attach(struct device_driver * drv); > > > > > > > > > > > > -/* driverfs interface for exporting device attributes */ > > > > > > > > > - > > > -struct device_attribute { > > > > > > -=09struct attribute=09attr; > > > -=09ssize_t (*show)(struct device *dev, struct device_attribute *attr= , > > > -=09=09=09char *buf); > > > > > > -=09ssize_t (*store)(struct device *dev, struct device_attribute *att= r, > > > > > > > > > -=09=09=09 const char *buf, size_t count); > > > > > > -}; > > > - > > > -#define DEVICE_ATTR(_name,_mode,_show,_store) \ > > > -struct device_attribute dev_attr_##_name =3D __ATTR(_name,_mode,_sho= w,_store) > > > > > > - > > > - > > > -extern int device_create_file(struct device *device, struct device_a= ttribute * entry); > > > > > > > > > > > > -extern void device_remove_file(struct device * dev, struct device_at= tribute * attr); > > > - > > > /* > > > * Platform "fixup" functions - allow the platform to have their say > > > > > > * about devices and actions that the general device layer doesn't > > > > > > > > > > > > diff --git a/include/linux/genhd.h b/include/linux/genhd.h > > > --- a/include/linux/genhd.h > > > +++ b/include/linux/genhd.h > > > @@ -132,6 +132,7 @@ struct gendisk { > > > > > > struct disk_attribute { > > > =09struct attribute attr; > > > > > > > > > > > > =09ssize_t (*show)(struct gendisk *, char *); > > > +=09ssize_t (*store)(struct gendisk *, const char *, size_t); > > > }; > > > > > > /* > > > --------------------------------------- > > > > > > > > > > > > > > > On 3/9/06, John B < joh...@gm...> wrote: > > > > > > > > > > > > On 3/9/06, Tony Brijeski < tb...@gm...> wrote: > > > > > > > > > Found a better patch but it is for the kernel. The uevent patch. > > > > > It will be included in the 2.6.16 kernel so it might be best to > > > > > just wait till 2.6.16 goes stable. > > > > > > > > > > These 3 lines will then replace the whole udevstart/coldplug issu= e > > > > > and much better than udevsynthesize. > > > > > > > > > > for i in /sys/block/*/*/uevent; do echo 1 > $i; done > > > > > for i in /sys/class/*/*/uevent; do echo 1 > $i; done > > > > > for i in /sys/bus/*/devices/*/uevent; do echo 1 > $i; done > > > > > > > > > > Let me know what you folks think. I can patch the stock kernel w= e > > > > > use if we want to play with it before 2.6.16 comes out. > > > > > > > > > > > > > Tony, > > > > > > > > I wouldn't mind playing around with a pre-2.6.16 kernel patched wit= h > > > > this patch. FWIW, I have the source for 2.6.13 sitting on my box. I= f > > > > you can let me know via a unified diff which file(s) need to be pat= ched, > > > > I'll roll my own 2.6.13 kernel for my box and see how well it works > > > > for me. ;-) > > > > > > > > Thanks, > > > > John > > > > > > > > > > > > > |
From: Tony B. <tb...@gm...> - 2006-03-10 01:46:01
|
You just have to make sure you enable uevent in the kernel. I also forgot to mention you must keep hotplug from running - it is in the sysvinit section. Just chmod 644 the hotplug script and that should work. I would recommend renaming rc.udev to rc.udev.orig and create the new rc.udev with the 5 or so lines needed to set udev up for uevent. Regards, Tony On 3/9/06, Sriram Durbha <sri...@gm...> wrote: > > hi folks, > the kernel is at 2.6.16-rc5 now .. i hope it will be ready in a few > weeks time. > would i be missing something tony is doing if i just took the 2.6.16-rc= 5kernel and follwed the other instructions abt hot/cold plog removal ? > cheers > ram > > > On 3/9/06, Tony Brijeski <tb...@gm...> wrote: > > > > Here is the patch. It adds a uevent to each block,char or bus device > > that you simply do the echo to at bootup. > > > > You have to remove udevstart starting from rc.udev. > > You also have to remove hotplug from the kernel. > > > > echo "/dev/null" > /proc/sys/kernel/hotplug > > > > You must remove hotplug before you start udev. > > > > This is how I would change rc.udev: > > > > put the echo "/dev/null" statement at the top. > > comment out all the udev stuff and jsut put this: > > > > /sbin/udevd --daemon > > > > Now add the for statements to echo the uevents. > > > > This should set everything up. > > > > Hotplug won't be needed as the kernel will send a uevent to udev and ge= t > > things going that way. > > > > This, IMHO, is the way to go as it makes hotplugging and coldplugging a > > thing of the past and just leaves everything up to udev rules. > > > > You can leave udev at the version it is now and see how it works. > > > > After you patch the kernel, a "make oldconfig" should offer you the new > > option of sending uevents from the kernel. > > > > This whole method will be the easiest to manage as udev will be a > > one-stop shop for everything and then we can just concentrate on the ud= ev > > rules to add function and improve device support and config. > > > > If this works, I would only offer this fix to those that have config > > problems today to see if it works for them. Making this mass deploymen= t > > might create a headache if we encounter other issues. > > > > I am a huge proponent of the "if it ain't broke don't fix it" mentality= . > > > > > > Moving forward, we need to upgrade udev to the latest anyway. > > > > Patch below between the hash lines > > > > ------------------------------------- > > > > > > diff --git a/drivers/base/class.c b/drivers/base/class.c > > > > > > --- a/drivers/base/class.c > > +++ b/drivers/base/class.c > > > > @@ -442,6 +442,13 @@ static ssize_t show_dev(struct class_dev > > =09return print_dev_t(buf, class_dev->devt); > > } > > > > +static ssize_t store_uevent(struct class_device *class_dev, > > > > > > +=09=09=09 const char *buf, size_t count) > > > > +{ > > +=09kobject_hotplug(&class_dev->kobj, KOBJ_ADD); > > +=09return count; > > +} > > + > > void class_device_initialize(struct class_device *class_dev) > > { > > =09kobj_set_kset_s(class_dev, class_obj_subsys); > > > > > > @@ -497,6 +504,12 @@ int class_device_add(struct class_device > > > > =09=09goto register_done; > > > > =09/* add the needed attributes to this device */ > > +=09class_dev->uevent_attr.attr.name =3D "uevent"; > > > > +=09class_dev->uevent_attr.attr.mode =3D S_IWUSR; > > > > +=09class_dev->uevent_attr.attr.owner =3D parent->owner; > > > > +=09class_dev->uevent_attr.store =3D store_uevent; > > +=09class_device_create_file(class_dev, &class_dev->uevent_attr); > > > > + > > =09if (MAJOR(class_dev->devt)) { > > > > =09=09struct class_device_attribute *attr; > > =09=09attr =3D kzalloc(sizeof(*attr), GFP_KERNEL); > > > > @@ -505,12 +518,10 @@ int class_device_add(struct class_device > > =09=09=09kobject_del(&class_dev->kobj); > > > > =09=09=09goto register_done; > > > > =09=09} > > - > > =09=09attr->attr.name =3D "dev"; > > > > =09=09attr->attr.mode =3D S_IRUGO; > > > > =09=09attr->attr.owner > > =3D parent->owner; > > =09=09attr->show =3D show_dev; > > -=09=09attr->store =3D NULL; > > =09=09class_device_create_file(class_dev, attr); > > =09=09class_dev->devt_attr =3D attr; > > > > =09} > > @@ -620,6 +631,7 @@ void class_device_del(struct class_devic > > > > > > =09=09sysfs_remove_link(&class_dev->kobj, "device"); > > =09=09sysfs_remove_link(&class_dev->dev->kobj, class_name); > > =09} > > > > +=09class_device_remove_file(class_dev, &class_dev->uevent_attr); > > > > > > =09if (class_dev->devt_attr) > > =09=09class_device_remove_file(class_dev, class_dev->devt_attr); > > =09class_device_remove_attrs(class_dev); > > diff --git a/drivers/base/core.c b/drivers/base/core.c > > > > --- a/drivers/base/core.c > > > > > > +++ b/drivers/base/core.c > > @@ -154,6 +154,13 @@ static struct kset_hotplug_ops device_ho > > =09.hotplug =3D=09dev_hotplug, > > }; > > > > +static ssize_t store_uevent(struct device *dev, struct device_attribut= e *attr, > > > > > > > > +=09=09=09 const char *buf, size_t count) > > +{ > > +=09kobject_hotplug(&dev->kobj, KOBJ_ADD); > > +=09return count; > > +} > > + > > /** > > *=09device_subsys - structure to be registered with kobject core. > > */ > > > > @@ -258,6 +265,14 @@ int device_add(struct device *dev) > > > > > > > > =09if ((error =3D kobject_add(&dev->kobj))) > > =09=09goto Error; > > + > > +=09dev->uevent_attr.attr.name =3D "uevent"; > > +=09dev->uevent_attr.attr.mode =3D S_IWUSR; > > > > +=09if (dev->driver) > > +=09=09dev->uevent_attr.attr.owner =3D dev->driver->owner; > > > > > > +=09dev->uevent_attr.store =3D store_uevent; > > +=09device_create_file(dev, &dev->uevent_attr); > > + > > =09kobject_hotplug(&dev->kobj, KOBJ_ADD); > > > > =09if ((error =3D device_pm_add(dev))) > > =09=09goto PMError; > > > > > > @@ -349,6 +364,7 @@ void device_del(struct device * dev) > > > > =09if (parent) > > =09=09klist_del(&dev->knode_parent); > > +=09device_remove_file(dev, &dev->uevent_attr); > > > > > > =09/* Notify the platform of the removal, in case they > > > > > > =09 * need to do anything... > > diff --git a/drivers/block/genhd.c b/drivers/block/genhd.c > > --- a/drivers/block/genhd.c > > +++ b/drivers/block/genhd.c > > > > @@ -337,10 +337,30 @@ static ssize_t disk_attr_show(struct kob > > > > > > =09return ret; > > } > > > > +static ssize_t disk_attr_store(struct kobject * kobj, struct attribute= * attr, > > +=09=09=09 const char *page, size_t count) > > > > +{ > > +=09struct gendisk *disk =3D to_disk(kobj); > > +=09struct disk_attribute *disk_attr =3D > > > > > > +=09=09container_of(attr,struct disk_attribute,attr); > > +=09ssize_t ret =3D 0; > > + > > +=09if (disk_attr->store) > > +=09=09ret =3D disk_attr->store(disk, page, count); > > > > +=09return ret; > > +} > > + > > static struct sysfs_ops disk_sysfs_ops =3D { > > > > > > =09.show=09=3D &disk_attr_show, > > +=09.store=09=3D &disk_attr_store, > > }; > > > > +static ssize_t disk_uevent_store(struct gendisk * disk, > > > > +=09=09=09=09 const char *buf, size_t count) > > +{ > > +=09kobject_hotplug(&disk->kobj, KOBJ_ADD); > > > > > > +=09return count; > > +} > > static ssize_t disk_dev_read(struct gendisk * disk, char *page) > > { > > =09dev_t base =3D MKDEV(disk->major, disk->first_minor); > > > > @@ -382,6 +402,10 @@ static ssize_t disk_stats_read(struct ge > > > > > > =09=09jiffies_to_msecs(disk_stat_read(disk, io_ticks)), > > =09=09jiffies_to_msecs(disk_stat_read(disk, time_in_queue))); > > } > > +static struct disk_attribute disk_attr_uevent =3D { > > > > +=09.attr =3D {.name =3D "uevent", .mode =3D S_IWUSR }, > > > > > > +=09.store=09=3D disk_uevent_store > > +}; > > static struct disk_attribute disk_attr_dev =3D { > > =09.attr =3D {.name =3D "dev", .mode =3D S_IRUGO }, > > > > =09.show=09=3D disk_dev_read > > @@ -404,6 +428,7 @@ static struct disk_attribute disk_attr_s > > > > > > }; > > > > static struct attribute * default_attrs[] =3D { > > +=09&disk_attr_uevent.attr, > > =09&disk_attr_dev.attr, > > > > =09&disk_attr_range.attr, > > =09&disk_attr_removable.attr, > > diff --git a/fs/partitions/check.c b/fs/partitions/check.c > > > > > > --- a/fs/partitions/check.c > > +++ b/fs/partitions/check.c > > @@ -192,6 +192,7 @@ check_partition(struct gendisk *hd, stru > > > > struct part_attribute { > > =09struct attribute attr; > > =09ssize_t (*show)(struct hd_struct *,char *); > > > > > > +=09ssize_t (*store)(struct hd_struct *,const char *, size_t); > > }; > > > > static ssize_t > > @@ -201,14 +202,33 @@ part_attr_show(struct kobject * kobj, st > > > > =09struct part_attribute * part_attr =3D container_of(attr,struct part= _attribute,attr); > > > > > > =09ssize_t ret =3D 0; > > =09if (part_attr->show) > > -=09=09ret =3D part_attr->show(p,page); > > +=09=09ret =3D part_attr->show(p, page); > > > > +=09return ret; > > +} > > +static ssize_t > > +part_attr_store(struct kobject * kobj, struct attribute * attr, > > > > > > +=09=09const char *page, size_t count) > > +{ > > +=09struct hd_struct * p =3D container_of(kobj,struct hd_struct,kobj); > > > > +=09struct part_attribute * part_attr =3D container_of(attr,struct part= _attribute,attr); > > +=09ssize_t ret =3D 0; > > > > > > + > > +=09if (part_attr->store) > > +=09=09ret =3D part_attr->store(p, page, count); > > =09return ret; > > > > } > > > > static struct sysfs_ops part_sysfs_ops =3D { > > =09.show=09=3D=09part_attr_show, > > +=09.store=09=3D=09part_attr_store, > > > > > > }; > > > > +static ssize_t part_uevent_store(struct hd_struct * p, > > +=09=09=09=09 const char *page, size_t count) > > > > +{ > > +=09kobject_hotplug(&p->kobj, KOBJ_ADD); > > +=09return count; > > +} > > static ssize_t part_dev_read(struct hd_struct * p, char *page) > > > > > > { > > =09struct gendisk *disk =3D container_of(p->kobj.parent,struct gendisk= ,kobj); > > > > @@ -229,6 +249,10 @@ static ssize_t part_stat_read(struct hd_ > > =09=09 p->reads, (unsigned long long)p->read_sectors, > > > > > > =09=09 p->writes, (unsigned long long)p->write_sectors); > > } > > +static struct part_attribute part_attr_uevent =3D { > > > > +=09.attr =3D {.name =3D "uevent", .mode =3D S_IWUSR }, > > +=09.store=09=3D part_uevent_store > > > > > > +}; > > static struct part_attribute part_attr_dev =3D { > > =09.attr =3D {.name =3D "dev", .mode =3D S_IRUGO }, > > > > =09.show=09=3D part_dev_read > > @@ -247,6 +271,7 @@ static struct part_attribute part_attr_s > > }; > > > > > > static struct attribute * default_attrs[] =3D { > > > > +=09&part_attr_uevent.attr, > > =09&part_attr_dev.attr, > > > > =09&part_attr_start.attr, > > =09&part_attr_size.attr, > > diff --git a/include/linux/device.h b/include/linux/device.h > > > > --- a/include/linux/device.h > > > > +++ b/include/linux/device.h > > @@ -190,6 +190,18 @@ struct class_attribute class_attr_##_nam > > > > extern int class_create_file(struct class *, const struct class_attrib= ute *); > > extern void class_remove_file(struct class *, const struct class_attri= bute *); > > > > > > > > +struct class_device_attribute { > > +=09struct attribute=09attr; > > > > +=09ssize_t (*show)(struct class_device *, char * buf); > > +=09ssize_t (*store)(struct class_device *, const char * buf, size_t co= unt); > > +}; > > + > > > > +#define CLASS_DEVICE_ATTR(_name,_mode,_show,_store)=09=09\ > > > > +struct class_device_attribute class_device_attr_##_name =3D =09\ > > > > +=09__ATTR(_name,_mode,_show,_store) > > + > > +extern int class_device_create_file(struct class_device *, > > > > +=09=09=09=09 const struct class_device_attribute *); > > > > > > struct class_device { > > =09struct list_head=09node; > > > > @@ -198,6 +210,7 @@ struct class_device { > > =09struct class=09=09* class;=09/* required */ > > =09dev_t=09=09=09devt;=09=09/* dev_t, creates the sysfs "dev" */ > > > > =09struct class_device_attribute *devt_attr; > > > > +=09struct class_device_attribute uevent_attr; > > > > =09struct device=09=09* dev;=09=09/* not necessary, but nice to have *= / > > =09void=09=09=09* class_data;=09/* class-specific data */ > > > > > > @@ -228,18 +241,6 @@ extern int class_device_rename(struct cl > > > > extern struct class_device * class_device_get(struct class_device *); > > > > extern void class_device_put(struct class_device *); > > > > -struct class_device_attribute { > > > > -=09struct attribute=09attr; > > -=09ssize_t (*show)(struct class_device *, char * buf); > > > > -=09ssize_t (*store)(struct class_device *, const char * buf, size_t co= unt); > > > > -}; > > - > > -#define CLASS_DEVICE_ATTR(_name,_mode,_show,_store)=09=09\ > > > > -struct class_device_attribute class_device_attr_##_name =3D =09\ > > -=09__ATTR(_name,_mode,_show,_store) > > > > - > > -extern int class_device_create_file(struct class_device *, > > > > -=09=09=09=09 const struct class_device_attribute *); > > > > extern void class_device_remove_file(struct class_device *, > > =09=09=09=09 const struct class_device_attribute *); > > > > extern int class_device_create_bin_file(struct class_device *, > > > > @@ -266,6 +267,20 @@ extern struct class_device *class_device > > > > extern void class_device_destroy(struct class *cls, dev_t devt); > > > > > > +/* interface for exporting device attributes */ > > > > +struct device_attribute { > > > > +=09struct attribute=09attr; > > +=09ssize_t (*show)(struct device *dev, struct device_attribute *attr, > > > > +=09=09=09char *buf); > > +=09ssize_t (*store)(struct device *dev, struct device_attribute *attr, > > > > +=09=09=09 const char *buf, size_t count); > > > > +}; > > + > > +#define DEVICE_ATTR(_name,_mode,_show,_store) \ > > +struct device_attribute dev_attr_##_name =3D __ATTR(_name,_mode,_show,= _store) > > > > + > > +extern int device_create_file(struct device *device, struct device_att= ribute * entry); > > > > > > +extern void device_remove_file(struct device * dev, struct device_attr= ibute * attr); > > struct device { > > =09struct klist=09=09klist_children; > > > > =09struct klist_node=09knode_parent;=09=09/* node in sibling list */ > > > > @@ -275,6 +290,7 @@ struct device { > > > > > > =09struct kobject kobj; > > =09char=09bus_id[BUS_ID_SIZE];=09/* position on parent bus */ > > +=09struct device_attribute uevent_attr; > > > > > > =09struct semaphore=09sem;=09/* semaphore to synchronize calls to > > > > =09=09=09=09=09 * its driver. > > > > @@ -343,23 +359,6 @@ extern int device_attach(struct device > > extern void driver_attach(struct device_driver * drv); > > > > > > > > -/* driverfs interface for exporting device attributes */ > > > > - > > -struct device_attribute { > > > > -=09struct attribute=09attr; > > -=09ssize_t (*show)(struct device *dev, struct device_attribute *attr, > > -=09=09=09char *buf); > > > > -=09ssize_t (*store)(struct device *dev, struct device_attribute *attr, > > > > -=09=09=09 const char *buf, size_t count); > > > > -}; > > - > > -#define DEVICE_ATTR(_name,_mode,_show,_store) \ > > -struct device_attribute dev_attr_##_name =3D __ATTR(_name,_mode,_show,= _store) > > > > - > > - > > -extern int device_create_file(struct device *device, struct device_att= ribute * entry); > > > > > > -extern void device_remove_file(struct device * dev, struct device_attr= ibute * attr); > > - > > /* > > * Platform "fixup" functions - allow the platform to have their say > > > > * about devices and actions that the general device layer doesn't > > > > > > diff --git a/include/linux/genhd.h b/include/linux/genhd.h > > --- a/include/linux/genhd.h > > +++ b/include/linux/genhd.h > > @@ -132,6 +132,7 @@ struct gendisk { > > > > struct disk_attribute { > > =09struct attribute attr; > > > > > > =09ssize_t (*show)(struct gendisk *, char *); > > +=09ssize_t (*store)(struct gendisk *, const char *, size_t); > > }; > > > > /* > > --------------------------------------- > > > > > > > > > > On 3/9/06, John B < joh...@gm...> wrote: > > > > > > > > > On 3/9/06, Tony Brijeski < tb...@gm...> wrote: > > > > > > > Found a better patch but it is for the kernel. The uevent patch. I= t > > > > will be included in the 2.6.16 kernel so it might be best to just > > > > wait till 2.6.16 goes stable. > > > > > > > > These 3 lines will then replace the whole udevstart/coldplug issue > > > > and much better than udevsynthesize. > > > > > > > > for i in /sys/block/*/*/uevent; do echo 1 > $i; done > > > > for i in /sys/class/*/*/uevent; do echo 1 > $i; done > > > > for i in /sys/bus/*/devices/*/uevent; do echo 1 > $i; done > > > > > > > > Let me know what you folks think. I can patch the stock kernel we > > > > use if we want to play with it before 2.6.16 comes out. > > > > > > > > > > Tony, > > > > > > I wouldn't mind playing around with a pre-2.6.16 kernel patched with > > > this patch. FWIW, I have the source for 2.6.13 sitting on my box. If > > > you can let me know via a unified diff which file(s) need to be patch= ed, > > > I'll roll my own 2.6.13 kernel for my box and see how well it works > > > for me. ;-) > > > > > > Thanks, > > > John > > > > > > > > |
From: Sriram D. <sri...@gm...> - 2006-03-10 01:35:13
|
hi folks, the kernel is at 2.6.16-rc5 now .. i hope it will be ready in a few weeks time. would i be missing something tony is doing if i just took the 2.6.16-rc5kernel and follwed the other instructions abt hot/cold plog removal ? cheers ram On 3/9/06, Tony Brijeski <tb...@gm...> wrote: > > Here is the patch. It adds a uevent to each block,char or bus device tha= t > you simply do the echo to at bootup. > > You have to remove udevstart starting from rc.udev. > You also have to remove hotplug from the kernel. > > echo "/dev/null" > /proc/sys/kernel/hotplug > > You must remove hotplug before you start udev. > > This is how I would change rc.udev: > > put the echo "/dev/null" statement at the top. > comment out all the udev stuff and jsut put this: > > /sbin/udevd --daemon > > Now add the for statements to echo the uevents. > > This should set everything up. > > Hotplug won't be needed as the kernel will send a uevent to udev and get > things going that way. > > This, IMHO, is the way to go as it makes hotplugging and coldplugging a > thing of the past and just leaves everything up to udev rules. > > You can leave udev at the version it is now and see how it works. > > After you patch the kernel, a "make oldconfig" should offer you the new > option of sending uevents from the kernel. > > This whole method will be the easiest to manage as udev will be a one-sto= p > shop for everything and then we can just concentrate on the udev rules to > add function and improve device support and config. > > If this works, I would only offer this fix to those that have config > problems today to see if it works for them. Making this mass deployment > might create a headache if we encounter other issues. > > I am a huge proponent of the "if it ain't broke don't fix it" mentality. > > Moving forward, we need to upgrade udev to the latest anyway. > > Patch below between the hash lines > > ------------------------------------- > > > diff --git a/drivers/base/class.c b/drivers/base/class.c > > --- a/drivers/base/class.c > +++ b/drivers/base/class.c > > @@ -442,6 +442,13 @@ static ssize_t show_dev(struct class_dev > =09return print_dev_t(buf, class_dev->devt); > } > > +static ssize_t store_uevent(struct class_device *class_dev, > > +=09=09=09 const char *buf, size_t count) > > +{ > +=09kobject_hotplug(&class_dev->kobj, KOBJ_ADD); > +=09return count; > +} > + > void class_device_initialize(struct class_device *class_dev) > { > =09kobj_set_kset_s(class_dev, class_obj_subsys); > > @@ -497,6 +504,12 @@ int class_device_add(struct class_device > > =09=09goto register_done; > > =09/* add the needed attributes to this device */ > +=09class_dev->uevent_attr.attr.name =3D "uevent"; > +=09class_dev->uevent_attr.attr.mode =3D S_IWUSR; > > +=09class_dev->uevent_attr.attr.owner =3D parent->owner; > > +=09class_dev->uevent_attr.store =3D store_uevent; > +=09class_device_create_file(class_dev, &class_dev->uevent_attr); > + > =09if (MAJOR(class_dev->devt)) { > > =09=09struct class_device_attribute *attr; > =09=09attr =3D kzalloc(sizeof(*attr), GFP_KERNEL); > > @@ -505,12 +518,10 @@ int class_device_add(struct class_device > =09=09=09kobject_del(&class_dev->kobj); > =09=09=09goto register_done; > > =09=09} > - > =09=09attr->attr.name =3D "dev"; > > =09=09attr->attr.mode =3D S_IRUGO; > =09=09attr->attr.owner > =3D parent->owner; > =09=09attr->show =3D show_dev; > -=09=09attr->store =3D NULL; > =09=09class_device_create_file(class_dev, attr); > =09=09class_dev->devt_attr =3D attr; > > =09} > @@ -620,6 +631,7 @@ void class_device_del(struct class_devic > > =09=09sysfs_remove_link(&class_dev->kobj, "device"); > =09=09sysfs_remove_link(&class_dev->dev->kobj, class_name); > =09} > > +=09class_device_remove_file(class_dev, &class_dev->uevent_attr); > > =09if (class_dev->devt_attr) > =09=09class_device_remove_file(class_dev, class_dev->devt_attr); > =09class_device_remove_attrs(class_dev); > diff --git a/drivers/base/core.c b/drivers/base/core.c > > --- a/drivers/base/core.c > > +++ b/drivers/base/core.c > @@ -154,6 +154,13 @@ static struct kset_hotplug_ops device_ho > =09.hotplug =3D=09dev_hotplug, > }; > > +static ssize_t store_uevent(struct device *dev, struct device_attribute = *attr, > > > +=09=09=09 const char *buf, size_t count) > +{ > +=09kobject_hotplug(&dev->kobj, KOBJ_ADD); > +=09return count; > +} > + > /** > *=09device_subsys - structure to be registered with kobject core. > */ > @@ -258,6 +265,14 @@ int device_add(struct device *dev) > > > > =09if ((error =3D kobject_add(&dev->kobj))) > =09=09goto Error; > + > +=09dev->uevent_attr.attr.name =3D "uevent"; > +=09dev->uevent_attr.attr.mode =3D S_IWUSR; > +=09if (dev->driver) > +=09=09dev->uevent_attr.attr.owner =3D dev->driver->owner; > > > +=09dev->uevent_attr.store =3D store_uevent; > +=09device_create_file(dev, &dev->uevent_attr); > + > =09kobject_hotplug(&dev->kobj, KOBJ_ADD); > =09if ((error =3D device_pm_add(dev))) > =09=09goto PMError; > > > @@ -349,6 +364,7 @@ void device_del(struct device * dev) > > =09if (parent) > =09=09klist_del(&dev->knode_parent); > +=09device_remove_file(dev, &dev->uevent_attr); > > =09/* Notify the platform of the removal, in case they > > > =09 * need to do anything... > diff --git a/drivers/block/genhd.c b/drivers/block/genhd.c > --- a/drivers/block/genhd.c > +++ b/drivers/block/genhd.c > @@ -337,10 +337,30 @@ static ssize_t disk_attr_show(struct kob > > > =09return ret; > } > > +static ssize_t disk_attr_store(struct kobject * kobj, struct attribute *= attr, > +=09=09=09 const char *page, size_t count) > +{ > +=09struct gendisk *disk =3D to_disk(kobj); > +=09struct disk_attribute *disk_attr =3D > > > +=09=09container_of(attr,struct disk_attribute,attr); > +=09ssize_t ret =3D 0; > + > +=09if (disk_attr->store) > +=09=09ret =3D disk_attr->store(disk, page, count); > +=09return ret; > +} > + > static struct sysfs_ops disk_sysfs_ops =3D { > > > =09.show=09=3D &disk_attr_show, > +=09.store=09=3D &disk_attr_store, > }; > > +static ssize_t disk_uevent_store(struct gendisk * disk, > +=09=09=09=09 const char *buf, size_t count) > +{ > +=09kobject_hotplug(&disk->kobj, KOBJ_ADD); > > > +=09return count; > +} > static ssize_t disk_dev_read(struct gendisk * disk, char *page) > { > =09dev_t base =3D MKDEV(disk->major, disk->first_minor); > @@ -382,6 +402,10 @@ static ssize_t disk_stats_read(struct ge > > > =09=09jiffies_to_msecs(disk_stat_read(disk, io_ticks)), > =09=09jiffies_to_msecs(disk_stat_read(disk, time_in_queue))); > } > +static struct disk_attribute disk_attr_uevent =3D { > +=09.attr =3D {.name =3D "uevent", .mode =3D S_IWUSR }, > > > +=09.store=09=3D disk_uevent_store > +}; > static struct disk_attribute disk_attr_dev =3D { > =09.attr =3D {.name =3D "dev", .mode =3D S_IRUGO }, > =09.show=09=3D disk_dev_read > @@ -404,6 +428,7 @@ static struct disk_attribute disk_attr_s > > > }; > > static struct attribute * default_attrs[] =3D { > +=09&disk_attr_uevent.attr, > =09&disk_attr_dev.attr, > =09&disk_attr_range.attr, > =09&disk_attr_removable.attr, > diff --git a/fs/partitions/check.c b/fs/partitions/check.c > > > --- a/fs/partitions/check.c > +++ b/fs/partitions/check.c > @@ -192,6 +192,7 @@ check_partition(struct gendisk *hd, stru > struct part_attribute { > =09struct attribute attr; > =09ssize_t (*show)(struct hd_struct *,char *); > > > +=09ssize_t (*store)(struct hd_struct *,const char *, size_t); > }; > > static ssize_t > @@ -201,14 +202,33 @@ part_attr_show(struct kobject * kobj, st > =09struct part_attribute * part_attr =3D container_of(attr,struct part_a= ttribute,attr); > > > =09ssize_t ret =3D 0; > =09if (part_attr->show) > -=09=09ret =3D part_attr->show(p,page); > +=09=09ret =3D part_attr->show(p, page); > +=09return ret; > +} > +static ssize_t > +part_attr_store(struct kobject * kobj, struct attribute * attr, > > > +=09=09const char *page, size_t count) > +{ > +=09struct hd_struct * p =3D container_of(kobj,struct hd_struct,kobj); > +=09struct part_attribute * part_attr =3D container_of(attr,struct part_a= ttribute,attr); > +=09ssize_t ret =3D 0; > > > + > +=09if (part_attr->store) > +=09=09ret =3D part_attr->store(p, page, count); > =09return ret; > } > > static struct sysfs_ops part_sysfs_ops =3D { > =09.show=09=3D=09part_attr_show, > +=09.store=09=3D=09part_attr_store, > > > }; > > +static ssize_t part_uevent_store(struct hd_struct * p, > +=09=09=09=09 const char *page, size_t count) > +{ > +=09kobject_hotplug(&p->kobj, KOBJ_ADD); > +=09return count; > +} > static ssize_t part_dev_read(struct hd_struct * p, char *page) > > > { > =09struct gendisk *disk =3D container_of(p->kobj.parent,struct gendisk,k= obj); > @@ -229,6 +249,10 @@ static ssize_t part_stat_read(struct hd_ > =09=09 p->reads, (unsigned long long)p->read_sectors, > > > =09=09 p->writes, (unsigned long long)p->write_sectors); > } > +static struct part_attribute part_attr_uevent =3D { > +=09.attr =3D {.name =3D "uevent", .mode =3D S_IWUSR }, > +=09.store=09=3D part_uevent_store > > > +}; > static struct part_attribute part_attr_dev =3D { > =09.attr =3D {.name =3D "dev", .mode =3D S_IRUGO }, > =09.show=09=3D part_dev_read > @@ -247,6 +271,7 @@ static struct part_attribute part_attr_s > }; > > > static struct attribute * default_attrs[] =3D { > > +=09&part_attr_uevent.attr, > =09&part_attr_dev.attr, > =09&part_attr_start.attr, > =09&part_attr_size.attr, > diff --git a/include/linux/device.h b/include/linux/device.h > > --- a/include/linux/device.h > > +++ b/include/linux/device.h > @@ -190,6 +190,18 @@ struct class_attribute class_attr_##_nam > extern int class_create_file(struct class *, const struct class_attribut= e *); > extern void class_remove_file(struct class *, const struct class_attribu= te *); > > > > +struct class_device_attribute { > +=09struct attribute=09attr; > +=09ssize_t (*show)(struct class_device *, char * buf); > +=09ssize_t (*store)(struct class_device *, const char * buf, size_t coun= t); > +}; > + > > +#define CLASS_DEVICE_ATTR(_name,_mode,_show,_store)=09=09\ > > +struct class_device_attribute class_device_attr_##_name =3D =09\ > +=09__ATTR(_name,_mode,_show,_store) > + > +extern int class_device_create_file(struct class_device *, > > +=09=09=09=09 const struct class_device_attribute *); > > > struct class_device { > =09struct list_head=09node; > @@ -198,6 +210,7 @@ struct class_device { > =09struct class=09=09* class;=09/* required */ > =09dev_t=09=09=09devt;=09=09/* dev_t, creates the sysfs "dev" */ > > =09struct class_device_attribute *devt_attr; > > +=09struct class_device_attribute uevent_attr; > =09struct device=09=09* dev;=09=09/* not necessary, but nice to have */ > =09void=09=09=09* class_data;=09/* class-specific data */ > > > @@ -228,18 +241,6 @@ extern int class_device_rename(struct cl > > extern struct class_device * class_device_get(struct class_device *); > extern void class_device_put(struct class_device *); > > -struct class_device_attribute { > > -=09struct attribute=09attr; > -=09ssize_t (*show)(struct class_device *, char * buf); > > -=09ssize_t (*store)(struct class_device *, const char * buf, size_t coun= t); > -}; > - > -#define CLASS_DEVICE_ATTR(_name,_mode,_show,_store)=09=09\ > > -struct class_device_attribute class_device_attr_##_name =3D =09\ > -=09__ATTR(_name,_mode,_show,_store) > > - > -extern int class_device_create_file(struct class_device *, > -=09=09=09=09 const struct class_device_attribute *); > > extern void class_device_remove_file(struct class_device *, > =09=09=09=09 const struct class_device_attribute *); > > extern int class_device_create_bin_file(struct class_device *, > @@ -266,6 +267,20 @@ extern struct class_device *class_device > > extern void class_device_destroy(struct class *cls, dev_t devt); > > > +/* interface for exporting device attributes */ > > +struct device_attribute { > +=09struct attribute=09attr; > +=09ssize_t (*show)(struct device *dev, struct device_attribute *attr, > > +=09=09=09char *buf); > +=09ssize_t (*store)(struct device *dev, struct device_attribute *attr, > > +=09=09=09 const char *buf, size_t count); > +}; > + > +#define DEVICE_ATTR(_name,_mode,_show,_store) \ > +struct device_attribute dev_attr_##_name =3D __ATTR(_name,_mode,_show,_s= tore) > > + > +extern int device_create_file(struct device *device, struct device_attri= bute * entry); > > +extern void device_remove_file(struct device * dev, struct device_attrib= ute * attr); > struct device { > =09struct klist=09=09klist_children; > > =09struct klist_node=09knode_parent;=09=09/* node in sibling list */ > @@ -275,6 +290,7 @@ struct device { > > > =09struct kobject kobj; > =09char=09bus_id[BUS_ID_SIZE];=09/* position on parent bus */ > +=09struct device_attribute uevent_attr; > > > =09struct semaphore=09sem;=09/* semaphore to synchronize calls to > =09=09=09=09=09 * its driver. > > @@ -343,23 +359,6 @@ extern int device_attach(struct device > extern void driver_attach(struct device_driver * drv); > > > > -/* driverfs interface for exporting device attributes */ > - > -struct device_attribute { > > -=09struct attribute=09attr; > -=09ssize_t (*show)(struct device *dev, struct device_attribute *attr, > -=09=09=09char *buf); > > -=09ssize_t (*store)(struct device *dev, struct device_attribute *attr, > -=09=09=09 const char *buf, size_t count); > > -}; > - > -#define DEVICE_ATTR(_name,_mode,_show,_store) \ > -struct device_attribute dev_attr_##_name =3D __ATTR(_name,_mode,_show,_s= tore) > > - > - > -extern int device_create_file(struct device *device, struct device_attri= bute * entry); > > -extern void device_remove_file(struct device * dev, struct device_attrib= ute * attr); > - > /* > * Platform "fixup" functions - allow the platform to have their say > > * about devices and actions that the general device layer doesn't > > diff --git a/include/linux/genhd.h b/include/linux/genhd.h > --- a/include/linux/genhd.h > +++ b/include/linux/genhd.h > @@ -132,6 +132,7 @@ struct gendisk { > > struct disk_attribute { > =09struct attribute attr; > > =09ssize_t (*show)(struct gendisk *, char *); > +=09ssize_t (*store)(struct gendisk *, const char *, size_t); > }; > > /* > --------------------------------------- > > > > > On 3/9/06, John B <joh...@gm...> wrote: > > > > > > On 3/9/06, Tony Brijeski < tb...@gm...> wrote: > > > > > Found a better patch but it is for the kernel. The uevent patch. It > > > will be included in the 2.6.16 kernel so it might be best to just wai= t > > > till 2.6.16 goes stable. > > > > > > These 3 lines will then replace the whole udevstart/coldplug issue an= d > > > much better than udevsynthesize. > > > > > > for i in /sys/block/*/*/uevent; do echo 1 > $i; done > > > for i in /sys/class/*/*/uevent; do echo 1 > $i; done > > > for i in /sys/bus/*/devices/*/uevent; do echo 1 > $i; done > > > > > > Let me know what you folks think. I can patch the stock kernel we us= e > > > if we want to play with it before 2.6.16 comes out. > > > > > > > Tony, > > > > I wouldn't mind playing around with a pre-2.6.16 kernel patched with > > this patch. FWIW, I have the source for 2.6.13 sitting on my box. If yo= u > > can let me know via a unified diff which file(s) need to be patched, I'= ll > > roll my own 2.6.13 kernel for my box and see how well it works for me. > > ;-) > > > > Thanks, > > John > > > > |
From: Tony B. <tb...@gm...> - 2006-03-09 23:10:03
|
Here is the patch. It adds a uevent to each block,char or bus device that you simply do the echo to at bootup. You have to remove udevstart starting from rc.udev. You also have to remove hotplug from the kernel. echo "/dev/null" > /proc/sys/kernel/hotplug You must remove hotplug before you start udev. This is how I would change rc.udev: put the echo "/dev/null" statement at the top. comment out all the udev stuff and jsut put this: /sbin/udevd --daemon Now add the for statements to echo the uevents. This should set everything up. Hotplug won't be needed as the kernel will send a uevent to udev and get things going that way. This, IMHO, is the way to go as it makes hotplugging and coldplugging a thing of the past and just leaves everything up to udev rules. You can leave udev at the version it is now and see how it works. After you patch the kernel, a "make oldconfig" should offer you the new option of sending uevents from the kernel. This whole method will be the easiest to manage as udev will be a one-stop shop for everything and then we can just concentrate on the udev rules to add function and improve device support and config. If this works, I would only offer this fix to those that have config problems today to see if it works for them. Making this mass deployment might create a headache if we encounter other issues. I am a huge proponent of the "if it ain't broke don't fix it" mentality. Moving forward, we need to upgrade udev to the latest anyway. Patch below between the hash lines ------------------------------------- diff --git a/drivers/base/class.c b/drivers/base/class.c --- a/drivers/base/class.c +++ b/drivers/base/class.c @@ -442,6 +442,13 @@ static ssize_t show_dev(struct class_dev =09return print_dev_t(buf, class_dev->devt); } +static ssize_t store_uevent(struct class_device *class_dev, +=09=09=09 const char *buf, size_t count) +{ +=09kobject_hotplug(&class_dev->kobj, KOBJ_ADD); +=09return count; +} + void class_device_initialize(struct class_device *class_dev) { =09kobj_set_kset_s(class_dev, class_obj_subsys); @@ -497,6 +504,12 @@ int class_device_add(struct class_device =09=09goto register_done; =09/* add the needed attributes to this device */ +=09class_dev->uevent_attr.attr.name =3D "uevent"; +=09class_dev->uevent_attr.attr.mode =3D S_IWUSR; +=09class_dev->uevent_attr.attr.owner =3D parent->owner; +=09class_dev->uevent_attr.store =3D store_uevent; +=09class_device_create_file(class_dev, &class_dev->uevent_attr); + =09if (MAJOR(class_dev->devt)) { =09=09struct class_device_attribute *attr; =09=09attr =3D kzalloc(sizeof(*attr), GFP_KERNEL); @@ -505,12 +518,10 @@ int class_device_add(struct class_device =09=09=09kobject_del(&class_dev->kobj); =09=09=09goto register_done; =09=09} - =09=09attr->attr.name =3D "dev"; =09=09attr->attr.mode =3D S_IRUGO; =09=09attr->attr.owner =3D parent->owner; =09=09attr->show =3D show_dev; -=09=09attr->store =3D NULL; =09=09class_device_create_file(class_dev, attr); =09=09class_dev->devt_attr =3D attr; =09} @@ -620,6 +631,7 @@ void class_device_del(struct class_devic =09=09sysfs_remove_link(&class_dev->kobj, "device"); =09=09sysfs_remove_link(&class_dev->dev->kobj, class_name); =09} +=09class_device_remove_file(class_dev, &class_dev->uevent_attr); =09if (class_dev->devt_attr) =09=09class_device_remove_file(class_dev, class_dev->devt_attr); =09class_device_remove_attrs(class_dev); diff --git a/drivers/base/core.c b/drivers/base/core.c --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -154,6 +154,13 @@ static struct kset_hotplug_ops device_ho =09.hotplug =3D=09dev_hotplug, }; +static ssize_t store_uevent(struct device *dev, struct device_attribute *a= ttr, +=09=09=09 const char *buf, size_t count) +{ +=09kobject_hotplug(&dev->kobj, KOBJ_ADD); +=09return count; +} + /** *=09device_subsys - structure to be registered with kobject core. */ @@ -258,6 +265,14 @@ int device_add(struct device *dev) =09if ((error =3D kobject_add(&dev->kobj))) =09=09goto Error; + +=09dev->uevent_attr.attr.name =3D "uevent"; +=09dev->uevent_attr.attr.mode =3D S_IWUSR; +=09if (dev->driver) +=09=09dev->uevent_attr.attr.owner =3D dev->driver->owner; +=09dev->uevent_attr.store =3D store_uevent; +=09device_create_file(dev, &dev->uevent_attr); + =09kobject_hotplug(&dev->kobj, KOBJ_ADD); =09if ((error =3D device_pm_add(dev))) =09=09goto PMError; @@ -349,6 +364,7 @@ void device_del(struct device * dev) =09if (parent) =09=09klist_del(&dev->knode_parent); +=09device_remove_file(dev, &dev->uevent_attr); =09/* Notify the platform of the removal, in case they =09 * need to do anything... diff --git a/drivers/block/genhd.c b/drivers/block/genhd.c --- a/drivers/block/genhd.c +++ b/drivers/block/genhd.c @@ -337,10 +337,30 @@ static ssize_t disk_attr_show(struct kob =09return ret; } +static ssize_t disk_attr_store(struct kobject * kobj, struct attribute * a= ttr, +=09=09=09 const char *page, size_t count) +{ +=09struct gendisk *disk =3D to_disk(kobj); +=09struct disk_attribute *disk_attr =3D +=09=09container_of(attr,struct disk_attribute,attr); +=09ssize_t ret =3D 0; + +=09if (disk_attr->store) +=09=09ret =3D disk_attr->store(disk, page, count); +=09return ret; +} + static struct sysfs_ops disk_sysfs_ops =3D { =09.show=09=3D &disk_attr_show, +=09.store=09=3D &disk_attr_store, }; +static ssize_t disk_uevent_store(struct gendisk * disk, +=09=09=09=09 const char *buf, size_t count) +{ +=09kobject_hotplug(&disk->kobj, KOBJ_ADD); +=09return count; +} static ssize_t disk_dev_read(struct gendisk * disk, char *page) { =09dev_t base =3D MKDEV(disk->major, disk->first_minor); @@ -382,6 +402,10 @@ static ssize_t disk_stats_read(struct ge =09=09jiffies_to_msecs(disk_stat_read(disk, io_ticks)), =09=09jiffies_to_msecs(disk_stat_read(disk, time_in_queue))); } +static struct disk_attribute disk_attr_uevent =3D { +=09.attr =3D {.name =3D "uevent", .mode =3D S_IWUSR }, +=09.store=09=3D disk_uevent_store +}; static struct disk_attribute disk_attr_dev =3D { =09.attr =3D {.name =3D "dev", .mode =3D S_IRUGO }, =09.show=09=3D disk_dev_read @@ -404,6 +428,7 @@ static struct disk_attribute disk_attr_s }; static struct attribute * default_attrs[] =3D { +=09&disk_attr_uevent.attr, =09&disk_attr_dev.attr, =09&disk_attr_range.attr, =09&disk_attr_removable.attr, diff --git a/fs/partitions/check.c b/fs/partitions/check.c --- a/fs/partitions/check.c +++ b/fs/partitions/check.c @@ -192,6 +192,7 @@ check_partition(struct gendisk *hd, stru struct part_attribute { =09struct attribute attr; =09ssize_t (*show)(struct hd_struct *,char *); +=09ssize_t (*store)(struct hd_struct *,const char *, size_t); }; static ssize_t @@ -201,14 +202,33 @@ part_attr_show(struct kobject * kobj, st =09struct part_attribute * part_attr =3D container_of(attr,struct part_attribute,attr); =09ssize_t ret =3D 0; =09if (part_attr->show) -=09=09ret =3D part_attr->show(p,page); +=09=09ret =3D part_attr->show(p, page); +=09return ret; +} +static ssize_t +part_attr_store(struct kobject * kobj, struct attribute * attr, +=09=09const char *page, size_t count) +{ +=09struct hd_struct * p =3D container_of(kobj,struct hd_struct,kobj); +=09struct part_attribute * part_attr =3D container_of(attr,struct part_attribute,attr); +=09ssize_t ret =3D 0; + +=09if (part_attr->store) +=09=09ret =3D part_attr->store(p, page, count); =09return ret; } static struct sysfs_ops part_sysfs_ops =3D { =09.show=09=3D=09part_attr_show, +=09.store=09=3D=09part_attr_store, }; +static ssize_t part_uevent_store(struct hd_struct * p, +=09=09=09=09 const char *page, size_t count) +{ +=09kobject_hotplug(&p->kobj, KOBJ_ADD); +=09return count; +} static ssize_t part_dev_read(struct hd_struct * p, char *page) { =09struct gendisk *disk =3D container_of(p->kobj.parent,struct gendisk,kob= j); @@ -229,6 +249,10 @@ static ssize_t part_stat_read(struct hd_ =09=09 p->reads, (unsigned long long)p->read_sectors, =09=09 p->writes, (unsigned long long)p->write_sectors); } +static struct part_attribute part_attr_uevent =3D { +=09.attr =3D {.name =3D "uevent", .mode =3D S_IWUSR }, +=09.store=09=3D part_uevent_store +}; static struct part_attribute part_attr_dev =3D { =09.attr =3D {.name =3D "dev", .mode =3D S_IRUGO }, =09.show=09=3D part_dev_read @@ -247,6 +271,7 @@ static struct part_attribute part_attr_s }; static struct attribute * default_attrs[] =3D { +=09&part_attr_uevent.attr, =09&part_attr_dev.attr, =09&part_attr_start.attr, =09&part_attr_size.attr, diff --git a/include/linux/device.h b/include/linux/device.h --- a/include/linux/device.h +++ b/include/linux/device.h @@ -190,6 +190,18 @@ struct class_attribute class_attr_##_nam extern int class_create_file(struct class *, const struct class_attribute = *); extern void class_remove_file(struct class *, const struct class_attribute= *); +struct class_device_attribute { +=09struct attribute=09attr; +=09ssize_t (*show)(struct class_device *, char * buf); +=09ssize_t (*store)(struct class_device *, const char * buf, size_t count)= ; +}; + +#define CLASS_DEVICE_ATTR(_name,_mode,_show,_store)=09=09\ +struct class_device_attribute class_device_attr_##_name =3D =09\ +=09__ATTR(_name,_mode,_show,_store) + +extern int class_device_create_file(struct class_device *, +=09=09=09=09 const struct class_device_attribute *); struct class_device { =09struct list_head=09node; @@ -198,6 +210,7 @@ struct class_device { =09struct class=09=09* class;=09/* required */ =09dev_t=09=09=09devt;=09=09/* dev_t, creates the sysfs "dev" */ =09struct class_device_attribute *devt_attr; +=09struct class_device_attribute uevent_attr; =09struct device=09=09* dev;=09=09/* not necessary, but nice to have */ =09void=09=09=09* class_data;=09/* class-specific data */ @@ -228,18 +241,6 @@ extern int class_device_rename(struct cl extern struct class_device * class_device_get(struct class_device *); extern void class_device_put(struct class_device *); -struct class_device_attribute { -=09struct attribute=09attr; -=09ssize_t (*show)(struct class_device *, char * buf); -=09ssize_t (*store)(struct class_device *, const char * buf, size_t count)= ; -}; - -#define CLASS_DEVICE_ATTR(_name,_mode,_show,_store)=09=09\ -struct class_device_attribute class_device_attr_##_name =3D =09\ -=09__ATTR(_name,_mode,_show,_store) - -extern int class_device_create_file(struct class_device *, -=09=09=09=09 const struct class_device_attribute *); extern void class_device_remove_file(struct class_device *, =09=09=09=09 const struct class_device_attribute *); extern int class_device_create_bin_file(struct class_device *, @@ -266,6 +267,20 @@ extern struct class_device *class_device extern void class_device_destroy(struct class *cls, dev_t devt); +/* interface for exporting device attributes */ +struct device_attribute { +=09struct attribute=09attr; +=09ssize_t (*show)(struct device *dev, struct device_attribute *attr, +=09=09=09char *buf); +=09ssize_t (*store)(struct device *dev, struct device_attribute *attr, +=09=09=09 const char *buf, size_t count); +}; + +#define DEVICE_ATTR(_name,_mode,_show,_store) \ +struct device_attribute dev_attr_##_name =3D __ATTR(_name,_mode,_show,_sto= re) + +extern int device_create_file(struct device *device, struct device_attribute * entry); +extern void device_remove_file(struct device * dev, struct device_attribute * attr); struct device { =09struct klist=09=09klist_children; =09struct klist_node=09knode_parent;=09=09/* node in sibling list */ @@ -275,6 +290,7 @@ struct device { =09struct kobject kobj; =09char=09bus_id[BUS_ID_SIZE];=09/* position on parent bus */ +=09struct device_attribute uevent_attr; =09struct semaphore=09sem;=09/* semaphore to synchronize calls to =09=09=09=09=09 * its driver. @@ -343,23 +359,6 @@ extern int device_attach(struct device extern void driver_attach(struct device_driver * drv); -/* driverfs interface for exporting device attributes */ - -struct device_attribute { -=09struct attribute=09attr; -=09ssize_t (*show)(struct device *dev, struct device_attribute *attr, -=09=09=09char *buf); -=09ssize_t (*store)(struct device *dev, struct device_attribute *attr, -=09=09=09 const char *buf, size_t count); -}; - -#define DEVICE_ATTR(_name,_mode,_show,_store) \ -struct device_attribute dev_attr_##_name =3D __ATTR(_name,_mode,_show,_sto= re) - - -extern int device_create_file(struct device *device, struct device_attribute * entry); -extern void device_remove_file(struct device * dev, struct device_attribute * attr); - /* * Platform "fixup" functions - allow the platform to have their say * about devices and actions that the general device layer doesn't diff --git a/include/linux/genhd.h b/include/linux/genhd.h --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -132,6 +132,7 @@ struct gendisk { struct disk_attribute { =09struct attribute attr; =09ssize_t (*show)(struct gendisk *, char *); +=09ssize_t (*store)(struct gendisk *, const char *, size_t); }; /* --------------------------------------- On 3/9/06, John B <joh...@gm...> wrote: > > > On 3/9/06, Tony Brijeski <tb...@gm...> wrote: > > > Found a better patch but it is for the kernel. The uevent patch. It > > will be included in the 2.6.16 kernel so it might be best to just wait > > till 2.6.16 goes stable. > > > > These 3 lines will then replace the whole udevstart/coldplug issue and > > much better than udevsynthesize. > > > > for i in /sys/block/*/*/uevent; do echo 1 > $i; done > > for i in /sys/class/*/*/uevent; do echo 1 > $i; done > > for i in /sys/bus/*/devices/*/uevent; do echo 1 > $i; done > > > > Let me know what you folks think. I can patch the stock kernel we use > > if we want to play with it before 2.6.16 comes out. > > > > Tony, > > I wouldn't mind playing around with a pre-2.6.16 kernel patched with this > patch. FWIW, I have the source for 2.6.13 sitting on my box. If you can > let me know via a unified diff which file(s) need to be patched, I'll rol= l > my own 2.6.13 kernel for my box and see how well it works for me. ;-) > > Thanks, > John > |
From: John B <joh...@gm...> - 2006-03-09 22:41:50
|
On 3/9/06, Tony Brijeski <tb...@gm...> wrote: > > Found a better patch but it is for the kernel. The uevent patch. It will > be included in the 2.6.16 kernel so it might be best to just wait till > 2.6.16 goes stable. > > These 3 lines will then replace the whole udevstart/coldplug issue and > much better than udevsynthesize. > > for i in /sys/block/*/*/uevent; do echo 1 > $i; done > for i in /sys/class/*/*/uevent; do echo 1 > $i; done > for i in /sys/bus/*/devices/*/uevent; do echo 1 > $i; done > > Let me know what you folks think. I can patch the stock kernel we use if > we want to play with it before 2.6.16 comes out. > Tony, I wouldn't mind playing around with a pre-2.6.16 kernel patched with this patch. FWIW, I have the source for 2.6.13 sitting on my box. If you can let me know via a unified diff which file(s) need to be patched, I'll roll my own 2.6.13 kernel for my box and see how well it works for me. ;-) Thanks, John |
From: Tony B. <tb...@gm...> - 2006-03-09 19:28:47
|
Found a better patch but it is for the kernel. The uevent patch. It will b= e included in the 2.6.16 kernel so it might be best to just wait till 2.6.16goes stable. These 3 lines will then replace the whole udevstart/coldplug issue and much better than udevsynthesize. for i in /sys/block/*/*/uevent; do echo 1 > $i; done for i in /sys/class/*/*/uevent; do echo 1 > $i; done for i in /sys/bus/*/devices/*/uevent; do echo 1 > $i; done Let me know what you folks think. I can patch the stock kernel we use if w= e want to play with it before 2.6.16 comes out. Regards, Tony On 3/9/06, Tony Brijeski <tb...@gm...> wrote: > > I already have the package and the patch. I will make it and then we can > disable hotplug altogether and see how it works. > > > > > On 3/9/06, uel archuletta <ue...@gm...> wrote: > > > > Tony, > > > > please go ahead and make the package. I know udev is up to 0.87 you can > > get it here http://www.us.kernel.org/pub/linux/utils/kernel/hotplug/ude= v-087.tar.bz2 > > > > once the package is done we can make sure all the udev rules, scripts, > > and permissions files are complete, > > and begin testing it > > > > > > Thanks > > Uelsk8s > > > > > > On 3/9/06, Tony Brijeski <tb...@gm...> wrote: > > > > > > I did some testing last night and it made no difference. I also foun= d > > > that hotplug is running but it is sysvinit. I made a coldplug script= but it > > > didn't work. > > > > > > The other option we have is the udevsynthesize patch for udev. It > > > removes the need for udevstart and coldplug and can actually go throu= gh and > > > setup all the /dev/ entries and load modules in about 1 second on a > > > 1.7Gig processor. Hotplug on my AthlonXP 2400+(which is overclocked > > > like a 2900+ or better) takes 7 seconds in addition to the udevstart = time. > > > > > > Also while looking into the whole udev thing there is a lot of > > > confusion. The VL package on SOHO says 0.71 version but in the > > > package contents it is udev-0.64. What is this about? It looks like > > > the packlage was created manually so an uninstall of that package wou= ld fail > > > as the slack tools strip out the 1st 2 characters which should be ./ = so > > > whomever packaged that up really needs to package it up using this ty= pe of > > > command from the root of the filesystem: > > > > > > tar cvzpf udev-0.71.....tgz ./install ./usr...... etc - there must > > > always be a ./ before the folder name so that the slack install doesn= 't > > > strip it out. > > > > > > If you folks want, I can patch udev with udevsynthesize and create a > > > proper new package. This would completely eliminate the need for hot= plug > > > but we would have to make sure all of our udev rules, scripts, and > > > permissions files were complete. > > > > > > Regards, > > > Tony > > > > > > > > > > > > On 3/8/06, Tony Brijeski <tb...@gm...> wrote: > > > > > > > > I have done some digging and coldplug is actually just the old > > > > hotplug *.rc scripts. We have hotplug installed and there but it n= eeds to > > > > be called after udev is started. > > > > > > > > rc.hotplug is what coldplug really is. If it is run after udev, > > > > then the devices will be setup. I will do some testing and if all = is well, > > > > this should be a wash to just add to rc.S after starting udev. > > > > > > > > I'm testing it now and will let you all know. > > > > > > > > Regards, > > > > Tony > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On 3/7/06, uel archuletta < ue...@gm...> wrote: > > > > > > > > > > I also have the udev and rules from zenwalk and it replaces > > > > > hotplug as well > > > > > so besides X setup like you said se have other options. > > > > > > > > > > > > > > > Uel > > > > > > > > > > > > > > > > > > > > On 3/7/06, Tony Brijeski <tb...@gm...> wrote: > > > > > > > > > > > > How much of vlsetup is still being used to configure the > > > > > > hardware and how much of udev/hotplug are we now using? > > > > > > > > > > > > I think we should concentrate on setting up udev to handle > > > > > > pretty much everything vlsetup used to but it will be on the fl= y during > > > > > > boot. > > > > > > > > > > > > Mandriva has setup some great scripts and rules for udev to tak= e > > > > > > care of most of the hardware so a hardware probe is not necessa= ry anymore > > > > > > other than for X setup. > > > > > > > > > > > > Let me know your thoughts on this. If we still want to keep > > > > > > vlsetup, then I will either have to try to find the source for = it in one of > > > > > > my very old backups or I will have to take a look at the curren= t hwsetup > > > > > > from knoppix and start from scratch again. > > > > > > > > > > > > I am thinking that the current state of udev makes most of > > > > > > vlsetup useless. If we have the right scripts and rules, there= should be no > > > > > > problems with letting udev take care of all of it. > > > > > > > > > > > > Regards, > > > > > > Tony > > > > > > > > > > > > > > > > > > > > > > > > > > > |
From: Tony B. <tb...@gm...> - 2006-03-09 18:04:32
|
I already have the package and the patch. I will make it and then we can disable hotplug altogether and see how it works. On 3/9/06, uel archuletta <ue...@gm...> wrote: > > Tony, > > please go ahead and make the package. I know udev is up to 0.87 you can > get it here http://www.us.kernel.org/pub/linux/utils/kernel/hotplug/udev-= 087.tar.bz2 > > once the package is done we can make sure all the udev rules, scripts, an= d > permissions files are complete, > and begin testing it > > > Thanks > Uelsk8s > > > On 3/9/06, Tony Brijeski <tb...@gm...> wrote: > > > > I did some testing last night and it made no difference. I also found > > that hotplug is running but it is sysvinit. I made a coldplug script b= ut it > > didn't work. > > > > The other option we have is the udevsynthesize patch for udev. It > > removes the need for udevstart and coldplug and can actually go through= and > > setup all the /dev/ entries and load modules in about 1 second on a > > 1.7Gig processor. Hotplug on my AthlonXP 2400+(which is overclocked > > like a 2900+ or better) takes 7 seconds in addition to the udevstart ti= me. > > > > Also while looking into the whole udev thing there is a lot of > > confusion. The VL package on SOHO says 0.71 version but in the package > > contents it is udev-0.64. What is this about? It looks like the > > packlage was created manually so an uninstall of that package would fai= l as > > the slack tools strip out the 1st 2 characters which should be ./ so > > whomever packaged that up really needs to package it up using this type= of > > command from the root of the filesystem: > > > > tar cvzpf udev-0.71.....tgz ./install ./usr...... etc - there must > > always be a ./ before the folder name so that the slack install doesn't > > strip it out. > > > > If you folks want, I can patch udev with udevsynthesize and create a > > proper new package. This would completely eliminate the need for hotpl= ug > > but we would have to make sure all of our udev rules, scripts, and > > permissions files were complete. > > > > Regards, > > Tony > > > > > > > > On 3/8/06, Tony Brijeski <tb...@gm...> wrote: > > > > > > I have done some digging and coldplug is actually just the old hotplu= g > > > *.rc scripts. We have hotplug installed and there but it needs to be= called > > > after udev is started. > > > > > > rc.hotplug is what coldplug really is. If it is run after udev, then > > > the devices will be setup. I will do some testing and if all is well= , this > > > should be a wash to just add to rc.S after starting udev. > > > > > > I'm testing it now and will let you all know. > > > > > > Regards, > > > Tony > > > > > > > > > > > > > > > > > > > > > > > > On 3/7/06, uel archuletta < ue...@gm...> wrote: > > > > > > > > I also have the udev and rules from zenwalk and it replaces hotplu= g > > > > as well > > > > so besides X setup like you said se have other options. > > > > > > > > > > > > Uel > > > > > > > > > > > > > > > > On 3/7/06, Tony Brijeski <tb...@gm...> wrote: > > > > > > > > > > How much of vlsetup is still being used to configure the hardware > > > > > and how much of udev/hotplug are we now using? > > > > > > > > > > I think we should concentrate on setting up udev to handle pretty > > > > > much everything vlsetup used to but it will be on the fly during = boot. > > > > > > > > > > Mandriva has setup some great scripts and rules for udev to take > > > > > care of most of the hardware so a hardware probe is not necessary= anymore > > > > > other than for X setup. > > > > > > > > > > Let me know your thoughts on this. If we still want to keep > > > > > vlsetup, then I will either have to try to find the source for it= in one of > > > > > my very old backups or I will have to take a look at the current = hwsetup > > > > > from knoppix and start from scratch again. > > > > > > > > > > I am thinking that the current state of udev makes most of vlsetu= p > > > > > useless. If we have the right scripts and rules, there should be= no > > > > > problems with letting udev take care of all of it. > > > > > > > > > > Regards, > > > > > Tony > > > > > > > > > > > > > > > > > > > > |
From: uel a. <ue...@gm...> - 2006-03-09 16:50:21
|
Tony, please go ahead and make the package. I know udev is up to 0.87 you can get it here http://www.us.kernel.org/pub/linux/utils/kernel/hotplug/udev-087.tar.bz2 once the package is done we can make sure all the udev rules, scripts, and permissions files are complete, and begin testing it Thanks Uelsk8s On 3/9/06, Tony Brijeski <tb...@gm...> wrote: > > I did some testing last night and it made no difference. I also found > that hotplug is running but it is sysvinit. I made a coldplug script but= it > didn't work. > > The other option we have is the udevsynthesize patch for udev. It remove= s > the need for udevstart and coldplug and can actually go through and setup > all the /dev/ entries and load modules in about 1 second on a 1.7Gigproce= ssor. Hotplug on my AthlonXP 2400+(which is overclocked like a 2900+ > or better) takes 7 seconds in addition to the udevstart time. > > Also while looking into the whole udev thing there is a lot of confusion. > The VL package on SOHO says 0.71 version but in the package contents it i= s > udev-0.64. What is this about? It looks like the packlage was created > manually so an uninstall of that package would fail as the slack tools st= rip > out the 1st 2 characters which should be ./ so whomever packaged that up > really needs to package it up using this type of command from the root of > the filesystem: > > tar cvzpf udev-0.71.....tgz ./install ./usr...... etc - there must always > be a ./ before the folder name so that the slack install doesn't strip it > out. > > If you folks want, I can patch udev with udevsynthesize and create a > proper new package. This would completely eliminate the need for hotplug > but we would have to make sure all of our udev rules, scripts, and > permissions files were complete. > > Regards, > Tony > > > > On 3/8/06, Tony Brijeski <tb...@gm...> wrote: > > > > I have done some digging and coldplug is actually just the old hotplug > > *.rc scripts. We have hotplug installed and there but it needs to be c= alled > > after udev is started. > > > > rc.hotplug is what coldplug really is. If it is run after udev, then > > the devices will be setup. I will do some testing and if all is well, = this > > should be a wash to just add to rc.S after starting udev. > > > > I'm testing it now and will let you all know. > > > > Regards, > > Tony > > > > > > > > > > > > > > > > On 3/7/06, uel archuletta < ue...@gm...> wrote: > > > > > > I also have the udev and rules from zenwalk and it replaces hotplug > > > as well > > > so besides X setup like you said se have other options. > > > > > > > > > Uel > > > > > > > > > > > > On 3/7/06, Tony Brijeski <tb...@gm...> wrote: > > > > > > > > How much of vlsetup is still being used to configure the hardware > > > > and how much of udev/hotplug are we now using? > > > > > > > > I think we should concentrate on setting up udev to handle pretty > > > > much everything vlsetup used to but it will be on the fly during bo= ot. > > > > > > > > Mandriva has setup some great scripts and rules for udev to take > > > > care of most of the hardware so a hardware probe is not necessary a= nymore > > > > other than for X setup. > > > > > > > > Let me know your thoughts on this. If we still want to keep > > > > vlsetup, then I will either have to try to find the source for it i= n one of > > > > my very old backups or I will have to take a look at the current hw= setup > > > > from knoppix and start from scratch again. > > > > > > > > I am thinking that the current state of udev makes most of vlsetup > > > > useless. If we have the right scripts and rules, there should be n= o > > > > problems with letting udev take care of all of it. > > > > > > > > Regards, > > > > Tony > > > > > > > > > > > > > > |
From: Tony B. <tb...@gm...> - 2006-03-09 14:23:12
|
I did some testing last night and it made no difference. I also found that hotplug is running but it is sysvinit. I made a coldplug script but it didn't work. The other option we have is the udevsynthesize patch for udev. It removes the need for udevstart and coldplug and can actually go through and setup all the /dev/ entries and load modules in about 1 second on a 1.7Gigprocessor. Hotplug on my AthlonXP 2400+(which is overclocked like a 2900+ or better) takes 7 seconds in addition to the udevstart time. Also while looking into the whole udev thing there is a lot of confusion. The VL package on SOHO says 0.71 version but in the package contents it is udev-0.64. What is this about? It looks like the packlage was created manually so an uninstall of that package would fail as the slack tools stri= p out the 1st 2 characters which should be ./ so whomever packaged that up really needs to package it up using this type of command from the root of the filesystem: tar cvzpf udev-0.71.....tgz ./install ./usr...... etc - there must always b= e a ./ before the folder name so that the slack install doesn't strip it out. If you folks want, I can patch udev with udevsynthesize and create a proper new package. This would completely eliminate the need for hotplug but we would have to make sure all of our udev rules, scripts, and permissions files were complete. Regards, Tony On 3/8/06, Tony Brijeski <tb...@gm...> wrote: > > I have done some digging and coldplug is actually just the old hotplug > *.rc scripts. We have hotplug installed and there but it needs to be cal= led > after udev is started. > > rc.hotplug is what coldplug really is. If it is run after udev, then the > devices will be setup. I will do some testing and if all is well, this > should be a wash to just add to rc.S after starting udev. > > I'm testing it now and will let you all know. > > Regards, > Tony > > > > > > > > On 3/7/06, uel archuletta < ue...@gm...> wrote: > > > > I also have the udev and rules from zenwalk and it replaces hotplug as > > well > > so besides X setup like you said se have other options. > > > > > > Uel > > > > > > > > On 3/7/06, Tony Brijeski <tb...@gm...> wrote: > > > > > > How much of vlsetup is still being used to configure the hardware and > > > how much of udev/hotplug are we now using? > > > > > > I think we should concentrate on setting up udev to handle pretty muc= h > > > everything vlsetup used to but it will be on the fly during boot. > > > > > > Mandriva has setup some great scripts and rules for udev to take care > > > of most of the hardware so a hardware probe is not necessary anymore = other > > > than for X setup. > > > > > > Let me know your thoughts on this. If we still want to keep vlsetup, > > > then I will either have to try to find the source for it in one of my= very > > > old backups or I will have to take a look at the current hwsetup from > > > knoppix and start from scratch again. > > > > > > I am thinking that the current state of udev makes most of vlsetup > > > useless. If we have the right scripts and rules, there should be no > > > problems with letting udev take care of all of it. > > > > > > Regards, > > > Tony > > > > > > > > > |
From: Tony B. <tb...@gm...> - 2006-03-08 20:43:22
|
I have done some digging and coldplug is actually just the old hotplug *.rc scripts. We have hotplug installed and there but it needs to be called after udev is started. rc.hotplug is what coldplug really is. If it is run after udev, then the devices will be setup. I will do some testing and if all is well, this should be a wash to just add to rc.S after starting udev. I'm testing it now and will let you all know. Regards, Tony On 3/7/06, uel archuletta <ue...@gm...> wrote: > > I also have the udev and rules from zenwalk and it replaces hotplug as > well > so besides X setup like you said se have other options. > > > Uel > > > > On 3/7/06, Tony Brijeski <tb...@gm...> wrote: > > > > How much of vlsetup is still being used to configure the hardware and > > how much of udev/hotplug are we now using? > > > > I think we should concentrate on setting up udev to handle pretty much > > everything vlsetup used to but it will be on the fly during boot. > > > > Mandriva has setup some great scripts and rules for udev to take care o= f > > most of the hardware so a hardware probe is not necessary anymore other= than > > for X setup. > > > > Let me know your thoughts on this. If we still want to keep vlsetup, > > then I will either have to try to find the source for it in one of my v= ery > > old backups or I will have to take a look at the current hwsetup from > > knoppix and start from scratch again. > > > > I am thinking that the current state of udev makes most of vlsetup > > useless. If we have the right scripts and rules, there should be no > > problems with letting udev take care of all of it. > > > > Regards, > > Tony > > > > > |
From: uel a. <ue...@gm...> - 2006-03-08 01:15:51
|
I also have the udev and rules from zenwalk and it replaces hotplug as well so besides X setup like you said se have other options. Uel On 3/7/06, Tony Brijeski <tb...@gm...> wrote: > > How much of vlsetup is still being used to configure the hardware and how > much of udev/hotplug are we now using? > > I think we should concentrate on setting up udev to handle pretty much > everything vlsetup used to but it will be on the fly during boot. > > Mandriva has setup some great scripts and rules for udev to take care of > most of the hardware so a hardware probe is not necessary anymore other t= han > for X setup. > > Let me know your thoughts on this. If we still want to keep vlsetup, the= n > I will either have to try to find the source for it in one of my very old > backups or I will have to take a look at the current hwsetup from knoppix > and start from scratch again. > > I am thinking that the current state of udev makes most of vlsetup > useless. If we have the right scripts and rules, there should be no > problems with letting udev take care of all of it. > > Regards, > Tony > > |
From: Tony B. <tb...@gm...> - 2006-03-07 21:47:20
|
How much of vlsetup is still being used to configure the hardware and how much of udev/hotplug are we now using? I think we should concentrate on setting up udev to handle pretty much everything vlsetup used to but it will be on the fly during boot. Mandriva has setup some great scripts and rules for udev to take care of most of the hardware so a hardware probe is not necessary anymore other tha= n for X setup. Let me know your thoughts on this. If we still want to keep vlsetup, then = I will either have to try to find the source for it in one of my very old backups or I will have to take a look at the current hwsetup from knoppix and start from scratch again. I am thinking that the current state of udev makes most of vlsetup useless. If we have the right scripts and rules, there should be no problems with letting udev take care of all of it. Regards, Tony |
From: Robert L. <vec...@ya...> - 2006-03-03 08:03:14
|
Hi All, We are ready to make the move to our new high speed host http://madtux.org. This means I will be shutting down the forum at 8 pm pst on march 3rd. This facilitates a final backup of the database with little loss of data that will be imported to the new location on saturday march 4th. Friday the 3rd after the backup I will institute the dns change so hopefully all should be normal within a day or so. This is for your information and I have posted this to the forum so nobody panic.................:) cheers, Vec Robert Lange vec...@ya... http://www.vectorlinux.com __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Jose J. R. <jo...@gm...> - 2006-03-03 04:04:18
|
On 3/2/06, John B <joh...@gm...> wrote: > If Jason Woodward, aka jaos, has been invited to this > mailing list, I'm sure he'll add some insight on this. He's subscribed. Regards, Joe1962 |
From: Jose J. R. <jo...@gm...> - 2006-03-03 03:58:36
|
On 3/2/06, Tony Brijeski <tb...@gm...> wrote: > we really need to start creating new folders for each version. We are us= ing > 5.0 on the repo and the version of the distro is 5.1. This is confusing = and > needs to be addressed before the next version. It's not just the version number. SOHO 5.1 packages won't install (unless forced) on Standard 5.1 due to dependencies. In recent talks we seem to have agreed that the way to go for 6.0 is to get a common base going (similar to the Dynamite concept, before it became a distro, lol). Standard and SOHO would build on this base in parallel. If this base is used to build the common packages, this problem goes away. We need to think carefully of packages that require more than the base deps though. > On 3/2/06, John B <joh...@gm...> wrote: > > > > To add to Tony's comments, we should also add pasture and unsupported > subdirectories in the main repository. They would serve the same purpose > that they do in Slackware - pasture would be used for holding old package= s, > and unsupported would be the holding place for packages we no longer supp= ort > but should be kept around for historical interest. Isn't that a very fine line between those 2? Or am I missing something here? (prolly am, lol). Regards, Joe1962 |