6

My goal is to be able to take a customized root file system loaded with the software I want. So far I've created a squashed filesystem using debootstrap and chroot to install the software I want on the system.

The problem I am now running in to.. whenever I boot in to the system, my user accounts that were set up in the chroot do not work. First boot everything works out, second boot I can't log in. That is baffling to me.

Any one know a reason or a place to start looking?

2
  • You have to keep searching for the changes you wish to make. Look at the casper scripts and initrd as well as /usr/share and in the libs.
    – Panther
    Jan 14, 2012 at 15:54
  • Well I got it working. I used the live-boot & live-boot-initramfs-tools to generate an initrd and extlinux for the bootloader. Works like a charm.
    – cldfzn
    Jan 15, 2012 at 22:13

2 Answers 2

8

To get a working system with a squashfs filesystem:

sudo apt-get install live-boot live-boot-initramfs-tools extlinux
sudo update-initramfs -u

Create a squashfs file from a bootstrapped or running ubuntu filesystem with whatever packages you want available. https://help.ubuntu.com/community/LiveCDCustomizationFromScratch provides good instructions for creating a debootstrapped system to build on. Format the target drive with ext2/3/4 and enable the bootable flag. Create the folder layout on the target drive and install extlinux:

mkdir -p ${TARGET}/boot/extlinux ${TARGET}/live
extlinux -i ${TARGET}/boot/extlinux
dd if=/usr/lib/syslinux/mbr.bin of=/dev/sdX #X is the drive letter
cp /boot/vmlinuz-$(uname -r) ${TARGET}/boot/vmlinuz
cp /boot/initrd.img-$(uname -r) ${TARGET}/boot/initrd
cp filesystem.squashfs ${TARGET}/live

Create ${TARGET}/boot/extlinux/extlinux.conf with the following contents:

DEFAULT Live
LABEL Live
  KERNEL /boot/vmlinuz
  APPEND initrd=/boot/initrd boot=live toram=filesystem.squashfs
TIMEOUT 10
PROMPT 0

Now you should be able to boot from the target drive in to your squashed system.

4

This question was solved by the OP:

Well I got it working. I used the live-boot & live-boot-initramfs-tools to generate an initrd and extlinux for the bootloader. Works like a charm.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .