On Thu, 2005-07-07 at 14:42 -0400, Paul Smith wrote:
> %% Eric Edgar <rocket@g.o> writes:
>
> ee> Catalyst doesnt really support unionfs at the moment.
>
> ee> You will need to add unionfs to your isolinux loader script to get
> ee> it to work.
>
> Well, it pretty much works. I wonder if anyone can be more clear about
> in what way Catalyst doesn't support unionfs and what exactly "add
> unionfs to my isolinux script" means? I'm happy to continue moving
> forward with this and even posting fixes etc. if I run into any.
Actually, what rocket means in that catalyst has no built-in support for
unionfs. To get unionfs, you need to use gk_mainargs (or gk_kernargs)
--unionfs. You will also probably want livecd/bootargs: unionfs...
unless you know the device you want, in which case you can do
livecd/bootargs: unionfs=/dev/sda1 (or whatever).
Yeah, livecd/bootargs is new in the _pre series. I even documented it
in the template spec files... ;]
Before livecd/bootargs, you would have had to edit
livecd/runscript/x86-archscript.sh yourself to add an option to the
isolinux boot line.
> What happens now: I'm booting a livecd image. If I add --union to the
> genkernel arguments when I build my livecd image with catalyst, then the
> system does come up correctly. I see it detect unionctl, I see it
> create the tmpfs, I see it mount the tmpfs, etc.
>
> However, after the system is booted there is one problem: all the
> partitions that were mounted during the linuxrc are no longer visible
> from within the unionfs. Here are the unionfs-related steps genkernel
> uses as far as I can determine them; I'm replacing variables with actual
> values here to make things simpler to follow (I hope!):
>
> 0) mkdir -p /newroot
>
> 1) Create a tmpfs at /memory
>
> 2) Create a unionfs at /union, where the only item in the union is
> /memory (mounted RW)
>
> 3) Init /newroot (make directories, copy over /dev/null and /dev/console)
>
> 4) Find the cdrom and mount it as /newroot/mnt/cdrom
>
> 5) Mount the squashfs as /newroot/mnt/livecd (read-only)
>
> 6) Add /newroot/mnt/livecd to the unionfs after the tmpfs (/memory)
>
> 7) Create /union/proc and /union/sys
>
> 8) Pivot_root to make /union the new /.
>
> 9) Clean up the old root (in /tmp/.initrd)
>
> 10) chroot . 'exec /sbin/init' (basically).
>
> So, at the end of this our / is actually /union, and things are set up
> properly, BUT if I run "df", for example, I get:
>
> Filesystme 1K-blocks Used Available Use% Mounted on
> df: `/memory': No such file or directory
> df: `/newroot/mnt/cdrom': No such file or directory
> df: `/newroot/mnt/livecd': No such file or directory
> udev 127724 2668 125056 3% /dev
>
> Is there a way to fix this? Can we do some sort of fancy footwork
> (maybe mount --move?) to get those things visible inside the union?
> Creating these directories inside the union keeps df from complaining,
> but those directories are still empty: you can't unmount them for
> example (not that you'd be able to anyway for the unioned ones).
>
> I'm mostly concerned with the cdrom mount. I wonder if it would at
> least be reasonable to mount /mnt/cdrom inside /union instead of inside
> /newroot: that should be safe. You can't do that with /memory since it
> needs to exist before the union is created, and I doubt it would work to
> do it with the livecd (union mount something that is mounted inside the
> union...? Hmm)
AFIAK, /mnt/cdrom would need to be done before the pivot_root, too. So
you can't move that to later.
Other than that, well, we're into unknown territory for me.
--
Chris Gianelloni
Release Engineering - Strategic Lead/QA Manager
Games - Developer
Gentoo Linux
|