Matthew Burgess wrote:
> So, with all that said, I think someone with some time on their hands
> needs to investigate this whole 'dev.d' setup (or just hit me with
> the relevant cluebat), and we'll put the relevant machinery in the 
> bootscripts and/or the book.  This, I believe, would completely 
> deprecate 'sysctl', in favour of configuring devices immediately
> after their creation.

I'm not sure what kind of machinery would be needed, but I made a simple
dev.d script for rtc, to handle this case.

/etc/dev.d/rtc/set-user-freq.dev:

---

#!/bin/sh

if [ "$ACTION" == "add" ] ; then
    echo "1024" >/proc/sys/dev/rtc/max-user-freq
fi

---

Just make sure it's executable.

It may not handle a few things correctly, though:

Number one, it'll print an error to "somewhere" (syslog? udev's log? the
system console? no idea) if your rtc module wasn't configured to support
/proc/sys/dev/rtc.  That may not be possible anymore, but I remember
doing it at one time -- I think it was near 2.6.8 or so, but I could be
remembering wrong.  I am fairly sure it was 2.6.X for some X.

Number two, if the rtc module doesn't create /proc/sys/dev/rtc before it
runs the hotplug handler, then the script might fail due to that race on
some machines under some loads.  (The driver might do this, too; it
calls misc_register way before it calls the function to register
/proc/sys/dev/rtc/max-user-freq, anyway.)  There isn't much I can do
about that, I don't think.

Attachment: signature.asc
Description: OpenPGP digital signature

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to