Themable App Icons

Gotta head to the airport soon, but a quick note: neat hack for installing app-specific themable icons.

New Hacking Project

Back in March, I bought a used 12” PowerBook G4 from James. I absolutely love it, but I’ve had one annoying problem. I have both Mac OS X and Linux on it, and I have three partitions on the 60GB drive: one for Mac, one for Linux, and one for my home directory, which is shared between both OSes. Of course, I needed something that both of them could read and write to, so I chose the Mac HFS+ format. At the time I installed it, the ext2/3 driver for OS X didn’t have write support for 10.4. It does now, but it doesn’t have ext3 journaling support.

Unfortunately, the Linux HFS+ driver lacks journaling support as well, so I was forced to use a non-journaled volume, as Linux refuses to mount a journaled HFS+ volume read/write.

Now, I don’t know if it’s a deficiency in the Linux HFS+ driver, but 90% of the time after a hard lock (which unfortunately happens somewhat often, as the OSS Broadcom wireless drivers aren’t always so stable), the filesystem gets trashed, and even OS X’s Disk Utility can’t fix it; I have to bust out the big guns: Disk Warrior. And even sometimes that has trouble. So, needless to say, I don’t put anything irreplaceable on that partition.

So, I’ve decided to add journaling support to the Linux HFS+ driver. I don’t expect this to be remotely easy. The first step, which I have somewhat completed, is just to allow the driver to replay the journal if there’s data in it on mount (i.e., if a crash under OS X left the filesystem in an inconsistent state). I’ve been running into a bunch of annoyances, many of which just stem from the fact that I’ve never done any kernel hacking before. It took forever just to figure out how to write to the disk. Figuring out how to read wasn’t easy either. I thought that after I’d found the sb_bread() function, that would be it. But, of course, it’s all a matter of units. sb_bread() seems to read in blocks of 4096 bytes (which might be device-dependent; it just happens to be 4096 for me). In the HFS+ volume header, the journal location is specified in filesystem blocks (512 bytes), which took me forever to realise. Then most other offsets are in bytes. To make matters worse, some of Apple’s documentation doesn’t quite make sense.

Writing was another matter. sb_bread() returns a “buffer head” structure, which contains all the data in that block from the disk. (That’s another thing: you can’t read a certain amount of bytes from the disk, from what I can tell. Each time you read, you get a block, no more, no less.) For writing, you have to read out the correct block, copy the new data to the correct point in that block’s buffer, then call mark_buffer_dirty() on it. If you want to write it immediately (I think/hope), you then call sync_dirty_buffer() on it as well.

Anyway, I think I have most of that sorted out; I just need to figure out some things I’m doing wrong regarding interpreting the spec and where portions of the journal are, and it should be ok.

Then comes the hard part, which as far as I can tell isn’t documented anywhere: actually implement the journaling support in the driver so as you write to the disk during normal daily activities, metadata gets journaled, then data is written, and then the metadata is flushed to disk (or whatever). I really have no idea how this even works, let alone the details of implementing it. If anyone has any info on this, please feel free to drop me a note…

Misc GPL Stuff

Auke was ruminating on how the GPL relates to a source distro (specifically, the one he runs, Lunar Linux). It raises some interesting questions. Is Lunar, as an entity, distributing binaries? Not in the literal sense: they just distribute sources, and some amount of patches, as well as a generic automated build system. All binaries are built on the user’s target machine (well, with the exception of the install CD, which I’ll get to in a minute). But does that “count” as anything more than source distribution? I would say no, but then, consider this (contrived) scenario (applicable to most source distros, not just Lunar):

Lunar user uses the Lunar package manager to install a piece of software named Foo. Say that when he does this, it’s version 1.0. Due to some quirks, the Lunar package manager has to patch the sources to get it to build properly (or perhaps to fix some icky bug, or whatever). So Lunar user happily uses Foo for a while, and decides he wants to give it to some friends. However, when he tries to find the sources to his binary (note that he’s required by the GPL to offer source in addition to the binary), he finds that Lunar has upgraded their version of Foo to 1.5, which is (for some reason) very different from 1.0.

So, where does he get the sources? And the patches applied by Lunar? What if the sources were modified by ‘sed’ scripts inlined into the build instructions, which are no longer available. Now, I suppose he could dig through Lunar’s Subversion repository, but is that kosher with the GPL?

I suppose it’s all moot, though: the GPL says that if you distribute binaries, you must make an offer to have the source available for three years. But what if you only distribute source? Does that change if you distribute source, plus patches? Do you have any future obligations at all?

Anyway, Auke also mentions this:

We only distribute binaries in lunar-linux through the ISO images (the installer cd). All the binaries on that image are created using the unmodified sources from the original websites. For the few packages that have patches, we use the patches from our own patch website URL. That’s according to the letter of the GPL and actually the *only* thing we’re required to provide.

I suggest you take a look at this FAQ entry. As an extension to that, regarding distributing only diffs from the original version with the binaries, see this one. So in other words, if you distribute binaries, you must also make available the full source used to create those binaries. The fact that it’s (currently) on the original author’s website is not enough.

And we wonder why most software development companies are so afraid of the GPL that they refuse to touch software “tainted” with it. Most of the people in our own community (including myself, on occasion) don’t even understand the license fully.

Samba Patch

I fixed a Samba crash with a 6-line patch and it got accepted… w00t!

Takeout

Lame. It seems the Chinese takeout place next door to the office has changed hands. All the people are different, the portions are smaller, and the price has gone up. Not to mention they don’t know me, and therefore don’t talk to me or give me free soup. To reiterate: lame.

Theories of War

I just read an excellent (though very very long) essay on “Just War Theory” vs. American Self-Defense. It breaks down theories of war into four general groups:

  1. Pacifists: those who feel that war is morally unjustifiable and is never an option;

  2. “Just War” theorists: those who feel that war is a measure of last resort, but can only be undertaken through principles of altruism and self-sacrifice;

  3. so-called “Realists”: those who feel that war has no moral implications, and can only be thought of in practical terms; and

  4. a theory proposed by the article as the correct theory: that war should be undertaken for reasons of self-defense, and that the purpose of war is to secure the safety and prosperity of the citizens of the country initiating war.

While I had heard of “just war” theory before, I wasn’t terribly familiar with its basic principles, or its implications. For the past several years, I had assumed that President Bush was a bumbling idiot, with no plan for the Iraq war, and no reasonable justification for that war. While I still do not at all agree with his rationale or justification, I believe I at least understand his motivations and his background and belief system that made a war with Iraq seem logical to him.

The core behind the “just war” is that it is solely motivated by altruism. A just nation does not start a war to defend itself or retaliate against aggression. A just nation starts a war for some higher purpose, some greater good. Just War theory requires that a nation have some selfless, altruistic motive for starting a war. Just War theory places the lives of enemy combatants on equal footing with friendly combatants. The theory even goes so far as to place enemy civilian non-combatants at a level of higher importance than that of friendly military. American soldiers are required to put their own lives in jeopardy in order to avoid killing enemy non-combatants.

While at first glance this may seem noble and just, consider that so-called “innocent” civilians are rarely actually innocent:

Observe the inversion of justice here. Benevolent, individualistic, life-loving Americans, and death-worshipping, collectivist, nihilistic Arabs—such as the dancing Arabs who celebrated 9/11—are regarded as equally worthy of protection by the American military. The exception is if the American is a soldier and the Arab is a civilian, in which case the Arab’s life is of greater value.

While enemy civilians may not be directly involved in the war, they are certainly not innocent. Civilians support the war effort through material means by providing weapons, money, and shelter to those who do actually fight. Civilians support the war effort via spiritual, religious, and other intangible means as well.

Just War theory is incompatible with self-defense. According to the theory, a nation cannot retaliate against an attack, or make a preemptive strike to avoid an attack, unless this retaliation is done for the benefit of others outside the nation. While there was considerable anger and desire to retaliate after the terrorist attacks of September 11, 2001, President Bush felt the need to also emphasise that the war with Afghanistan was not with the nation of Afghanistan, but with its corrupt leaders (the Taliban) and the terrorist network it supported (al Qaida), and that deposing the Taliban regime would create a better life for oppressed Afghans. In the case of Iraq, where any connection to al Qaida or Osama bin Laden is tenuous at best, the Bush Administration’s justification for war had nothing to do with protecting America or Americans: the grand master plan was to stop Saddam Hussein from continuing to oppress and murder the Iraqi people (i.e., to protect the Iraqis), and to help install a democracy in its place, with the hope of setting an example that other nations in the Middle East would attempt to emulate. Arrows pointing to WMDs and terrorism were drawn, but they have ultimately turned out to be misleading and false.

Why attack Iraq? Iran is essentially the seat of Islamic Totalitarianism. Saudi Arabia is a close second. Both nations fund, support, and harbor Islamic terrorists. But, while a case could be made for “bringing democracy and freedom to Iraq,” no such altruistic case could be made for attacking Iran or Saudi Arabia.

But why not? Iran and Saudi Arabia are perfect model of present threats to America. While life isn’t exactly all peachy with Iranian and Saudi citizens, it would be very difficult to paint a removal of either of their governments as being done for the benefit of their people. How do we deal with these threats? Ineffectively, through attempts at appeasement:

In the rare cases that it has taken any action toward these regimes, its action has been some form of appeasement: extending them invitations to join an “anti-terrorism” coalition (while excluding Israel); responding to the Palestinians’ jihad with a promised Palestinian State; declaring “eternal friendship” with Saudi Arabia and inviting its leaders to vacation with our President; responding to Iran’s active pursuit of nuclear weapons with the “threat” of possible, eventual, inspections by the U.N.

Let’s look at our effectiveness in the two wars we have waged. In Afghanistan, we gave advance notice of our intentions to attack, avoided civilian casualties to the extent of failing to remove crucial military targets, and stood back and watched while many important Taliban leaders escaped.

While that doesn’t sound particularly successful, Iraq has been a disaster in comparison. To this day, we have failed to defeat the remnants of Saddam Hussein’s Baathist regime. While removing Hussein himself was an impressive feat, his regime still lives on in some areas. An insurgency has risen, and continues to kill American soldiers and Shiites. To make matters worse, it’s eminently possible that a Shiite theocracy (even a democratically-elected one) could replace Saddam Hussein, which could simply add another proponent of Islamic Totalitarianism to the mix.

Many have blamed our military failures on sloppy planning. I don’t believe this is true. The war was planned poorly, no doubt, but it was not done haphazardly. The key is in the Just War outlook: military action had to account for “innocent” Iraqi civilians, and avoid killing them, even if it stood in the way of crucial objectives or put American soldiers in much worse danger. The lives of Iraqi civilians – even those sympathetic to the Hussein regime – are somehow judged to be worth more than the lives of American soldiers.

So what is the correct approach? Clearly, pacifism will not solve our problems. Attempts at appeasing Saudi Arabia and Iran have only made them more bold and confident in their opposition to Western life. Just War theory has thrust us into two poorly-executed wars with the loss of much more American life than is necessary, with results that have the potential to make the situation even worse than it was previously.

How about “realism”? Realists believe that practical considerations trump everything, including morality. If an act can bring a quicker end to a war or more effectively protect the “good guys,” it should be taken; in fact, it is therefore an obligation to be taken. However, realists miss out on the fact that practicality cannot be separated from morality. Practicality assumes some kind of goal in mind that can be achieved by a certain action (which is deemed to be practical). Any questions as to what are acceptable goals are inevitably moral questions.

At this point, we must consider rational self-interest, or rational egoism, which holds that every individual should be allowed to live his own life without interference, and to pursue his own vision of happiness, as long as his/her actions do not interfere negatively with the lives of others. This principle actually establishes the need for governments. If the sole purpose of a government (with regard to foreign affairs) was altruism, a government would not be necessary. The purpose of the government, plain and simple, is to protect its citizens’ rights and freedoms.

And so, by extension, the moral purpose of any war engaged by any government must be to protect the rights and freedoms of its citizens. This, in many ways, directly contradicts the tenets of Just War theory. The rationale behind a war started by proponents of rational self-interest is self-defense.

Now, I don’t want this to sound like I’m advocating an “anything goes” approach to war. Under rational self-interest, a warring nation is responsible for protecting its people, not the least of which are its soldiers. The interests of enemy combatants and noncombatants alike are secondary to the interests of the nation’s people and soldiers. If the so-called “collateral damage” of civilian casualties is necessary in achieving an important military target, then so be it. If flattening a town full of both civilians and military is the only way to ensure victory, then so be it. But it is not without compassion: if military objectives can be achieved while safeguarding enemy civilian lives, without incurring massive losses for the military, civilians should be left out of the fight.

Let’s compare WWII-era Japan to present-day Iraq:

Observe what it took for the United States and the Allies to defeat Germany and Japan and thus win World War II. Before the Germans and Japanese surrendered, the Allies had firebombed every major Japanese city and bombed most German cities—killing hundreds of thousands. Explaining the ration­ale for the German bombings, Churchill wrote, “. . . the severe, the ruthless bombing of Germany on an ever-increasing scale will not only cripple her war effort . . . but will create conditions intolerable to the mass of the German population.” And as we well know, what ended the war—and the Nazi and Japanese Imperialist threat to this day—was America’s dropping of two atomic bombs on Japan.

[…]

In… World War II…, once massive defeats were handed to the enemy, the causes that drove the military threats were thoroughly defeated as political forces. There are no threatening Nazis or Japanese Imperialists today…

[…]

Many Just War theorists hold—as by their standard they are obliged to hold—that the dropping of atomic bombs on Hiroshima and Nagasaki in 1945 was immoral. America, they claim, should have valued Japanese civilians over the hundreds of thousands of GIs who would have died invading Japan.

A war with a nation is not just a war with that nation’s leadership and military. It is a war with that nation’s people as well. By making the war with Iraq simply a war with Hussein and his regime, we have lost control of the situation. An insurgency has risen, and, given the rules of engagement, we are powerless to stop it. Most civilian Iraqis are not happy with our actions. The fledgling Iraqi government does not appear to have the support of its people. The American-trained Iraqi police force is motivated not by a desire to see their country repaired, but by the promise of a paycheck. Iraq does not want us there, and yet we try to make it look like we are there to help them, instead of doing what we should be doing: effectively occupying the country and squashing insurrection by any means necessary, and installing a government that will pose little to no threat to us. I’m not saying they have to be puppets of the U.S. government, just that they need to lack a desire – though fear, if necessary – to do harm to America.

Another aspect of Just War theory is that all cultures and ways of life are equal and deserve equal opportunity to flourish and succeed. This is simply false and self-destructive. All cultures are not equal. All ways of life do not deserve existence. Extremist Islam has time and time again stated its goals to wipe Western culture from the face of the earth. Iran has gone so far as to directly threaten to erase Israel by nuclear means. How can these cultures coexist? Perhaps they cannot. In that case, which should be allowed to flourish? In my opinion, it is the way of life that encourages freedom and peace, not the eradication of everyone who doesn’t agree with you.

But why does that even matter? Why ask who is “right” or “wrong”? The bottom line is that one culture wishes to destroy the other. Are we (the Western world) so willing to be tolerant and accepting of other points of view that we will literally allow those opposing points of view to destroy and eliminate our way of life? I certainly hope not. If it’s a choice between us or them, I’m going to choose us.

War is not about spreading “feel good” intentions around the world. War is not about giving the “joys” of democracy and freedom to other nations. War is about safeguarding the lives of those who are threatened. America’s goal in attacking another nation needs to be to eliminate any threat that nation poses to America. I’ll close with another short passage from the linked article, as it really says it best:

America faces a choice between two irreconcilable foes: self-defense or altruism—which are but forms of the basic choice we all face: life or death. Let us choose life.

Xfce 4.4rc2 Released

This weekend, we just released the second release candidate in preparation for Xfce 4.4.0. Check out the list of changes from rc1, or go ahead and get to the downloads.

I’m really happy with this release (where xfdesktop is concerned, at least). I closed something like 26 bugs, and I’m much more comfortable with xfdesktop’s stability level. There are still some features that I wanted to get in for 4.4 that aren’t going to make it, but I think the desktop manager is pretty usable and stable, and works well at this point. Give it a try.

Oh, and if you’re bothered by the fact that icons that ‘fall off’ the screen (due to the icon size being too large) never reappear when you lower the icon size, grab the patch from this bug and apply it to rc2.

Oh, Wikipedia

Apparently, xfmedia has a (tiny) Wikipedia entry. I find that… somewhat silly (if ego-boosting, in a way). Though I did learn something: apparently I haven’t made a release in over a year. I suck.

« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 next »