Archive for June, 2008

Creating an fstab /w Ubuntu 8.04 derivatives

June 15, 2008
The following tutorial is meant to be used alongside a tutorial for creating a Ubuntu 8.04 derivative. To create a Ubuntu 8.04 derivative from scratch for instance follow these steps: https://help.ubuntu.com/community/LiveCDCustomizationFromScratch.

On most *ix systems a file exists that is used to determine where partitions are found. In Microsoft Windows a USB flash drive shows up as a drive such as “E:\”. On GNU/Linux systems a USB flash drive shows up as a location relative to “/”. For instance the contents of a flash drive might show up in “/mnt/sdb1” or “/media/USB Flash Drive”. What determines this location is specified in the “/etc/fstab” file

A LiveCD is a computer operating system that runs from CD without needing to be installed. Most users install GNU/Linux systems from LiveCD. Most LiveCDs detect the partitions and drives of a system automatically and create an fstab file when booting. This overwrites the “/etc/fstab” file.

Modifying a LiveCD is sometimes called remastering or customizing. When creating a derivative distribution most configuration files are found in the same places they would be located after an install. Although the “/etc/fstab” file will exist in most cases it won’t be utilized when booting from a LiveCD. The reason is a script detects the drives and creates the file automatically.

During the initialization of the LiveCD system a temporary root filesystem is created, and if this filesystem contains a program “/init” then the system boots. In Ubuntu 8.04 the “/init” program is Initiramfs-tools.

Casper is a hook for initramfs-tools to boot live systems. The Casper scripts are contained in a file called initrd.gz. A solution to being unable to modify the “/etc/fstab” manually is to make changes to the Casper scripts which create it instead.

  • chroot chroot_dir /bin/bash
  • nano /usr/share/initramfs-tools/scripts/casper-bottom/12fstab
  • Add any changes for fstab between "cat > $FSTAB <<EOF" and "EOF"
  • mkinitramfs -o /new-initrd.gz `uname -r`
  • If the system you are using uses a different kernel than the one on the LiveCD replace 'uname -r' with the one you are using on the LiveCD.
  • exit
  • mv chroot_dir/new-initrd.gz image/casper/initrd.gz


Advertisements

Ubuntu 8.04 boot Toram Fix

June 8, 2008

Since Ubuntu’s toram feature is still broken in 7.04, 7.10, and 8.04 I thought I’d let those searching for a solution know that the pendrivelinux fix for 7.04 linked below works for 7.10 & 8.04. The only difference is the kernel will be something other than 2.6.20-15-generic. You probably already know that “uname -a” will provide that information. While the older modified casper script works you might want to determine the parts you need and update the 8.04 script manually (I’m not sure if it actually differs or not as I didn’t bother to check).

http://www.pendrivelinux.com/2007/10/15/ubuntu-toram-how-to-make-ubuntu-boot-to-ram/