I’ve been a member of April, the french association for promotion and defense of Free Software, for a bit more than a year, and I often regret not becoming a member earlier. (I was feeling so guilty and shameful about not being a member that I actually postponed becoming a member.)
Stop feeling guilty and shameful, become an April member today!
Why Is becoming an April member so important?
when not being distracted by other uses of the system, i've
managed to spend some more time on packaging some more stuff that's
useful on a debian ps3. namely:
so... where were we? oh yes.
put this in your sources.list:
deb http://people.debian.org/~seanius/ps3-experimental-packages sid main
source packages are also available if you want to poke around or
backport the packages to etch or ubuntu or something else wierd
like that:
deb-src http://people.debian.org/~seanius/ps3-experimental-packages sid main
now, if you have a properly configured system, you should get a
warning:
Reading package lists... Done
W: GPG error: http://people.debian.org sid Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY CA78CB3E6E76D81D
W: You may want to run apt-get update to correct these problems
but i promise this key is valid, and mine. but hey, you don't
have to take my word for it
sudo apt-get install debian-keyring
gpg --no-default-keyring --keyring /usr/share/keyrings/debian-keyring.gpg --export --armor CA78CB3E6E76D81D sudo apt-key add -
then you can install the packages... assuming you want the xorg
video driver:
sudo apt-get install xserver-xorg-video-spu
and update the appropriate Device entry in your xorg.conf, so
that the normal fbdev is commented out and instead you use the
spufbdev driver. example:
Section "Device"
Identifier "Generic Video Card"
Driver "spufbdev"
Option "ShadowFB" "false"
EndSection
and then
sudo /etc/init.d/gdm restart
(or the equivalent if you're using something else). that's
it!
more packages may trickle in here as well, at least until and
they find their way into debian proper. i'm also in contact with
the upstream authors of this stuff, and they're generally very
responsive, so let me know if you have any problems.
I wrote to a site owner last week and I thought I was writing to a webmaster. The site owner complained about some of the jargon and, while explaining who I thought I was writing for, I explained some of it because I think more website owners might benefit from these three explanations:-
“Expat-like terms” - made available in a way that is freely sharable, modifiable and redistributable, similar to the Expat software package, whose terms are published at http://www.jclark.com/xml/copying.txt - this is often used as a clear, simple example for encouraging wide distribution of electronic resources (software).
“clandestine Google Analytics” - Google Analytics is a service from Google, Inc for tracking users through a website in various ways. I believe the Data Protection Act means that English websites should obtain informed consent from users by publishing a Privacy Policy on their site which discloses what the GA service will be used for and linking through to GA’s own Privacy Policy. Some websites attempt to run Google Analytics on users’ computers without explaining why and without any Privacy Policy. That is what I mean by “clandestine”.
“valid xhtml” - validating against the eXtensible HyperText Markup Language standards published by the World Wide Web Consortium (W3C) - the underlying language of the web. There is a test service provided at http://validator.w3.org/ and passing it is a key stepping stone towards making an accessible website. There’s not really such a thing as “invalid xhtml” - if it doesn’t pass validation, it’s not xhtml. So I guess I’m guilty of using a tautology sometimes - sorry about that.
Is it worthwhile knowing those three phrases? Are there other key technical phrases which you think site owners should know?
Long time no post. Anyway, I have some good news.
The Gtk code for Aptitude has been merged some time ago into the main development trunk and we now have a release in Experimental.
For those that don’t know about it, here’s what it’s all about : “The new frontend is is an effort to bring some of the design principles of the curses frontend to a GUI environment, while also exploiting the unique features a GUI gives us and exploring ways to deal with changes in the environment in the nine years since aptitude was first designed.”
I had a very good time this summer working on Aptitude with Daniel Burrows in the Google Summer of Code program and I’m very glad we now have a real release. This version is by no means final or perfect but it’s a good start.
Head for the blog post from Daniel for some other informations : [Daniel Burrows]
I think the real reason there was resistance to this change is that MySQL doesn't support DDL transactions; and wrapping migrations in a transaction is mostly pointless without this feature. Since MySQL doesn't support it, most Rubyists don't know what DDL transactions are - so here's a quick primer on this incredibly useful and certainly underrated feature. DDL = data definition language, also known as the schema. DDL commands include CREATE TABLE, DROP TABLE, ALTER TABLE, and CREATE INDEX. DDL transaction support means that the following sequence of SQL commands will not modify your databaseI never even thought of that. I was fairly confident in my vision of Postgres getting faster and faster, and Mysql become a "real" database... that the two systems were converging on something resembling a common speed/feature set. But things like this still occasionally rear their ugly heads and I'm happy to be a Postgres user.
Meme from Jono:

bzr shell-complete command (or bzr s-c for short),
which was never fully fleshed out, and has since fallen into disrepair.
The principles behind this are
+ the program is the best place to store up-to-date and accurate information
+ the program already knows all these things (albeit usually in unparseable forms)
+ duplicating information and effort is annoying
Here is an excerpt from bzr s-c, which was intended to give a comprehensive
list of subcommands, paired with short descriptions:
diff:show differences in the working tree, between revisions or branches
export:export current or past revision to a destination directory or archive
get:create a new copy of a branch
help:show help on a command or other topic
ignore:ignore specified files or patterns
ignored:list ignored files and the patterns that matched them
info:show information about a working tree, branch or repository
init:make a directory into a versioned branch
There is one subcommand per line, separated from its description by a colon.
Next you can invoke something like bzr s-c diff to get the possible options
and arguments for the diff subcommand, although the output you would see today
is broken and nearly useless.
Since I've lost faith in bzr, I'll illustrate what the output might be
corresponding to topgit's tg remote if topgit supported this kind of thing:
--populate
REMOTE
This would mean that tg remote can understand the option --populate, which
takes no argument, and that the first non-option argument should be a
REMOTE.
REMOTE would then be defined, for example, in zsh's _topgit function as
some kind of git remote which is completed in the same way you might complete
a git remote for git.
The exciting part then, is that if tg remote starts taking a --decimate
option, the topgit completion helper subsystem will start outputting it
and _topgit will do the right thing without having to be altered.
For tg export, things are a bit more complicated, so let's have it be
described in the style of the zsh completion system:
'(--collapse)--quilt:directory:_directories'
'(--collapse -b --branch)' -b,--branch= ':branches:BRANCHES'
'(--quilt)--collapse:branch:BRANCH'
This means that --collapse and --quilt are exclusive, that -b
and --branch cannot be used with --collapse, that -b and
--branch are equivalent, that -b and --branch take an argument
in the form of BRANCHES, that --collapse takes an argument in the
form of BRANCH, and that --quilt takes an argument that's a
real directory in the filesystem.
Then _topgit would have logic to interpret BRANCH as a branch, and
BRANCHES as a comma-separated list of branches.
A similar idea is the one used by axp. If you invoke axp self completion zsh,
it will output zsh completion functions for you. To me this seems more onerous
on both the developers and the end users, but I suppose it gives you immediate
flexibility that a more generic interface would lack.
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0 9 Power_On_Hours 0x0032 089 089 000 Old_age Always - 8719 196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0 197 Current_Pending_Sector 0x0012 200 200 000 Old_age Always - 2 198 Offline_Uncorrectable 0x0010 200 200 000 Old_age Offline - 0 [...] SMART Error Log Version: 1 ATA Error Count: 10 (device log contains only the most recent five errors) [...] Error 10 occurred at disk power-on lifetime: 8692 hours (362 days + 4 hours) When the command that caused the error occurred, the device was active or idle. After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- 40 51 08 78 e5 89 e0 Error: UNC 8 sectors at LBA = 0x0089e578 = 9037176 Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- 25 00 08 78 e5 89 2f 00 45d+06:36:27.880 READ DMA EXT 25 00 08 70 e5 89 2f 00 45d+06:36:27.798 READ DMA EXT 25 00 08 68 e5 89 2f 00 45d+06:36:27.308 READ DMA EXT 25 00 08 e0 77 e5 35 00 45d+06:36:27.295 READ DMA EXT 25 00 08 60 e5 89 2f 00 45d+06:36:26.653 READ DMA EXT [...] Error 9 occurred at disk power-on lifetime: 8692 hours (362 days + 4 hours) When the command that caused the error occurred, the device was active or idle. After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- 40 51 08 60 e5 89 e0 Error: UNC 8 sectors at LBA = 0x0089e560 = 9037152 SMART Self-test log structure revision number 1 Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error # 1 Extended offline Completed: read failure 90% 8715 797566305 # 2 Extended offline Completed without error 00% 8198 -Notice that 197 Current_Pending_Sector indicates that there are 2 sectors with a problem. Note that the SMART error log shows LBA sectors 9037176 (0x89e578) and 9037152 (0x89e560) but it's limited to 0xffffff. The self test logs shows us the proper LBA error at 797566305 (0x2f89e561) which has a 0x2f in front, and also shows us that it's the second sector in the block of 8 we tried to read. The kernel log also shows:
ata4.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
ata4.00: (BMDMA2 stat 0xc0009)
ata4.00: cmd 25/00:08:60:e5:89/00:00:2f:00:00/e0 tag 0 cdb 0x0 data 4096 in
res 51/40:00:61:e5:89/00:00:2f:00:00/f0 Emask 0x9 (media error)
So I've tried to reproduce the error with:
# dd if=/dev/sdd of=797566305 skip=797566305 bs=512 count=1 iflag=direct 1+0 records in 1+0 records out 512 bytes (512 B) copied, 1.27727 s, 0.4 kB/sNotice that it can actually read that block, it just seems to take a while. And the error log now contains:
After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- 40 51 01 61 e5 89 e0 Error: UNC 1 sectors at LBA = 0x0089e561 = 9037153Because it's part of a RAID device I could just let the whole disk resync, but I was a little curious which files were in it. So I found this document that explains on how to find which files has the problem. But it only has examples covering ext2/ext3 on a partition and LVM and nothing about RAID device. So it looks like someone using RAID 0 will have a hard time finding the file that's having a problem. So following the document we start with:
# fdisk -lu /dev/sdd Disk /dev/sdd: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors Units = sectors of 1 * 512 = 512 bytes Disk identifier: 0x000578f9 Device Boot Start End Blocks Id System /dev/sdd1 * 63 385559 192748+ fd Linux raid autodetect /dev/sdd2 972864270 976768064 1951897+ fd Linux raid autodetect /dev/sdd3 385560 972864269 486239355 fd Linux raid autodetect Partition table entries are not in disk orderIn /proc/mdstat we see:
md1 : active raid5 sda3[0] sdd3[3] sdc3[2] sdb3[1]
1458717696 blocks level 5, 64k chunk, algorithm 2 [4/4] [UUUU]
So sdd3 is part of md1 and I have an ext3 filesytsem on that. Tune2fs -l grep Block gives:
Block count: 364679424 Block size: 4096 Blocks per group: 32768mdadm tells me:
# mdadm -QE /dev/sdd3
/dev/sdd3:
Magic : a92b4efc
Version : 00.90.00
UUID : 747b071a:a70f723b:c3a9ed44:15845cbf
Creation Time : Mon Nov 12 20:13:51 2007
Raid Level : raid5
Used Dev Size : 486239232 (463.71 GiB 497.91 GB)
Array Size : 1458717696 (1391.14 GiB 1493.73 GB)
Raid Devices : 4
Total Devices : 4
Preferred Minor : 1
Update Time : Mon Nov 10 10:57:28 2008
State : clean
Active Devices : 4
Working Devices : 4
Failed Devices : 0
Spare Devices : 0
Checksum : 4b3147f4 - correct
Events : 78
Layout : left-symmetric
Chunk Size : 64K
Number Major Minor RaidDevice State
this 3 8 51 3 active sync /dev/sdd3
0 0 8 3 0 active sync /dev/sda3
1 1 8 19 1 active sync /dev/sdb3
2 2 8 35 2 active sync /dev/sdc3
3 3 8 51 3 active sync /dev/sdd3
I've been told that 0.90 stores the superblock at the end of the device, so that makes it a little easier. And this seems to agree:
# cat /sys/block/md1/md/dev-sdd3/offset 0We have a left-symmetric layout, so in raid5_compute_sector() we see
stripe = chunk_number / data_disks; *dd_idx = chunk_number % data_disks; [...] case ALGORITHM_LEFT_SYMMETRIC: *pd_idx = data_disks - stripe % raid_disks; *dd_idx = (*pd_idx + 1 + *dd_idx) % raid_disks;So it looks like the chunks are located on the disk like:
| stripe | sda | sdb | sdc | sdd |
| 0 | D 0 | D 1 | D 2 | P 0-2 |
| 1 | D 4 | D 5 | P 3-5 | D 3 |
| 2 | D 8 | P 6-8 | D 6 | D 7 |
| 3 | P 9-11 | D 9 | D 10 | D 11 |
| 4 | D 12 | D 13 | D 14 | P 12-14 |
# dd if=/dev/md1 of=797566305.2 skip=2391542217 bs=512 count=1 iflag=direct 1+0 records in 1+0 records out 512 bytes (512 B) copied, 5.99103 s, 0.1 kB/sWe see an error message in the kernel log, there are 2 new errors in the error log, so it seems that everything is calculated correctly. The files are also identical. The file system is in blocks of 4096 bytes, so for the file system this is block 2391542217*512/4096=298942777.125 Then we use debugfs:
# debugfs debugfs 1.41.2 (02-Oct-2008) debugfs: open /dev/md1 debugfs: icheck 298942777 Block Inode number 298942777 <block not found>Which isn't making any sense to me, since I get that error about every 2 hour when a certain cronjob runs. 298942777 / 32768 (Blocks per group) = 9123.00955. So I wonder if ext3 is keeping some meta data there and debugfs doesn't tell that? Anyway, at some point I was running a smartctl -t long /dev/sdd again because I couldn't reproduce the error anymore, the cronjob started, and I then found alot of errors in my log again and now it included:
raid5:md1: read error corrected (8 sectors at 797180744 on sdd3)It's so much fun that disks always behaves the same trying to read the same sector. Smartctl now reports:
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0 196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0 197 Current_Pending_Sector 0x0012 200 200 000 Old_age Always - 0 198 Offline_Uncorrectable 0x0010 200 200 000 Old_age Offline - 0I assume the kernel removed the pending sector by writing to it. The other pending error was already gone for some time, I assume new data got written to that one.

I actually think it's a bit of an insult if people think of Motorola's EZX or MAGX (and now Android) phones as "Linux phones". Because all the freedoms of Linux (writing native applications against native Linux APIs that Linux developers know and love, being able to do Linux [kernel] development) are stripped.-
C++ header dependencies got cleaned up in GCC 4.3, which broke a lot of
code which relied on headers to be included indirectly through some other
headers. I found some new build failures with GCC 4.4 related to missing
#includes; in particular, #include <cstdio> is missing in a
lot of code.
Typical errors look like these:
error: 'sscanf' was not declared in this scope error: 'EOF' was not declared in this scope error: '::fseek' has not been declared error: 'uint32_t' does not name a typeBelow is a table showing which header needs to be included for a number of common functions:
| Functions and defines | Header |
| fopen, fwrite, fclose | cstdio |
| fread, fseek, feof | cstdio |
| sscanf, sprintf | cstdio |
| rename, open | cstdio |
| EOF | cstdio |
| memset, memcpy, strdup | cstring |
| va_list | cstdarg |
| int16_t, uint32_t | stdint.h |
I have been meaning to fix this up for a long time, but so far real
work keeps getting in the way. The idea is that C-C t brings you to
this week's time tracker buffer, and then you use (C-c C-x C-i/C-c C-x
C-o) to start and stop timers.
The only even slightly clever is stopping the timer and saving on
quitting emacs, which I borrowed from the someone on the net.
Oh, and one of the things I meant to fix was the dependence on mhc. Sorry.
Here is the snippet from my .emacs
(require 'org-timetracker)
(setq ott-file
(expand-file-name
(let ((now (mhc-date-now)))
(format "~/.org/%04d/%02d.org"
(mhc-date-yy now) (mhc-date-cw now)))))
It needs emacs restarted once a week, in order to pick up the
new file name.
The main guts of the hack are here.
The result might look like the this
(works better in emacs org-mode. C-c C-x C-d for a summary)
Yesterday I took part of the fourth inter-state bike ride, requesting the construction of proper and safe cycling ways. Tens of Mexican bike-rider organizations were part of the organization, althought the effort is basically grouped under the Ciclopistas y Ciclov as Interestatales project - For further details on the route we took, you can look at the M xico-Pachuca road map, although it was not followed literally.
As a brief introduction to this - I first read through the Android code when interviewing with Google for an opening with the Android kernel team. I didn't get the job, and while I don't think anything that follows here is as a result of residual bitterness you might want to take some of it with a pinch of salt.android_early_suspend_t early_suspend; android_early_suspend_t slightly_earlier_suspend;to deal with the fact that the MSM framebuffer driver depends on the MDDI driver having brought the link bank up and so needs its suspend method called before the MDDI driver but its resume method to be called after, and the only way to handle that is to register two methods - the "slightly earlier" one which has a suspend method but no resume, and the "early" one which has a resume method but no suspend one.
I’ve just released pommed v1.22, which has been collecting improvements and reworks over the past few weeks; this release also adds partial support for the Late 2008 laptops.
Partial support means the LCD backlight is not supported yet. The method for controlling the backlight has to be figured out; if you hear of anything, let me know.
You’ll need a recent kernel for full support on these machines, which means either a late 2.6.28-rc or possibly an early 2.6.29-rc. It all depends on how fast the patches get applied to mainline. Patches are needed for the keyboard quirks, trackpad support, applesmc support and sound support, as usual.
On the improvements front, wmpomme has become event-driven, eliminating the fixed-rate update and associated wakeups and visual ugliness in some configurations; pommed has got some code fixes, though nothing major; gpomme has got a new Japanese translation.
Hopefully the next release will bring full Late 2008 support.
I've had this crazy ATA over Ethernet SAN for my MythTV setup for as long as
I've been running MythTV. I'm using minotaur, an old Pentium III
1RU VA Linux server as the "head".
Originally, I had 4 IDE hard drives, attached to minotaur via
IDE-USB adapters. This worked perfectly fine, but I missed the ability to
query SMART information, and do other low-level drive tweaking with
hddparm
So a while ago, NewEgg had a sale on
750Gb SATA drives, and I bought a 4 port eSATA card, and took the plunge
with SATA. That all went fine.
The entire time, I've had the 4 hard drives themselves just sitting on top
of minotaur, on cork trivets. The whole arrangement is in the
bottom of our linen closet, as this is where the patch panel for the
apartment is.
I've graphed the temperature
of linen closet for some time now, but the benefit of having hard drives
connected via SATA was that I could easily graph the temperature of them as
well, which I started
doing recently.
The catalyst for wanting to do this was that I had a drive fail, and I was
concerned that they were getting too hot, just sitting in the
closet with no airflow. Matt Bottrell's recent
reminder of Google's research into hard drive failures also helped bring
this concern to forefront.
Seagate's product
documentation for the Barracuda 7200.10 claims that ambient operating
temperature must be between 0 C and 60 C. I'm assuming
that's the environment the hard drive is in, and not the temperature of the
drive itself as reported by something like hddtemp. The closet is
typically in the high 30's. If you believe what SMART reports, it seems to
imply that anything over 45 C is a Bad Thingtm.
So after I had a drive fail, I figured I should probably try to do something
about the temperature situation, and started looking around for an external
enclosure.
I'd previously
had problems with the IEC-to-Molex power supplies I was using to power
the disks, and think that they'd been the cause of some failures of my IDE
disks, so was quite eager to stop using them as well, which was something
else an external enclosure would give me.
I had trouble finding an enclosure that presented 4 separate eSATA ports,
and I was talking to Marc about SATA port multipliers, when he mentioned he
had a brand-new unused full-height SCSI enclosure, for four disks, which was
surplus to his requirements. Since all I really needed was external power
and cooling, I thought I could cannibalise this to my needs.
Sure enough, I could just remove the SCSI cables and their Centronics
connectors, and feed the eSATA cables out the gap they left, and use the
molex-SATA power splitters I already had. Because the enclosure was intended
for full-height 3.5" hard drives, there was plenty of air space between each
disk. The enclosure included two fans.
The results? Well the graph speaks for itself:
(I'm not
entirely sure why minotaur's internal disk occasionally reports a
very low temperature)
The added bonus is I've cleaned up the rats nest of cables in the linen
closet. So thanks very much, Marc!
Way back in mid-late May, I switched keyboard layouts from standard US QWERTY to Colemak. I’d played around with the layout a bit before that and thought it seemed pretty solid, but it hadn’t been a good time to switch then. (I did, however, snag the idea of remapping Caps Lock to Backspace from that early trial though, and to this day that’s probably the most annoying thing about typing on QWERTY, because I associate Caps Lock with Backspace on both layouts now. Anyway.) This time, however, I strategically timed it to coincide with the end of classes, so I had no assignments due and could make a fool out of myself during the first few days of my summer job. Smashing success.
It only took a couple days to get past the point of extremely frustrating slowness. Two weeks in I was up to 40wpm, which was about the point where I stopped noticing that I’d taken a backwards step in typing speed, as it didn’t really hinder anything I did on a regular basis. By the end of the summer I was back up to the same speed as I’d been prior to switching (around 75wpm). I didn’t really do any typing lessons after the first few days, as I found just doing whatever I would normally do on a computer much more interesting.
The biggest hurdle after the initial adaptation of actually being able to type on the layout was, for a command-line lover like myself, dealing with “hjkl” not being a convenient way of navigating around in console apps like mutt, vim, aptitude, and less. After a bit of experimentation, I stole an idea from this page and started adapting my dotfiles to make these programs use ne for jk and st for hl, and that seems to be working out well. The worst key that this clobbers in general is n, but it’s pretty easy to remap that to QWERTY’s n, which is easy to remember and is the hardly-used k on the Colemak layout.
For any interested others, I’ve thrown the relevant dotfile snippets up here. I’d been putting off blogging this because I wanted to finish setting up dotfiles/homedirs-in-git la Joey Hess beforehand, but I figure I’ll never actually get it done if I keep using that excuse. For mutt, the given snippet goes in your .muttrc (or whatever you source keybindings into your muttrc from). The same goes for vim. Aptitude keybindings go in .aptitude/config. For less, it’s a little more arcane: first you stick your keybindings in .lesskey, and then you run the command lesskey. I also remapped screen’s escape key to ctrl-t.
Why not Dvorak?
Dvorak seems to be the most well-known QWERTY alternative around, so why didn’t I switch to that if I wanted something better? I did try Dvorak first, but the incredibly uncomfortable combination of ls on the right pinky was a complete deal-breaker. I also found it very slow-going to try to adapt to Dvorak after typing on QWERTY for years. The Colemak FAQ has some more notes on Dvorak deficiencies that it addresses.
Overall, I’ve found typing on Colemak to be remarkably lacking in anything that particularly bothers me. I still type on QWERTY a little, but mostly just for login prompts on Athena workstations and the desktop machine in my room which my roommate sometimes uses. I have to glance down at the keyboard when typing on QWERTY to get it back in my head, but generally I only need it for a few minutes anyway and it’s no big deal. As long as I glance down occasionally I can still maintain a speed level well above that of frustration. On the plus side, this means that if I look at the keyboard when typing normally in Colemak, I get screwed up because I start thinking in QWERTY. So it’s good touch-typing reinforcement in general.
(Part 1 of an ongoing series: shiny things in telepathy-glib)
16:46 < epmf> tp-glib is made of magic—#telepathy, 2008-04-15
Rob pointed out today that I'd been promising to blog about telepathy-glib for several months and still haven't done so. I think there's too much to cover in one blog post, so I'll start with the oldest part - implementing a service (typically a Telepathy connection manager).
While telepathy-glib is (obviously) intended for Telepathy implementors, I think the ideas we've been implementing are likely to be useful for any D-Bus API, particularly flexible/complex APIs where an object implements many interfaces.
(credit: daf)
commit 355ef78d98d6fc65715845d56232199162cab12a
Author: Steve Fr cinaux <steve istique net>
Date: Thu Aug 17 11:48:20 2006 +0200
Interface support for bindings.
Instead of running dbus-binding-tool or creating GObjects with D-Bus
interfaces, we put the entire Telepathy spec through
glib-ginterface-gen.py, a distant descendant of Gabble's gengobject.py.
For each interface in the spec, we generate a GInterface that mirrors the
D-Bus interface. Any GObject that implements the GInterface automatically
gets the D-Bus interface if it's exported onto D-Bus.
There are a few non-obvious refinements, though:
The signature of the method implementation is always in the mode that dbus-glib calls "asynchronous", where the method implementation can either send a reply message before or after it returns. For "slow" methods, this is the only thing you can do. For instance, many Telepathy D-Bus methods can't return anything until some TCP round-trips to the server have happened. This is also the only thing you can do if you want to extract extra information, like the sender's unique name, from the method-call message (dbus-glib's "synchronous" API doesn't allow this to be done). For "fast" methods, sending a reply message before returning is just as easy as using the "synchronous" API (it's just a difference of syntax), and has an API consistent with that of the "slow" methods, making it easier for service authors.
The layout of the GInterface vtable is private, and (auto-generated) accessor functions are used to fill in implementations. This means our ABI doesn't change just because we re-ordered functions in the spec.
If no implementation is provided for a method, we just raise an appropriate error (org.freedesktop.Telepathy.Errors.NotImplemented), rather than suffering an assertion failure. This means we can safely add methods to an interface.
While we're generating code anyway, we generate some static inline wrapper functions which wrap dbus_g_method_return(), to have type-safe method returns. You can easily check that a method replies with correct types, by checking that the implementation of Foo() replies by calling tp_svc_some_interface_return_from_foo().
Similarly, we generate wrapper functions to emit signals, to get type-safe signal emission.
I've been meaning to document this for ages...
My laptop is set up with an encrypted root filesystem using LVM and dmcrypt.
It also has a small Debian stable system for recovery purposes (I don't have
a CD drive, so if everything goes horribly wrong, I can't just boot from a
live CD).
Here's how to set up something similar:
/. If you wanted extra LVs, set them up too.
Also set your recovery partition to be used as ext3, mounted on /boot,
and not reformatted.
It should now look something like this (smcvcrypt is the name of
a KVM virtual machine in which I've been testing these instructions, normally
you'd have the laptop's hostname there).
Proceed with the installation.
Install Grub to the MBR - this will temporarily make the recovery system
unbootable, but shrug never mind. Finish the installation and reboot into
your new main system.
title Go to recovery system
root (hd0,1)
chainloader +1
(Replace (hd0,1) with what Grub thinks the recovery partition is - the second
number is the partition number starting from 0, so /dev/hda5 would be (hd0,4)
and so on.)
Also edit /boot/boot/grub/menu.lst and put this right at the end:
title Back to main system
root (hd0)
chainloader +1
Also, still in /boot/boot/grub/menu.lst, go to the top of the file and
change the colour scheme to something else (I used a red background) to
indicate that this boot menu is for the recovery system.
Reboot and try it out. You should now have an extra boot menu option,
"Recovery system". Selecting it will switch to the recovery system's
boot menu, which has an option to switch back, and so on. Each boot menu
also has some entries for kernels, any of which will boot with the
appropriate root filesystem (encrypted root for the main system,
unencrypted for the recovery system). Success!
I spent much of this week in Alicante. It was wonderful to have a
few days away from the beginnings of Winter in Cambridge - Alicante's
in South West Spain, right on the Mediterranean. It's a lovely city,
although it was very quiet due to the time of year.
I was invited down to Alicante by organisers of the Congr s de Programari Lliure,
Comunitat Valenciana, to present a talk about Debian. That I did,
and as always my slides
and photos
are available in case people are interested. I wasn't too sure about
what level to aim the talk, so I deliberately went for a general
introduction to Debian. That seems to have been the correct level -
nobody threw anything at me, and nobody was visibly falling
asleep. *grin* It's also the first time I've ever given a talk with
official translators, which is a weird experience! The main topic for
the conference was the new release of Lliurex, Valencia's own GNU/Linux
distribution targeted primarily at use in schools.
The conference was massive; I was told there were about 1500
attendees in all, most of whom were teachers who wanted to come and
learn more about Free Software. There was a good spread of talks and
workshops, covering topics from development through to deployment in
the classroom. The level of enthusiasm for Free Software here was
immense - lots of people were keen to learn more about it and get
involved. I was told that out of the 15 regions/states of Spain, 11 of
them have now started their own distributions to use in schools!
Extremadura were the first region to experiment with Free Software
like this, and their success with LinEx was a clear inspiration to
their neighbours elsewhere in Spain. As well as the obvious cost
advantages of moving from proprietary to Free Software, the local
governments also love the freedom to use and modify their software
however they like - including the ability to provide their own
translations.
I met up with a lot of cool people at the conference too. The local
education minister (Alejandro Font de Mora) was keen to talk with all
the speakers and very enthusiastic about the future of Free Software
in his schools. As is increasingly common at FS events around the
world, there were of course quite a few Debian people around too.
Luciano and Miriam were also giving talks, and I bumped into Rene and
Miguel and a whole bunch of others whose names I'm too crap to
remember - sorry! I also spoke a lot with Kurt Gramlich, the
mega-enthusiastic Skolelinux developer who was also happy to push
Debian to everybody he spoke to *grin*. Jon "Maddog" Hall had some
excellent ideas that I'm sure we'll all hear more about soon, and his
talk was excellent. He did a very good job of explaining how Free
Software makes such a difference, including how it helps people to
make money. He also explained that due to travel he had missed
Halloween at home and he wanted to share the experience of scary masks
with the people at the conference:
I had a great time in Alicante, and I'm very grateful for the
invitation to go there. I wish that the UK was as far as advanced as
Spain in the use of Free Software in education - they've done a huge
amount of good work in this area and I'm glad we can help them.
Next.