Archive for the ‘linux’ Category

SheevaPlugs, Wall Warts, and Debian

Posted at 10:34pm on Thursday, September 23rd, 2010 by

Whether I like it or not I have a need for permanently running machine. I bought a ReadyNAS Duo a while back which does almost everything I need, but it’s so underpowered that it can’t handle some pretty simple tasks (like rsync over SSH, for example). That, and you have to get up to all sorts of jiggery pokery to be able to install any additional software. This means that I’ve always ended up with an ancient desktop in the cupboard under the stairs, however hard I try to do without.

The last one of these died recently, and I didn’t have another to replace it. This meant that I had the opportunity to look for something more suited to the job at hand; quiet, low power, and able to cope in a dusty, underventilated and sometimes hot environment (under the stairs).

By a strange stroke of luck an article about “wall warts” appeared in my Google Reader stream at just the right time, and the idea of a tiny computer that consumes only 5W for under £100 was just too much for me to ignore.

I bought the base SheevaPlug from New IT, and it turned up the other day. Obviously the first thing I did was to try and reinstall it. The rest of this post describes how I got Debian and SqueezeCenter running from an SD card on my SheevaPlug, mounting all of its content from my ReadyNAS. There was a lot of trial and error, but the following process worked for me repeatably (once I’d found it…)

Before you start:

  • Get a minimum of a 4GB SD card, the highest class (speed) you can find/afford.
  • Make sure you have an ethernet connection available for the Plug, as the installer will download Debian from the internet. If you want to do this a lot (I ended up with about 7 attempts before being happy with the results) you might want to consider setting up Squid or similar on another machine to proxy your many downloads of the Debian distro.
  • Have a machine capable of running a serial terminal to work on. I used my Ubuntu laptop, with cu (sudo apt-get install cu). Other methods are available (Linux, Windows, Mac).

Before you power anything on connect the Plug to the network and connect the USB serial cable to the Plug and your laptop. Get a terminal open and run:

cu -s 115200 -l /dev/ttyUSB0

You should get ‘Line busy’ or similar. Turn on the Plug and then keep trying the above line to connect. Pretty soon (10 seconds?) you should get a prompt that looks like:

Marvell>>

I followed the extremely good Installing Debian on the Marvell SheevaPlug with some important alterations. Specifically:

  • The kernel that currently comes with Squeeze does not work on the current version of the SheevaPlug (at least, it kept failing from me and then I found this article about installing Debian on the GuruPlug that suggested an alternative that worked). Instead of downloading the uInitrd and uImage files from the instruction page, I downloaded them from the Debian daily snapshots. (NB: Unfortunately I have no idea if this is actually important, unfortunately, as changed more than one thing before the successful install. It worked though.)
  • If you bought a pre-installed Plug from New IT then you shouldn’t need to change any environment variables before the first boot, so no need to run the first set of setenv commands.
  • I installed Sid (Debian unstable) rather than Squeeze, and so had to force my debconf priority to low before starting the install.

So. Here are those instructions in full:

Format your SD card. If it’s a brand new card (or the first time you’ve tried) you won’t need to this but, due to a number of failed installations, I ended up having to do this quite a lot. I’m assuming you’ve got a Linux machine here, I’m afraid.  I ended up with my 4GB card only showing up as 200-odd MB under Windows a couple of times and couldn’t for the life of me work out how to format it back to its original size. So, assuming you have Linux plug the card in. Modern installations will automount the card in /media. Unmount it (sudo umount /media/XXXX-XXXX) and then run sudo fdisk -l to identify the name of the device (for me it was /dev/sdb). Then run parted, delete all the partitions, and reformat it. An example is shown below:

andy@ubuntu$ sudo parted /dev/sdb
GNU Parted 1.8.8.1.159-1e0e
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: xxxx
Disk /dev/sdb: 16GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End    Size    Type      File system     Flags
 1      32.3kB  15GB   123GB   primary   ext3            boot
 2      15GB    16GB   1GB     extended
 5      15GB    16GB   1GB     logical   linux-swap(v1)

(parted) rm 1
(parted) rm 2
(parted) rm 5
(parted) mkpartfs primary fat32 1s 16GB

Remount the card (sudo mount -t auto /dev/sdb1 /mnt) and download the nightly snapshot boot images (uInitrd and uImage) to the root of the card. Unmount the card (sudo umount /mnt), and stick it in the SheevaPlug.

Now we’re ready to start.

If you still have the Plug turned on and connected to a terminal you can type reset to reboot the device. If not, turn it on and connect with cu as described above. You need to catch it when it says “Press any key to interrupt autoboot” so that you get the Marvell>> prompt.

Next you need to start up the SD card subsystem, and load the disk images that you’ve downloaded:

Marvell>> mmcinit
Marvell>> fatload mmc 0:1 0x01100000 uInitrd
Marvell>> fatload mmc 0:1 0x00800000 uImage
Marvell>> setenv bootargs console=ttyS0,115200n8 base-installer/initramfs-tools/driver-policy=most
Marvell>> bootm 0x00800000 0x01100000

This should fire up the Debian installer.

In my case this did not fire up the Debian installer the first few times. Instead I kept getting the message “Bad magic number”. Lots of googling didn’t really help. In the end I found that reformatting the SD card and redownloading the uInitrd and uImage files to it worked, but it took me a while to get to this point.

Once you’ve got the Debian installer running you need to set debconf to low to ensure you can get the option to install Sid rather than Squeeze. To do this press escape before you answer any questions from the installer, and choose ‘Select debconf priority’. From the resulting menu choose ‘low’. Debconf controls how many questions you get asked as part of the installation. If you set it to critical or high you don’t get asked many questions, but you lose some control. If you set it to low you get asked loads of questions. In this case, we need low so that we can choose the version of Debian to install.

Now choose the first option from the installer menu (‘Choose language’) and follow the instructions on screen. The installer chooses sensible defaults the entire way through, including disk partitioning, so just let it do what it recommends. When you get to choose the mirror to download from choose one that allows you to choose Sid, and select it. Bytemark (a lovely company based here in York) provide all options, so I chose their mirror. Some mirrors do not offer all versions of Debian, so you might have to keep choosing until you find one that does.

At this point you’ll need to wait. And wait. A long time. The installer will ask you a couple more questions, including right at the end which software you want to install (I didn’t choose anything other than the defaults, but make sure you have open-ssh selected). It’s pretty much plain sailing from here.

Once it’s finally finished enjoy your shiney new Debian for a moment, and then restart it (sudo shutdown -r now) so that you can make your installation the default boot.

As it restarts catch it at the “Press any key to interrupt auto boot” again so that you’re back at the Marvell>> prompt. Then type the following commands:

Marvell>> setenv bootargs_console console=ttyS0,115200
Marvell>> setenv bootcmd_mmc 'mmcinit; ext2load mmc 0:1 0x01100000 /uInitrd; ext2load mmc 0:1 0x00800000 /uImage'
Marvell>> setenv bootcmd 'setenv bootargs $(bootargs_console); run bootcmd_mmc; bootm 0x00800000 0x01100000'
Marvell>> saveenv

You should now be able to reboot by typing reset and leave it to boot. It should boot into your debian installation.

If it doesn’t you have two options. Retry this entire blog post from scratch, or start reading around the subject. These two links are the two that got me up and running…

…and it’s worth also looking at the PlugComputer wiki.

Assuming it is working for you it’s pretty simple to get SqueezeCenter installed.

As root (or using sudo if that’s the option you chose during the installation) you need to get MySQL installed:

apt-get install mysql-server-5.1

Then you’ll need to get the SqueezeCenter itself installed. Check the latest version of SqueezeCenter by have a look at the download index. Latest for me was 7.5.1. So, again as root (don’t worry about “Errors were encountered messages”):

debian:~# cd /tmp
debian:~# wget http://downloads.slimdevices.com/SqueezeboxServer_v7.5.1/squeezeboxserver_7.5.1_all.deb
debian:~# dpkg -i squeezeboxserver_7.5.1_all.deb
debian:~# apt-get --yes install -f

There are (IMHO too detailed) instructions at http://wiki.slimdevices.com/index.php/SqueezePlug. I ignored much of what was on that page, except for the Install SqueezeCenter section. It’s worth looking at some of the pages that page refers to though, particularly if you’re keen to improve the MySQL performance and increase the life of the SD.

To intrepidly go where many men have already gone

Posted at 11:29pm on Wednesday, February 11th, 2009 by

Now. I am not an Operating Systems wonk.  My computer is the applications; the operating system is largely uninteresting. It has to be easy to use, easy to configure and easy on the eye, but beyond that I don’t really care that much. That, combined with laziness and a desire for other more adventurous people to iron out the kinks mean that I tend to lag behind on the OS front.

My main desktop is 18 months old, my file server at home 2 years and, until a couple of weeks ago, my laptop was a year (Hardy Heron). I’ve liked each release enough to not feel the need to upgrade until forced.

Two weeks ago I took the plunge and upgraded my laptop to Kubuntu 8.10 (Intrepid Ibex) to see how I liked it before upgrading my ailing main desktop…  And for the last 2 weeks I’ve been a whining frustrated pain in the arse to anyone who’ll listen.

I love Ubuntu.  It was the first Linux distribution that “just worked” for me.  To find that this latest and greatest version doesn’t “just work” in some really key areas was a bit of a disappointment.  My expectation (rightly or wrongly) is that each release will improve upon the last.  It’s certainly been my experience to date. Each Ubuntu release has been markedly better than the previous one in really useful ways (particularly as a heavy laptop user).

So – my woes?

  1. Missing scrollbar in Thunderbird, weird display problems on Firefox tabs and browser form elements and general user interface brokeness.
  2. Network manager not appearing to start on each boot, and when it does start, not automatically connecting to previously known networks (despite being configured to do so)
  3. No bluetooth support (particularly to get images off my phone, which is my primary use)

Fixes?

  1. Install the human-theme package.  Then in System Settings -> Appearance -> GTK Styles and Fonts select “Use another style” and choose Human from the dropdown in the “GTK Styles” section
  2. Edit /etc/NetworkManager/nm-system-settings.conf.  In the section [ifupdown], set “managed=true” (this worked for me, doesn’t seem to work for everyone)
  3. This one sucks the most, but the news is that it will be fixed extremely soon; the fix is done and in testing, and such an important thing not working is getting lots of attention. To workaround while waiting for the proper fix I installed the bluez-gnome and obextool packages and then run bluetooth-applet when I want to connect to the phone, and obextool for a really shonky two-way file transfer app.  At least I can get photos off my phone now though, despite the kludginess.

Now that I’ve got these things sorted I can settle down and enjoy what is actually a really nice OS.  While I value working bluetooth over UI sugar I can’t argue with the huge interface improvements.  It really is a joy to use, and many of the features of KDE4 that I initially rejected as frippery are actually really useful.

I just wish my initial experience had been as good as it was with Gutsy and Hardy. Here’s hoping Jaunty is a little less frustrating to get going.

Tags:

| Comments Off

More on the Heron

Posted at 9:34pm on Thursday, June 12th, 2008 by

OK – next niggle with my new Hardy Heron installation. Clicking links in emails in Thunderbird doesn’t do anything. Nothing. For the last week I’ve been pasting links from emails into Firefox. This is no fun. Some googling around didn’t really help (the suggestions here, for example, didn’t work for me). What did work for me was the following (ymmv, obviously)…

In Thunderbird go to Edit -> Preferences. Open the Advanced tab and then the General tab. Then click the Config editor button. Find the line called network.protocol-handler.expose-all and change it to True. Voilà (at least for me).

Update: OK.  I lied.  This didn’t work for me at all.  In fact what it did for me was cause Firefox to open with a downloaded version of the file.  I’m stumped.  And annoyed.

Hardy Heron and Lenovo x60s

Posted at 10:31pm on Friday, June 6th, 2008 by

Edgy Eft took me nearly a fortnight of painful evenings to get it installed on my x60s. Feisty Fawn took a couple of evenings.  Hardy Heron took all of 2 hours to get completely installed and configured.  That, ladies and gentleman, is progress… (well, that and a removable drive…)

Only problem so far? In Dolphin (the replacement for Konqueror) when you mouse over any XML or HTML file you get a nasty popup telling you that Amarok is incorrectly configured:

The desktop entry file
/usr/share/apps/d3lphin/servicemenus/amarok_addaspodcast.desktop
has an invalid menu entry
addAsPodcast

As always Google is your friend – a fix for the annoying Amarok addAsPodcast error popup in Dolphin in Hardy Heron.