6,534
edits
Changes
some fixes/improvements →Creating booted LiveCD root filesystem
# cp mksquashfs /usr/bin/
# cd ~/workbench/-
# wget http://belnet.dl.sourceforge.net/sourceforge/squashfs/squashfs3.2-r2.tar.gz
# tar xzf squashfs3.2-r2.tar.gz
cc unsquashfs.o -lz -o unsquashfs
# cp unsquashfs /usr/bin/
# cd ~/workbench-
</pre>
Well, having the intruments in hand, why not extract the images? Create a directory, called <tt>livecd-root</tt>,
# mkdir livecd-root
# unsquashfs ovz-livecd/base/for f in bin.mo # mv squashfs-root/bin/ livecd-root/# rm -rf squashfs-root # unsquashfs ovz-livecd/base/etc.mo # mv squashfs-root/etc/ livecd-lib root/sbin usr var; do \# rm -rf squashfs-root # unsquashfs ovz-livecd/base/lib$f.mo ; \# mv squashfs-root/lib$f/ livecd-root/; \# rm -rf squashfs-root; \ done# unsquashfs ovz-livecd</base/root.mo # mv squashfs-root/root/ livecd-root/# rm -rf squashfs-rootpre>
Yet we have nearly complete root filesystem of '''booted''' LiveCD in <tt>livecd-root</tt> directory. However some things
are missing, and I guess you know what are they: <tt>/dev</tt>, <tt>/proc</tt>, <tt>/sys</tt>, <tt>/tmp</tt> and <tt>/boot</tt> directories. We need them, because some tools (<tt>rpm</tt>, <tt>bash</tt>, ...) will not work without them in chrooted environment later.
<pre>
# cd livecd-root# mkdir root/dev
# cp -a /dev/* root/dev
# mkdir root/proc# mount -t proc proc root/proc/
# mkdir root/sys
# mount -t sysfs sysfs root/sys/# mkdir root/tmp# mkdir root/boot# cd -
</pre>
That's it. We have '''bootedbootstrapped''' LiveCD root filesystem in <tt>livecd-root</tt> directory.
Now we can <tt>chroot</tt> in this directory and install all needed packages. But what
packages do we need?