You are not logged in.

#1 2007-05-25 15:19:25

1311219
Member
From: Sweden
Registered: 2007-01-09
Posts: 121

Help with some small things on my (very) simple live-cd.

I've been thinking about trying my arch setup on another hardware (since I've had problems with the SLiM login manager, and I suspect that I wont have those problems on other hardware, don't ask me why...:/).
So the best way I've come up with is to create a live-cd of the system, although I must admit I'm doing it mostly for fun smile, and it seems simpler than I had thought.

For the moment I'm temporary changing the fstab and then use mkisofs to create a bootable dvd image (with isolinux) of my root fs, and then burn it. However, having the root partition on a read-only filesystems have some obvious disadvantages.

Since the system needs to create many temporary files, It isn't possible to start x from the cd (but the terminals does start), so I need a simple way to create a ramdisk and then let all changes to the root filesystem mounted on a dvd to be saved on the ramdisk instead.

this tutorial gives a good understanding of ramdisks, but I think I'll still need a way to save the changes in places like my home directory (which is already mounted) to be placed in the ramdisk.

So anyone got any experience of using ramdisks, or having directories mounted over several places (that's whats needed here, right?)?

thanks for all help!:)

Last edited by 1311219 (2007-05-25 15:20:25)

Offline

#2 2007-05-25 15:32:42

raymano
Member
Registered: 2006-10-13
Posts: 357
Website

Re: Help with some small things on my (very) simple live-cd.

1311219 wrote:

I've been thinking about trying my arch setup on another hardware (since I've had problems with the SLiM login manager, and I suspect that I wont have those problems on other hardware, don't ask me why...:/).
So the best way I've come up with is to create a live-cd of the system, although I must admit I'm doing it mostly for fun smile, and it seems simpler than I had thought.

For the moment I'm temporary changing the fstab and then use mkisofs to create a bootable dvd image (with isolinux) of my root fs, and then burn it. However, having the root partition on a read-only filesystems have some obvious disadvantages.

Since the system needs to create many temporary files, It isn't possible to start x from the cd (but the terminals does start), so I need a simple way to create a ramdisk and then let all changes to the root filesystem mounted on a dvd to be saved on the ramdisk instead.

this tutorial gives a good understanding of ramdisks, but I think I'll still need a way to save the changes in places like my home directory (which is already mounted) to be placed in the ramdisk.

So anyone got any experience of using ramdisks, or having directories mounted over several places (that's whats needed here, right?)?

thanks for all help!:)

There are some scripts that already accomplish this for you. Take a look at gradgrind's work at http://four.fsphost.com/gradgrind/dev3A/index.html. He uses unionfs to accomplish what you are trying to do.


FaunOS: Live USB/DVD Linux Distro: http://www.faunos.com

Offline

#3 2007-05-25 17:34:27

1311219
Member
From: Sweden
Registered: 2007-01-09
Posts: 121

Re: Help with some small things on my (very) simple live-cd.

unionfs was what I were looking for! Thanks, I will play around with that when I've got time. smile

btw: that link doesn't seem to work, but it might be because I'm not a member on fsphost?

Offline

#4 2007-05-26 06:16:15

gradgrind
Member
From: Germany
Registered: 2005-10-06
Posts: 921

Re: Help with some small things on my (very) simple live-cd.

1311219 wrote:

unionfs was what I were looking for! Thanks, I will play around with that when I've got time. smile

btw: that link doesn't seem to work, but it might be because I'm not a member on fsphost?

No, it's just a problem that can occur very easily with the forum markup - the full stop at the end of the sentence got included in the link (...index.html.). You can use my link below.

Offline

#5 2007-05-26 11:34:09

1311219
Member
From: Sweden
Registered: 2007-01-09
Posts: 121

Re: Help with some small things on my (very) simple live-cd.

*Suddenly sees the dot in the end of the link...*
I don't understand why I didn't notice it before!:lol:


BTW: I know this might sound like an stupid question, but it should be possible to modify the init script from a standard arch fallback image (since it does include the unionfs module, and should be able to be extracted/compressed back using bsdtar) and use that to create the root filesystem, right?

update: just experimented with the append option to mkinitcpio, since it's possible to give it modified file lists, replacing the normal initscript with another should be easy. now I just have to learn how to create the root filesystem with unionfs.:)

Last edited by 1311219 (2007-05-26 18:13:57)

Offline

#6 2007-05-27 10:27:23

1311219
Member
From: Sweden
Registered: 2007-01-09
Posts: 121

Re: Help with some small things on my (very) simple live-cd.

This is what I'm going to try: "remove the device not found" section from the init script, and then add something like this in the end:

mkdir /mnt
mkdir /mnt/tmpfs
mkdir /mnt/cd
mkdir /mnt/root

mount -t tmpfs -o size=20% none /mnt/tmpfs
mount -t iso9660 -r /dev/sr0 /mnt/cd
mount -t unionfs -o dirs=/mnt/cd:/mnt/tmpfs none /mnt/root

cd /mnt/root
exec chroot . sbin/init > /dev/console 2>&1

Will that work? I haven't tried all the commands yet. (do I need to use pivot_root ?)
Hopefully, all thats left now, is to figure out how to change the fstab (or can I just skip the root entry in the fstab?).

update: changed some errors in the code, now it seems to work.




update: how should I use the pivot_root command in this situation? It seems like a good idea...:P



update2: ignore that thing above about pivot_root, I think I've solved everything, all I need to do now, it to understand a really annoying "couldn't find kernel" message from isolinux.:cool:

If anyone wants to know how to modifying the init script in the initcpio to create a live-cd, then I'm more than happy to help!:)

Last edited by 1311219 (2007-05-29 09:38:37)

Offline

Board footer

Powered by FluxBB