[ipxe-devel] iPXE command line script help

Andrew Bobulsky rulerof at gmail.com
Mon Dec 9 12:27:19 UTC 2013


On Saturday, December 7, 2013, sam a wrote:
>
> Hi
>
> I need an  iPXE script that can be inserted in the NBP ( network bootstrap program ) for  windows XP ,7 or 8 that is capable to download a batch file ( exe ) in a specific directory in the HD  as well as be able  to run it automatically once  windows OS has been taking control.
> it would self-install an application on windows every time the system is booted from network
>
> does anyone has done it or could help to develop it ?
>
> Thanks
>
> Sam


 Hello Sam,

Such a thing is definitely possible.  Choosing an implementation is
where it gets convoluted.

For lack of a better term, I'd speculate that the most "proper" way to
go about this would be to register the machine via some type of web
service by having it chain an HTTP URI with query information like
"?mac={netX/mac}&ip={netX/ip}&(other relevant info)" and have it
return an iPXE script that either exits iPXE--continuing to local disk
boot--or sanboots the local disk[1], or chainloads a different
bootloader more suited to the task[2].

On the back end, you then use a script on your web server to pipe the
necessary actions to the client through any management engine that you
might have already installed on the machine, like Puppet.  At least I
think that's what Puppet is for... ;)

You could even do something as hack-ish as creating a
specifically-targeted group policy that does what you want.  You could
have all of your computers process a startup script that your web
server adds lines to, wherein each machine selects its tasks.

Aside from that type of solution, many other possibilities do exist.
Currently, what comes to mind would be to pack the files you need into
a bootable DOS disk image with NTFS read/write support, load that
image into RAM with iPXE, chainload GRUB4DOS, map the RAM disk image,
boot it, copy your files around, and then call back to GRUB4DOS, unmap
your image, and then have it boot the local disk.

There's lots of possibilities here... it's just that none of them is
very simple I'm afraid :P

Best Regards,
Andrew Bobulsky

[1]: http://ipxe.org/cmd/sanboot#examples
[2]: (some BIOSes don't play nice and require workarounds)
http://ipxe.org/appnote/work_around_bios_halting_on_ipxe_exit



More information about the ipxe-devel mailing list