-
-
Save aheadley/3837229 to your computer and use it in GitHub Desktop.
Trying out the native iPXE menu feature with Ubuntu 12.04 preseed install working (and also pxe-dispatcher menu default set)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!ipxe | |
echo | |
echo Booting UbuntuVM | |
set menu-default ubuntu | |
chain --replace --autofree default.pxe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!ipxe | |
# Setup some basic convenience variables | |
set menu-timeout 5000 | |
set base-iqn iqn.2011-02.lan.smidsrod | |
set base-iscsi iscsi:nas.smidsrod.lan::::${base-iqn} | |
# Set initiator-iqn to either hostname or mac | |
isset ${hostname} && set initiator-iqn ${base-iqn}:${hostname} || set initiator-iqn ${base-iqn}:${mac} | |
# Ensure we have menu-default set to something | |
isset ${menu-default} || set menu-default exit | |
###################### MAIN MENU #################################### | |
:start | |
menu iPXE boot menu for ${initiator-iqn} | |
item --gap -- ------------------------- Operating systems ------------------------------ | |
item --key f freedos Boot FreeDOS from iSCSI | |
item --key m msdos Boot MS-DOS from iSCSI | |
item --key u ubuntu Boot Ubuntu from iSCSI | |
item --key v vmware Boot VMware ESXi from iSCSI | |
item --key w windows7 Boot Windows 7 from iSCSI | |
item --key l live-menu Live environments... | |
item --gap -- ------------------------- Tools and utilities ---------------------------- | |
item --key p pxelinux Load PXELinux menu | |
item --key r recovery-menu Recovery tools... | |
item --key d diagnostics-menu Diagnostics tools... | |
item --key i iscsi-installer-menu iSCSI installers... | |
item --gap -- ------------------------- Advanced options ------------------------------- | |
item --key c config Configure settings | |
item shell Drop to iPXE shell | |
item reboot Reboot computer | |
item | |
item --key x exit Exit iPXE and continue BIOS boot | |
choose --timeout ${menu-timeout} --default ${menu-default} selected || goto cancel | |
set menu-timeout 0 | |
goto ${selected} | |
:cancel | |
echo You cancelled the menu, dropping you to a shell | |
:shell | |
echo Type exit to get the back to the menu | |
shell | |
set menu-timeout 0 | |
goto start | |
:failed | |
echo Booting failed, dropping to shell | |
goto shell | |
:reboot | |
reboot | |
:exit | |
exit | |
:config | |
config | |
goto start | |
############ MAIN MENU ITEMS ############ | |
:freedos | |
echo Booting FreeDOS from iSCSI for ${initiator-iqn} | |
set root-path ${base-iscsi}:${hostname}.boot.freedos | |
sanboot ${root-path} || goto failed | |
goto start | |
:msdos | |
echo Booting MS-DOS from iSCSI for ${initiator-iqn} | |
set root-path ${base-iscsi}:${hostname}.boot.msdos | |
sanboot ${root-path} || goto failed | |
goto start | |
:ubuntu | |
echo Booting Ubuntu from iSCSI for ${initiator-iqn} | |
set root-path ${base-iscsi}:${hostname}.boot.ubuntu | |
sanboot ${root-path} || goto failed | |
goto start | |
:vmware | |
echo Booting VMware ESXi from iSCSI for ${initiator-iqn} | |
set root-path ${base-iscsi}:${hostname}.boot.vmware | |
sanboot ${root-path} || goto failed | |
goto start | |
:windows7 | |
echo Booting Windows 7 from iSCSI for ${initiator-iqn} | |
set root-path ${base-iscsi}:${hostname}.boot.windows7 | |
sanboot ${root-path} || goto failed | |
goto start | |
:pxelinux | |
chain ../pxelinux.0 || goto failed | |
goto start | |
###################### RECOVERY MENU ################################ | |
:recovery-menu | |
menu Recovery tools | |
item sysrcd SystemRescueCD 2.6.0 | |
item spinrite SpinRite 6.0 | |
item spinrite-msdos SpinRite 6.0 (using MS-DOS 6.22) | |
item macrium-winpe Macrium Reflect 5.0 Rescue CD (WinPE 3.1) | |
item macrium-linux Macrium Reflect 5.0 Rescue CD (Linux) | |
item macrium-wimboot Macrium Reflect 5.0 Rescue CD (WinPE 3.1 via wimboot) | |
item | |
item --key x start Back to top menu... | |
choose selected && goto ${selected} || goto start | |
:spinrite | |
sanboot --no-describe --drive 0x00 http://boot.smidsrod.lan/spinrite-6.0/spinrite-6.0.img || goto failed | |
#sanboot --no-describe --drive 0x081 http://boot.smidsrod.lan/spinrite-6.0/spinrite-6.0.iso | |
#initrd ../spinrite/spinrite-6.0.img | |
#chain ../memdisk | |
goto start | |
:spinrite-msdos | |
sanboot --no-describe --drive 0x00 http://boot.smidsrod.lan/spinrite-6.0/spinrite-6.0-msdos.img || goto failed | |
goto start | |
:sysrcd | |
echo Booting SystemRescueCD 2.6.0 x86 for ${initiator-iqn} | |
# Fixup needed after copying files from downloaded ISO to directory: | |
# cd path/to/sysrcd-iso-unpacked-files/isolinux && \ | |
# perl -p -i -e 's{/bootdisk}{../bootdisk}' isolinux.cfg && \ | |
# perl -p -i -e 's{scandelay=1}{scandelay=1 dodhcp nfsboot=nas.smidsrod.lan:/raid/boot/sysrcd-2.6.0-x86}' isolinux.cfg && \ | |
# perl -p -i -e 's{rescuecd_us}{rescuecd_no}; s{US}{NO}; s{setkmap=us}{setkmap=no}; s{american}{norwegian};' isolinux.cfg && \ | |
# cd - | |
# PXELinux options, see http://syslinux.zytor.com/wiki/index.php/PXELINUX for details | |
set 210:string http://boot.smidsrod.lan/sysrcd-2.6.0-x86/isolinux/ | |
set 209:string isolinux.cfg | |
set filename ${210:string}pxelinux.0 | |
chain ${filename} || goto failed | |
goto start | |
:macrium-winpe | |
sanboot --no-describe http://boot.smidsrod.lan/macrium-5.0/macrium-5.0-rescue-winpe-3.1.iso || goto failed | |
goto start | |
:macrium-linux | |
sanboot --no-describe http://boot.smidsrod.lan/macrium-5.0/macrium-5.0-rescue-linux.iso || goto failed | |
goto start | |
:macrium-wimboot | |
echo Booting Macrium Reflect 5.0 (WinPE 3.1) for ${initiator-iqn} | |
set boot-url http://boot.smidsrod.lan/macrium-5.0/wimboot/ | |
kernel ../wimboot | |
initrd ${boot-url}bootmgr bootmgr | |
initrd ${boot-url}boot/bcd BCD | |
initrd ${boot-url}boot/boot.sdi boot.sdi | |
initrd ${boot-url}sources/boot.wim boot.wim | |
boot || goto failed | |
goto start | |
###################### DIAGNOSTICS MENU ############################# | |
:diagnostics-menu | |
menu Diagnostic tools | |
item hdt HDT 0.5.0 | |
item memtest Memtest86+ 4.20 | |
item memtestnbp Memtest86+ 4.20 (iPXE) | |
item breakin Breakin 3.71 | |
item dban Darik's Boot and Nuke 2.2.6 | |
item etdump Bart's etdump 1.2 | |
item wdcdiag Western Digital Diagnostics 5.04f | |
item | |
item --key x start Back to top menu... | |
choose selected && goto ${selected} || goto start | |
:hdt | |
sanboot --no-describe http://boot.smidsrod.lan/hdt-0.5.0.iso || goto failed | |
goto start | |
:memtest | |
chain http://boot.smidsrod.lan/memtest86+-4.20.elf.img - || goto failed | |
goto start | |
:memtestnbp | |
chain ../memtest.0 passes=1 && set memtest GOOD || set memtest BAD | |
set memtest_errno ${errno} | |
iseq ${memtest} GOOD && goto memtest-info || | |
iseq ${memtest_errno} 0x1 && set memtest BAD || set memtest UNKNOWN | |
:memtest-info | |
menu Your memory seems to be ${memtest} | |
item memtest-report Report memtest result to web service | |
item diagnostics-menu Back to diagnostics menu... | |
choose --default diagnostics-menu selected && goto ${selected} || goto start | |
:memtest-report | |
chain http://boot.smidsrod.lan/memtest-report.cgi?result=${memtest}&mac=${mac}&uuid=${uuid}&hostname=${hostname} || | |
goto diagnostics-menu | |
:breakin | |
# Stress-testing and diagnostics utility | |
# http://www.advancedclustering.com/software/breakin.html | |
# Set sshpasswd=yourpassword for remote access | |
# Set startup= to 'cloner' or 'rescue' for more features | |
# When startup=cloner, server= and image= can also be set | |
# http://www.advancedclustering.com/software/cloner.html | |
kernel http://boot.smidsrod.lan/breakin-3.71/kernel-3.71 | |
initrd http://boot.smidsrod.lan/breakin-3.71/initrd-3.71.cpio.lzma | |
imgargs kernel-3.71 startup=breakin | |
boot || goto failed | |
goto start | |
:dban | |
sanboot --no-describe http://boot.smidsrod.lan/dban-2.2.6-i586.iso || goto failed | |
goto start | |
:etdump | |
# Booting it with memdisk makes it read/write, while sanboot forces read/only | |
#sanboot --drive 0x00 http://boot.smidsrod.lan/freedos-etdump-floppy.img | |
initrd http://boot.smidsrod.lan/freedos-etdump-floppy.img | |
chain ../memdisk || goto failed | |
goto start | |
:wdcdiag | |
# Extracted the bootable floppy image from diag-5.04f.iso | |
sanboot --drive 0x00 http://boot.smidsrod.lan/western-digital/diag-5.04f.img || goto failed | |
goto start | |
###################### ISCSI INSTALLER MENU ######################### | |
:iscsi-installer-menu | |
menu iSCSI installers for ${initiator-iqn} | |
item freedos-install Install FreeDOS 1.1 to iSCSI | |
item msdos-install Install MS-DOS 6.22 to iSCSI | |
item ubuntu-install-amd64 Install Ubuntu 12.04 amd64 to iSCSI | |
item ubuntu-install-i386 Install Ubuntu 12.04 i386 to iSCSI | |
item windows7-install Install Windows 7 to iSCSI | |
item vmware-x64-install Install VMware ESXi 5.0 (x64) to iSCSI | |
item vmware-x86-install Install VMware ESXi 3.5 (x86) to iSCSI | |
item winpe Hook Windows 7 iSCSI and boot WinPE | |
item winpe-wimboot Boot WinPE using wimboot | |
item ubuntu-installer-amd64-remote Install Ubuntu 12.04 amd64 from public archive | |
item ubuntu-installer-i386-remote Install Ubuntu 12.04 i386 from public archive | |
item ubuntu-install-amd64-local Install Ubuntu 12.04 amd64 to local drive(s) | |
item ubuntu-install-i386-local Install Ubuntu 12.04 i386 to local drive(s) | |
item xenclient-install Install XenClient 2.1 to local drive | |
item | |
item --key x start Back to top menu... | |
choose selected && goto ${selected} || goto start | |
:freedos-install | |
echo Booting FreeDOS 1.1 installer to iSCSI for ${initiator-iqn} | |
set root-path ${base-iscsi}:${hostname}.boot.freedos | |
sanhook ${root-path} || goto failed | |
sanboot --drive 0x81 http://boot.smidsrod.lan/freedos-1.1/fd11src.iso || goto failed | |
goto start | |
:msdos-install | |
echo Booting MS-DOS 6.22 installer to iSCSI for ${initiator-iqn} | |
set root-path ${base-iscsi}:${hostname}.boot.msdos | |
sanhook ${root-path} || goto failed | |
sanboot --no-describe --drive 0x00 http://boot.smidsrod.lan/msdos-6.22/disk1.img || goto failed | |
goto start | |
:ubuntu-install-amd64 | |
echo Starting Ubuntu 12.04 amd64 installer for ${initiator-iqn} | |
# Hook iSCSI drive | |
set root-path ${base-iscsi}:${hostname}.boot.ubuntu | |
#sanhook ${root-path} || goto failed | |
# Start ubuntu-installer. Remember that the iSCSI target must be writable | |
# by anyone, as debian-installer generates a randomized initiator-iqn in | |
# /etc/iscsi/initiatorname.iscsi | |
# The preseed script used takes care of rewriting it to the | |
# hostname-based IQN used in this script. | |
# This kernel param which open-iscsi README.Debian mentions doesn't work | |
# inside debian-installer, unfortunately: iscsi_initiator=${initiator-iqn} | |
# Hard workaround available here: | |
# http://umfcloudpilot.eduserv.org.uk/entries/20299686-enable-pre-seed-or-kickstart-seeding-of-iscsi-intiator-iqn-in-ubuntu-server | |
set base-url http://boot.smidsrod.lan/ubuntu-12.04-server-amd64 | |
kernel ${base-url}/install/netboot/ubuntu-installer/amd64/linux | |
initrd ${base-url}/install/netboot/ubuntu-installer/amd64/initrd.gz | |
imgargs linux auto=true fb=false url=${base-url}/./preseed.cfg DEBCONF_DEBUG=5 netcfg/get_hostname=${hostname} partman-iscsi/login/address=10.1.1.10 partman-iscsi/login/targets=${base-iqn}:${hostname}.boot.ubuntu partman-iscsi/login/username=${username} partman-iscsi/login/password=${password} | |
boot || goto failed | |
goto start | |
:ubuntu-install-i386 | |
echo Starting Ubuntu 12.04 i386 installer for ${initiator-iqn} | |
# Hook iSCSI drive | |
set root-path ${base-iscsi}:${hostname}.boot.ubuntu | |
sanhook ${root-path} || goto failed | |
# Start ubuntu-installer. Remember that the iSCSI target must be writable | |
# by anyone, as debian-installer generates a randomized initiator-iqn in | |
# /etc/iscsi/initiatorname.iscsi | |
# The preseed script used takes care of rewriting it to the | |
# hostname-based IQN used in this script. | |
# This kernel param which open-iscsi README.Debian mentions doesn't work | |
# inside debian-installer, unfortunately: iscsi_initiator=${initiator-iqn} | |
# Hard workaround available here: | |
# http://umfcloudpilot.eduserv.org.uk/entries/20299686-enable-pre-seed-or-kickstart-seeding-of-iscsi-intiator-iqn-in-ubuntu-server | |
set base-url http://boot.smidsrod.lan/ubuntu-12.04-server-i386 | |
kernel ${base-url}/install/netboot/ubuntu-installer/i386/linux | |
initrd ${base-url}/install/netboot/ubuntu-installer/i386/initrd.gz | |
imgargs linux auto=true fb=false url=${base-url}/./preseed.cfg DEBCONF_DEBUG=5 netcfg/get_hostname=${hostname} partman-iscsi/login/address=10.1.1.10 partman-iscsi/login/targets=${base-iqn}:${hostname}.boot.ubuntu partman-iscsi/login/username=${username} partman-iscsi/login/password=${password} | |
boot || goto failed | |
goto start | |
:ubuntu-install-amd64-local | |
echo Starting Ubuntu 12.04 amd64 local installer for ${initiator-iqn} | |
set base-url http://boot.smidsrod.lan/ubuntu-12.04-server-amd64 | |
kernel ${base-url}/install/netboot/ubuntu-installer/amd64/linux | |
initrd ${base-url}/install/netboot/ubuntu-installer/amd64/initrd.gz | |
imgargs linux auto=true fb=false url=${base-url}/./preseed.cfg | |
boot || goto failed | |
goto start | |
:ubuntu-install-i386-local | |
echo Starting Ubuntu 12.04 i386 local installer for ${initiator-iqn} | |
set base-url http://boot.smidsrod.lan/ubuntu-12.04-server-i386 | |
kernel ${base-url}/install/netboot/ubuntu-installer/i386/linux | |
initrd ${base-url}/install/netboot/ubuntu-installer/i386/initrd.gz | |
imgargs linux auto=true fb=false url=${base-url}/./preseed.cfg | |
boot || goto failed | |
goto start | |
:windows7-install | |
echo Starting Windows 7 x64 installer for ${initiator-iqn} | |
# Hook iSCSI drive | |
set root-path ${base-iscsi}:${hostname}.boot.windows7 | |
sanhook ${root-path} || goto failed | |
# Start Windows 7 installer DVD | |
sanboot --no-describe --drive 0x81 http://boot.smidsrod.lan/windows-7/ultimate-x64.iso || goto failed | |
# Better solution, according to Oliver Rath on the mailing-list | |
# Requires massive amounts of RAM, though | |
#initrd http://boot.smidsrod.lan/windows-7/ultimate-x64.iso | |
#chain ../memdisk iso raw || goto failed | |
goto start | |
:vmware-x64-install | |
echo Booting VMware 64-bit installer for ${initiator-iqn} | |
set root-path ${base-iscsi}:${hostname}.boot.vmware | |
sanhook ${root-path} || goto failed | |
initrd http://boot.smidsrod.lan/vmware/vmware-esxi-5.0-x64.iso | |
chain ../memdisk iso || goto failed | |
goto start | |
:vmware-x86-install | |
echo Booting VMware 32-bit installer for ${initiator-iqn} | |
set root-path ${base-iscsi}:${hostname}.boot.vmware | |
sanhook ${root-path} || goto failed | |
initrd http://boot.smidsrod.lan/vmware/vmware-esxi-3.5-x86.iso | |
chain ../memdisk iso || goto failed | |
goto start | |
:winpe | |
echo Booting Windows PE x64 installer for ${initiator-iqn} | |
echo (for installing Windows 7) | |
set root-path ${base-iscsi}:${hostname}.boot.windows7 | |
sanhook ${root-path} || goto failed | |
# Remember to map the install volume with the following command: | |
# net use y: \\nas\wds /user:NAS\robin | |
# Use Y:\Operating Systems\Windows 7 x64\setup.exe to install | |
# Boots WinPE via native MS TFTP support | |
#chain tftp://${next-server}/%5CBoot%5CPXE%5Cpxeboot.n12 | |
# Better solution, according to Oliver Rath on the mailing-list | |
# Requires decent amounts of RAM, though | |
# Details on how to generate winpe-x64.iso from you Windows 7 install DVD | |
# can be found here: http://technet.microsoft.com/en-us/library/cc722358%28v=ws.10%29.aspx | |
initrd http://boot.smidsrod.lan/windows-7/winpe-x64.iso | |
chain ../memdisk iso raw || goto failed | |
goto start | |
:winpe-wimboot | |
echo Booting Windows PE x64 installer for ${initiator-iqn} | |
#echo (for installing Windows 7) | |
set root-path ${base-iscsi}:${hostname}.boot.windows7 | |
sanhook ${root-path} || goto failed | |
# Remember to map the install volume with the following command: | |
# net use y: \\nas\wds /user:NAS\robin | |
# Use Y:\Operating Systems\Windows 7 x64\setup.exe to install | |
# Boots WinPE via iPXE wimboot binary | |
# BCD is from http://www.fensystems.co.uk/~mcb30/BCD | |
# wimboot prebuilt from http://www.fensystems.co.uk/~mcb30/wimboot | |
# source at http://git.ipxe.org/wimboot.git | |
# bootmgr.exe from the same package that enables PXE booting for Windows | |
# (most likely WDS tools) | |
set boot-url http://boot.smidsrod.lan/winpe | |
cpuid --ext 29 && set arch amd64 || set arch x86 | |
kernel ../wimboot | |
initrd ${boot-url}/${arch}/media/bootmgr bootmgr | |
initrd ${boot-url}/${arch}/media/Boot/BCD BCD | |
initrd ${boot-url}/${arch}/media/Boot/Fonts/segmono_boot.ttf segmono_boot.ttf | |
initrd ${boot-url}/${arch}/media/Boot/Fonts/segoe_slboot.ttf segoe_slboot.ttf | |
initrd ${boot-url}/${arch}/media/Boot/Fonts/wgl4_boot.ttf wgl4_boot.ttf | |
initrd ${boot-url}/${arch}/media/Boot/boot.sdi boot.sdi | |
initrd ${boot-url}/${arch}/media/sources/boot.wim boot.wim | |
boot || goto failed | |
goto start | |
:ubuntu-installer-amd64-remote | |
echo Starting Ubuntu 12.04 amd64 installer for ${initiator-iqn} | |
set base-url http://no.archive.ubuntu.com/ubuntu/dists/precise/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64 | |
kernel ${base-url}/linux | |
initrd ${base-url}/initrd.gz | |
#imgargs linux auto=true url=http://yourserver/some/path/preseed.cfg | |
boot || goto failed | |
goto start | |
:ubuntu-installer-i386-remote | |
echo Starting Ubuntu 12.04 i386 installer for ${initiator-iqn} | |
set base-url http://no.archive.ubuntu.com/ubuntu/dists/precise/main/installer-i386/current/images/netboot/ubuntu-installer/i386 | |
kernel ${base-url}/linux | |
initrd ${base-url}/initrd.gz | |
#imgargs linux auto=true url=http://yourserver/some/path/preseed.cfg | |
boot || goto failed | |
goto start | |
:xenclient-install | |
echo Booting XenClient 2.1 installer for ${initiator-iqn} | |
# XenClient doesn't seem to support installing to iSCSI volumes | |
# It only supports installing using iBFT | |
#set root-path ${base-iscsi}:${hostname}.boot.xenclient | |
#sanhook ${root-path} || goto failed | |
# The xenclient-2.1 folder is just the unpacked contents of the installer ISO | |
# Make sure you modify the isolinux.cfg and point it at your answer file URL | |
# You can find an example of the answer file in the "Setup and Usage Guide" | |
set 210:string http://boot.smidsrod.lan/xenclient-2.1/isolinux/ | |
set 209:string isolinux.cfg | |
set filename ${210:string}pxelinux.0 | |
chain ${filename} || goto failed | |
goto start | |
###################### LIVE ENVIRONMENT MENU ######################## | |
:live-menu | |
menu Live environments for ${initiator-iqn} | |
item ubuntu-live-1204-amd64 Boot Ubuntu LiveCD 12.04 amd64 | |
item ubuntu-live-1204-i386 Boot Ubuntu LiveCD 12.04 i386 | |
item mythbuntu-live-1204-amd64 Boot Mythbuntu LiveCD 12.04 amd64 | |
item mythbuntu-live-1204-i386 Boot Mythbuntu LiveCD 12.04 i386 | |
item smartos Boot SmartOS | |
item smartos-pre-ept Boot SmartOS (pre-ept) | |
item kms-test Boot KMS test kernel | |
item | |
item --key x start Back to top menu... | |
choose selected && goto ${selected} || goto start | |
:ubuntu-live-1204-amd64 | |
# See http://manpages.ubuntu.com/manpages/oneiric/man7/casper.7.html for casper cmdline details | |
echo Booting Ubuntu Live 12.04 amd64 for ${initiator-iqn} | |
set base-url http://boot.smidsrod.lan/ubuntu-12.04-dvd-amd64 | |
kernel ${base-url}/casper/vmlinuz | |
initrd ${base-url}/casper/initrd.lz | |
imgargs vmlinuz root=/dev/nfs boot=casper netboot=nfs nfsroot=10.1.1.10:/raid/boot/ubuntu-12.04-dvd-amd64 locale=en_US.UTF-8 keyboard-configuration/layoutcode=no mirror/country=NO | |
boot || goto failed | |
goto start | |
:ubuntu-live-1204-i386 | |
# See http://manpages.ubuntu.com/manpages/oneiric/man7/casper.7.html for casper cmdline details | |
echo Booting Ubuntu Live 12.04 i386 for ${initiator-iqn} | |
set base-url http://boot.smidsrod.lan/ubuntu-12.04-dvd-i386 | |
kernel ${base-url}/casper/vmlinuz | |
initrd ${base-url}/casper/initrd.lz | |
imgargs vmlinuz root=/dev/nfs boot=casper netboot=nfs nfsroot=10.1.1.10:/raid/boot/ubuntu-12.04-dvd-i386 locale=en_US.UTF-8 keyboard-configuration/layoutcode=no mirror/country=NO | |
boot || goto failed | |
goto start | |
:mythbuntu-live-1204-amd64 | |
# See http://manpages.ubuntu.com/manpages/oneiric/man7/casper.7.html for casper cmdline details | |
echo Booting Mythbuntu Live 12.04 x64 for ${initiator-iqn} | |
set base-url http://boot.smidsrod.lan/mythbuntu-12.04-desktop-amd64 | |
kernel ${base-url}/casper/vmlinuz | |
initrd ${base-url}/casper/initrd.lz | |
imgargs vmlinuz root=/dev/nfs boot=casper netboot=nfs nfsroot=10.1.1.10:/raid/boot/mythbuntu-12.04-desktop-amd64 locale=en_US console-setup/layoutcode=no | |
boot || goto failed | |
goto start | |
:mythbuntu-live-1204-i386 | |
# See http://manpages.ubuntu.com/manpages/oneiric/man7/casper.7.html for casper cmdline details | |
echo Booting Mythbuntu Live 12.04 x86 for ${initiator-iqn} | |
set base-url http://boot.smidsrod.lan/mythbuntu-12.04-desktop-i386 | |
kernel ${base-url}/casper/vmlinuz | |
initrd ${base-url}/casper/initrd.lz | |
imgargs vmlinuz root=/dev/nfs boot=casper netboot=nfs nfsroot=10.1.1.10:/raid/boot/mythbuntu-12.04-desktop-i386 locale=en_US console-setup/layoutcode=no | |
boot || goto failed | |
goto start | |
:smartos | |
chain smartos.pxe || goto failed | |
goto start | |
:smartos-pre-ept | |
chain smartos-pre-ept.pxe || goto failed | |
goto start | |
:kms-test | |
chain kms-test.pxe || goto failed | |
goto start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Disable framebuffer, it's usually slower, especially on VMs | |
d-i debian-installer/framebuffer boolean false | |
# Locale, language and country | |
d-i debconf/language string en_US:en | |
d-i debian-installer/country string NO | |
d-i debian-installer/language string en_US:en | |
d-i debian-installer/locale string en_US.UTF-8 | |
d-i localechooser/preferred-locale string en_US.UTF-8 | |
d-i localechooser/supported-locales en_US.UTF-8, nb_NO.UTF-8 | |
# Keyboard selection | |
d-i keyboard-configuration/layoutcode string no | |
d-i keyboard-configuration/variantcode string | |
# Controls whether or not the hardware clock is set to UTC | |
d-i clock-setup/utc boolean true | |
# You may set this to any valid setting for $TZ; see the contents of | |
# /usr/share/zoneinfo/ for valid values | |
d-i time/zone string Europe/Oslo | |
# Controls whether to use NTP to set the clock during the install | |
d-i clock-setup/ntp boolean true | |
# Skip creation of a root account (normal user account will be able to | |
# use sudo). The default is false; preseed this to true if you want to set | |
# a root password. | |
d-i passwd/root-login boolean true | |
# Root password, either in clear text | |
#d-i passwd/root-password password r00tme | |
#d-i passwd/root-password-again password r00tme | |
# or encrypted using an MD5 hash. | |
d-i passwd/root-password-crypted password $1$92PDztZI$asdkfljhasdf2UR8il9Lz0 | |
# To create a normal user account. | |
d-i passwd/user-fullname string Robin Smidsrød | |
d-i passwd/username string robin | |
# Normal user's password, either in clear text | |
#d-i passwd/user-password password insecure | |
#d-i passwd/user-password-again password insecure | |
# or encrypted using an MD5 hash. | |
d-i passwd/user-password-crypted password $1$92PDztZI$OnXkjhasdfuweu2UR8il9Lz0 | |
# Do not encrypt home directory | |
d-i user-setup/encrypt-home boolean false | |
# If you select ftp, the mirror/country string does not need to be set | |
# Location: http://boot.smidsrod.lan/ubuntu-12.04-server-amd64/ | |
d-i mirror/protocol string http | |
d-i mirror/country string manual | |
d-i mirror/http/hostname string boot.smidsrod.lan | |
d-i mirror/http/directory string /ubuntu-12.04-server-amd64 | |
d-i mirror/http/proxy string | |
# Suite to install | |
d-i mirror/suite string precise | |
# Suite to use for loading installer components (optional) | |
d-i mirror/udeb/suite string precise | |
# Components to use for loading installer components (optional) | |
d-i mirror/udeb/components multiselect main, restricted | |
# The kernel image (meta) package to be installed; "none" can be used if no | |
# kernel is to be installed. | |
d-i base-installer/kernel/image string linux-generic | |
# Disk setup (partman) | |
# Suppress question if it is okay to not have swap | |
# We don't use disk for swap on iSCSI, we have enough memory | |
d-i partman-basicfilesystems/no_swap boolean false | |
# Package selection | |
tasksel tasksel/first multiselect openssh-server | |
# Individual additional packages to install | |
d-i pkgsel/include string build-essential ntp | |
# Whether to upgrade packages after debootstrap. | |
# Allowed values: none, safe-upgrade, full-upgrade | |
d-i pkgsel/upgrade string full-upgrade | |
# Policy for applying updates. May be "none" (no automatic updates), | |
# "unattended-upgrades" (install security updates automatically), or | |
# "landscape" (manage system with Landscape). | |
d-i pkgsel/update-policy string unattended-upgrades | |
# Install language packs for apps | |
d-i pkgsel/install-language-support boolean true | |
# By default, the system's locate database will be updated after the | |
# installer has finished installing most packages. This may take a while, so | |
# if you don't want it, you can set this to "false" to turn it off. | |
d-i pkgsel/updatedb boolean true | |
# Some versions of the installer can report back on what software you have | |
# installed, and what software you use. The default is not to report back, | |
# but sending reports helps the project determine what software is most | |
# popular and include it on CDs. | |
popularity-contest popularity-contest/participate boolean true | |
# This is fairly safe to set, it makes grub install automatically to the MBR | |
# if no other operating system is detected on the machine. | |
d-i grub-installer/only_debian boolean true | |
# This one makes grub-installer NOT install to the MBR if it also finds some other | |
# OS, which is less safe as it might not be able to boot that other OS. | |
d-i grub-installer/with_other_os boolean false | |
# This will prevent the installer from ejecting the CD during the reboot, | |
# which is useful in some situations. | |
d-i cdrom-detect/eject boolean false | |
# This command is run just before the install finishes, but when there is | |
# still a usable /target directory. You can chroot to /target and use it | |
# directly, or use the apt-install and in-target commands to easily install | |
# packages and run commands in the target system. | |
# Fix broken resolvconf setup | |
# Change apt to use public mirror and refresh apt database | |
# Set proper initator IQN and remove quiet flag in grub | |
# Update grub | |
d-i preseed/late_command string \ | |
in-target mv /etc/resolvconf/resolv.conf.d/original /etc/resolvconf/resolv.conf.d/tail; \ | |
in-target sed -i -e 's/http:\/\/boot.smidsrod.lan\/ubuntu-12.04-server-amd64/http:\/\/no.archive.ubuntu.com\/ubuntu/' /etc/apt/sources.list; \ | |
in-target apt-get -qq update; \ | |
apt-install joe; \ | |
in-target sed -i -e 's/GRUB_CMDLINE_LINUX_DEFAULT=\"quiet\"/GRUB_CMDLINE_LINUX_DEFAULT=\"\"/' /etc/default/grub; \ | |
in-target sed -i -e 's/GRUB_CMDLINE_LINUX=\"\"/GRUB_CMDLINE_LINUX=\"iscsi_initiator=iqn.2011-02.lan.smidsrod:$(hostname)\"/' /etc/default/grub; \ | |
in-target update-grub; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment