Posts

Showing posts from November, 2013

Magic ISO Image Booting with GNU GRUB 2

Image
Recently I needed to prepare a USB thumb drive with several Ubuntu installations. A little research quickly yielded many setup instructions, for example like the one from Pendrivesystem.com .  I was really surprised at how well this works and wanted to understand it better. In essence all recipes rely on GNU GRUB in version 2 and the loopback feature that it contains and on the OS's ability to work off an ISO image. The loopback command  mounts a CD or HDD image that contains the kernel and initrd from an ISO image. As a result one can put several ISO images on the boot media without the need to extract them. The OS then also mounts the ISO image and uses that instead of a CD/DVD drive. So here is my version of the recipe, the USB thumb drive is in /dev/sdc  in my examples: 1. partition & format device I prefer to partition the device with parted because it aligns the partition at 1MB so that it leaves enough space for GRUB to embed itself into the first sectors of

Setting hostname from DHCP in Debian

Image
For our team monitors that use the Kiosk Browser on a Raspberry Pi I am building a Raspbian wheezy image. One requirement is that the system will configure the hostname from DHCP so that we can use the same image for all devices. Sadly, setting the hostname from DHCP is not  trivial in Debian, here is the result of my research into the topic. I found 2 things to be essential and learned both of them by analysing the dhclient script. 1. Set the hostname to localhost The first thing to do is to set the system hostname to localhost:     # echo localhost >/etc/hostname 2. Workaround for broken dhclient-script The dhclient-script has (IMHO) a bug: If there is an old DHCP lease with a hostname in the lease database (e.g. in  /var/lib/dhcp/dhclient.eth0.leases ), then the script will not  set the hostname from DHCP even if the system name is still localhost. To circumvent this bug simply create a dhclient enter hook to unset the old host name variable:     #

Idea: Electric Family Van

Image
Today I was walking a bit on the way home. After the third silent taxi (Toyota Prius Hybrid) passed by I started to think about what would be the ideal electric car for my use case. We are a large household and won't do with the standard 4 or 5 seat cars that are now beeing offered as electric or hybrid cars. Since the car makers don't offer what I need I am posting my idea here. This is an approximation of our current family car: It is nice, fairly large, seats 8 people comfortably and even has some extra luggage space in the back. We use it for short trips in the city to go shopping, drive the kids around and do the occasional family sunday trip to the surrounding country side. When we go travelling, we usually need a larger trunk so we have this add-on trunk: This is a trailer which is about half as long as the car and of the same height and width. It fits everything we need even for a long vacation. Or all our bikes for a shorter one. Or the insanely large
Like this content? You could send me something from my Amazon Wishlist. Need commercial support? Contact me for Consulting Services.