Fedora 15 (x86_64) LiveUSB notes to self
Making a custom ISO image.
It turns out it’s no so difficult to make a custom LiveCD / LiveDVD / LiveUSB, even if that includes making small hacks in the target system’s outline. Just follow this guide.
Creating the liveUSB
Create a liveUSB from a liveDVD image with liveusb-creator. Download the ISO image, don’t let liveUSB do it for you. LiveUSB Creator fails more than it succeeds, sometimes because the USB stick isn’t all that reliable, and sometimes it just fails with a yucky Python error message. I wonder if people who choose Python tend to write scripts that break all the time, or if it’s the language which was designed to kick your butt all the time.
For some details and manual generation how-to, see Fedora’s page on this.
The chosen device should be a partition (e.g. /dev/sdd1) and not a drive (e.g. /dev/sdd).
First steps after booting
It looks like a parody on Windows, the way it was 10 years ago: Ugly GUI, a lot of self-importance, and it hangs every now and then.
Let’s face it: Fedora 15 sucks. In retrospective, Fedora 14 is much better, as a LiveUSB and in general.
The persistent image isn’t mounted, so all changes are lost on reboot. There’s a workaround which requires manual intervention on each reboot. The nice thing about this workaround is that I finally found out how to get a boot prompt during boot (useful when exotic installs):
Pressing [Tab] twice on GRUB’s splash, adding the boot parameter
rd.break=pre-trigger
(press ENTER once, and then wait patiently for some 20 seconds). Then at shell prompt
mkdir /overlayfs ; exit
and type “exit” again on the second prompt.
The image comes with a regular user named “liveuser” with an unknown (?) password, and a root account with no password (!). First thing is to open a terminal window (at the bottom of applications. Command line in Linux? Who’s doing that??). Actions:
- Change the passwords
- Open the Firewall GUI and allow SSH. Or just go “service iptables stop” at root prompt if you like to live on the edge.
- Start the sshd service (service sshd start and chkconfig)
- Connect from remote computer.
- Switch to runlevel 3 (“telinit 3″). Installing gcc with graphic display on makes the system hang for whatever reason. But hey, who needs gcc? It’s not like we’re running on a free software system of something.
- Install gcc: “yum install gcc” does the job (one could expect that kernel-devel would require this, but no).
- Install kernel headers: “
yum install kernel-devel“. NOT! That installed the headers for the latest kernel out there, which wasn’t the one I was running. Upgrade the kernel? Really. I wonder if anything of that is left when I reboot. - To install the headers for the running kernel: “yum install kernel-devel-`uname -r`”
- At which point I compiled a kernel module successfully
Installing to hard disk
# yum install anaconda # /usr/bin/liveinst
Fooling around
While trying to find my way to making modifications on the LiveCD image, I looked around a bit inside the booted system. The rest of this post is just some probably useless findings. This guide explains how to make the modifications easily.
So, after booting Fedora 15′s liveUSB, I created an mnt directory and went (as root):
# mount -o loop /run/initramfs/live/LiveOS/squashfs.img mnt mount: warning: mnt seems to be mounted read-only.
The squashfs contains a single file, which is an image of a fullblown ext3 filesystem. It’s a 4 GB file (squashed into 552 MB in the squashfs). So I copied it to a disk, and then mounted it:
# mount -o loop ext3fs.img mnt
Looking around it was evident that there are no traces of any real users in /etc/passwd (not even root), and that there were no subdirectories in /home. The latter issue is easily explained by the following line in the output of plain “mount” on the live system:
/dev/mapper/live-rw on /home type ext4 (rw,noatime,seclabel,barrier=1,data=ordered)
The entire setup is a bit complicated, but it’s pretty easy to find out who the players are:
# dmsetup status live-osimg-min: 0 8388608 snapshot 2416/2416 24 live-rw: 0 8388608 snapshot 1094288/2129920 4272 # losetup -a /dev/loop0: [0001]:1898 (/osmin.img) /dev/loop1: [0700]:2 (/run/initramfs/squashfs.osmin/osmin) /dev/loop2: [0801]:4 (/run/initramfs/live/LiveOS/squashfs.img) /dev/loop3: [0702]:3 (/run/initramfs/squashfs/LiveOS/ext3fs.img) /dev/loop4: [0801]:5 (/overlayfs/LiveOS/overlay-disk-47BA-F8F8) /dev/loop5: [0801]:4 (/run/initramfs/live/LiveOS/squashfs.img)