Difference between revisions of "User:Apple/projects/ISOMetro"

From Funtoo Linux
Jump to: navigation, search
(Created page with "==Abstract== Funtoo needs to be able to create bootable media. ''Needs? We seem to be doing fine without our own branded media.'' Anyway, it shouldn't be hard to add ISO/image...")
 
(LVM)
Line 30: Line 30:
 
I'm pretty sure a genkernel kernel can be put on a livecd as-is, but by now the squashfs is set in stone; too late for the modules to be placed in <tt>/lib/modules</tt>.
 
I'm pretty sure a genkernel kernel can be put on a livecd as-is, but by now the squashfs is set in stone; too late for the modules to be placed in <tt>/lib/modules</tt>.
  
I seem to remember a gentoo<sub>maybe it was ubuntu...</sub> livecd with grub. How?
+
I seem to remember a gentoo<sub>or maybe it was ubuntu...</sub> livecd with grub. How?
  
 
==LiveUSB==
 
==LiveUSB==
Line 40: Line 40:
 
Mounting an empty image via loop and writing to it doesn't work AFAIK:
 
Mounting an empty image via loop and writing to it doesn't work AFAIK:
 
{{Root|<nowiki>#</nowiki> mount -o loop blank.img /mnt/gentoo}}
 
{{Root|<nowiki>#</nowiki> mount -o loop blank.img /mnt/gentoo}}
 +
 +
===LVM===
 +
Some of us are loud proponents for lvm, and installing a gentoo/funtoo instance on an LVM on a USB has the possibility of being '''*very*''' practical.
 +
 +
Basically, instead of the squashfs, we have a (compressed or not) lvm image that we mount as our rootfs in the live environment; the "stage 5" (stage 4 + kernel stuff).
 +
 +
To install it, just <tt>dd</tt> the lvm to the hdd (as long as the hdd has the capacity to hold the lvm image).
 +
 +
This should put a very small partition onto the hdd with the rest zeroed and unused. In the live environment: fdisk in and change the end cylinder of the partition (max it out), then pvresize to get the lvm filling the disk.
  
 
===References===
 
===References===
[http://edoceo.com/liber/gentoo-live-usb] - Unfortunately, in this case, pretty much all of the work has already been done by catalyst.
+
[http://edoceo.com/liber/gentoo-live-usb http://edoceo.com/liber/gentoo-live-usb] - Unfortunately, in this case, pretty much all of the work has already been done by catalyst.
 +
 
 +
[http://muzso.hu/2009/07/28/how-to-resize-an-lvm-physical-volume-without-a-reboot http://muzso.hu/2009/07/28/how-to-resize-an-lvm-physical-volume-without-a-reboot]

Revision as of 17:18, 17 November 2010

Contents

Abstract

Funtoo needs to be able to create bootable media.

Needs? We seem to be doing fine without our own branded media.


Anyway, it shouldn't be hard to add ISO/image generation to Metro.

I should say I get really confuzed when figuring out bootloader->kernel->init, so this might get messy.


The following is some pseudosteps which I think would create an ISO.

  1. Create a stage4, but instead of tar compression, use squashfs.
    • From brief exploration, it seems targets/gentoo/stage/capture will be the place to edit.
  2. Make an kernel w/ genkernel; should be able to handle squashfs.
    • If not with genkernel, get a generic kernel (monolithic or modular), make initramfs with better-initramfs.
  3. Prepare isolinux.
    • ISOLINUX's documentation is a little arcane, and I have no idea how gentoo's livedvd handles EFI.
  4. ...
  5. Profit!

LiveCD/DVD Generation

Squashfs compression in Metro

Taking a look at etc/builds/funtoo/build.conf, there is no reference to what type to capture (see targets/gentoo/stage/capture/). I have no idea where to specify ami (and therefore any other capture method).

Metro would need to create a stage4, then use that as a seed for an ISO (or, shall we do something completely different?).

Bootable kernel

I'm pretty sure a genkernel kernel can be put on a livecd as-is, but by now the squashfs is set in stone; too late for the modules to be placed in /lib/modules.

I seem to remember a gentooor maybe it was ubuntu... livecd with grub. How?

LiveUSB

Now, this is slightly easier yet more difficult. A liveUSB image should be the product of:

# dd bs=4096 if=/dev/sda of=funtoo-liveusb.img


However, boot-loaders (EXTLINUX, GRUB) need a real mounted device, which is $DIFFICULTY; especially when considering automating it: metro can (if your portage snapshot is already made) run many instances at the same time without problem; otherwise you'd need a spare partition and fast drives so you can dd off many images (I suspect it would be several hours per image).

Mounting an empty image via loop and writing to it doesn't work AFAIK:

# mount -o loop blank.img /mnt/gentoo


LVM

Some of us are loud proponents for lvm, and installing a gentoo/funtoo instance on an LVM on a USB has the possibility of being *very* practical.

Basically, instead of the squashfs, we have a (compressed or not) lvm image that we mount as our rootfs in the live environment; the "stage 5" (stage 4 + kernel stuff).

To install it, just dd the lvm to the hdd (as long as the hdd has the capacity to hold the lvm image).

This should put a very small partition onto the hdd with the rest zeroed and unused. In the live environment: fdisk in and change the end cylinder of the partition (max it out), then pvresize to get the lvm filling the disk.

References

http://edoceo.com/liber/gentoo-live-usb - Unfortunately, in this case, pretty much all of the work has already been done by catalyst.

http://muzso.hu/2009/07/28/how-to-resize-an-lvm-physical-volume-without-a-reboot

Personal tools
Namespaces

Variants
Actions
Categories
Toolbox
Stuff