FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.

» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Catalyst

LinkBack Thread Tools
Old 11-24-2007, 02:35 PM
Chris Gianelloni
Default LiveCD fs root creation

On Mon, 2007-11-19 at 13:06 +0100, lurker wrote:
> How/when/where is the LiveCD's filesystem root "created"? With this I'm
> referring to the actual fs root ("/") when running the CD, not the root
> found in the squashfs image that is created during build time. For some
> reason, these are not the same. It appears that only some directories
> from the image appears on the LiveCD root, where some symlinks not
> present in the image root also get created.

A typical squashfs-enabled LiveCD built with catalyst has 3 different
places that could be considered "root" on the CD at different times.
The first is the "outside" root, what you see when you mount the CD and
browse it. The second is the intramfs "root" which houses the splash
themes, drivers, busybox, lvm/evms, etc. from genkernel. The last, is
the tmpfs created at boot, which genkernel runs one of switch_root,
pivot_root, or chroot. This tmpfs consists of certain directories from
within the squashfs image, like /etc and /tmp, so they're writable. It
also symlinks certain other directories, like /usr.

> In my case I need /media to have KDED media manager automounting through
> HAL. I explicitly create /media in my fsscript and have verified that it
> indeed is created (by mounting the image) but it still doesn't appear on
> the LiveCD root. This is also the case for the Gentoo LiveCD's. The
> obvious solution is to create /media in local.start at every LiveCD boot
> up but I would nonetheless like to know the procedure of how the LiveCD
> root is set up from the contents of the image and if and how I can
> modify it.

You could modify it, but you would need to modify genkernel to do so.
There are two ways that I can think of to resolve this. Using
local.start is one way of doing it, and how we have done some things in
the past. We're trying to move away from that in the official media,
but it's still a viable solution. The second is to use a feature of
genkernel that very few people know exists. When booting a CD,
genkernel will search for ${NEW_ROOT}/mnt/cdrom/cdupdate.sh, which is
the "outside" root of the CD. When genkernel finds this, it executes
it. This is done in the "second" root above, the initramfs, immediately
prior to the chroot/pivot_root/switch_root. Since it runs in busybox,
it needs to run in the minimal busybox shell correctly. In your case,
it could simply say:

mkdir -p ${NEW_ROOT}/media

Make sure the file is executable, or genkernel won't run it.

Chris Gianelloni
Release Engineering Strategic Lead
Alpha/AMD64/x86 Architecture Teams
Games Developer/Foundation Trustee
Gentoo Foundation

Thread Tools

All times are GMT. The time now is 05:21 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org