LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Blogs > Musings on technology, philosophy, and life in the corporate world
User Name
Password

Notices

Hi. I'm a Unix Administrator, mathematics enthusiast, and amateur philosopher. This is where I rant about that which upsets me, laugh about that which amuses me, and jabber about that which holds my interest most: Unix.
Rate this Entry

My little PXE experiment has gone mad

Posted 11-25-2012 at 06:10 AM by rocket357

Ok, so in my original PXE experiment blog post, I outlined getting everything setup and working for basic pxe boot options (isos that don't require additional work other than memdisk, menu.c32, etc...).

I've taken the liberty of sub-menuing and beautifying the configuration a bit, and I've added two of my favorite live dvds (BackTrack and Linux Mint). Here is my /tftp/pxelinux.cfg/default file now:

Code:
DEFAULT vesamenu.c32
prompt 0

MENU title PXE Boot Menu
MENU background openbsd.jpg
MENU AUTOBOOT Starting Local System in # seconds

LABEL local_disk
        MENU label ^Boot Local Hard drive
        MENU default
        LOCALBOOT -1
        timeout 200

LABEL utilities
        MENU label ^Utilities
        KERNEL vesamenu.c32
        APPEND pxelinux.cfg/utilities.menu

LABEL livecds
        MENU label ^Live CDs
        KERNEL vesamenu.c32
        APPEND pxelinux.cfg/livecds.menu

LABEL installers
        MENU label ^Install Images
        KERNEL vesamenu.c32
        APPEND pxelinux.cfg/installers.menu
openbsd.jpg is available here.

This default menu has four options: boot from local disk (default), reload a utilities menu, reload a live cds menu, and reload an installer menu. I explained the LOCALBOOT stuff in my last post, so let's look at the remaining three.

They all perform the basic function of loading the vesamenu "kernel" and feed it a configuration file that outlines what is available in that menu. Here is the fun one:

Code:
MENU title Live CDs Menu
MENU background openbsd.jpg

LABEL MainMenu
        MENU label ^Return to Main Menu
        KERNEL vesamenu.c32
        APPEND pxelinux.cfg/default

LABEL mint
        MENU label ^Linux Mint Live DVD
        KERNEL images/linuxmint-14-cinnamon-dvd-32bit/casper/vmlinuz
        APPEND root=/dev/nfs boot=casper netboot=nfs nfsroot=192.168.1.4:/tftp/images/linuxmint-14-cinnamon-dvd-32bit initrd=images/linuxmint-14-cinnamon-dvd-32bit/casper/initrd.lz quiet splash --

LABEL bt5
        MENU label ^BackTrack 5 Live DVD
        KERNEL images/BT5-KDE-32/casper/vmlinuz
        APPEND root=/dev/nfs boot=casper netboot=nfs nfsroot=192.168.1.4:/tftp/images/BT5-KDE-32 initrd=images/BT5-KDE-32/casper/initrd.gz quiet splash --
There's a bit of translation that needs to occur here (remember, my tftp server is an OpenBSD box, not a Linux machine). The "hard" part is that OpenBSD doesn't have the "loop" option for mount. Instead, you have to configure a vnd device (vnode disk driver):

vnconfig vnd0c /path/to/some/livecd.iso

This creates /dev/vnd0c, which can be used to mount the iso like a regular disk:

mount -t cd9660 /dev/vnd0c /mnt/whatever

Once that's complete, I copied the entire contents of the iso to /tftp/images/<IMAGE_NAME>/, then put the directory containing the copy in /etc/exports. Once mountd was reloaded, the directory is exported and can be mounted.

There's a bit of kernel option trickery for getting the Linux kernel to nfs mount the root directory, but if you look in the livecds.menu file above you can see how I have it configured.

The other two menu files are basically the default file from my last post split (similarly to the livecds.menu file above) into functional groups. UBCD and G4l are in utilities, and the openbsd installer images are in installers.menu (will be adding others soon once I manage to get a virtual machine system setup (openstack, anyone? ^^)).

More to come...
Posted in Uncategorized
Views 730 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 07:14 PM.

Main Menu
Advertisement

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration