Search Results: "bap"

9 February 2010

Christian Perrier: Family DebConf

This year, at DebConf 10, I'll very probably have the pride to attend the conference along with my 22 y.o. son, Jean-Baptiste. JB began a 3 year cycle to graduate in electronics and industrial computing at Polytech'Paris-UPMC and is increasingly becoming more and more interested in Linux, programming and particularly low-level programming in embedded devices (as far as I can understand this stuff). As one can see, he's on his way to become a much clever geek than his dad. It then became natural for him to consider attending Debconf even though he's not (yet) involved in Debian. So, you folks will have to suffer having two bubulles instead of one. That should make a nice picture if Bdale and Elisabeth are there too..:-) See you in NYC!

20 December 2009

Gregor Herrmann: RC bugs 2009/51

after attending the Munich BSP 3 weeks ago (thanks for inviting me, & thanks especially to Stefan for hosting me) I've tasted blood & started to look at our RC bugs more often. I'm still far from zack's RCBW frequency; but I thought I'd give a short overview anyway; maybe it motivates others to chime in? So here's a list of RC bugs I've touched in the last weeks (not counting some merges in the BTS): remarks:

13 December 2009

Julian Andres Klode: APT2 progress report for the 1st half of December


This week was successful. I have pushed some changes from November to the repository which change the license to LGPL-2.1+ (which makes bi-directional sharing of code with other projects easier, since most Vala code is under the same license) and implement HTTP using libsoup2.4 directly, instead of using GIO and GVFS for this. I also added a parser for the sources.list format which uses regular expressions to parse the file and is relatively fast. The code needs a current checkout of Vala s git master to work correctly; as released versions had a bug which I noticed today and J rg Billeter fixed in Vala 25 minutes later; thank you J rg. While nothing else happened in the public repository, the internal branch has seen a lot of new code; including SQLite 3 caches; Acquire text progress handling; and capt; the command-line advanced package tool. Most of the code will need to be reworked before it will be published, but I hope to have this completed until Christmas. It will also depend on Vala 0.7.9 or newer, which is yet to be released. The decision to use SQLite 3 as a backend means that we won t see the size limitations APT has and that development can be simplified by using SQL queries for filtering requests. It also means that APT2 will be very fast in most actions, like searching; which currently happens in 0.140 seconds (unstable,experimental and more repositories enabled), whereas aptitude takes 1.101 seconds, cupt (which has no on-disk cache) 1.292 seconds, and apt-cache 0.475 seconds. Searching is performed by one SQL query. I also want to thank Jens Georg <mail@jensge.org>, who wrote Rygel s Database class which is also used with minor modifications (like defaulting to in-memory journals) in APT2 as well. Rygel.Database is a small wrapper around sqlite3 which makes it easier to program for Vala programmers. The command-line application capt provides a shell based on readline with history (and later on command completion) as well as direct usage like capt config dump or capt search python-apt . Just as with Eugene s cupt, capt will be the only program in the core APT2 distribution and provide the same functionality currently provided by apt-get, apt-config and friends. The name is not perfect and can be easily confused with cupt , but it was the closest option for now; considering that the name apt is already used by Java (for its Annotation Processing Tool ). That s all for now, I ll tell you once all those features have passed my QA, and there is really something usable in the repository. In the meanwhile, you can discuss external dependency solvers, database layouts and other stuff in their threads on deity@lists.debian.org. And a screenshot from capt:
jak@hp:~/Desktop/APT2:temp$ capt
apt$ help
APT2 0.0.20091213 command-line frontend
Commands:
  config dump               Dump the configuration
  config get OPTION         Get the given option
  config set OPTION VALUE   Set the given option
  search EXPRESSION         Search for the given expression
  show PACKAGE              Show all versions of the given package
  sources list              Print a list of all sources
  version                   Print the version of APT2
apt$ search python-apt
build-depends-python-apt - Dummy package to fulfill package dependencies
python-apt - Python interface to libapt-pkg
python-apt-dbg - Python interface to libapt-pkg (debug extension)
python-apt-dev - Python interface to libapt-pkg (development files)
python-aptdaemon - Python module for the server and client of aptdaemon
python-aptdaemon-gtk - Python GTK+ widgets to run an aptdaemon client
apt$
Posted in APT2

2 December 2009

Russell Coker: Noise Canceling Headphones

My patience with the noise of airlines has run out, on my trip from AU to US I didn t get any sleep due to the cramped seat and the noise of the plane. While I can t do anything about the cramped seat without spending a lot of money it seems that I can do something about the noise with moderate expense. I ve been researching Noise Canceling Headphones [1]. The principle of such devices is that they have a microphone on the outside and a speaker on the inside to generate sound that is 180 degrees out of phase which will then almost cancel out the ambient noise. Apparently such devices are very effective for low frequencies but less effective for high frequencies. High frequencies are more easily blocked by sound insulation, so the ideal seems to be around the ear headphones with lots of padding to passively stop noise with active noise canceling to deal with the lower frequencies. So I m now planning on buying a set of headphones before I leave the US. Choice Magazine (an Australian independent product review organisation) published a review of noise canceling headphones in 2007, it has some interesting information but is not suitable for buying advice today [2]. Choice gave the best results to the Jabra C820s which had just gone out of production when they published the review and by now could only be bought on eBay. The Jabra had an active cancellation of 14.3dB and a passive cancellation of 8.3dB. The best active cancellation of all the reviewed products was 19.5dB for the Bose QuietComfort 3 which incidentally only had a passive cancellation of 4.8dB. Both the Bose and Jabra products got good reviews in a mailing list discussion. It s a pity that Jabra is now only manufacturing products for call centers. I am not considering the headphones that go on top of the ears, they will inherently give less passive protection due to the design and they will annoy me. I am also not considering the ear-buds because I don t like putting things in my ears. I will note that there are some very positive reviews of some of the ear-bud devices. The Etymotic Research devices get very good reviews and are apparently on sale at reasonable prices in Apple stores (among other places) [3]. Anyone who wants noise-canceling headphones and disagrees with me about the desirability of ear-bud type devices should probably consider them. The Bose QuietComfort 15 is selling for $300 (NB for this post all prices will be in US dollars) [4]. It has microphones both inside and outside the ear cup to allow better detection of ambient sound. A single AAA battery is supposed to last 35 hours, it has a detachable audio cable (for use in just blocking noise), and comes with an airline adapter (for the two-port airline sockets). It does require being turned on to listen to audio, some headphones allow you to turn off the noise canceling feature to listen to music without a battery this doesn t matter for my planned use. They have a volume switch (low and high settings) to cope with airlines that set the volume too high. They are specifically designed for passengers in commercial jet aircraft. Surprisingly the Bose web site doesn t mention the number of dB of audio protection and none of the reviews I have read have mentioned it either. The store Brookstone was recommended, they have some unbranded noise canceling headphones, but as they are on the ear and more expensive than comparable Sony products ($130 vs $100) I eliminated them quickly. Sony has a good range of noise-canceling headphones [5]. They have ear-buds starting at $90 and on-ear headphones for as little as $50. They have two models of over the ear headphones that are advertised at $200 and $400. The MDR-NC60 costs $200 and reduces noise by 12dB at 200Hz while the MDR-NC500D costs $400 and reduces noise by 20dB at 160Hz. I don t know why they didn t measure both headphones at the same frequency or give any information on passive sound insulation. They state that the MDR-NC500D was voted as being better than the Bose QC2 and QC3 but made no such claim about the MDR-NC60 presumably the older Bose devices were rated as better than the MDR-NC60, and I have to wonder about how the Bose QC15 would compare to the MDR-NC500D. The MDR-NC500D has an internal Lithium-Ion battery that lasts 16 hours and can take a pair of AA batteries as well for a total of 28 hours. The Sennheiser PXC 350 claims up to 32dB of passive attenuation and up to 18dB of active noise compensation [6]. Their claims about NoiseGuard (TM) cause me to lack confidence in their products. The PXC 350 is advertised at $330 and the reviews that I have read suggest that the Bose might be a better product. Sennheiser also has PXC 450 which offers 23dB of active noise compensation and costs $450. I am not going to pay $450 for headphones. It seems that the choice for over the ear noise canceling headphones comes down to the Sony MDR-NC60 at $200 and the Bose QuietComfort 15 at $300. I have the impression that the Bose product is better, but whether it is $100 better is the question. Also while I haven t forgiven Sony for Rootkitting their customers [7], this is not going to prevent me from buying the headphones that best suit my needs. Does anyone have any suggestions? Did I miss a good brand that I should be considering? Does Sennheiser have some redeeming features that I missed?

27 November 2009

Stefano Zacchiroli: RC bugs of the week - week 12

RCBW - week #12 Here is this week squashes, by yours truly: The funniest part of this RCBW issue is probably that Luk has started handing over RC bugs to me: from time to time I just get a /query from him with bug numbers :-) In fact, this is more useful than one can imagine, because a considerable amount of time in periodic RC squashing is taken by triaging the RC bug list to choose your targets. Of course there is no guarantee that I'll be willing/able to fix handed-over bugs but, as a RM, Luk has evidently well-trained feelings about how hard would be to fix a given bug. All in all, for this week it worked well: 4 of the above 7 came from SchindlerLuk's list. ... and of course, let's welcome Simon on board! He is definitely doing a better job at spotting packages that should be removed from the archive rather than resurrected (potential negative effect that a NMU can indeed have on a package, de facto "saving" it from testing/release exclusion). In fact, the dilemma of "NMU vs Request Removal" raises various tricky questions. For instance, while we currently have pretty clear guidelines on how and, more importantly, when doing NMUs, we are more stringent on "Non-Maintainer Removals". Quoting from the Package Removal Requests wiki page:
    In all cases, if there is a maintainer and it's not you, mention the
    maintainer's opinion or, if you don't know it, mention how and when you
    tried to contact him.

It is of course reasonable to be more stringent on a measure that is way more invasive than a "simple" NMU. But if we start to rely on NMU-time as an important trigger for removal requests, then we could probably use a more aggressive and more distributed process for removals.

24 November 2009

Tim Retout: Delayed gratification

I've been slacking on the RC bugs front. :) Let's see, my last blog post was on Monday 16th, so I'm late... The DELAYED queue is a wonderful mechanism for reducing the amount of busy waiting that needs to happen for NMUs; you don't have to remember to come back and upload several days later. For non-DDs, it takes a bit more co-ordination between you and your sponsor, unfortunately - do you send the NMUdiff to the bug before you get sponsorship, and risk having to change it? And then revisit the bug to give notice again once it does get sponsored? Or leave it until after upload, which might reduce the amount of notice you're actually giving the maintainer (if, say, your mentor is in a different timezone)? I've been opting for the first approach, but it doesn't have the same fire-and-forget quality of the real thing.

15 November 2009

Stefano Zacchiroli: RC bugs of the week - week 10

RCBW - week #10 Here is this week squashes, by yours truly (also truly amazed by the simple fact of having reached the 10th RCBW week, my DDPO NMU section probably hates me now): This week I've made (once more) a friday/saturdary rush to keep up, mostly because during the week I've been traveling (again) back to Italy and also because on mon/tue we invited Luk in Paris to discuss some Mancoosi-powered Britney (potential) improvements (and yes, have some fun also. BTW, Yves, Ralf was not visiting, he has been teaching in Paris for quite a while now :-) ). More on this as soon as the advantages will turn potentiality into reality. To conclude ... drum roll ... please join me in cherishing this week new RCBW participant, welcome on board Tim!

4 November 2009

Enrico Zini: Custom function decorators with TurboGears 2

Custom function decorators with TurboGears 2 I am exposing some library functions using a TurboGears2 controller (see web-api-with-turbogears2). It turns out that some functions return a dict, some a list, some a string, and TurboGears 2 only allows JSON serialisation for dicts. A simple work-around for this is to wrap the function result into a dict, something like this:
@expose("json")
@validate(validator_dispatcher, error_handler=api_validation_error)
def list_colours(self, filter=None, productID=None, maxResults=100, **kw):
    # Call API
    res = self.engine.list_colours(filter, productID, maxResults)
    # Return result
    return dict(r=res)
It would be nice, however, to have an @webapi() decorator that automatically wraps the function result with the dict:
def webapi(func):
    def dict_wrap(*args, **kw):
        return dict(r=func(*args, **kw))
    return dict_wrap
# ...in the controller...
    @expose("json")
    @validate(validator_dispatcher, error_handler=api_validation_error)
    @webapi
    def list_colours(self, filter=None, productID=None, maxResults=100, **kw):
        # Call API
        res = self.engine.list_colours(filter, productID, maxResults)
        # Return result
        return res
This works, as long as @webapi appears last in the list of decorators. This is because if it appears last it will be the first to wrap the function, and so it will not interfere with the tg.decorators machinery. Would it be possible to create a decorator that can be put anywhere among the decorator list? Yes, it is possible but tricky, and it gives me the feeling that it may break in any future version of TurboGears:
class webapi(object):
    def __call__(self, func):
        def dict_wrap(*args, **kw):
            return dict(r=func(*args, **kw))
        # Migrate the decoration attribute to our new function
        if hasattr(func, 'decoration'):
            dict_wrap.decoration = func.decoration
            dict_wrap.decoration.controller = dict_wrap
            delattr(func, 'decoration')
        return dict_wrap
# ...in the controller...
    @expose("json")
    @validate(validator_dispatcher, error_handler=api_validation_error)
    @webapi
    def list_colours(self, filter=None, productID=None, maxResults=100, **kw):
        # Call API
        res = self.engine.list_colours(filter, productID, maxResults)
        # Return result
        return res
As a convenience, TurboGears 2 offers, in the decorators module, a way to build decorator "hooks":
class before_validate(_hook_decorator):
    '''A list of callables to be run before validation is performed'''
    hook_name = 'before_validate'
class before_call(_hook_decorator):
    '''A list of callables to be run before the controller method is called'''
    hook_name = 'before_call'
class before_render(_hook_decorator):
    '''A list of callables to be run before the template is rendered'''
    hook_name = 'before_render'
class after_render(_hook_decorator):
    '''A list of callables to be run after the template is rendered.

    Will be run before it is returned returned up the WSGI stack'''
    hook_name = 'after_render'
The way these are invoked can be found in the _perform_call function in tg/controllers.py. To show an example use of those hooks, let's add a some polygen wisdom to every data structure we return:
class wisdom(decorators.before_render):
    def __init__(self, grammar):
        super(wisdom, self).__init__(self.add_wisdom)
        self.grammar = grammar
    def add_wisdom(self, remainder, params, output):
        from subprocess import Popen, PIPE
        output["wisdom"] = Popen(["polyrun", self.grammar], stdout=PIPE).communicate()[0]
# ...in the controller...
    @wisdom("genius")
    @expose("json")
    @validate(validator_dispatcher, error_handler=api_validation_error)
    def list_colours(self, filter=None, productID=None, maxResults=100, **kw):
        # Call API
        res = self.engine.list_colours(filter, productID, maxResults)
        # Return result
        return res
These hooks cannot however be used for what I need, that is, to wrap the result inside a dict. The reason is because they are called in this way:
        controller.decoration.run_hooks(
                'before_render', remainder, params, output)
and not in this way:
        output = controller.decoration.run_hooks(
                'before_render', remainder, params, output)
So it is possible to modify the output (if it is a mutable structure) but not to exchange it with something else. Can we do even better? Sure we can. We can assimilate @expose and @validate inside @webapi to avoid repeating those same many decorator lines over and over again:
class webapi(object):
    def __init__(self, error_handler = None):
        self.error_handler = error_handler
    def __call__(self, func):
        def dict_wrap(*args, **kw):
            return dict(r=func(*args, **kw))
        res = expose("json")(dict_wrap)
        res = validate(validator_dispatcher, error_handler=self.error_handler)(res)
        return res
# ...in the controller...
    @expose("json")
    def api_validation_error(self, **kw):
        pylons.response.status = "400 Error"
        return dict(e="validation error on input fields", form_errors=pylons.c.form_errors)
    @webapi(error_handler=api_validation_error)
    def list_colours(self, filter=None, productID=None, maxResults=100, **kw):
        # Call API
        res = self.engine.list_colours(filter, productID, maxResults)
        # Return result
        return res
This got rid of @expose and @validate, and provides almost all the default values that I need. Unfortunately I could not find out how to access api_validation_error from the decorator so that I can pass it to the validator, therefore I remain with the inconvenience of having to explicitly pass it every time.

29 October 2009

John Goerzen: Apache Update

Thanks everyone for the helpful comments yesterday on Apache vs. lighttpd. I ve taken the first few steps towards improving things. I ve eliminated mod_php5, switched all PHP to FastCGI, and switched from the prefork to the event MPM. The event MPM docs say that it s incompatible with mod_ssl, but it worked, and googling for that turned up mailing list posts from 2006 saying it was fixed. The only real glitch was that egroupware inexplicably depends on libapache2-mod-php5. It works fine without it, but I had to create a fakelibapache2-mod-php5 that provides libapache2-mod-php5 to convince the system not to remove egroupware when I switched to the event MPM. I went from 28 Apache processes to 4 Apache processes plus an average of around 2 php5-cgi processes which, despite the name, actually do grok FastCGI. Three of my Apache processes now have an RSS of about 20M, and the other of about 30M. The php5-cgi processes are at around 40M. My old Apache processes ranged from 18M to over 40M. So there is some memory savings here, though not drastic. My Redmine processes, two of them, each use over 50M. Ruby on Rails still is leaving me with a bad taste. At least it s not a Java app; it seems a lot of those allocate 2GB before they ever start accepting connections. I ll see how this goes for awhile, but for now I doubt that moving to lighttpd (or similar) will yield enough benefit to make it worth the effort. But there may be some benefit in inserting a caching proxy in front of Apache, so I may yet do that.

25 September 2009

Julian Andres Klode: cupt and how to write package managers


cupt is a new package manager written in Perl by Eugene V. Lyubimkin, who previously contributed to APT. And more than all, the project makes no sense at all. First of all, there is a language issue. Implementing a package manager in Perl has some major drawbacks. One of the features of APT was it being written in a lower-level language (i.e. C++ which really is below Perl), making it possible to write applications like synaptic and python bindings which in turn lead to applications like gnome-app-install or Ubuntu s new Software Store. Furthermore, writing a package manager in Perl means that Distributions such as Emdebian might not be able to use it since they have excluded Perl due to its space requirements. This becomes even more important considering that cupt depends on even more perl libraries. This means that cupt will never be able to replace APT. Secondly, a package manager should not be designed specifically for one distribution. This is another major drawback of cupt and other package managers such as yum or zypper. The smart package manager, written in Python and funded by Canonical Ltd. is an example for a distribution-neutral package manager. Now let s take a look at package management in modern distributions. Usually we have two levels of package managers, the first being tools like dpkg and rpm which take care of installing and removing the packages and level-2 package managers implementing dependency resolvers and package retrieval from remote locations. Recently, distributions started to add a third layer named PackageKit, which shall provide distribution-independent package management user interfaces. The project was well-received by RPM-based distributions, but failed in Debian-based distributions due to not supporting debconf. Furthermore, adding a third layer just increases the possibility of problems. The right way to do package management is a distribution-independent level-2 package manager written in C. The smart project shows us that this is possible although itself fails to meet the lower-level language (C) requirement. That s why I decided to write a package manager in Vala, a GObject-based language which gets converted to C and then compiled. If successful, this project will be able to replace most of the current level-2 package managers and will also provide the same distribution-independence as provided by a level-3 package manager such as PackageKit. It is also easy to create binding for other programming language such as Python or Perl thus enabling application developers to choose the language they like most. The core of this project is a vendor-neutral library, temporarily called libapt (as the project is called APT2 for now). This library contains all the code which is not specific to a vendor i.e. file retrieval, dependency resolver, caches, etc and is then enhanced by several vendor-specific plugins, each implementing a PackageManager (interface to the distribution s level-1 package manager) and a Repository (well, repositories from which you can download packages) interface. We could even enhance the vendor-independent interface to include more details of a repository. Most repositories nowadays consist of 4 components: A meta index (Release files for Debian, repomd.xml for Fedora/openSUSE/etc.), a package index (e.g. Packages files for Debian, *primary.xml.gz on Fedora, etc. ), a source index (e.g Sources files in Debian) and a files index (e.g. Contents-*.gz for Debian). I took a look at the repository formats of Slackware, openSUSE and Fedora and it seems that this concept can be applied to all of them. So maybe all we need are distribution dependent parsers for those files. One of the most important issues with APT is its use of mmap() for the cache. Using mmap() makes it hard to grow the cache, which is sometimes needed. We see a lot of bug reports from people with too small cache sizes. We can circumvent this problem by utilizing an embedded database like SQLite for this, but we would probably loose some speed and it may be harder to maintain a flexible API. We should see what the best option is here, both ways are possible since Vala 0.7.6 includes my patches for adding mmap(), ftruncate(), mremap() and some other functions. An idea to circumvent the mmap() issue is gathering statistics about the relation between the number of repositories and the size of the cache and then using a value which is slightly above the average statistical value. The project is not very mature yet, it only includes basic library functions for downloading files and parsing configuration files, etc. You can find the (MIT licensed) code at http://git.debian.org/?p=users/jak/apt2.git. I also have some local code for repository management and multi-threaded file fetching, but it s just not ready to be merged yet. Posted in APT2, Debian

Julian Andres Klode: The APT2 project


I just started working on a replacement for APT written in Vala and called APT2 (I know, the name could be better). The main idea behind the project is to create a library for working with Debian repositories and packages, and on top of this library a few applications. This is different from APT because the project focuses on the library part, whereas APT is primarily focused on the application part. I chose Vala for this task because it has an easy syntax and allows me to use the features provided by GLib and Co. really easily. GLib provides many functions needed for APT like file access, unicode handling, hashsums creation. It also provides us with signals which are useful for implementing progress reporting. Another project, called cupt tries to provide an APT replacement in Perl. Apart from the fact that I don t like Perl, it also has the disadvantage of being too big to ship on embedded devices and is not useable from other languages such as Python or C/C++. Yet another project, smart provides a different package manager written in Python. While I like Python, it can t be used from languages such as Perl or C/C++ and is too large. APT2 will only require GLib, Gee and libarchive, which require about 2MB of space; about 1/10 of Perl s size. The core of APT2 is a library called libapt . At the moment, this library provides classes for reading tag files (TagFile&TagSection) and an incomplete configuration class based on libgee s HashMap (to ease coding, it will probably be changed to a special data structure like those in apt-pkg). The next step will be implementing a parser for configuration files (currently we only support in-memory objects) and writing the Acquire system. The planned Acquire system uses GModule to modularize the support for different URI schemes. Each module provides a worker class which implements one or more URI schemes. The first of these modules will provide a worker using GIO, which deals with local file access, samba shares, FTP, SFTP, WebDAV and various other protocols, including HTTP until a replacement has been written (since we don t want to force gvfs-backends). The workers communicate with the parent Acquire object using signals and can cause the whole acquisition to be aborted by emiting an abort signal (or similar). The whole project has just been started and may take some months until it becomes useful (if it becomes useful at all). The code can be found at http://git.debian.org/?p=users/jak/apt2.git and is licensed under the MIT license (see http://www.opensource.org/licenses/mit-license.php). It is a secondary project and will not affect my work on apt (not much yet) and python-apt (0.8 series). Posted in APT2, Debian

16 September 2009

Frans Pop: debtree 1.0 - Instant dependency graphs

Yay! I've done it: 1160 lines of bash script are now 1215 lines of perl, and:
    'debtree aptitude': 1m2.832s -> 0m0.596s
The new release is available as version 0.9.9 from the debtree web site and has been uploaded for the archive as version 1.0.
This was the starting position, the run time for my complete test set:
    real    22m33.583s
    user    18m29.709s
    sys     4m21.320s
I began with a pure language conversion from bash to perl, i.e. I kept the call-outs to dctrl-tools. This allowed me to easily identify problems in the language conversion by running my test suite, without having to worry that a change might have been caused by getting different data. The language conversion itself was fairly straightforward; most time was spent on finding all the little errors made during the conversion. This resulted in "only" a 10% speedup:
    real    20m56.368s
    user    18m3.996s
    sys     2m46.986s
So bash itself isn't even horribly slower than perl, even with all the recursion and starting of subshells for calls to grep, sed, etc. Then I replaced the call-outs to dctrl-tools one by one, adding the dependency on libapt-pkg-perl. And that resulted in the amazing:
    real    0m21.350s
    user    0m19.797s
    sys     0m1.372s
So, from 22 minutes to 21 seconds for 22 graphs, including some pretty complex ones. Not bad. I had to keep a call-out to dctrl-tools for build dependencies as it turned out libapt-pkg-perl does not expose architecture conditions. The full conversion process can be seen in the source repository, which was recently moved from my $HOME on alioth to collab-maint.

10 September 2009

Mark Brown: ASoC updates in 2.6.31

Linux 2.6.31 was released today. This was a fairly busy release for the ASoC subsystem, with updates including: Plus lots of updates and fixes to existing code, especially to the OMAP and TWL4030 drivers.

11 April 2009

Chris Lamb: Installing FogBugz the Debian way

Yeah, proprietary software is bad, but let's at least install it the Debian way. The following walkthrough assumes Debian lenny.
#!/bin/sh
set -e
for PEAR_PKG in Auth_SASL HTTP_Client Mail_Mime XML_Tree
do
        PKG_TEMP=$(mktemp -d)
        cd $ PKG_TEMP 
        pear download $ PEAR_PKG 
        dh-make-pear $ PEAR_PKG *.tgz
        cd $(find -mindepth 1 -type d   head -n1)
        dpkg-buildpackage -uc -us -rfakeroot
        sudo dpkg -i ../*.deb
        rm -rf $ PKG_TEMP 
done
$ sudo ./install.sh
/***************************************\
*            FogBugz 6 Setup
\***************************************/
--    Checking for required tools
 +      found mono 1.9.1
[..]

7 March 2009

Adeodato Sim : The SQL "IN" operator in psycopg2

I ve been working as of late with psycopg2, the Python bindings for PostgreSQL. Documentation is a bit, erm, lacking. You can get the basic stuff working by reading Python s DBAPI-2.0 specification, since psycopg2 follows it, but (as I ve only recently realized) discovering the extra features that exist needs you to poke the source. The other day I was wanting to pass to the execute method of a cursor a sequence to fill the value list in a SQL IN statement. The DBAPI spec does not mention this usage at all, and a cursory question in #python told me it wasn t supported (required?) by the spec. It is, in any case, supported in psycopg2. You just need to
  import psycopg2.extensions
and it just works: you can pass tuples, and they ll be converted to a value list. If you want to be able to pass lists as well:
  from psycopg2.extensions import SQL_IN, register_adapter
  register_adapter(list, SQL_IN)
There is also a row factory in psycopg2.extras that offers a dictionary interface, instead of tuple-based. Finally, I have no idea why, but when I started with psycopg2, I came to get the idea that only named parameter substitution was supported (INSERT ... VALUES (%(var1)s, %(var2)s)), but simple %s substitution is also supported: just pass (of course) a tuple as the second parameter to execute, instead of a dictionary.

24 February 2009

Russell Coker: Tragedy and Profit

Every time something goes wrong there will be someone who tries to take advantage of the situation. The recent bushfires in Australia that have killed hundreds of people (the count is not known yet) are a good example. Pastor Nalliah of Catch the Fire Ministries [1] claims that it is due to legalising abortion. This is astoundingly wrong. In a more extreme example representatives of the Westboro Baptist Church were planning to visit Australia to launch a protest in support of the bushfires [2]. I have not yet found any news reports about whether they actually visited Australia or protested - it s most likely that they decided not to visit due to the Australian laws being very different to US laws regarding the relative importance of freedom of speech and incitement to violence. Apparently the insane Westboro Baptist Church people (who are best known for GodHatesFags.com and GodHatesAmerica.com) believe that God hates Australia and caused the fires (presumably due to Australia not persecuting homosexuals). Danny Nalliah has permanently damaged his own reputation by acting in a similar way to the Westboro Baptist Church. The reputation of Catch The Fire now depends on how quickly they get a new pastor Please note well that the vast majority of Christians have nothing in common with Westboro or Catch The Fire. I don t recall the last time I met an Australian Christian who was strongly opposed to homosexuality or abortion. Now we do have to try and investigate ways of avoiding future tragedies, and the work to do this needs to begin immediately. John Brumby (the Premier of Victoria) has announced that Victoria will get new strict building codes for fire resistant buildings [3]. There have been many anecdotes of people who claim to have been saved by attaching sprinkler systems to their homes, by building concrete bunkers to hide in while the fire passes, and using other techniques to save their home or save themselves. Some more research on the most effective ways of achieving such goals would be worthwhile, an increase in funding for the CSIRO to investigate the related issues would be a good thing. The article also has an interesting quote As the fallout from the disaster widened, the union representing the nation s 13,000 firefighters warned both the federal and state governments to take global warming seriously to prevent a repeat of last weekend s lethal firestorm . However given that traditionally Australia and the US have been the two nations most opposed to any efforts to mitigate global warming it seems unlikely that anything will change in this regard in a hurry. The attempts to link bushfires to abortion and homosexuality are offensive, but can be ignored in any remotely serious debate about politics. However there are some other groups trying to profit from the tragedy that make claims which are not as ridiculous. On the 9th of February the Australian Green party was compelled to release an official statement from Spokesperson Scott Ludlam, Sarah Hanson-Young, Rachel Siewert, Christine Milne, and Bob Brown following some political discussion about Greens policies [4]. There have been attempts to blame the Greens for the tragedy which were politically motivated, some of which came from groups that traditionally oppose the Greens for other reasons (I m not going to provide the detail - anyone who is really interested can do google searches on the people in question). On the 16th of February Bob Brown (the leader of the Green party) felt obliged to make another media release reiterating the fact that the Greens support prescribed burn-offs to limit the scope of wild fires [5], he also decried the hate mongering that has been occurring in the wake of the disaster. One of the strange memes that seems to be spread by opponents to the Greens is that the Greens are all supposedly from the city and know nothing about the country. To avoid being subject to such attack I feel obliged to note that on one of the bad fire days I visited my parents. I spent the morning with my father and some friends at a park that was not far from the fire area, my friends then returned to their home which was not far from the fire area. I then had lunch with my parents and watched the smoke through the dining room window. After that my friends didn t respond to email for a while and I was concerned that they may have lost their house or maybe suffered injury or death. I didn t know them well enough to feel it appropriate to try a dozen different ways of contacting them (I m sure that many other people were doing so), but I was rather concerned until my wife received an email from them. But I don t base my political beliefs on what I personally observe or my connections to people on the edge of the fire zone. I believe in the Green principles of Peace and Non Violence, Grassroots Democracy, Social and Economic Justice, Ecological Sustainability and the use of science and statistics to determine the best ways of achieving those goals.

15 February 2009

Mike Hommey: Testing small upgrades with namespaces and unionfs

If you are following this blog, you probably remember per-process namespaces. Today, I m going to tell you how I did use them in the process of preparing this server to be upgraded to Lenny. I must say I was not using the most recent stuff on this server, and this is why I needed such preparation. First, this server is still running with php4. And well, the following line in the apt-get dist-upgrade output got my full attention (emphasis mine):
The following packages will be REMOVED:
cacti libapache2-mod-php4 libarchive-tar-perl libcurl3-openssl-dev
libgssapi2 libpci2 librpm4 libssp0 linux-kernel-headers modutils php4-mysql
While this server is not important enough not to be broken for a couple hours, I do like to test procedures that could help on servers that are. The first thing I needed to do on this server was obviously to upgrade php. But we all know how php applications are not fully compatible with all versions of php, so I also needed to test the upgrade was not breaking anything. On a server you don t care much about, you can just upgrade, test if all is okay, and be done with it. Obviously, if all is not okay, your visitors will see it, and you may also have a bad time downgrading. Another way to perform the upgrade is to have a similarly installed server on the side, test and validate the upgrade there, and replicate the upgrade on the production server if everything is fine. However, that does require additional resources, and possibly to setup them if they don t already exist. A cheaper way to do the above is to do it on the production server, both in-place and on the side (you ll see what I mean), using unionfs and per-process namespaces. Full containers could be used instead of per-process namespaces (such as openvz, vserver or lxc), but they still require much more setup, especially when you don t use them in the first place. Chroots could work just as well as per-process namespaces, but one of the ideas here is to expose the per-process namespaces feature, and allow for improvement of this procedure with pid and network namespaces, which are not available in Etch (where I m starting from), but are in Lenny. Unionfs allows to merge several directories into a single one, accessing some read-only, and others read-write. Installing unionfs is as easy as running the following command:
apt-get install unionfs-modules- uname -r
I won t describe all the kinds of setups that are possible with unionfs, but only one typical use case, which is what we will be using here:
# mkdir /tmp/root-cow
# mount -t unionfs -o dirs=/tmp/root-cow:/=ro none /mnt
The first thing we do here is to create an empty directory. Next, we merge it with the root filesystem (/), that we will keep read-only (meaning unionfs won t allow itself to write there), and mount the merged filesystem under /mnt. none could just be anything, as there is no device to be mounted. The result, in /mnt, is just something that looks like the root filesystem:
# ls /
bin boot dev etc home initrd lib media mnt opt proc root sbin srv sys tmp usr var
# ls /mnt
bin boot dev etc home initrd lib media mnt opt proc root sbin srv sys tmp usr var
But creating or modifying a file will do so in /tmp/root-cow:
# echo a > /mnt/a
# cat /a
cat: /a: No such file or directory
# cat /tmp/root-cow/a
a
# echo foo.com > /mnt/etc/mailname
# cat /etc/mailname
glandium.org
# cat /tmp/root-cow/etc/mailname
foo.com
# find /tmp/root-cow
/tmp/root-cow
/tmp/root-cow/etc
/tmp/root-cow/etc/mailname
/tmp/root-cow/a
Keep in mind that it doesn t include submounts, though:
# ls /var
backups cache lib local lock log mail opt run spool tmp www
# ls /mnt/var
This means we ll have to also mount /var, /proc, /dev, and /sys. That s enough testing for now, and we ll first do some cleanup before going after the real job:
# umount /mnt
# rm -rf /tmp/root-cow
Using the newns utility from my first post on per-process namespaces, let s create a new namespace to keep our testing private, and populate it with the necessary mount points:
# newns
# umount /tmp
# mount -t tmpfs tmpfs /tmp
# mkdir /tmp/root-cow /tmp/var-cow
# mount -t unionfs -o dirs=/tmp/root-cow:/=ro none /mnt
# mount -t unionfs -o dirs=/tmp/var-cow:/var=ro none /mnt/var
# cd /mnt
# pivot_root . mnt
# mount --move /mnt/proc /proc
# mount --move /mnt/sys /sys
# mount --move /mnt/lib/init/rw /lib/init/rw
# mount --move /mnt/tmp /tmp
# mount --move /mnt/dev /dev
The second and third statements are useful to avoid sharing /tmp with the main namespace, which means the directories we create in the fourth statement won t be visible in /tmp outside this namespace. The fifth and sixth statements put the union filesystems in place. As my system only has a separate /var filesystem (no /usr, and I don t care about /home here), I only need to setup these two. Feel free to add more union filesystems as necessary. The pivot_root call allows to switch to the unionfs ed root: everything under /mnt (/mnt and /mnt/var in our case) will be remounted under /, while what was under / is remounter under /mnt under the new root.
This means, in our case, that we have / and /var as union filesystems, while the old / and /var are respectively in /mnt and /mnt/var. It also means /dev, /proc, /sys and other filesystems are remounted as /mnt/dev, /mnt/proc, /mnt/sys, etc., which is why we next mount --move all of them to a better place in our namespace. Once all this setup is done, we are ready to do our php upgrade test. As Etch doesn t have support for neither PID namespaces nor network namespaces, we ll still have some conflicts with the main namespace for TCP port binding and process handling, so we need to be a little careful:
# rm /var/run/apache2.pid
# echo Listen 8080 > /etc/apache2/ports.conf
With these changes, we can now safely start apache2 in this namespace, at the same time the main apache2 runs in the main namespace:
# /etc/init.d/apache2 start
Now, there are actually 2 problems showing up in apache in this setup. The first one is that displaying static files doesn t work. At all. It appears unionfs doesn t support sendfile(). Which is fine. But apache doesn t check for sendfile() s error cases and doesn t fallback to a working solution when sendfile() doesn t work. So we have to manually disable it:
# echo EnableSendfile off > /etc/apache2/conf.d/sendfile.conf
The second one is that access to the mysql socket doesn t work properly under the unionfs. I didn t want to investigate further, so I only worked around the issue by forcing to use the socket outside the unionfs:
# mount --bind /mnt/var/run/mysqld /var/run/mysqld
Finally, we can test and validate our php upgrade:
# apt-get install php5-mysql php5-cli php5-snmp libapache2-mod-php5
# /etc/init.d/apache2 restart
# apt-get remove --purge php4-common
Note that installing libapache2-mod-php5 will remove libapache2-mod-php4, and apache2 gets restarted, taking into account this change. But the php modules (php5-mysql and php5-snmp) install is only going to happen after that, and no apache2 restart is triggered then, which leaves a half working php setup
Also note that the cacti setup in etch supposes php4 is installed, using a IfModule statement against mod_php4.c and none for mod_php5.c, which means a part of its setup doesn t work out of the box (most notably, the DirectoryIndex). Once all is validated, all we need to do is to stop apache2 and exit from the namespace. The union filesystems and temporary filesystems are then automagically cleaned-up and the namespace disappears as well as all modifications we just did, since all processes using the namespace ended. We are now free to upgrade on the production server, as we know all the side effects. I ll now be able to upgrade to Lenny without php getting removed.

10 February 2009

Gunnar Wolf: dh-make-drupal - Easily debianize Drupal modules, themes

I have spent a couple of days working into dh-make-drupal. Yes, you guessed right: An idea based on the wonderful dh-make-perl, but applied to the Drupal Content Management System.
Drupal's greatest strengths, IMHO, are: Yup, even though I am quite fond of its flexibility and power, I fell for Drupal in no small part because of its sysadmin-friendliness. Now, I hate having non-Debian-packaged files spilled over my /usr/share partition. Drupal modules want to be installed in /usr/share/drupal5/modules/module_name (or s/5/6/ for Drupal6, to which I have not yet migrated). For that reason, over the last year I have been growing my personal apt repository of Drupal stuff. Yes, it is still on, and I don't plan on taking it off. You can access it by adding deb http://www.iiec.unam.mx/apt/ etch drupal to your /etc/apt/sources. However, you can now also do the process locally. Do you fancy the wonderful Biblio module? Or the very nice Abarre theme? Great!
  1. 0 gwolf@mosca 4 /tmp$ ~/code/dh-make-drupal/dh-make-drupal --drupal 5 biblio
  2. 0 gwolf@mosca 5 /tmp$ cd drupal5-mod-biblio-1.16/
  3. 0 gwolf@mosca 6 /tmp/drupal5-mod-biblio-1.16$ debuild -us -uc >& /dev/null
  4. 0 gwolf@mosca 7 /tmp/drupal5-mod-biblio-1.16$ cd ..
  5. 0 gwolf@mosca 8 /tmp$ su
  6. Password:
  7. 0 root@mosca[1]/tmp# dpkg -i drupal5-mod-biblio_1.16-1_all.deb
  8. Selecting previously deselected package drupal5-mod-biblio.
  9. (Reading > database ... 275110 files and directories currently installed.)
  10. Unpacking drupal5-mod-biblio (from drupal5-mod-biblio_1.16-1_all.deb) ...
  11. Setting up drupal5-mod-biblio (1.16-1) ...
Yay! Yes, still many more things to come (i.e. including the debuild call and whatnot), but... Enjoy! BTW, this piece of software owes a couple of beers to Why the lucky stiff, author of Hpricot. You are insane (but we are all well aware of that). You deserve to go to the webscraping heaven. Yes, besides the programming-languages-teaching-cartoon heaven. You find out how to split the time between them. [Update]: Of course, ITP bug #514786 has been filed, and I will soon be uploading this into Debian.

29 January 2009

Neil Williams: langupdate uploaded to experimental

I'm happy enough with the langupdate tool now that I've made the upload to Debian experimental. langupdate is an apt frontend to Emdebian TDebs to support Emdebian Grip and Emdebian Crush but also to support mixed installations of Debian and Emdebian.

Any Debian package is ignored because those packages already contain all the translation files.

Emdebian packages do not include /usr/share/locale, so langupdate identifies these packages from the dpkg status files, identifies the available Emdebian TDebs for the corresponding source package via libapt-pkg and a temporary apt-cache in /var/lib/langupdate and identifies which locales are supported on the current machine from the environment and from /etc/locale.gen. The Emdebian TDeb packages that match these criteria are then automatically installed.

If only Debian packages exist, langupdate reports "Nothing to do."

The end result, for Emdebian users, is that a typical 450Mb /usr/share/locale on Debian is stripped down to 9Mb (or less) per configured language.

The advantages over localepurge are:
  1. The Emdebian packages are smaller because the translations have already been removed at the repository, so no wasted bandwidth or wasted CPU workload removing files that have just been installed.

  2. If a language is added or de-configured, all the corresponding translation files are added or removed respectively.


langupdate can use any suitable repository - the default is the Emdebian TDeb repository.

Note that, unlike in Debian, Emdebian TDebs are architecture-dependent and are split into individual packages for each language and source package and architecture. Yes, it is a lot of packages and a lot of work for the machine hosting the server but better that than trying to do the work on the Emdebian device.

Currently, Emdebian Grip still has a very limited package set so the list of packages that have Emdebian TDebs is still small. Depending on how long it takes to release Lenny, more packages will get added to Grip but the "full Grip experience" will, for most people, involve upgrading from Emdebian Grip 1.0 (based on Debian 5.0 "lenny") to Emdebian Grip testing - what will become 2.0, based on Squeeze.

langupdate itself is translated into 7 languages (cs, de, eu, fr, it, ru and sv) thank you to those who prepared those translations before the deadline ended tonight and uses a langupdate-locale package as a precursor to the eventual Debian TDeb.

20 January 2009

Obey Arthur Liu: Debian Summer of Code 08 : Where are they now (part 1/3)

It s been a while now since the 2008 Summer of Code ended. This year, twelve (?) projects were selected. That s twelve students working full time on a Debian-related project during the summer. The Google Summer of Code has sometimes been criticized in the past for having a poor student-developer retention rate inside the host projects. One of the goals of the program has always been to bring new people to budding or established free software organizations and it s a pity that some would leave the project as soon as the program ends. On the other end, poor integration of created code within the project leads to work that is hard to merge in, or worse, doesn t get merged in at all. That s a waste of time and resources and a probably cause of global warming as well. Hopefully, it s not always the case. Some people choose to stay committed within the organization in the long-term. Useful code gets merged in and pushed to the public. I am going to give a talk about this at FOSDEM (go to FOSDEM!) so I m giving you a little preview. I need your help to collect information for my talk. As you know, information is always hard to come by with these kinds of projects so anything can be useful. Without further ado, let s have a look at the cast of the Debian Google Summer of Code 2008: Netconf, a network configuration management system Presentation Netconf is a network configuration management system designed with modern network infrastructures and the needs of roaming users in mind. It is a personal project of Martin Krafft that he started in 2007. He did some presentations about it that you can find on the dev website. The project proposal was introduced by the mentor. The work was mainly about completing the roadmap items for version 1.0. Most of the design was done and code fleshed out. The stated goal was to have netconf ready for lenny. Martin noted that due to lack of regular free time, he couldn t reach that goal by himself. Student Jonathan Roes was a computer science graduate student from the University of North Carolina at Charlotte. He had programming experience as a hobby for a long time and wrote some free games and libraries for the Nintendo DS and some proprietary webapps. He submitted a few little patches in mid-march right after the publication of accepted mentoring organizations and went on to work from mid-may to mid-august. He wrote a lot of code right into the trunk since the whole project was a prototype. Result The last commit by Jonathan was also the last to date in the main netconf git repository. No further progress has been made and obviously netconf didn t get into lenny. I couldn t find any further public involvement of Jonathan within Debian. The ultimate Debian database, all things Debian in a SQL database Presentation The Ultimate Debian database wants to reunite all Debian data sources in a SQL database The project was mentored by Lucas Nussbaum and co-mentored by Stefano Zacchiroli and Marc HE Brockschmidt. The project proposal was introduced by Lucas. Student Christian Neronus Von Essen is.. well, there wasn t much information readily available on him. Result The whole project is coded up and working well with a whole bunch of data sources. There will be a talk at FOSDEM about this so I ll leave it to Lucas to talk about it in detail. I couldn t find any further public involvement of Christian within Debian. Security-beta, a beta testing for Debian security updates Presentation The task is to improve the quality assurance process for security updates by providing a public security update beta test program in addition to the existing QA done for security updates. During the preparation of security updates, there s an inherent delay between the initial upload of the fixed packages and the time until the packages have been built on porter machines. This time gap will be used for a new security update beta program. The project was supposed to be mentored by Moritz M hlenhoff. Student The project was supposed to be done by Nico Nion Golde. He is studying computer sciences at the Technical University of Berlin. He s also a DD. Result There s no nothing. Nico, what happened ? And obviously, he s still developing for Debian. Debgraph, a generic infrastructure for the development of packages management tools Presentation In a large software ecosystem such as Debian Linux, there is the potential for dependencies among software packages to create complex management and technical problems. For example, dependency loops (cycles) in which a package directly or indirectly depends on itself can confuse package management tools as they determine the proper order of package installation. debgraph helps developers to solve this problem by enabling generic queries (e.g., Give me all the nodes that depend on package X ) against the graph of packages and thus automating much of the manual labor that is typically involved in resolving dependency problems. The project was mentored by Robert Lemmen, who introduced the project proposal. The project was already started and the C++ code foundation was done by the time it was proposed. Student The project was executed by Adam Jensen, research assistant in the Software Engineering and Network Systems Laboratory at Michigan State University. Result Adam maintained a blog about his progress and finished ahead of schedule. However, the resulting work seems to be unused, which is a pity since the code could be used within other programs (package managers?). I couldn t find any further public involvement of Adam within Debian.
That s all for now. The information is quite fragmented I admit. Most of it was pulled from Google, mailing lists, commit logs, blogs, whatever. If some projects are lacking in information here, it s because I couldn t find it readily (which is an issue in itself!). In my next post, I ll try to analyze the success and failures to extract some insight. Teaser: pet projects!
If you re a student or a mentor mentioned above, feel free to fill any of the blanks in my report. It s much appreciated. You re not a student or mentor mentioned above and have an opinion on how to improve the next Debian Summer of Code ? Feel free to comment.
Sledge, ping! Here s a list of projects to be described in my next posts:

Next.

Previous.