Thursday, August 18, 2011

Step 1: boot livedvd-amd64-multilib-11.2.iso from a usbstick (without wiping all data)
Gentoo Linux releases 11.2 LiveDVD: run the iso from hard disk (hack on initramfs)

Recently Gentoo LiveDVD 11.2 was released on Aug 7, I'd like to try it but don't want to waste a blank DVD; the first thing I think is to run it on a usb; the only usb stick I have important data, don't want to try the dd way ("dd if=image.iso of=/dev/sdb")  in faq which will wipe out all data, looking up some documentation on its default isolinux/syslinux, finally I got this way working:

1) mount loop that livedvd-amd64-multilib-11.2.iso; mkdir /gentoo on the usb stick, copy all files inside the iso into that /gentoo;
2) rename its isolinux/ to syslinux/, and isolinux.cfg to syslinux.cfg; yes! thanks to syslinux.zytor.com great work, they're sharing the same configuration file syntax, what you need to do is just rename;
3) since we copied all the files from rootdir of cdrom to /gentoo of another disk(usb), the syslinux.cfg need to be adjusted; find out the "label gentoo-x86_64", change it to this;


label gentoo-x86_64
  MENU LABEL Gentoo ^x86_64
  kernel ../boot/gentoo
  append root=/dev/ram0 init=/linuxrc dokeymap aufs looptype=squashfs loop=/gentoo/image.squashfs cdroot initrd=../boot/gentoo.igz vga=791 splash=silent,theme:livecd-10 console=tty1 quiet subdir=gentoo

the "kernel" "initrd=" parameters was parsed by syslinux so it support "../" style relative path, so you could move the whole "/gentoo" to any name, under any path; but the "loop=" and some otherwhere was read by code inside the initramfs (here it's ../boot/gentoo.igz), there some hard code doesn't support relative path, so you must write its full absolute path, prepend "/gentoo" to image.squashfs, and append "subdir=gentoo";

for other label entries if you want to use, you could change the same way;

4) install syslinux bootsector to that usb stick (/dev/sdb has only one vfat partition):
  syslinux -d /gentoo/syslinux /dev/sdb1

Then you could boot it with this usb: find out label gentoo-x86_64 and boot it into LiveDVD 11.2;
The 2.8G iso file has packaged with linux kernel 3.0.0 and most a dozen of major and minor WM Environment (gnome3/kde4/xfce/lxde/windowmaker/openbox/fluxbox/awesome/xmbc/...), and all applications on each WM; just try and found which is your favorite? all the latest software;


http://www.gentoo.org/news/20110807-livedvd.xml
http://syslinux.zytor.com/wiki/index.php/SYSLINUX
http://paste.pocoo.org/show/460334/
http://www.gentoo.org/proj/en/pr/releases/10.0/faq.xml
http://mirrors.kernel.org/gentoo/releases/amd64/11.2/

livedvd-amd64-multilib-11.2.iso                      06-Aug-2011 07:12  2.8G

No comments: