hints and tips for Ubuntu on the Viglen MPC-L

andy@stanford-clark.com

retro-style "netscape grey" background :)

product page

Viglen MPC-L

The Viglen MPC-L is a small embedded fanless PC running Ubuntu. It has 512MB RAM, 80GB hard disk, a 400MHz AMD Geode processor turning in 800 bogomips, 6 USB ports, and consumes only 10W of power.

Much as I like the Linksys NSLU-2 "SLUG", the MPC-L is a worthy replacement for it at the heart of my home automation system.

And at the @uupc special offer price of £79 including keyboard, mouse, a year's on-site support, VAT, AND courier delivery to your door: it's a bargain!

cross links

Ubuntu UK podcast reviewing the MPC-L

Tony Whitmore: Viglen MPC-L. Well worth £79

Tony Whitmore: More on the MPC-L

Alan Pope: Playing with the Viglen MPC-L

getting swap working

cat /etc/fstab

see swap partition /dev/hda2

http://ge.ubuntuforums.com/showthread.php?t=822427

sudo blkid shows partition types (and UUIDs)

sudo mkswap /dev/hda2

sudo swapon -a
free

updates

applications -> system -> update manager
To do it from the command line:
sudo apt-get update
sudo apt-get upgrade

sshd

sudo apt-get install openssh-server

hard disk temperature

apt-get install hddtemp

hddtemp /dev/hda
mine runs at 46C 

Note the default installation puts in a daemon which logs the temperature every 60 sec

Disable this with 
sudo update-rc.d -f hddtemp remove

(see below about disk use!)

find out raw information about hard disk (e.g. size)

sudo hdparm -I /dev/hda

version of ubuntu

lsb_release -a

software updates

sudo apt-get update

sudo apt-get upgrade 

sudo apt-get dist-upgrade

(BTW, sudo do-release-upgrade is the way you move between releases)

upgrade from Feisty to Gutsy

Feisty is no longer supported, so you have to use the old-releases repository.
https://help.ubuntu.com/community/GutsyUpgrades

There is also another way to do it by mounting an iso image of the liveCD, which @knolleary eloquently explains here...
http://knolleary.net/2008/12/12/upgrading-the-mpc-l-from-feisty/

volume control

have to enable on the task bar

http://ubuntuforums.org/showthread.php?t=832929

ACPI boot options

Viglen said:
"It could also be worth mentioning to the customer that we use the pci=noacpi argument instead of acpi=off (this allows the systems to shutdown gracefully, rather than the immediate shutdown which occurs when you pass the acpi=off flag and press the power off button)."
Put "pnpbios=off pci=noacpi" in the kopt stanza in /boot/grub/menu.lst

# kopt=root=UUID={hex-stuff} ro pnpbios=off pci=noacpi

Note the '#' at the start of the line. It's not a comment!

sudo update-grub
to apply this.

Thereafter, it will be automatically added to future kernel updates.

For the differences between pci=noacpi and acpi=off

http://forums12.itrc.hp.com/service/forums/questionanswer.do?admit=109447627+1221210940338+28353475&threadId=1172060

the Viglen as shipped has "noacpi acpi=off" but the "noacpi" appears to be incorrect (should be "pci=noacpi")

Viglen optimisations

Viglen said:
Viglen have tuned and tweaked this distribution for optimal performance on the MPC through the use of various techniques and tricks. Load times and startup times have been greatly reduced through adaptive analysis techniques and removing unnecessary startup scripts. A daemon monitors applications that users run, it is through the analysis of this data, the daemon predicts what applications users might run, and fetches those binaries and their dependencies into memory for faster startup times. The system is configured with light-weight applications that provide office and web browsing functionality making the MPC perfect for every day use!
In practice, this means that it runs:
 
 
prelink - (ELF prelinking utility to speed up dynamic linking)
 
preload - (adaptive readahead daemon)

disk use

Something seems to be accessing the hard drive every 10 sec or so.
What is it?
run top, updating every second:
top -d 1
add page fault count to the display
f u 
sort by page faults
F u 

Shows what's accessing the disk

Not helpful? Try blktrace

apt-get install blktrace

in order to use it, you have to mount the debugfs

sudo mount -t debugfs debugfs /sys/kernel/debug

Then:

bltrace /dev/hda

(note it's bltrace rather than blktrace!)
that's short for:
blktrace -d /dev/hda -o - | blkparse -i -

much more useful, though is:

sudo su

echo 1 >/proc/sys/vm/block_dump
wait 15 seconds or so
echo 0 >/proc/sys/vm/block_dump

then display output with dmesg

Turns out it's these things writing to /var/log/
syslog, messages and kern.log

preload
hddtemp

stop them:

/etc/init.d/preload stop
/etc/init.d/hddtemp stop

aaaaah much better! :)

http://ubuntuforums.org/showthread.php?t=833301

http://ubuntuforums.org/showthread.php?t=613715

http://ph.ubuntuforums.com/showthread.php?t=661071


To permanently disable them, 

sudo update-rc.d -f preload remove
sudo update-rc.d -f hddtemp remove

to put them back again:

sudo update-rc.d -f service-name defaults

using 'screen' for multiple long-running shell windows


To start things in screen sessions:
screen -dmS name command
e.g. screen -dmS broker ./broker

To list the screen sessions
screen -ls

To re-attach to one of the screens
screen -dr session_name
e.g. screen -dr broker

To detach from a screen session
ctrl-a d

To go into scroll mode
ctrl-a [
<esc> to get out of it

Changing hostname

To change the hostname from the default "mpc-viglen", you have to edit
/etc/hostname
and
/etc/hosts
then reboot

installing a .rpm file on Ubuntu

Debian-derived distros use .deb files, not .rpm files. To convert between them, use alien.
sudo apt-get install alien
cd to the directory where the .rpm is
sudo alien -k name-of-rpm-file.rpm
This will create a corresponding .deb file Install the .deb package with
sudo dpkg -i name-of-deb-file.deb

Enabling the cron log

Unbelievably, by default, Ubuntu disables the cron log.

Here's how to fix it: How to enable cron log in Ubuntu.

Make sure you

sudo touch /var/log/cron.log
per the response comment, else the sysklogd complains

So...

1. sudo vi /etc/syslog.conf  and uncomment the line starting with cron.*
2. sudo touch /var/log/cron.log
3. sudo /etc/init.d/sysklogd restart
4. sudo /etc/init.d/cron restart
Have a quick look in /var/log/cron.log to make sure it's said something
 


comments and updates to: andy@stanford-clark.com