Thursday, May 10, 2012

Ubuntu Precise Pangolin 12.04 issues

In no particular order, things I have found different with Precise 12.04 compared with previous versions:

  1. idmapd has changed the location of the Pipefs-Directory. If your uid is generic, and name resolution doesn't seem to work when using NFS4 on Precise, make sure your Pipefs-Directory is set to:

    Pipefs-Directory = /run/rpc_pipefs

    It used to be

    Pipefs-Directory = /var/lib/nfs/rpc_pipefs
More as I find them!

Saturday, December 31, 2011

Suspend and boot problems - X220 and Oneiric 11.10

My brand new Lenovo X220 on Ubuntu Oneiric 11.10 had this weird problem where it would boot occasionally into Ubuntu, but other times it would start booting, but reboot before it hit grub or Xorg. Upon reboot, it would go to grub, but hang there waiting for me to hit enter (i.e. didn't auto boot).

Suspend didn't work either. It would always suspend, but upon opening the lid, it would reboot, and hang at grub (just like the booting problem).

I initially thought it was due to the Active Protection System that stops the hard drive from being damaged -  and wanted to turn it off (due to having an SSD). I also played with CPU and PCI power management settings in the BIOS. Nothing worked.

I then researched kernel options that could work. I found the kernel option for disabling extended C-States. This worked great! 5 days so far without a single reboot either booting or coming out of suspend.

To do it:

  • Edit /etc/default/grub (as root)

  • sudo update-grub
  • reboot

Wednesday, October 5, 2011

2gb deb package limit

I have been creating Matlab 2011b deb packages for my Ubuntu fleet, and have encountered problems as apt currently doesn't like packages > 2gb. You get errors like:

size mismatch


something went wrong

and negative sizes during the download and install of the deb package. There is currently open bugs dealing with fixing it, but in the mean time, I have figured out a nice way to get around it. Change the default compression!

Instead of:

dpkg-deb -b <folder> <deb package name>


dpkg-deb -Zlzma -b <folder> <deb package name>

It shrunk my 2.4gb deb package to 1.95gb, and hence doesn't fall foul of the 2gb size limit!

Wednesday, August 24, 2011

OpenGL on Ubuntu

Trying to install Geant4 on a Ubuntu VM, and enable the OpenGL extensions

Complains about missing OpenGL during configure

1) apt-get install libx11-dev mesa-common-dev
2) Point Geant4 to /usr for OpenGL (file is actually at /usr/include/GL/gl.h)


So I'm trying out RHEL6 to install on my new NFS server.

All is going well, until it comes to getting LDAP user information. The new setup on RHEL6 is to use the SSS daemon. It is configured using authconfig.

My LDAP database requires TLS, and simple binding to get any user information, including just NSS related stuff.

So, I thought that would mean just running this command:

authconfig --enableshadow --enablesssd --disablesssdauth --enablecache --enablelocauthorize --update

This results in:

id_provider = ldap
#auth_provider = ldap
ldap_schema = rfc2307
ldap_uri = ldap://*****
ldap_search_base = *****
ldap_default_bind_dn = *****
ldap_default_authtok_type = password
ldap_default_authtok = ******
ldap_tls_reqcert = demand
cache_credentials = true
enumerate = true
entry_cache_timeout = 5400
ldap_tls_cacert = /etc/pki/tls/certs/ca-bundle.crt

But, doing a /etc/init.d/sssd restart doesn't make user information work.

id username

yields an error.

I found that you have to include the line in sssd.conf

ldap_id_use_start_tls = True


Friday, June 24, 2011

Compiling tun.ko for Android - OpenVPN

I have a Xoom, and a Galaxy S, and need to be able to compile my own tun.ko for the kernel version I have. As you all know, if the kernel version of the module you are trying to insert isn't the same, it won't insert, and will give you errors like:

<3>[95175.874872] tun: version magic ' SMP preempt mod_unload ARMv7 ' should be ' SMP preempt mod_unload ARMv7 '

in dmesg. We need to compile the module for the right version of the kernel

  1. Download the Kernel source - normally from The Xoom can be found at, and the Galaxy S can be found at Use

    $ pwd
    $ git clone to clone the Xoom kernel source
  2. Copy your old kernel config from your device

    $ pwd
    $ adb pull /proc/config.gz
    $ gunzip config.gz
    $ mv config.gz tegra
  3. Download an ARM crosscompiler from
  4. Untar the crosscompiler, and add the binary directory to the path

    $ pwd
    $ tar -jxvf arm-2010q1-202-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
    $ export PATH=$PATH:/scratch/gnu-eabi/arm-2010q1/bin
  5. Prepare the kernel for compilation
    $ cd /scratch/xoom/tegra
    $ vi scripts/setlocalversion

       Find the following lines
           # If only the short version is requested, don't bother
           # running further git commands
           if $short; then
              echo "+"

       Change the line - echo "+" to echo ""

    $ ARCH=arm make menuconfig

       Go to General setup->Local version - append to kernel release. Make the value of this "-gc2bee64", without the quotes
       Exit, and say Y to saving changes
    $ Edit the file .config, and check for the value CONFIG_TUN
       If there is not a line CONFIG_TUN=m, create it. Save and exit the file
  6. Compile the modules only
    $ ARCH=arm make modules SUBDIRS=drivers/net
  7. If all goes well, there will now be a file tun.ko in drivers/net. Copy it to your device using adb, and place it in /system/lib/modules (create the directory if necessary). To check the version of the module, type "strings drivers/net/tun.ko". It will show you the version of the module.
You now have to install OpenVPN on your device. Grab the OpenVPN Installer and OpenVPN Settings app from the Market, and install. Install OpenVPN to /system/xbin. Then install BusyBox to /system/xbin (or /sbin if you have run out of room) using the Busybox Installer (from the market)

With the latest versions of Android (or if you have push rules in your config), you have to get a newer version of the openvpn binary than what comes with the OpenVPN Installer. So grab and extract it over the top of /system/xbin/openvpn

With that above version of openvpn, it goes looking for ifconfig and route in particular locations. It looks for them in /system/xbin/bb/ifconfig and /system/xbin/bb/route. So

$ mkdir /system/xbin/bb
$ ln -s /system/xbin/busybox /system/xbin/bb/route
$ ln -s /system/xbin/busybox /system/xbin/bb/ifconfig

And that should be that!

Tuesday, April 19, 2011

Preseeding Ubuntu Natty 11.04

I decided to start this blog because of the never ending battles I have with remembering what I have conquered before, and thinking that other people have the same problems.

The specific problem I was working on when I came to this conclusion was preseeding a Natty netboot install. EVERY version of Ubuntu brings more preseeding problems - something always changes, causing you to get prompted for something new, when the previous release worked without a hitch.

This time (going from Lucid to Natty) was the keyboard layout preseed. I got the dreaded keyboard layout screen.

Turns out the preseed file is only looked at once the locale is set (makes sense), so you have to pass the keyboard config in the kernel line of your PXE boot:

LABEL stuff_natty64kernel linux.natty64append vga=normal initrd=initrd.gz.natty64 locale=en_AU preseed/locale=en_AU keyboard-configuration/layoutcode=us console-setup/ask_detect=false netcfg/wireless_wep= netcfg/choose_interface=auto netcfg/get_hostname= netcfg/get_domain= preseed/url=http://myserver/preseed/ubuntu_natty/preseed.cfg http_proxy= my_image_type=stuff --

The key component this time is:


I worked this out by checking the update log for console-setup (which is what you used to have to pass for Lucid):

console-setup (1.57ubuntu8) natty; urgency=low
* Move keyboard detection templates from console-setup.templates to
-- Colin Watson Mon, 28 Feb 2011 19:21:18 +0000

And there you have it - instead of being "console-setup/layoutcode=us", it is now "keyboard-configuration/layoutcode=us"

Makes sense now - but that is an hour of my life I can't get back!