Re: Pyrex experts? Looking to expose settimeofday() and RTC_SET_TIME ioctl()

2010-04-28 Thread Daniel Drake
On 26 April 2010 20:21, Martin Langhoff martin.langh...@gmail.com wrote:
 I am porting some awkward patches I have against the old olpc
 initramfs to the new dracut-based, all bling initramfs.

 The python part is mostly done, but the fun part is that we're trying
 to set the clock (both system clock and rtc) based on network
 messages.

 The general approach in our initramfs when we need some specific calls
 to potent magic hidden (as we often do in our voodoo initramfsen) is
 to unleash The Power of Pyrex. So that's what I plan to do.

I wouldn't have thought pyrex is necessary. I suggest using
fnctl.ioctl() for RTC_SET_TIME, and ctypes for settimeofday().

Daniel
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Pyrex experts? Looking to expose settimeofday() and RTC_SET_TIME ioctl()

2010-04-28 Thread Martin Langhoff
On Wed, Apr 28, 2010 at 8:32 AM, Daniel Drake d...@laptop.org wrote:
 I wouldn't have thought pyrex is necessary. I suggest using
 fnctl.ioctl() for RTC_SET_TIME, and ctypes for settimeofday().

Our chvt() is in pyrex, and all it does is call ioctl() on
/dev/console. If there's a better way to call ioctl() then we can get
rid of pyrex in our initramfs completely.

In the meantime, I am following the approach already in use in our
initramfs, and Hal Murray's posted in private a very nice pyrex
wrapper around those two that I plan to test/merge/use today.

cheers,


m
-- 
 martin.langh...@gmail.com
 mar...@laptop.org -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Pyrex experts? Looking to expose settimeofday() and RTC_SET_TIME ioctl()

2010-04-28 Thread Daniel Drake
On 28 April 2010 09:59, Martin Langhoff martin.langh...@gmail.com wrote:
 Our chvt() is in pyrex, and all it does is call ioctl() on
 /dev/console. If there's a better way to call ioctl() then we can get
 rid of pyrex in our initramfs completely.

It's not quite that simple, see e.g. pyfb/pyvt.
But yes, I believe that most or all of the stuff could be rewritten
using ctypes and fnctl without much effort. The code was written
before ctypes existed.

 In the meantime, I am following the approach already in use in our
 initramfs, and Hal Murray's posted in private a very nice pyrex
 wrapper around those two that I plan to test/merge/use today.

I don't have any ctypes experience, but from what I read, it looks
like it really would be trivial. Hal, would you be interested in
trying this alternative approach for the 2 new bits that we need? :)

Daniel
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Pyrex experts? Looking to expose settimeofday() and RTC_SET_TIME ioctl()

2010-04-28 Thread Martin Langhoff
On Wed, Apr 28, 2010 at 9:10 AM, Daniel Drake d...@laptop.org wrote:
 I don't have any ctypes experience, but from what I read, it looks

Just to make sure there's water before anyone jumps.

What impact would it have in our initramfs? Does it expect header
files to do its job? Does it require new modules / so files in the
initramfs? (the ctypes dir in f11 weighs in at 164KB, it could
however depend on other stuff...)

Any any case, if we're forced to keep using Pyrex, let's use Pyrex,
instead of a dozen things. We already have a bazillion languages,
libraries and toolkits. I definitely don't want to add to the burden.

cheers,


m
-- 
 martin.langh...@gmail.com
 mar...@laptop.org -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel