forked from bradgillap/IPXEBOOT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboot.ipxe
342 lines (286 loc) · 13.1 KB
/
boot.ipxe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
#!ipxe
#beginning of file incase of failure
:start
# Some constants I didn't need right away but may be helpful if you have long addresses or directories to keep track of.
set boot-url http://10.0.0.1 #Example http://10.0.0.1 No trailing slashes.
set nfs-server 10.0.0.1 #Example just the raw IP of the NFS server no slashes
set nfs-root /srv/tftp/nfs #Example the raw path to the NFS server in linux. NO trailing slash.
set image-dir images # Cut down on the hardlinking of directories. Example /boot/images NO trailing slashes.
set boot-image boot.png #set your background boot image if you have console vesafb and png turned on. Exmaple: Boot image should go in http://yourwhatever.com/boot.png
# Only use this if you compiled your ipxe with console and png options see http://ipxe.org/cmd/console
# I'm so nice I even provide you with the wallpaper. https://github.com/bradgillap/IPXEBOOT/blob/master/boot.png
console --x 1024 --y 768 # I have to put up with some sucky monitors at work.
console --picture ${boot-url}/${boot-image} #1024x768 Graphic
# Some menu default timeout
set menu-timeout 1000000
#Set the default menu item selected.
isset ${menu-default} || set menu-default exit
# Figure out if client is 64-bit capable
cpuid --ext 29 && set arch x64 || set arch x86
#This is just another way to write the same thing using amd64 and i386 instead of x86 and x64. We use x86 and x64 because it's easier to read for most people.
#The ubuntu-online install needs this and some others. Notice the difference between the variable $(archl) and $(arch)
cpuid --ext 29 && set archl amd64 || set archl i386
###################### BEGIN VERSION CONSTANTS ##################################
set master-version March-2014
set hdt-version 0.5.20
set astra-version 6.14
set freedos-version 1.1
set winpe8-version March-2014
set winpe7-version March-2014
set bootrepair-version 2013-05-08
set pmagic-version 2014-02-06
set systemrescue-version 4.1.0
set hirens-version 15.2
set clonezilla-version 2.2.1-25
set gparted-version 0.18.0-1
set redobackup-version 1.0.4
set deblive64-version 7.4-nonfree
set ophcrackxp-version 3.6.0
set ophcrackvista-version 3.6.0
set memtestx86-version 5.01
set hdat-version 5.0
set spinrite-version 6.0
set dban-version 2.2.8
set ntpassword-version 2014-02-01
set konboot-version 2.4
set acronis-version 2014
set trinity-version 372
###################### END VERSION CONSTANTS ####################################
###################### BEGIN MAIN MENU ##########################################
#GOTO line for changing architecture so it doesn't run the arch command again.
:menu
menu IPXE SUPERBOOT UPDATED ${master-version}
item --gap -- ------------------------- System Info -------------------------------------------------------------------------------------
item --key 0 start (0) Architecture: ${arch} - Reset? #If user chooses this it reset the arch.
item --key 1 changearch (1) Switch Opposite Architecture
item --key 2 netinfo (2) Network Card Info
item --key 3 lspci (3) PCI Detection Info
item --key 4 hdt (4) Hardware Detection Tool ${hdt-version}
item --key 5 astra (5) Astra System Info ${astra-version}
item --gap -- ------------------------- Operating Systems Install -------------------------------------------------------------------------
item --key 6 freedos (6) FreeDOS ${freedos-version} IMG
item --key 7 winpe7 (7) WinPE Win7 ${winpe7-version} 200 MB+ WIM
item --key 8 winpe8 (8) WinPE Win8 ${winpe8-version} 200 MB+ WIM
item --key 9 ubuntu-installer-remote (9) Ubuntu ${archl} Dynamic Net Install HTTP WEB
item --gap -- ------------------------- Live Boot Environments ----------------------------------------------------------------------------
item --key a bootrepair (A) Boot Repair ${arch} ${bootrepair-version} NFS
item --key b pmagic (B) Parted Magic ${pmagic-version} 400+ MB ISO
item --key c systemrescue (C) System Rescue ${systemrescue-version} HTTP
item --key d trinity (D) Trinity Rescue ${trinity-version}
item --key e hirens (E) Hiren's Boot ${hirens-version} 600+ MB ISO
item --key f clonezilla (F) Clonezilla ${arch} ${clonezilla-version} HTTP
item --key g gparted (G) Gparted ${arch} ${gparted-version} HTTP
item --key h redobackup (H) RedoBackup! ${redobackup-version} NFS
item --key i acronis (I) Acronis ${acronis-version} 350+ MB ISO
item --key j deblive64 (J) Debian Live ONLY X64 ${deblive64-version} Wheezy HTTP
item --key k ophcrackxp (K) Ophcrack Live XP ${ophcrackxp-version} 400+ MB ISO
item --key l ophcrackvista (L) Ophcrack Live Vista ${ophcrackvista-version} 400+ MB ISO
item --gap -- ------------------------- Tools and utilities -------------------------------------------------------------------------------
item --key m memtestx86 (M) Memtestx86 ${memtestx86-version} ISO
item --key n hdat (N) Hdat ${hdat-version} Hard Drive Diagnostics IMG
item --key o spinrite (O) SpinRite ${spinrite-version} HD Repair IMG
item --key p dban (P) Dban ${dban-version} Wipe Warning! DESTRUCTIVE! IMG
item --key q ntpassword (Q) Offline NT Password and Registry Editor ${ntpassword-version} WARNING! EFS ENCRYPTION! ISO
item --key v konboot (V) Kon-boot ${konboot-version}
item --gap -- ------------------------- Advanced options -----------------------------------------------------------------------------------
item --key z config (Z) Configure settings
item --key t external (T) External Linux Installs http://boot.salstar.sk/
item --key s shell (S) Drop to iPXE shell
item --key r reboot (R) Reboot computer
item --key x exit (X) Exit
choose --timeout ${menu-timeout} --default ${menu-default} selected || goto cancel
set menu-timeout 0
goto ${selected}
###################### END MAIN MENU ####################################
###################### BEGIN TASKS ######################################
###################### Built In IPXE Commands ###########################
:cancel
echo You cancelled the menu, dropping you to a shell.
:shell
echo Type 'exit' to get the back to the menu.
echo Type 'help' for more IPXE commands.
echo
echo INTERFACE,IP,SUBNET,GATEWAY
echo .......................................
echo
route #IP INFO
echo
echo .......................................
shell
set menu-timeout 0
set submenu-timeout 0
goto start
:failed
echo Booting failed, dropping to shell and freeing memory.
imgfree
goto shell
:reboot
reboot
:exit
exit 0
:config
config
goto start
:back
set submenu-timeout 0
clear submenu-default
goto start
# This forces the document to do the opposite architecture from the menu down.
:changearch
cpuid --ext 29 && set arch x86 || set arch x64
goto menu
################### END OF BUILT IN COMMMANDS ###########################
####### BEGIN SYSTEM INFO #########
:hdt
initrd ${image-dir}/hdt-0.5.2.img
chain memdisk || goto failed
:astra
initrd ${image-dir}/astraiso.iso
chain memdisk iso raw || goto failed
:netinfo
menu Select network card
item netX Default (netX)
set idx:int32 0
:sel_card_loop isset ${net${idx}/mac} || goto sel_card_done
item net${idx} net${idx}
inc idx && goto sel_card_loop
:sel_card_done
choose netcard || goto start
:netinfo_show
menu Network info for ${netcard}
item --gap Chip:
item chip ${space} ${${netcard}/chip}
item --gap MAC:
item mac ${space} ${${netcard}/mac}
item --gap IP/mask:
item ip ${space} ${${netcard}/ip}/${${netcard}/netmask}
item --gap Gateway:
item gw ${space} ${${netcard}/gateway}
item --gap Domain:
item domain ${space} ${${netcard}/domain}
item --gap DNS:
item dns ${space} ${${netcard}/dns}
item --gap DHCP server:
item dhcpserver ${space} ${${netcard}/dhcp-server}
item --gap Next-server:
item nextserver ${space} ${next-server}
item --gap Filename:
item filename ${space} ${${netcard}/filename}
choose empty ||
goto start
:lspci
chain ${boot-url}/lspci.ipxe
goto start
##################### END SYSTEM INFO ####################################
##################### BEGIN Operating Systems Install ####################
:freedos
initrd ${image-dir}/freedosv1.img
chain memdisk || goto failed
# Special set base-url constant for remote host
:ubuntu-installer-remote
echo Starting Ubuntu 12.04 ${archl} installer.
set base-url http://no.archive.ubuntu.com/ubuntu/dists/precise/main/installer-${archl}/current/images/netboot/ubuntu-installer/${archl}
kernel ${base-url}/linux
initrd ${base-url}/initrd.gz
#imgargs linux auto=true url=http://yourserver/some/path/preseed.cfg
boot || goto failed
:winpe8
kernel wimboot
initrd /winpe8/${arch}/media/bootmgr bootmgr
initrd /winpe8/${arch}/media/Boot/BCD BCD
initrd /winpe8/${arch}/media/Boot/Fonts/segmono_boot.ttf segmono_boot.ttf
initrd /winpe8/${arch}/media/Boot/Fonts/segoe_slboot.ttf segoe_slboot.ttf
initrd /winpe8/${arch}/media/Boot/Fonts/segoen_slboot.ttf segoen_slboot.ttf
initrd /winpe8/${arch}/media/Boot/Fonts/wgl4_boot.ttf wgl4_boot.ttf
initrd /winpe8/${arch}/media/Boot/boot.sdi boot.sdi
initrd /winpe8/${arch}/media/sources/boot.wim boot.wim
boot || goto failed
:winpe7
kernel wimboot
initrd /winpe7/${arch}/ISO/bootmgr bootmgr
initrd /winpe7/${arch}/ISO/boot/bcd BCD
initrd /winpe7/${arch}/ISO/boot/boot.sdi boot.sdi
initrd /winpe7/${arch}/winpe.wim boot.wim
boot || goto failed
################ END Operating Systems Install ###########################
################ BEGIN Live Boot Environments ###########################
:hirens
initrd ${image-dir}/Hiren's.BootCD.15.2.iso
chain memdisk iso raw || goto failed
:clonezilla
kernel ${image-dir}/clonezilla/${arch}/vmlinuz boot=live config noswap nolocales edd=on nomodeset vga=788 nosplash noprompt fetch=${boot-url}/${image-dir}/clonezilla/${arch}/filesystem.squashfs
initrd ${image-dir}/clonezilla/${arch}/initrd.img
boot || goto failed
:gparted
kernel ${image-dir}/gparted/${arch}/vmlinuz boot=live config union=aufs noswap noprompt vga=788 fetch=${boot-url}/${image-dir}/gparted/${arch}/filesystem.squashfs
initrd ${image-dir}/gparted/${arch}/initrd.img
boot || goto failed
:redobackup
kernel ${image-dir}/redobackup/casper/vmlinuz boot=casper netboot=nfs nfsroot=${nfs-server}:${nfs-root}/redobackup/
initrd ${image-dir}/redobackup/casper/initrd.lz
boot || goto failed
:acronis
initrd ${image-dir}/acronis2014.iso
chain memdisk iso raw || goto failed
:trinity
initrd ${image-dir}/trinity-rescue-kit.3.4-build-372.iso
chain memdisk iso || goto failed
:bootrepair
kernel ${image-dir}/bootrepair/${arch}/casper/vmlinuz boot=casper netboot=nfs nfsroot=${nfs-server}:${nfs-root}/bootrepair/${arch}/
initrd ${image-dir}/bootrepair/${arch}/casper/initrd.lz
boot || goto failed
:systemrescue
kernel ${boot-url}/${image-dir}/systemrescue/isolinux/rescue${arch}
initrd ${image-dir}/systemrescue/isolinux/initram.igz
imgargs rescue${arch} dodhcp netboot=${boot-url}/${image-dir}/systemrescue/sysrcd.dat
boot || goto failed
:ophcrackxp
initrd ${image-dir}/ophcrack-xp-livecd-3.6.0.iso
chain memdisk iso raw || goto failed
:ophcrackvista
initrd ${image-dir}/ophcrack-vista-livecd-3.6.0.iso
chain memdisk iso raw || goto failed
#vmalloc=512 is the ISO + 50mb or so to give it room to breathe in ram.
:pmagic
initrd ${image-dir}/pmagic_2014_02_26.iso
chain memdisk iso vmalloc=512M || goto failed
# x86 version of this has some weird double initd1 and initrd2 that I couldn't figure out.
:deblive64
kernel ${image-dir}/debian/live/debian-live-7.4-amd64-gnome-desktop+nonfree.vmlinuz
initrd ${image-dir}/debian/live/debian-live-7.4-amd64-gnome-desktop+nonfree.initrd.img
imgargs debian-live-7.4-amd64-gnome-desktop+nonfree.vmlinuz boot=live config console=ttyS0 username=live fetch=${boot-url}/${image-dir}/debian/live/debian-live-7.4-amd64-gnome-desktop+nonfree.squashfs
boot || goto failed
###################### END Live Boot Environments ######################
###################### START Tools and Utilities #######################
:hdat
initrd ${image-dir}/HDAT2FDD.IMG
chain memdisk || goto failed
:spinrite
initrd ${image-dir}/spinritev6.iso
chain memdisk iso raw || goto failed
:memtestx86
initrd ${image-dir}/memtest86v5.iso || goto failed
chain memdisk iso raw || goto failed
:ntpassword
initrd ${image-dir}/cd140201.iso
chain memdisk iso || goto failed
:konboot
initrd ${image-dir}/kon-boot.img
chain memdisk || goto failed
# quick explanation of imgargs. We don't need to put the path to DBA.BZI because we just downloaded to a root path.
:dban
kernel ${image-dir}/DBAN.BZI
imgargs DBAN.BZI nuke="dwipe --method gutmann --rounds 2 --verify last" silent vga=785
boot || goto failed
# This was just a test for boot.wim. We use winpe instead with injected drivers for lan and disks
#:wimboot
#kernel wimboot
#initrd win7/bootmgr bootmgr
#initrd win7/boot/bcd BCD
#initrd win7/boot/boot.sdi boot.sdi
#initrd win7/sources/boot.wim boot.wim
#imgstat
#boot || goto failed
:external
chain http://boot.salstar.sk || goto failed
goto start