Archive for: February, 2012

Historical insights into the current Canberra mayhem

Feb 26 2012 Published by under realworld

I don’t feel the need to publicly add my opinion to the current federal ALP leadership ructions; contributions aplenty to the Prime Ministerial stoush, in theory due to culminate tomorrow, have been whirring around the Internet and traditional media at an ever increasing rate for days now.

Instead I think it is worth reflecting on some facts and historical trivia about Australian Prime Ministers:

  • In Federal lower house elections in Australia, votes are cast to elect member representing the voters electorate in the federal parliament. We do not vote directly for the Prime Minister.
  • How to Vote cards do not have to be taken or followed by voters. Lower house preferences are fully allocated at the whim of the voter. Preference deals rely on the parties hoping voters will be “sheep” and vote how they are told.
  • Many people get upset about preferential vs. first past the post voting.
    They should take solace in noting that mathematically, preferential voting is equivalent to holding multiple simultaneous ‘run-off’ elections (as found in some countries.) Concurrently running first past the post elections where each time an election is ‘held’, the candidate with the least number of votes is removed, until someone manages to make it to 50% + 1 vote.
    The difference being that our system assumes that voters who voted for a candidate would not have changed their next preference at the next run-off.
    Another way of putting it, which I prefer, is that preferential voting elects the ‘least worst candidate for the largest number of voters’.
  • There is nothing in the Australian Constitution mandating there be a Prime Minister. This is just a long-standing convention. The lack of written formalisation of various conventions contributed to the constitutional crisis of 1975.
  • At one stage in 1974, the Liberals, in opposition at the time, had three former prime ministers or leaders in their party room – John Gorton, William McMahon and Billy Snedden.
  • Both houses of parliament do not have to be elected concurrently. For example, it is possible that independent members withdrawing support from the Government may trigger an early election of the House of Representatives, but if it happened in the next while this would not be accompanied by a half-Senate election as this is not scheduled until 2013.

    The last House-only election was in 1972 and the last half-senate election was in 1970.

PS I have tried to make sure my facts are correct, but I am human and of course there may be mistakes…

No responses yet

OpenWRT tips

Feb 17 2012 Published by under howto

“Undeleting” files from the /rom filesystem…

This post describes in gory detail how to recover files from the ROM image in case you accidentally removed a base package from OpenWRT.
In brief, locate files called ‘META_*’ on /overlay and edit them to remove deletions from the overlay filesystem. For detail, read on…

TL;DR

When first installed, the OpenWRT image is built into a squashfs read-only filesystem, mounted at /rom and underlying the root (/).  Writes to the root filesystem persist on a jffs2 filesystem mounted at /overlay and merged at the root using mini_fo.  Ignoring operations occurring actually on /rom/ and /overlay paths, if a file is overwritten, the file is actually stored in /overlay at the same relative location, and mini_fo makes the newer file appear to the system form that point.  Operations in /overlay/ itself are obviously filtered by mini_fo.  /tmp, /dev, etc. are all mounted on tmpfs outside of this process.

So how are deleted files handled? It turns out there is a special file made in each directory in /overlay, that mini_fo hides from view in the applicable root level directory, that records files on /rom that are deleted.

The special files are prefixed with ‘META_’, for  example: META_dAfFgHE39ktF3HD2sr, the content is simply one file per line, two fields, the letter D followed by the deleted file:

Undelete files by simply removing the entry from the META_ file.

In the event you remove a package that was in the /rom image using ipkg, it is easy enough to get back by finding editing all the special files in /overlay and removing the deletion references.

Hint: although there are various to choose from, I always start with the smallest /rom image, as that allows easier reconfiguration by adding and later removing packages, and provides a bigger R/W jffs2 partition at /overlay.  If you need to delete a package that was in /rom, it doesn’t actually give you any extra space on the small SSD…

No responses yet

OpenWRT web admin (LUCI) wierdness

Feb 09 2012 Published by under howto

I had a router configured with OpenWRT BackFire (10.03) and had a need to upgrade it to support the web management interface.

So to do this login to a console and:

However, in my attempt to streamline things and reduce disk usage I managed to only have the ‘Essentials’ menu, this was missing various important items such as detailed dnsmasq settings (which was the whole point of the exercise.) So I pushed on and installed luci, which should have enabled the “Administration” menu but did not.

After much mucking around and browsing through the installed files, I stumbled upon this:

after which logging in the “Administration” menu is now present.

No responses yet