I came across usplash recently as a solution to setting up a custom bootsplash screen. It installed and worked fine, but there didn’t seem to be any way to customise the splash screen. There are plenty of HowTo’s for how to customise it in Ubuntu (like this one) but they didn’t work for Debian.

The reason is that the Debian build doesn’t use a shared library for the bootsplash screen. Instead, it’s compiled in and so will always use the testcard theme.

Changing it is pretty simple though. Firstly,

apt-get install usplash libbogl0 libbogl-dev libgd2-noxpm libgd2-noxpm-dev
apt-get source usplash

I’m presuming you already have ~/bs.png that you want to use for the bootsplash. This should have a 16 colour palette and be of the required resolution.

Next, cd into the usplash source directory and copy your bootsplash image into it.

cd usplash-0.3e
cp ~/bs.png usplash-artwork.png

For this example, I’m setting up a usplash-artwork theme.

Next, use pngtobogl to convert the png image to C code.

pngtobogl usplash-artwork.png >usplash-artwork.c

The easiest way to set up the theme is copy usplash-testcard-theme.c and edit it for your own theme. In this case, you’ll want to search for any occurances of testcard and change it to artwork. Do this with sed, awk or whatever editor you use (which, of course, should be ViM!!). The code you’ll want to change is pretty obvious in the file too. To change the colours, edit the hex values for the palette indexes. Your image should have 16 colours, and each hex value, 0×0 through 0xf, will represent one of those 16 colours. The rest are positions and sizes for the progress bar, text box and text.

Lastly, edit usplash.c and again search and replace testcard with artwork.

sed -e ‘s/testcard/artwork/g’ usplash-testcard-theme.c >usplash-artwork-theme.c
vim usplash-artwork-theme.c
** Edit the palette, progress bar, text box and text details **
vim usplash.c
** Search and replace testcard for artwork **

Now, you’re ready to compile usplash again. Just run make in the source directory. Shortly afterwards, the usplash binary is there. Next thing is to “install” it! As root do

cd /sbin
cp usplash usplash.bak
cp ~/usplash-0.3e/usplash .
update-initramfs -u

This backs up your previous usplash binary, copies in your newly compiled one and updates the kernel’s initrd to contain your newly created bootsplash image.

Lastly, reboot to see the bootsplash screen.

Tip: you can test the image without rebooting by just running your usplash binary as long as X isn’t running. It obviously won’t have any progress bar animation or text, but you’ll get a good idea of how it’ll look during boot.

Edit – 2007-08-13

Two minor updates to this. Firstly, if you run usplash just after compiling, and you get a bogl_init failed message, it’s probably because you’re not using framebuffer support. You’ll need to edit /boot/grub/menu.1st as follows :

# defoptions=quiet splash vga=791

Leave the ‘#’ in place. It’s picked up when you run update-grub and added to the kernel line for each configured kernel. So, update it now with update-grub.

The different options for vga= are :

  • 785 – 640×480
  • 788 – 800×600
  • 791 – 1024×768
  • 794 – 1280×1024

The second issue is that when you boot, the bootsplash screen is ended prematurely and a load of the usual boot-text is shown. To fix this, edit /etc/init.d/console-screen.sh and find the text unicode_stop 2> /dev/null|| true and comment it out, so it looks like

#unicode_stop 2> /dev/null|| true

Now your bootsplash screen should run right to the end of boot.



I remember when I started using GNU/Linux, back around 2000, there wasn’t much choice in media players, and they weren’t exactly feature rich. Thankfully, that has changed quite significantly now. There’s not only a wide choice in players, but also in video creation software.

As part of my new job, I have to work with these players and develop add-ons for them. It’s within the source code that I’ve developed a preference for xine.

I started with mplayer, which is a fantastic player and very featureful. But it’s a pain to develop on. After that, I looked at VLC, which again, while featureful and extensive, just didn’t suit my needs.

In between the two was xine, which has the features and format support to do most of what I want, and has a very good API and good documentation, which when combined with the source, gives all the direction I need for writing new frontends and any plugins necessary.

In short, if you need to hack on any open source media players, do give xine a look!



Antiword

≡ Category: Software, Tech |Leave a Comment

This is more of a reminder for myself than anything else. If you need to convert a MS Word document to something legible, use antiword. It’s very simple, and very useful.

antiword file.doc

This converts file.doc to plain text, and outputs to standard output. It can also be used to convert Word docs to PDF, PS and XML.

Of course, if people would stop sending documents in this manufacturer controlled, proprietary format, we wouldn’t require hacks to read them. But that’s not likely to happen any time soon.



I’ve created this page to track releases of SvnFs. The first release, version 0.2 is now available.

Please let me know if you find it useful, and send any patches or bugs to john+svnfs@jmadden.eu.

I haven’t yet set up anonymous access to the Subversion repository for this project, but I’ll hopefully get it done during the week.



SvnFs has gotten to somewhat of a milestone! You can use it to mount a subversion repository, and browse it like a filesystem – ie. you can use cd and ls to look around the repository. There’s no auth support, so it’s pretty much only useful for anonymous or otherwise authenticated (eg. svn+ssh, file) repositories.

While the FUSE documentation isn’t great, the example programs are very easy to follow. In this case, the setup is the same as the hello.c setup.

#include <fuse.h>

struct fuse_args args = FUSE_ARGS_INIT(argc, argv);

fuse_opt_parse(&args, &svnfs, svnfs_opts, svnfs_parse_opts);
return(fuse_main(args.argc, args.argv, &svnfs_oper));

Here, I’m using svnfs as a global struct to hold specific SvnFs options (eg. debugging on or off); svnfs_opts are the possible command line options and svnfs_parse_opts is the function to parse SvnFs specific options.

To get started with Subversion, the first thing I needed was a client context and a memory pool. Subversion uses APR for portability. APR manages the allocation and deallocation (along with plenty of other stuff) of memory for you, and it uses a concept of pools of memory. So, to start with, I created a global memory pool, and I initialise it in a function called from main().

#include <apr_pools.h>

apr_pool_t *pool;

apr_initialize();
pool = svn_pool_create(pool);

Secondly, I created the client context.

#include <svn_client.h>

svn_client_ctx_t *ctx;
svn_auth_baton_t *auth_baton;
apr_array_header_t *providers;
svn_auth_provider_object_t *username_wc_provider;

svn_client_create_context(&ctx, pool);
svn_config_get_config(&(ctx->config), NULL, pool);

providers = apr_array_make(pool, 1, sizeof(svn_auth_provider_object_t *));
username_wc_provider = apr_pcalloc(pool, sizeof(*username_wc_provider));
svn_client_get_username_provider(&username_wc_provider, pool);
*(svn_auth_provider_object_t **)apr_array_push(providers) = username_wc_provider;
svn_auth_open(&auth_baton, providers, pool);
ctx->auth_baton = auth_baton;

This block of code loads up your configuration (currently not supported, the NULL in svn_config_get_config is the configuration file name), and sets up the authentication baton for the client context.

Lastly, I use a recursive svn ls to get the full list of files from the repository, and store this in a linked list. Getting the list of files from Subversion is done as follows.

apr_hash_t *dirents;
apr_array_header_t *array;
svn_opt_revision_t *rev = { 0 };
svn_sort__item_t *item;
svn_dirent_t *dirent;
char *fullpath;

SVN_ERR(svn_client_ls(&dirents, fullpath, rev, TRUE, ctx, pool));
array = svn_sort__hash(dirents, svn_sort_compare_items_as_paths, pool);

for( int i = 0; i < array->nelts; ++i ) {
item = &APR_ARRAY_IDX(array, i, svn_sort__item_t);
utf8_name = item->key;

dirent = apr_hash_get(dirents, utf8_name, item->klen);
}

I populate my linked list with the filename and a struct stat for each file. The struct stat is only used (at the moment) to store the mode – 0755 for directories, 0644 for files. Obviously, this will have to be updated in future to match real file permissions, or preferred permissions (eg. if you wanted to use SvnFs to store your email in Subversion, you don’t want world readable files).

The svn_dirent_t *dirent; above has a member called kind which can be svn_node_file or svn_node_dir. This is what I’m using to set the mode of the file.

Lastly, when a readdir() is called, svnfs_readdir get’s called. This simply returns all the elements in the current directory, but checking the filename in the linked list, and omitting any files in subdirectories. When getattr() is called, svnfs_getattr() gets run. This finds the entry in the linked list that matches the filename being looked for, and returns the struct stat for that element. This search needs to be optimised for larger repositories, but for now, it works! Pretty simple really, but functional!



My fiancee got her new Dell Inspiron 6400 yesterday. Dell are only offering the different versions of Windows Vista as OS options, so obviously, the new laptop came with Vista.

I had a look at it, used it for an hour or so, just to see what the fuss is about! And, to be honest, there’s nothing substantially useful in it. Sure, the new GUI looks good, but it’s nothing that hasn’t already been done elsewhere. The fancy 3-D window switching app is more of a gimmick than a useful tool. The widgets for the desktop are mostly toys and distractions. And, to top it all off, you need a powerhouse to run it on.
Vista Box
The GUI is nice though – it’s new (for Windows) and clean. However, looking from the GNU/Linux side of the bridge, there’s nothing in Vista that hasn’t been available for any GNU/Linux distribution for quite a while. Take the semi-transparent window borders – I’ve been using semi-transparent terminals on my Debian and Ubuntu machines for years! Of course, this transparency is terminal to background, and not to the window underneath. But, there are already mature projects available for Linux which do this (eg. Beryl).

The “Start Menu” has been changed around a bit. It’s got a new “Search” box, instead of going through a few clicks to bring up the search window. I saw this, but didn’t test it – this kind of thing should wait until there’s plenty of files and stuff sitting around on the machine. The menu has maintained the XP side-by-side menu look, but less sizeable. The left side contains a bunch of programs, with access to the full Programs menu from a button at the bottom. The right side has links to your home directory, music, videos (etc. etc.), Control Panel and other bits. It’s a bit confusing, with quite a lot of options that probably needn’t be there.

While having a look through the Control Panel, I came across the “Baseline Score” in the “System” dialogue. Windows will now grade the hardware in your system out of 5 to indicate how well it will perform certain tasks. For example, it says you should have a score of 3 or over to run the Aero desktop environment, but less than 4 means it mightn’t run it well on two monitors. While it’s not a bad idea (software developers can put a notice on their software to say above what baseline their software works best), it again shows the how much computational and graphical power Vista requires.

I really can’t see why this OS was delayed so much. There’s no really substantial updates. Of course, people will knock out the increase in security, phishing protection, the new search, but these things don’t take this long to write! Microsoft missed the opportunity to come out with a substantial upgrade (eg. WinFS) this time, and instead filled their new OS with fluff. It looks pretty, but in essence, it’s XP with a fancier GUI and requiring twice the power.

At the end of the day, the OS is meant to facilitate us in what we want to do. It’s meant to get the hardware into a useable state, then provide a method of using it to the software above it. The software is what we use to do whatever it is we want to do. Microsoft seem to have overlooked this, and filled Vista with bells and whistles, most of which I suspect will be sidelined once people want to use the OS to do something productive.




« go back