Skip to content

Instantly share code, notes, and snippets.

@wention
Last active June 16, 2024 08:31
Show Gist options
  • Select an option

  • Save wention/5aefecaa8f80f9a3a778571cab07c16b to your computer and use it in GitHub Desktop.

Select an option

Save wention/5aefecaa8f80f9a3a778571cab07c16b to your computer and use it in GitHub Desktop.
iPXE Sanboot windows
#!ipxe
cpuid --ext 29 && set arch amd64 || set arch x86
## Menus
:menus
imgfree
menu WETA PXE Boot Service
item --gap -- --------------- Installations ---------------
item boot1 PE1
item WEPE64_2.2 WEPE64_2.2
item boot3 PE1 with bootmgr
item --gap -- --------------- Boot ---------------
item boot4 Windows 10 LTSC
item --gap -- --------------- Additional ---------------
item check check
item reboot reboot
choose os && goto ${os}
set base_url http://10.211.55.19
:boot1
set image_path images/winpe
set iscsi-rootfs iscsi:192.168.31.48:tcp:3260:1:iqn.2000-01.com.synology:WETA.win.cb751b4f41
set keep-san 1
sanhook --drive 0x80 ${iscsi-rootfs}
kernel wimboot
initrd ${image_path}/boot/BCD BCD
initrd ${image_path}/boot/boot.sdi boot.sdi
initrd ${image_path}/boot/Startnet.cmd Startnet.cmd
initrd ${image_path}/sources/boot.wim boot.wim
imgstat
#prompt
boot
:WEPE64_2.2
set image_path images/win10-ltsc
set iscsi-rootfs iscsi:192.168.31.48:tcp:3260:1:iqn.2000-01.com.synology:WETA.win.cb751b4f41
set keep-san 1
sanhook --drive 0x80 ${iscsi-rootfs}
set image_path images/wepe
kernel wimboot
initrd images/winpe/boot/BCD bcd
initrd images/winpe/boot/boot.sdi boot.sdi
initrd images/winpe/boot/bootmgr bootmgr
#initrd ${image_path}/${arch}/boot/bcd bcd
#initrd ${image_path}/${arch}/boot/boot.sdi boot.sdi
#initrd ${image_path}/${arch}/boot/bootmgr bootmgr
initrd ${image_path}/${arch}/sources/boot.wim boot.wim
boot
:boot3
set image_path images/win10-ltsc
set iscsi-rootfs iscsi:192.168.31.48:tcp:3260:1:iqn.2000-01.com.synology:WETA.win.cb751b4f41
set gateway 0.0.0.0
set keep-san 1
sanhook --drive 0x80 ${iscsi-rootfs}
kernel wimboot
initrd ${image_path}/boot/bcd bcd
initrd ${image_path}/boot/boot.sdi boot.sdi
#initrd images/wepe/b64 B64
#initrd images/wepe/wepe.sdi WEPE.SDI
#initrd images/wepe/wepe64 bootmgr
#initrd images/wepe/wepe64.wim boot.wim
initrd ${image_path}/sources/boot.wim boot.wim
imgstat
#prompt
boot
:boot4
set iscsi-rootfs iscsi:192.168.31.48:tcp:3260:1:iqn.2000-01.com.synology:WETA.win.cb751b4f41
set keep-san 1
set initiator-iqn iqn.bablaba:test
sanhook --drive 0x80 ${iscsi-rootfs}
sanboot
:reboot
reboot
:check
:scan pciscan addr || goto scan_done
echo ${addr:busdevfn}: ${pci/${addr}.0.2}:${pci/${addr}.2.2}
goto scan
:scan_done
# disable dns
port=0
# dhcp
log-dhcp
log-queries
interface=enp0s5
bind-interfaces
#dhcp-range=10.211.55.250,10.211.55.254,255.255.255.0
dhcp-range=10.211.55.1,proxy
pxe-service=tag:ipxe,x86PC,"PXELINUX (BIOS)",http://10.211.55.19/boot.ipxe
pxe-service=tag:!ipxe,x86PC,"PXELINUX (BIOS)",undionly.kpxe
#pxe-service=X86-64_EFI,"PXELINUX (EFI)",ipxe.efi
dhcp-userclass=set:ipxe,iPXE
dhcp-match=set:ipxe,175 # iPXE sends a 175 option.
dhcp-boot=tag:ipxe,http://10.211.55.19/boot.ipxe
#dhcp-boot=tag:ipxe,http://192.168.31.150/boot.ipxe
#dhcp-match=set:efi-x86_64,option:client-arch,7
#dhcp-match=set:efi-x86_64,option:client-arch,9
#dhcp-match=set:efi-x86,option:client-arch,6
#dhcp-match=set:bios,option:client-arch,0
#dhcp-boot=tag:efi-x86_64,ipxe.efi
#dhcp-boot=tag:efi-x86,ipxe.efi
#dhcp-boot=tag:bios,ipxe.pxe
dhcp-boot=undionly.kpxe
# tftp
enable-tftp
tftp-root=/tftp/
Wpeinit
ipconfig /all
netsh interface show interface
net use z: \\10.211.55.19\public
z:
.\setup.exe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment