Advertisement
Guest User

Untitled

a guest
Feb 18th, 2016
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.28 KB | None | 0 0
  1. #!ipxe
  2.  
  3. # Variables are specified in boot.ipxe.cfg
  4.  
  5. # Some menu defaults
  6. set menu-timeout 5000
  7. set submenu-timeout ${menu-timeout}
  8. isset ${menu-default} || set menu-default exit
  9.  
  10. # Figure out if client is 64-bit capable
  11. cpuid --ext 29 && set arch x64 || set arch x86
  12. cpuid --ext 29 && set archl amd64 || set archl i386
  13.  
  14. ###################### MAIN MENU ####################################
  15.  
  16. :start
  17. menu iPXE boot menu for ${initiator-iqn}
  18. item --gap -- ------------------------- Operating systems ------------------------------
  19. item --key f freedos Boot FreeDOS from iSCSI
  20. item --key m msdos Boot MS-DOS from iSCSI
  21. item --key u ubuntu Boot Ubuntu from iSCSI
  22. item --key v vmware Boot VMware ESXi from iSCSI
  23. item --key w windows7 Boot Windows 7 from iSCSI
  24. item --key l menu-live Live environments...
  25. item --gap -- ------------------------- Tools and utilities ----------------------------
  26. item --key p pxelinux Load PXELinux menu
  27. item --key r menu-recovery Recovery tools...
  28. item --key d menu-diag Diagnostics tools...
  29. item --key i menu-install Installers...
  30. item --gap -- ------------------------- Advanced options -------------------------------
  31. item --key c config Configure settings
  32. item shell Drop to iPXE shell
  33. item reboot Reboot computer
  34. item
  35. item --key x exit Exit iPXE and continue BIOS boot
  36. choose --timeout ${menu-timeout} --default ${menu-default} selected || goto cancel
  37. set menu-timeout 0
  38. goto ${selected}
  39.  
  40. :cancel
  41. echo You cancelled the menu, dropping you to a shell
  42.  
  43. :shell
  44. echo Type 'exit' to get the back to the menu
  45. shell
  46. set menu-timeout 0
  47. set submenu-timeout 0
  48. goto start
  49.  
  50. :failed
  51. echo Booting failed, dropping to shell
  52. goto shell
  53.  
  54. :reboot
  55. reboot
  56.  
  57. :exit
  58. exit
  59.  
  60. :config
  61. config
  62. goto start
  63.  
  64. :back
  65. set submenu-timeout 0
  66. clear submenu-default
  67. goto start
  68.  
  69. ############ MAIN MENU ITEMS ############
  70.  
  71. :freedos
  72. echo Booting FreeDOS from iSCSI for ${initiator-iqn}
  73. set root-path ${base-iscsi}:${hostname}.boot.freedos
  74. sanboot ${root-path} || goto failed
  75. goto start
  76.  
  77. :msdos
  78. echo Booting MS-DOS from iSCSI for ${initiator-iqn}
  79. set root-path ${base-iscsi}:${hostname}.boot.msdos
  80. sanboot ${root-path} || goto failed
  81. goto start
  82.  
  83. :ubuntu
  84. echo Booting Ubuntu from iSCSI for ${initiator-iqn}
  85. set root-path ${base-iscsi}:${hostname}.boot.ubuntu
  86. sanboot ${root-path} || goto failed
  87. goto start
  88.  
  89. :vmware
  90. echo Booting VMware ESXi from iSCSI for ${initiator-iqn}
  91. set root-path ${base-iscsi}:${hostname}.boot.vmware
  92. sanboot ${root-path} || goto failed
  93. goto start
  94.  
  95. :windows7
  96. echo Booting Windows 7 from iSCSI for ${initiator-iqn}
  97. # Force gateway to be the iSCSI target server (kludge for stupid window behavior)
  98. set netX/gateway ${iscsi-server}
  99. set root-path ${base-iscsi}:${hostname}.boot.windows7
  100. sanboot ${root-path} || goto failed
  101. goto start
  102.  
  103. :pxelinux
  104. set 210:string tftp://${next-server}/
  105. chain ${210:string}pxelinux.0 || goto failed
  106. goto start
  107.  
  108. ###################### RECOVERY MENU ################################
  109.  
  110. :menu-recovery
  111. menu Recovery tools
  112. item sysrcd SystemRescueCD ${sysrcd-version}
  113. item spinrite SpinRite ${spinrite-version}
  114. item spinrite-msdos SpinRite ${spinrite-version} (using MS-DOS 6.22)
  115. item macrium-winpe Macrium Reflect ${macrium-version} Rescue CD (WinPE 4.0 ${arch})
  116. item macrium-winpe-sanboot Macrium Reflect ${macrium-version} Rescue CD (WinPE 4.0 ${arch} with sanboot)
  117. item macrium-linux Macrium Reflect ${macrium-version} Rescue CD (Linux ${arch})
  118. item macrium-linux-sanboot Macrium Reflect ${macrium-version} Rescue CD (Linux ${arch} with sanboot)
  119. item firefly Firefly IllumOS recovery environment ${firefly-version}
  120. item freedos-direct FreeDOS 1.1 (directly using iPXE)
  121. item
  122. item --key 0x08 back Back to top menu...
  123. iseq ${menu-default} menu-recovery && isset ${submenu-default} && goto menu-recovery-timed ||
  124. choose selected && goto ${selected} || goto start
  125. :menu-recovery-timed
  126. choose --timeout ${submenu-timeout} --default ${submenu-default} selected && goto ${selected} || goto start
  127.  
  128. :spinrite
  129. sanboot --no-describe --drive 0x00 ${sanboot-url}spinrite-${spinrite-version}/spinrite-${spinrite-version}.img || goto failed
  130. #sanboot --no-describe --drive 0x081 ${sanboot-url}spinrite-${spinrite-version}/spinrite-${spinrite-version}.iso
  131. #initrd spinrite/spinrite-${spinrite-version}.img
  132. #chain memdisk
  133. goto start
  134.  
  135. :spinrite-msdos
  136. sanboot --no-describe --drive 0x00 ${sanboot-url}spinrite-${spinrite-version}/spinrite-${spinrite-version}-msdos.img || goto failed
  137. goto start
  138.  
  139. :sysrcd
  140. echo Booting SystemRescueCD ${sysrcd-version} x86 for ${initiator-iqn}
  141. # Fixup needed after copying files from downloaded ISO to directory:
  142. # cd path/to/sysrcd-iso-unpacked-files/isolinux && \
  143. # perl -p -i -e 's{/bootdisk}{../bootdisk}' isolinux.cfg && \
  144. # perl -p -i -e 's{scandelay=1}{scandelay=1 dodhcp netboot=nfs://nas.smidsrod.lan:/raid/boot/sysrcd-3.8.0-x86}g' isolinux.cfg && \
  145. # perl -p -i -e 's{setkmap=us}{setkmap=us dodhcp netboot=nfs://nas.smidsrod.lan:/raid/boot/sysrcd-3.8.0-x86}g' isolinux.cfg && \
  146. # perl -p -i -e 's{rescuecd_us}{rescuecd_no}; s{US}{NO}; s{setkmap=us}{setkmap=no}g; s{american}{norwegian};' isolinux.cfg && \
  147. # cd -
  148. # PXELinux options, see http://syslinux.zytor.com/wiki/index.php/PXELINUX for details
  149. set 210:string ${boot-url}sysrcd-${sysrcd-version}-x86/isolinux/
  150. set 209:string isolinux.cfg
  151. set filename ${210:string}pxelinux.0
  152. chain ${filename} || goto failed
  153. goto start
  154.  
  155. :macrium-winpe
  156. echo Booting Macrium Reflect ${macrium-version} (WinPE 4.0 ${arch}) for ${initiator-iqn}
  157. set base-url macrium-${macrium-version}/macrium-${macrium-version}-rescue-winpe-4.0-${arch}
  158. kernel wimboot
  159. initrd ${base-url}/bootmgr bootmgr
  160. initrd ${base-url}/Boot/BCD BCD
  161. initrd ${base-url}/Boot/boot.sdi boot.sdi
  162. initrd ${base-url}/sources/boot.wim boot.wim
  163. boot || goto failed
  164. goto start
  165.  
  166. :macrium-linux
  167. echo Booting Macrium Reflect ${macrium-version} (Linux ${arch}) for ${initiator-iqn}
  168. set base-url macrium-${macrium-version}/macrium-${macrium-version}-rescue-linux
  169. kernel ${base-url}/vmlinuz
  170. initrd ${base-url}/initramfs.xz
  171. imgargs vmlinuz vga=0x317
  172. boot || goto failed
  173. goto start
  174.  
  175. :macrium-winpe-sanboot
  176. sanboot --no-describe ${sanboot-url}macrium-${macrium-version}/macrium-${macrium-version}-rescue-winpe-4.0-${arch}.iso || goto failed
  177. goto start
  178.  
  179. :macrium-linux-sanboot
  180. sanboot --no-describe ${sanboot-url}macrium-${macrium-version}/macrium-${macrium-version}-rescue-linux.iso || goto failed
  181. goto start
  182.  
  183. :firefly
  184. echo Booting Firefly ${firefly-version} for ${initiator-iqn}
  185. set base-url firefly-${firefly-version}/boot
  186. # http://alexeremin.blogspot.no/2013/05/firefly-failsafe-image-for-illumos.html
  187. # http://sourceforge.net/projects/fireflyfailsafe/files/
  188. # Download ISO, unpack ISO and copy files to boot-url
  189. # The ramdisk is compressed with gzip, which must be unpacked
  190. # to work with iPXE
  191. # mv firefly firefly.gz
  192. # gunzip firefly.gz
  193. kernel ${base-url}/platform/i86pc/kernel/amd64/unix
  194. module ${base-url}/firefly
  195. boot || goto failed
  196. goto start
  197.  
  198. :freedos-direct
  199. echo Booting FreeDOS 1.1 KERNEL.SYS for ${initiator-iqn}
  200. set base-url freedos-1.1/fd11src/FREEDOS/SETUP/ODIN
  201. # TODO: Work-in-progress
  202. kernel ${base-url}/KERNEL.SYS
  203. boot || goto failed
  204. goto start
  205.  
  206. ###################### DIAGNOSTICS MENU #############################
  207.  
  208. :menu-diag
  209. menu Diagnostic tools
  210. item hdt HDT ${hdt-version}
  211. item memtest Memtest86+ 4.20
  212. item memtest-ipxe Memtest86+ 4.20 (iPXE)
  213. item breakin Breakin 3.71
  214. item dban Darik's Boot and Nuke 2.2.7
  215. item etdump Bart's etdump 1.2
  216. item wdcdiag Western Digital Diagnostics 5.04f
  217. item
  218. item --key 0x08 back Back to top menu...
  219. iseq ${menu-default} menu-diag && isset ${submenu-default} && goto menu-diag-timed ||
  220. choose selected && goto ${selected} || goto start
  221. :menu-diag-timed
  222. choose --timeout ${submenu-timeout} --default ${submenu-default} selected && goto ${selected} || goto start
  223.  
  224. :hdt
  225. # http://hdt-project.org/
  226. sanboot --no-describe --drive 0x00 ${sanboot-url}hdt-${hdt-version}.img || goto failed
  227. goto start
  228.  
  229. :memtest
  230. # TODO: Fix the URI parser to make the + sign work
  231. #chain memtest86+-4.20.elf.img - || goto failed
  232. chain memtest86plus-4.20.elf.img - || goto failed
  233. goto start
  234.  
  235. :memtest-ipxe
  236. chain memtest.0 passes=1 && set memtest GOOD || set memtest BAD
  237. set memtest_errno:uint8 ${errno}
  238. iseq ${memtest} GOOD && goto memtest-info ||
  239. iseq ${memtest_errno} 0x1 && set memtest BAD || set memtest UNKNOWN
  240. :memtest-info
  241. menu Your memory seems to be ${memtest}
  242. item memtest-report Report memtest result to web service
  243. item --key 0x08 menu-diag Back to diagnostics menu...
  244. choose --default menu-diag selected && goto ${selected} || goto start
  245.  
  246. :memtest-report
  247. chain ${memtest-report-url}?result=${memtest}&mac=${mac}&uuid=${uuid}&hostname=${hostname} ||
  248. goto menu-diag
  249.  
  250. :breakin
  251. # Stress-testing and diagnostics utility
  252. # http://www.advancedclustering.com/software/breakin.html
  253. # Set sshpasswd=yourpassword for remote access
  254. # Set startup= to 'cloner' or 'rescue' for more features
  255. # When startup=cloner, server= and image= can also be set
  256. # http://www.advancedclustering.com/software/cloner.html
  257. kernel breakin-3.71/kernel-3.71
  258. initrd breakin-3.71/initrd-3.71.cpio.lzma
  259. imgargs kernel-3.71 startup=breakin
  260. boot || goto failed
  261. goto start
  262.  
  263. :dban
  264. kernel dban-2.2.7/DBAN.BZI
  265. imgargs DBAN.BZI nuke="dwipe --method gutmann --rounds 2 --verify last" silent vga=785
  266. boot || goto failed
  267. goto start
  268.  
  269. :etdump
  270. # Booting it with memdisk makes it read/write, while sanboot forces read/only
  271. #sanboot --drive 0x00 ${sanboot-url}freedos-etdump-floppy.img
  272. initrd freedos-etdump-floppy.img
  273. chain memdisk || goto failed
  274. goto start
  275.  
  276. :wdcdiag
  277. # Extracted the bootable floppy image from diag-5.04f.iso
  278. sanboot --drive 0x00 ${sanboot-url}western-digital/diag-5.04f.img || goto failed
  279. goto start
  280.  
  281. ############################ INSTALLER MENU #########################
  282.  
  283. :menu-install
  284. menu Installers for ${initiator-iqn}
  285. item freedos-install Install FreeDOS 1.1 to iSCSI
  286. item msdos-install Install MS-DOS 6.22 to iSCSI
  287. item ubuntu-install Install Ubuntu 12.04 ${archl} to iSCSI
  288. item windows7-install Install Windows 7 to iSCSI
  289. item vmware-x64-install Install VMware ESXi 5.0 (x64) to iSCSI
  290. item vmware-x86-install Install VMware ESXi 3.5 (x86) to iSCSI
  291. item winpe Hook Windows 7 iSCSI and boot WinPE
  292. item winpe-wimboot Boot WinPE ${arch} using wimboot
  293. item ubuntu-installer-remote Install Ubuntu 12.04 ${archl} from public archive
  294. item ubuntu-install-local Install Ubuntu 12.04 ${archl} to local drive(s)
  295. item xenclient-install Install XenClient 2.1 to local drive
  296. item windows7-hookonly Hook Windows 7 iSCSI and boot local CD
  297. item
  298. item --key 0x08 back Back to top menu...
  299. iseq ${menu-default} menu-install && isset ${submenu-default} && goto menu-install-timed ||
  300. choose selected && goto ${selected} || goto start
  301. :menu-install-timed
  302. choose --timeout ${submenu-timeout} --default ${submenu-default} selected && goto ${selected} || goto start
  303.  
  304. :freedos-install
  305. echo Booting FreeDOS 1.1 installer to iSCSI for ${initiator-iqn}
  306. set root-path ${base-iscsi}:${hostname}.boot.freedos
  307. sanhook ${root-path} || goto failed
  308. sanboot --drive 0x81 ${sanboot-url}freedos-1.1/fd11src.iso || goto failed
  309. goto start
  310.  
  311. :msdos-install
  312. echo Booting MS-DOS 6.22 installer to iSCSI for ${initiator-iqn}
  313. set root-path ${base-iscsi}:${hostname}.boot.msdos
  314. sanhook ${root-path} || goto failed
  315. sanboot --no-describe --drive 0x00 ${sanboot-url}msdos-6.22/disk1.img || goto failed
  316. goto start
  317.  
  318. :ubuntu-install
  319. echo Starting Ubuntu 12.04 ${archl} installer for ${initiator-iqn}
  320. # Hook iSCSI drive
  321. set root-path ${base-iscsi}:${hostname}.boot.ubuntu
  322. #sanhook ${root-path} || goto failed
  323. # Start ubuntu-installer. Remember that the iSCSI target must be writable
  324. # by anyone, as debian-installer generates a randomized initiator-iqn in
  325. # /etc/iscsi/initiatorname.iscsi
  326. # The preseed script used takes care of rewriting it to the
  327. # hostname-based IQN used in this script.
  328. # This kernel param which open-iscsi README.Debian mentions doesn't work
  329. # inside debian-installer, unfortunately: iscsi_initiator=${initiator-iqn}
  330. # Hard workaround available here:
  331. # http://umfcloudpilot.eduserv.org.uk/entries/20299686-enable-pre-seed-or-kickstart-seeding-of-iscsi-intiator-iqn-in-ubuntu-server
  332. set base-url ${boot-url}ubuntu-12.04-server-${archl}
  333. kernel ${base-url}/install/netboot/ubuntu-installer/${archl}/linux
  334. initrd ${base-url}/install/netboot/ubuntu-installer/${archl}/initrd.gz
  335. imgargs linux auto=true fb=false url=${base-url}/./preseed.cfg DEBCONF_DEBUG=5 netcfg/get_hostname=${hostname} partman-iscsi/login/address=${iscsi-server} partman-iscsi/login/targets=${base-iqn}:${hostname}.boot.ubuntu partman-iscsi/login/username=${username} partman-iscsi/login/password=${password}
  336. boot || goto failed
  337. goto start
  338.  
  339. :ubuntu-install-local
  340. echo Starting Ubuntu 12.04 ${archl} local installer for ${initiator-iqn}
  341. set base-url ${boot-url}ubuntu-12.04-server-${archl}
  342. kernel ${base-url}/install/netboot/ubuntu-installer/${archl}/linux
  343. initrd ${base-url}/install/netboot/ubuntu-installer/${archl}/initrd.gz
  344. imgargs linux auto=true fb=false url=${base-url}/./preseed.cfg
  345. boot || goto failed
  346. goto start
  347.  
  348. :windows7-install
  349. echo Starting Windows 7 ${arch} installer for ${initiator-iqn}
  350. # Force gateway to be the iSCSI target server (kludge for stupid window behavior)
  351. set netX/gateway ${iscsi-server}
  352. # Hook iSCSI drive
  353. set root-path ${base-iscsi}:${hostname}.boot.windows7
  354. sanhook ${root-path} || goto failed
  355. # Start Windows 7 installer DVD
  356. #sanboot --no-describe --drive 0x81 ${sanboot-url}windows-7/ultimate-${arch}-en.iso || goto failed
  357. # Better solution, according to Oliver Rath on the mailing-list
  358. # Requires massive amounts of RAM, though
  359. #initrd windows-7/ultimate-${arch}-en.iso
  360. #chain memdisk iso raw || goto failed
  361. # This method uses wimboot
  362. set base-url windows-7/ultimate-${arch}-en
  363. kernel wimboot
  364. initrd ${base-url}/bootmgr bootmgr
  365. initrd ${base-url}/boot/bcd BCD
  366. initrd ${base-url}/boot/fonts/wgl4_boot.ttf wgl4_boot.ttf
  367. initrd ${base-url}/boot/boot.sdi boot.sdi
  368. initrd ${base-url}/sources/boot.wim boot.wim
  369. boot || goto failed
  370. goto start
  371.  
  372. :vmware-x64-install
  373. echo Booting VMware 64-bit installer for ${initiator-iqn}
  374. set root-path ${base-iscsi}:${hostname}.boot.vmware
  375. sanhook ${root-path} || goto failed
  376. initrd vmware/vmware-esxi-5.0-x64.iso
  377. chain memdisk iso || goto failed
  378. goto start
  379.  
  380. :vmware-x86-install
  381. echo Booting VMware 32-bit installer for ${initiator-iqn}
  382. set root-path ${base-iscsi}:${hostname}.boot.vmware
  383. sanhook ${root-path} || goto failed
  384. initrd vmware/vmware-esxi-3.5-x86.iso
  385. chain memdisk iso || goto failed
  386. goto start
  387.  
  388. :winpe
  389. echo Booting Windows PE ${arch} installer for ${initiator-iqn}
  390. echo (for installing Windows 7)
  391. # Force gateway to be the iSCSI target server (kludge for stupid window behavior)
  392. set netX/gateway ${iscsi-server}
  393.  
  394. set root-path ${base-iscsi}:${hostname}.boot.windows7
  395. sanhook ${root-path} || goto failed
  396.  
  397. # Remember to map the install volume with the following command:
  398. # net use y: \\nas\wds /user:NAS\robin
  399. # Use Y:\Operating Systems\Windows 7 x64\setup.exe to install
  400.  
  401. # Boots WinPE via native MS TFTP support
  402. #chain tftp://${next-server}/%5CBoot%5CPXE%5Cpxeboot.n12
  403. # Better solution, according to Oliver Rath on the mailing-list
  404. # Requires decent amounts of RAM, though
  405. # Details on how to generate winpe-x64.iso from you Windows 7 install DVD
  406. # can be found here: http://technet.microsoft.com/en-us/library/cc722358%28v=ws.10%29.aspx
  407. initrd windows-7/winpe-${arch}.iso
  408. chain memdisk iso raw || goto failed
  409. goto start
  410.  
  411. :winpe-wimboot
  412. echo Booting Windows PE ${arch} installer for ${initiator-iqn}
  413. #echo (for installing Windows 7)
  414.  
  415. # Force gateway to be the iSCSI target server (kludge for stupid window behavior)
  416. set netX/gateway ${iscsi-server}
  417.  
  418. set root-path ${base-iscsi}:${hostname}.boot.windows7
  419. sanhook ${root-path} || goto failed
  420.  
  421. # Remember to map the install volume with the following command:
  422. # net use y: \\nas\wds /user:NAS\robin
  423. # Use Y:\Operating Systems\Windows 7 x64\setup.exe to install
  424.  
  425. # Boots WinPE via iPXE wimboot binary
  426. # BCD is from http://www.fensystems.co.uk/~mcb30/BCD
  427. # wimboot prebuilt from http://www.fensystems.co.uk/~mcb30/wimboot
  428. # source at http://git.ipxe.org/wimboot.git
  429. # bootmgr.exe from the same package that enables PXE booting for Windows
  430. # (most likely WDS tools)
  431. set base-url winpe/${arch}
  432. kernel wimboot
  433. initrd ${base-url}/media/bootmgr bootmgr
  434. initrd ${base-url}/media/Boot/BCD BCD
  435. initrd ${base-url}/media/Boot/Fonts/segmono_boot.ttf segmono_boot.ttf
  436. initrd ${base-url}/media/Boot/Fonts/segoe_slboot.ttf segoe_slboot.ttf
  437. initrd ${base-url}/media/Boot/Fonts/wgl4_boot.ttf wgl4_boot.ttf
  438. initrd ${base-url}/media/Boot/boot.sdi boot.sdi
  439. initrd ${base-url}/media/sources/boot.wim boot.wim
  440. boot || goto failed
  441. goto start
  442.  
  443. :ubuntu-installer-remote
  444. echo Starting Ubuntu 12.04 ${archl} installer for ${initiator-iqn}
  445. set base-url http://no.archive.ubuntu.com/ubuntu/dists/precise/main/installer-${archl}/current/images/netboot/ubuntu-installer/${archl}
  446. kernel ${base-url}/linux
  447. initrd ${base-url}/initrd.gz
  448. #imgargs linux auto=true url=http://yourserver/some/path/preseed.cfg
  449. boot || goto failed
  450. goto start
  451.  
  452. :xenclient-install
  453. echo Booting XenClient 2.1 installer for ${initiator-iqn}
  454. # XenClient doesn't seem to support installing to iSCSI volumes
  455. # It only supports installing using iBFT
  456. #set root-path ${base-iscsi}:${hostname}.boot.xenclient
  457. #sanhook ${root-path} || goto failed
  458. # The xenclient-2.1 folder is just the unpacked contents of the installer ISO
  459. # Make sure you modify the isolinux.cfg and point it at your answer file URL
  460. # You can find an example of the answer file in the "Setup and Usage Guide"
  461. set 210:string ${boot-url}xenclient-2.1/isolinux/
  462. set 209:string isolinux.cfg
  463. set filename ${210:string}pxelinux.0
  464. chain ${filename} || goto failed
  465. goto start
  466.  
  467. :windows7-hookonly
  468. echo Hooking Windows 7 iSCSI volume for ${initiator-iqn}
  469. # Force gateway to be the iSCSI target server (kludge for stupid window behavior)
  470. set netX/gateway ${iscsi-server}
  471. # Hook iSCSI drive
  472. set root-path ${base-iscsi}:${hostname}.boot.windows7
  473. sanhook --drive 0x81 ${root-path} || goto failed
  474. echo Start Windows 7 installer DVD from local drive
  475. sanboot --no-describe --drive 0x80 ${sanboot-url}windows-7/ultimate-${arch}-en.iso || goto failed
  476. goto start
  477.  
  478. ###################### LIVE ENVIRONMENT MENU ########################
  479.  
  480. :menu-live
  481. menu Live environments for ${initiator-iqn}
  482. item openelec-generic-live Boot OpenELEC Generic ${openelec-version} ${archl}
  483. item ubuntu-live-1204 Boot Ubuntu LiveCD 12.04 ${archl}
  484. item slitaz-live Boot SliTaz 4.0 LiveCD
  485. item smartos Boot SmartOS
  486. item smartos-pre-ept Boot SmartOS (pre-ept)
  487. item kms-test Boot KMS test kernel
  488. item tinycore-live-core Boot TinyCoreLinux ${tc-version} Core
  489. item tinycore-live-tinycore Boot TinyCoreLinux ${tc-version} TinyCore
  490. item tinycore-live-coreplus Boot TinyCoreLinux ${tc-version} CorePlus
  491. item coreos Boot CoreOS ${coreos-version}
  492. item
  493. item --key 0x08 back Back to top menu...
  494. iseq ${menu-default} menu-live && isset ${submenu-default} && goto menu-live-timed ||
  495. choose selected && goto ${selected} || goto start
  496. :menu-live-timed
  497. choose --timeout ${submenu-timeout} --default ${submenu-default} selected && goto ${selected} || goto start
  498.  
  499. :openelec-generic-live
  500. echo Booting OpenELEC Generic ${openelec-version} for ${initiator-iqn}
  501. set base-url openelec-generic-${archl}-${openelec-version}
  502. kernel ${base-url}/target/KERNEL
  503. initrd ${base-url}/target/SYSTEM
  504. # Config from: http://wiki.openelec.tv/index.php?title=Network_Boot_-_NFS
  505. # and http://wiki.openelec.tv/index.php?title=Installation#Network_Boot_.28PXE.29
  506. # NFS/NBD/iSCSI boot support only works on version >= 2 of OpenELEC
  507. # The NFS server must be specified as an IP, name resolution doesn't work :(
  508. imgargs KERNEL ip=dhcp boot=NFS=${nfs-server}:${nfs-root}${base-url}/target disk=NFS=${openelec-storage-dir} overlay
  509. boot || goto failed
  510. goto start
  511.  
  512. :ubuntu-live-1204
  513. # See http://manpages.ubuntu.com/manpages/precise/man7/casper.7.html for casper cmdline details
  514. echo Booting Ubuntu Live 12.04 ${archl} for ${initiator-iqn}
  515. set base-url ubuntu-12.04-dvd-${archl}
  516. kernel ${base-url}/casper/vmlinuz
  517. initrd ${base-url}/casper/initrd.lz
  518. imgargs vmlinuz root=/dev/nfs boot=casper netboot=nfs nfsroot=${nfs-server}:${nfs-root}${base-url} locale=en_US.UTF-8 keyboard-configuration/layoutcode=no mirror/country=NO
  519. shell
  520. boot || goto failed
  521. goto start
  522.  
  523. :slitaz-live
  524. echo Booting SliTaz 4.0 LiveCD for ${initiator-iqn}
  525. set base-url slitaz-4.0/
  526. kernel ${base-url}/boot/bzImage
  527. initrd ${base-url}/boot/rootfs4.gz
  528. initrd ${base-url}/boot/rootfs3.gz
  529. initrd ${base-url}/boot/rootfs2.gz
  530. initrd ${base-url}/boot/rootfs1.gz
  531. imgargs bzImage rw root=/dev/null vga=normal autologin lang=en_US kmap=no-latin1
  532. boot || goto failed
  533. goto start
  534.  
  535. :smartos
  536. echo Booting SmartOS for ${initiator-iqn}
  537. # Hook iSCSI root volume (optional, not yet working)
  538. sanhook ${base-iscsi}:${hostname}.boot.smartos ||
  539. set base-url smartos
  540. # See http://nahamu.github.com/2011/08/17/smartos-pxe.html for details
  541. # See http://wiki.smartos.org/display/DOC/Getting+Started+with+SmartOS
  542. # http://wiki.smartos.org/display/DOC/PXE+Booting+SmartOS
  543. # http://wiki.smartos.org/display/DOC/SmartOS+Command+Line+Tips#SmartOSCommandLineTips-FiguringoutwheretoconfigureadditionalNetworkinterfacesorVLANs
  544. # http://wiki.smartos.org/display/DOC/extra+configuration+options
  545. # http://wiki.smartos.org/display/DOC/Managing+NICs
  546. kernel ${base-url}/platform/i86pc/kernel/amd64/unix
  547. initrd ${base-url}/platform/i86pc/amd64/boot_archive
  548. # This doesn't work, but I would very much like it to
  549. #initrd ${base-url}/config/${hostname}.txt /usbkey/config
  550. # smartos=true to run smartos "installer" (and disable noimport=true)
  551. # You can also run it manually, it's at /smartdc/bin/smartos_prompt_config.sh
  552. # keyboard-layout=norway doesn't work anymore (it used to)
  553. #imgargs unix -v -B console=text,standalone=true,noimport=true,keyboard-layout=norway,hostname=${hostname},root_shadow='${root-shadow}'
  554. imgargs unix -B console=text,standalone=true,hostname=${hostname},admin_nic=${mac},admin_ip=dhcp,admin_gateway=dhcp,external_nic=${mac},external_ip=dhcp,external_gateway=dhcp,dns_resolvers=${dns},dns_domain=${domain},ntp_hosts=pool.ntp.org,root_shadow='${root-shadow}'
  555. boot || goto failed
  556. goto start
  557.  
  558. :smartos-pre-ept
  559. echo Starting SmartOS (pre-ept branch) for ${initiator-iqn}
  560. # pre-ept image downloaded from http://alpha.sysmgr.org/smartos-20120223-jmc2.iso
  561. # Posted by LeftWing on #illumos / FreeNode at 2012-04-11 09:09 UTC+2
  562. set base-url smartos/pre-ept
  563. kernel ${base-url}/platform/i86pc/kernel/amd64/unix
  564. module ${base-url}/platform/i86pc/amd64/boot_archive
  565. imgargs unix -v -B console=text,standalone=true,noimport=true,root_shadow='${root-shadow}'
  566. boot || goto failed
  567. goto start
  568.  
  569. :kms-test
  570. echo Booting KMS-enabled Linux kernel for ${initiator-iqn}
  571. set base-url kms_test
  572. kernel ${base-url}/vmlinuz
  573. initrd ${base-url}/initrd ||
  574. imgargs vmlinuz rw root=/dev/nfs nfsroot=${nfs-server}:/raid/kms_test ip=dhcp ||
  575. boot || goto failed
  576. goto start
  577.  
  578. # TinyCore is work-in-progress
  579. # Current problems is that tce=/mnt/nfs/cde works, but dir is not writable by tc user,
  580. # keymap is not loaded, and it seems like there is something I'm not understanding properly
  581. # about the TC boot process
  582. # More to read on http://distro.ibiblio.org/tinycorelinux/concepts.html
  583. # and http://wiki.tinycorelinux.net/wiki:netbooting
  584. :tinycore-live-core
  585. echo Booting TinyCoreLinux Live Core ${tc-version} for ${inititator-iqn}
  586. set base-url tinycore/Core-${tc-version}/
  587. kernel ${base-url}/boot/vmlinuz
  588. initrd ${base-url}/boot/core.gz
  589. imgargs vmlinuz loglevel=3
  590. boot || goto failed
  591. goto start
  592.  
  593. :tinycore-live-tinycore
  594. echo Booting TinyCoreLinux Live TinyCore ${tc-version} for ${inititator-iqn}
  595. set base-url tinycore/TinyCore-${tc-version}
  596. kernel ${base-url}/boot/vmlinuz
  597. initrd ${base-url}/boot/core.gz
  598. imgargs vmlinuz nfsmount=${nfs-server}:${nfs-root}${base-url} host=${hostname} lang=us kmap=nb loglevel=3 syslog tce=/mnt/nfs/cde
  599. boot || goto failed
  600. goto start
  601.  
  602. :tinycore-live-coreplus
  603. echo Booting TinyCoreLinux Live CorePlus ${tc-version} for ${inititator-iqn}
  604. set base-url tinycore/CorePlus-${tc-version}
  605. kernel ${base-url}/boot/vmlinuz
  606. initrd ${base-url}/boot/core.gz
  607. imgargs vmlinuz nfsmount=${nfs-server}:${nfs-root}${base-url} host=${hostname} lang=us kmap=nb loglevel=3 syslog tce=/mnt/nfs/cde showapps desktop=flwm_topside
  608. boot || goto failed
  609. goto start
  610.  
  611. :coreos
  612. echo Booting CoresOS ${coreos-version} for ${inititator-iqn}
  613. #set base-url ${boot-url}/coreos/CorePlus-${tc-version}
  614. set base-url http://storage.core-os.net/coreos/${archl}-generic/${coreos-version}
  615. kernel ${base-url}/coreos_production_pxe.vmlinuz
  616. initrd ${base-url}/coreos_production_pxe_image.cpio.gz
  617. imgargs coreos_production_pxe.vmlinuz root=squashfs: state=tmpfs: sshkey="${coreos-sshkey}"
  618. boot || goto failed
  619. goto start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement