mass producing linux

Place to discuss Fedora and/or Red Hat
Post Reply
User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Thu Jul 30, 2009 9:04 am

It's no trouble at all and no it's not like the LiveCD, although you can pull the file system out of a LiveCD and use it as a start (or use one you already have customized down to what you want). It works just like the Ubuntu setup in that you have an ext3 filesystem image and a swap file image except instead of Ubuntu it's Fedora. I'll try and create a step by step for you in the next couple of hours if I didn't already do it earlier in this thread.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Thu Jul 30, 2009 11:21 am

I guess my first question is, do you already have a Fedora box set up the way you want? If so we can turn that into a Wubi installation and I can target the steps more specifically to your existing installation.

byrdman
administrator
administrator
Posts: 225
Joined: Thu May 08, 2003 1:59 pm
Location: In the cloud

Post by byrdman » Mon Aug 03, 2009 9:19 am

yes, I have one already running the way we want it...for the most part!. I am sure I will be going back and adding, adjusting, etc...but for now, it is built and running.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Mon Aug 03, 2009 10:36 am

Ok, sorry I haven't had a chance to work on this, we had a hillclimb this weekend and I had a lot of work to do getting ready for it and running things all weekend. Will try and get back to this tonight.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Mon Aug 03, 2009 8:35 pm

I have the shutdown/unmounting problem worked out. So the basic steps you want to accomplish to get your existing configured Fedora 10 system into a Wubi system is:

1 - Create a disk image file called "root.disk" and copy the entire file system from your configured system to that disk image. You do not want to be booted into the configured system when you do this (boot from a Live CD to do the copy, mount the root file system from the hard drive on a mount point, use rsync over the net or tar the file system up to a usb drive, etc, then extract into your image on your other machine by mounting the image and extracting the archive into the mount point of the image file). Place that image in your ubuntu/disks directory.

2 - Replace the /etc/fstab and the /etc/init.d/halt files in that image with these:

http://voidmain.is-a-geek.net/files/Kio ... /etc/fstab
http://voidmain.is-a-geek.net/files/Kio ... nit.d/halt

3 - copy your Fedora kernel that you want to boot from your configured system into the ubuntu/disks/boot directory.

4 - Use the initrd that comes with the Ubuntu Wubi installation but replace the Ubuntu kernel modules in that image with the Fedora kernel modules that match the Fedora kernel you want to boot.

You could skip steps 3 and 4 and just use my kernel and initrd, will save you the trouble of hacking the initrd. Place these two files in your ubuntu/disks/boot directory:

http://voidmain.is-a-geek.net/files/Kio ... nstein.img
http://voidmain.is-a-geek.net/files/Kio ... .fc10.i686

Just make sure you have that exact kernel RPM (2.6.27.5-117.fc10.i686) installed on the system you are turning into a Wubi system.

5 - Put a section in ubuntu/disks/boot/grub/menu.lst to boot your Fedora system. Here's what my section looks like:

Code: Select all

title           Fedora 10 - Fedora kernel
root            ()/ubuntu/disks
kernel          /boot/vmlinuz-2.6.27.5-117.fc10.i686 root=LABEL=C loop=/ubuntu/disks/root.disk ro ROOTFLAGS=syncio quiet rhgb
initrd          /boot/initrd-frankenstein.img
That should be about it. I realize I didn't give you a step by step on creating the file system image and copying the file system over but hopefully you picked up enough knowledge earlier in this thread to accomplish that. If not I can list out the steps in more detail on how you could do this.

byrdman
administrator
administrator
Posts: 225
Joined: Thu May 08, 2003 1:59 pm
Location: In the cloud

Post by byrdman » Tue Aug 04, 2009 7:13 am

Yeah, I think I can manage but as I booted into the Live OS, I have a pretty simple but stupid question....where is the root filesystem?
I can't tell where I am booted into? How can I tell what I am running off of? I know it is booted into the live OS, but where it that.
I guess when it comes down to it, I can't even get past step 1... :roll:
I just need help copying the root filesystem cause I don't know where I am in the filesystem when I boot in teh Live OS?

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Tue Aug 04, 2009 9:01 am

What does "df -h" show when booted into your Kiosk system? Also the "mount" command by itself shows you what is mounted when you are booted into that system. Your root file system should be on something like "/dev/sda1". When you boot the LiveCD it usually finds the partitions on the hard drive and places them under the "Computer" icon on the upper left part of your desktop and should mount them automatically when you click on them. But I usually just mount them manually. Say your root file system is on /dev/sda1 you would just:

Code: Select all

# mkdir /mnt/root
# mount /dev/sda1 /mnt/root
This assumes you are not using logical volumes. Hopefully you are just using ext3 directly on the partitions. Also "fdisk -l /dev/sda" would give you a list of partitions on your hard drive.

Another way is to boot your installation CD/DVD into "rescue" mode. It will find your file systems on your disk and ask you if you want it to mount them.

byrdman
administrator
administrator
Posts: 225
Joined: Thu May 08, 2003 1:59 pm
Location: In the cloud

Post by byrdman » Tue Aug 04, 2009 9:26 am

That must be in...when I did the install of the kiosk system, it was a Logical Volume...damn...
the Computer icon just shows "/boot" "USB drive" and "Filesystem", none of which are my kiosk filesystem.
is the VolGroup messing everything up?

byrdman
administrator
administrator
Posts: 225
Joined: Thu May 08, 2003 1:59 pm
Location: In the cloud

Post by byrdman » Tue Aug 04, 2009 9:44 am

'df -h' does show the /dev/mapper/VolGroup00-LogVol00

can I just mount /dev/mapper/VolGroup00-LogVol00 /mnt/root ?

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Tue Aug 04, 2009 9:57 am

I believe you can actually. If not it should mount that file system from rescue mode. You can definitely do it from the LiveCD too though but it may take a couple more commands that I don't know off the top of my head.

byrdman
administrator
administrator
Posts: 225
Joined: Thu May 08, 2003 1:59 pm
Location: In the cloud

Post by byrdman » Tue Aug 04, 2009 10:22 am

another dumb question...where to create the root.disk? I am in a read only filesystem under the LiveOS, correct?

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Tue Aug 04, 2009 10:38 am

I assume you are doing your build (creating your zip archive) on a machine "other" than the one you are trying duplicate no? I had step by step instructions for creating that zip archive previously in this thread. Use that exact same zip archive, just replace the root.disk file containing the Ubuntu installation with a root.disk file containing your Fedora installation. You could actually mount the USB stick from your Live CD boot, create the root.disk file and then mount the root.disk file on that USB stick under a mount point (/mnt/root2) then all you would have to do is copy your files from your hard drive (mounted on /mnt/root) to the image file:

Mount the root file system from your hard drive:

Code: Select all

# mkdir /mnt/root
# mount /dev/logicalvolume/blah/blah /mnt/root
Mount the USB stick:

Code: Select all

# mkdir /mnt/usbstick
# mount /dev/sdb1 /mnt/usbstick (if your USB stick is /dev/sdb1)
Create a 3GB root.disk file on the USB stick (make it larger if needed):

Code: Select all

# dd if=/dev/zero of=/mnt/usbstick/root.disk bs=1M count=3072
# mkfs.ext3 /mnt/usbstick/root.disk
Mount the root.disk:

Code: Select all

# mkdir /mnt/root2
# mount /mnt/usbstick/root.disk /mnt/root2 -o loop
Copy files:

Code: Select all

# cd /mnt/root
# cp -a * /mnt/root2
Once finished unmount the root.disk and the usb stick and stick it in your other machine and copy the root.disk off and replace the one in your zip archive you are building. This is just "one" way to do it. You could also create the root.disk on the archive machine, mount it and copy the files over the network. There are many other ways too but this should work.

byrdman
administrator
administrator
Posts: 225
Joined: Thu May 08, 2003 1:59 pm
Location: In the cloud

Post by byrdman » Tue Aug 04, 2009 3:47 pm

well, the first attempt failed but that was because I tried to use the 2.6.27.25-170.2.72.fc10.i686 kernel so I modified some of the stuff you had with what I thought would be correct, but it failed at the menu.lst and said could not find /lib/modules/2.6.27..blah-blah.

will try again tomorrow...Thanks for all the help though. It is really helping me

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Tue Aug 04, 2009 5:08 pm

byrdman wrote:well, the first attempt failed but that was because I tried to use the 2.6.27.25-170.2.72.fc10.i686 kernel so I modified some of the stuff you had with what I thought would be correct, but it failed at the menu.lst and said could not find /lib/modules/2.6.27..blah-blah.

will try again tomorrow...Thanks for all the help though. It is really helping me
If you use my initrd then you *must* use the exact kernel version I said and it must also be installed in the file system. If you want to use a different kernel then you have to modify the initrd image and replace the modules from the kernel I specified with the modules from the kernel you want to boot. All three things *must* match exactly. 1) modules in initrd, 2) modules on filesystem 3) kernel

byrdman
administrator
administrator
Posts: 225
Joined: Thu May 08, 2003 1:59 pm
Location: In the cloud

Post by byrdman » Tue Aug 04, 2009 5:13 pm

yep, thats where I failed...The system I had used had both kernels but it was running the latest, so I figured that I had to use that one. I must of missed or mis-typed something when I tried to use the latest kernel.

Post Reply