Last updated: July 17, 2008
~Keripo

Note: This should only be done on Linux (e.g. Slax).
It may not work on Mac OS X and will not work Windows/Cygwin.

This is for generating a userland loop-mount image from
scratch. If you want to use pre-generated images, see the
"build.sh" script. If you just want to edit your userland,
skip to the "To mount and edit loop-mount image:" section.


To create the loop-mount image from scratch:

dd if=/dev/zero of=~/userland.ext3 bs=512 count=#
(where # is: 16384 for 8MB, 32768 for 16MB, or 65536 for 32MB)
mkfs.ext3 ~/userland.ext3 (answer "y")
tune2fs -c 0 ~/userland.ext3


To mount and edit loop-mount image:

mkdir ~/ipl-loop
mount -t ext3 -o loop,rw ~/userland.ext3 ~/ipl-loop
(edit content at ~/ipl-loop)
(if you are making a userland image from scratch,
 best to do rm -rf ~/ipl-loop/* then add content
 i.e. extract/copy userland files to ~/ipl-loop/)
umount ~/ipl-loop

Note that the SansaLinux userland is ext2, thus you will
need to replace "-t ext3" with "-t ext2" above. As well,
SansaLinux's userland is slightly different from
iPodLinux's and the below does not apply.

To make newly made loop-mount userland usable:

If you want to use unmodified userland files, you will
have to make the following changes to the "/etc/rc" file:

1. Add the line "mount -t devfs devfs /dev"
   before the line "mount -t proc proc /proc"

2. Change "mount -tvfat -osync,rw /dev/hda2 /mnt"
   to "mount -tvfat -oremount,sync,rw /dev/hda2 /mnt"

If you are using the 2.4.24 kernel, you must patch the
command line to use "root=/dev/hda2 rootfstype=vfat rw".
If you are using the 2.4.32 kernel with the cmdline patch
applied (i.e. kernel builds found on the "Experimental
Kernel" iPodLinux wiki page), you can pass the above
command line as a kernel argument through Loader 2.

