Changes

From Amahi Wiki
Jump to: navigation, search
== Part 2 - Making ISO images bootable ==
First, we need to create some directories to hold the PXE menu structure and the script to generate it:
{{Code|Code= cd /usr/share/amahi-netboot/tftp mkdir iso-boot mkdir iso-boot/conf mkdir iso-boot/mnt}}
Next you will need to download [[File:menu-gen.sh]] to generate the PXE boot menus. Save this script as iso-boot/menu-gen.sh and make it executable:
{{Code|Code= chmod u+x iso-boot/menu-gen.sh}}
menu-gen.sh contains a number of configuration variables at the top; you will need to edit HDA_IP to match the IP address of your HDA at the very least. The TIMEOUT variable also needs to match the automount timeout set in part one so that your machine doesn't run out of loop devices.
Now run the script to generate the menus based on the ISOs on your system and the distributions the script knows about:
{{Code|Code= iso-boot/menu-gen.sh}}
Note that the script will appear to run slowly as it waits for each ISO to time out before moving on to the next one.
The last stage in setting up the menus, we need to add an entry in pxelinux.cfg/default to link to the generated menus. Open pxelinux.cfg/default in your favourite editor and add:
{{Text|Text=<pre>
LABEL linux-boot
MENU LABEL Boot from ISO images
kernel menu.c32
append iso-boot/conf/boot.conf
}}</pre>
With the menus created, we just have two final steps to take. First, the kernel and initrd need to be available under the tftp directory structure. Fortunately, the automounter can take care of this for us; simply add the following additional to /etc/auto.master:
{{Text|
Text=/usr/share/amahi-netboot/tftp/iso-boot/mnt /media/.iso-fs.map ro,loop --timeout=5
}}
...and then restart the automounter:
{{Code|Code= service autofs restart}}
Secondly, we need to enable NFS and export the relevant directories. Assuming you have NFS installed and running, edit /etc/exports to add:
{{Text|Text= /media 192.168.147.0/24(ro,crossmnt)}}
And then issue service nfs restart to load the new export table.
12,424

edits