Category Archives: Linux - Page 4

Build DKMS modules for specific kernel

After upgrading my kernel, somehow DKMS missed to build the NVidia stub modules for the NVidia-binary driver. A oneliner can solve this:

$ sudo /usr/lib/dkms/dkms_autoinstaller start 3.5.0-23-generic

Ubuntu 12.10 and Windows 8 with Secure Boot mode

Installing Ubuntu 12.10 on a Samsung Series 9 Notebook has some pitfalls. My goal was to install Ubuntu 12.10 along Windows 8 while using Secure Boot too.

The first challenge is booting from an USB flash drive. You need to enter your BIOS by pressing F2 while booting the system. Change to the “Boot” tab, enter the sub menu “Boot Device Priority”  and move “USB HDD” in front of “SATA HDD” (using F5). Then, curiously, you also need to disable the “Fast BIOS Mode” (tab “Advanced”). You can also use F10 to select the boot device, but “Fast BIOS Mode” still needs to be disabled. Installing Ubuntu should then work as usually.

Even thought Ubuntu 12.10 supports Secure Boot, on my system, the first boot after the installation failed with this Error:

Secure Boot

Image failed to verify with *ACCESS DENIED*.
Press any key to continue.

Read more »

Switching Windows 7 and Ubuntu to UEFI

UEFI Logo

UEFI Logo

After upgrading my hard disk on my Laptop I planned to switch to a GPT (GUID Partition Table). But since I’ve a Windows 7 installation as well I had to switch to UEFI boot mode because Windows 7 does not support booting from GPT using the old BIOS/MBR bootmanager/bootloader (You can find a good Q&A about GPT support of Windows at MSDN). Luckily my old HP Elitebook 8530w already includes an UEFI enabled BIOS (without Secure Boot). It supports (like many others) the old boot mode as well as the new UEFI boot mode. By selecting the “UEFI” entry in the boot menu one can make sure that the UEFI boot mode is enabled. After reading some documentation (especially the once from Roderick W. Smith) I decided to use the rEFInd boot manager and the kernel provided EFI stub bootloader (part of the mainline kernel since 3.3.0). I’m using Ubuntu 12.10 which comes with Linux 3.5 and enabled EFI stub bootloader in the stock kernel… Read more »

Secure Boot implementation of Ubuntu 12.10 (Quantal Quetzal)

Ubuntu 12.10 supports UEFI secure boot. I did some research in order to understand the actual implementation on Ubuntu and would like to share my findings. Since Windows 8 requires secure boot, most new Computer contain Microsoft’s Platform Key. Microsoft allows to sign own binaries with this Platform Key. As outlined in the Canonical blog post Ubuntu 12.10 uses a signed version of the EFI application Shim (to maintain the chain of trust) and Grub2 as its default boot manager.

Canonicals version of the Shim EFI application

Ubuntu’s 12.10 Shim EFI application is a early version of Shim which don’t has any support for MOKs (Machine Owner Keys). Shim was made by Matthew Garrett. He wrote two blog posts how Shim works, but because Ubuntu uses an older version not all of his description apply to Ubuntu’s Shim. Matthew Garrett also published its own Microsoft-signed version of Shim. Ubuntu however doesn’t use this signed version. Read more »

Convert MBR partition table to GPT (Ubuntu)

Since I have some big disks I started using GUID partition table (GPT). However, Ubuntu (12.10 in my case) installed itself using a oldschool MBR partition table (or MS-DOS partition table). There are ways to create a GPT while installing, but I missed that point… So I asked myself is it possible to convert the MBR partition table to a GUID partition table? Yes, and its quite easy…

In order to use GPT with nowadays BIOS there need to be a BIOS boot partition. However there are two prerequisites which you should check before converting: There need to be space between the MBR and the first partition (most  modern partition utilities start the first partition on the 1 MiB boundary):

$ sudo fdisk -l /dev/sda
....
Device    Boot    Start          End     Blocks  Id  System
/dev/sda1 *        2048    117186559   58592256  83  Linux

As you can see, my partition table meet this requirement. We use this partition to store the BIOS boot partition in it (Note: It should also work with a BIOS boot partition at another place, I never tried that).

Second, GRUB need to be 1.97~beta1 or newer. Check this by issuing

$ grub-install --version

If your system meets this requirements you’re ready to go. First backup the old MBR (and all important data, if you have any on the system in question), just in case anything goes wrong

sudo dd if=/dev/sda of=/root/sda-mbr.dd bs=512 count=1

Now it’s time for gdisk, the GPT equivalent to fdisk for the old partition tables. Starting this utility on a system with the old MBR partition table converts this automatically: Read more »

DisplayLink under Ubuntu

DeLock Port Replicator contains DL-165

DeLock Port Replicator contains DL-165

To have some more connection options for different embedded devices I bought a port replicator. My favorite dealer offered an adequate device from DeLock: DeLock USB 2.0 Port Replicator (87503). It supports DVI (and also VGA using an adapter), powered USB and Ethernet. But according to the device description and according to DeLock the device doesn’t support Linux. I asked which graphic chip is inside this device and I get a quick response: DisplayLink’s DL-165. This chip is supported by Linux using the udlfb driver. There are other drivers needed for the rest of the functionality, so I was not sure it is really working completely with Linux. but I’m an optimist, so I ordered the device… 🙂

Now I could take a look at it: The device consists of an USB-Hub, an ASIX AX88772 USB 2.0 Ethernet adapter and the mentioned DisplayLink DL-165 adapter. All devices are being detected by my Ubuntu 11.10 (Oneiric Ocelot) without additional packages. The output of dmesg shows the detected devices. My monitor turned to the udlfb green as expected. Read more »

Fix numpad in linux

Recently my numpad didn’t worked. Googling around I found the solution: My keypad was in a cursor control mode. Switching back to numpad is easy as that:

Ctrl+Shift+Num

Building an image for BeagleBone

BeagleBone

BeagleBone

A few day’s ago TI anaounced a new BeagleBoard: BeagleBone. It’s a stripped down BeagleBoard which basically only has a USB slave-client (providing a serial console, a JTAG debugger and an USB connection to the processor) an USB host controller, an ethernet port and a lot of I/O’s on the PIN-Headers for $89. It’s a bit inspired by the popular Arduino boards. I always thought about buying a BeagleBoard, but it was a too expensive and too functional to use it for my electronic projects…

So in my case, TI’s strategy worked: I want some more power, I want Linux, but it souldn’t be too expensive. I’m going to buy the BeagleBone, i’m just not yet sure about the quantity 😉 But it’s not here yet, in the meanwhile I looked at the software a bit: How can I create root images for the BeagleBone? Read more »

IPv6 with OpenWRT and SixXS

WNDR3700v2 Package

WNDR3700v2 Package

Lately I wanted to try using IPv6. The first part I needed was an IPv6 capable router. Since I was always interested running Linux on my router I picked one which is ready to run OpenWRT on it. Netgear WNDR3700 seems to match my needs: Pretty common in the OpenWRT community, 16 MiB flash (4 MiB is the absolute minimum, 8 MiB should be fine for IPv6 use. More flash, more space to play with :-)). But take care: Lately Netgear made a new revision, v3, which is not compatible with OpenWRT, or at least no yet.

 

My provider says he is still working on implementing IPv6, he don’t know when it’s ready, but it should be in the next months… That’s way too long 🙂 So I decided using one of these tunneling solutions. Wikipedia has a list of tunnel brokers, I chose SixXS. After Signup you have to wait some hours until your account request is being processed. After the approval you get a username, password and 25 credits. These credits are needed to get a tunnel and your own subnet, for each of them you need 15 credits, which makes 30 for both. The first thing you do is requesting a tunnel. Some hours later, you should get a tunnel approval with your Tunnel Id. You can earn 5 credits by operating the tunnel a week. So after you have a tunnel, one has to wait another week to request a subnet. For me it took about two hours to get the account and another two hours to get the tunnel, so they are pretty fast! Read more »

Python web frameworks

Lately I played around with python web frameworks. After working on a web project with Django last year, I discovered Aspen lately. There are many other frameworks out there. Nevertheless, I’d like to share my findings about Django and Aspen. 🙂

  • Both use python, which is generally known as being fast. It’s compiled and therefore usually less memory hungry than other web oriented languages. There are also better ways to optimize performance, e.g. by writing a custom web server, if your website has high traffic.
  • Both frameworks are nicely object oriented. You get a request object (Django, Aspen) which encapsulate all information from the client. The application can use all its information to generate the output, encapsulated in a response object (Django, Aspen). When errors occur, you can simply raise an error response object in the middle of your code.
  • Aspen and Django are providing templating engines which are very similar to each other.
  • URL’s like http://falstaff.agner.ch/list/10/ score in terms of readability and alterability. Also, they simply look better! Both frameworks encourage the user to use such URL’s without file endings or unreadable long query strings (like ?page=start&session=123). While Django uses a configuration file, Aspen uses the file system itself to create such URL’s.

However, there are also big differences between these frameworks… Read more »