Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is it posible to use variable arguments (parameters) when run ipxe and then pars it i
2018-04-14, 21:14
Post: #1
Is it posible to use variable arguments (parameters) when run ipxe and then pars it i
Hi

Is it posible to use variable arguments (parameters) when run ipxe and then pars it in script?
I need load some iso images, but write script for each is not good idea.
It will be better to run its in one script by specifying the path to the file as an argument.
Find all posts by this user
Quote this message in a reply
2018-04-15, 10:43
Post: #2
RE: Is it posible to use variable arguments (parameters) when run ipxe and then pars it i
I don't really understand your use-case
What iPXE binary are you using and how do you start it?
Those builds of iPXE that supports arguments from commandline (only ipxe.lkrn) would parse it as a script

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
2018-04-16, 06:36
Post: #3
RE: Is it posible to use variable arguments (parameters) when run ipxe and then pars it i
I run ipxe from syslinux.

Now i must to have one config file in syslinux and 3 config files in ipxe.

default:
Code:
LABEL
menu label Image1
kernel /ipxe/ipxe.lkrn
initrd /ipxe/image1.ipxe

LABEL
menu label Image2
kernel /ipxe/ipxe.lkrn
initrd /ipxe/image1.ipxe

LABEL
menu label Image3
kernel /ipxe/ipxe.lkrn
initrd /ipxe/image1.ipxe

image1.ipxe:
Code:
#!ipxe
dhcp
sanboot --no-describe http://10.80.1.44/Image1.iso
image2.ipxe:
Code:
#!ipxe
dhcp
sanboot --no-describe http://10.80.1.44/Image2.iso
image3.ipxe:
Code:
#!ipxe
dhcp
sanboot --no-describe http://10.80.1.44/Image3.iso


I desire to have one config file in syslinux and one config file in ipxe.


default:
Code:
LABEL
menu label Image1
kernel /ipxe/ipxe.lkrn  http://10.80.1.44/Image1.iso
initrd /ipxe/loadimage.ipxe

LABEL
menu label Image2
kernel /ipxe/ipxe.lkrn http://10.80.1.44/Image2.iso
initrd /ipxe/loadimage.ipxe

LABEL
menu label Image3
kernel /ipxe/ipxe.lkrn http://10.80.1.44/Image2.iso
initrd /ipxe/loadimage.ipxe

loadimage.ipxe:
Code:
#!ipxe
dhcp
sanboot --no-describe %Arg1%
Find all posts by this user
Quote this message in a reply
2018-04-16, 06:51
Post: #4
RE: Is it posible to use variable arguments (parameters) when run ipxe and then pars it i
(2018-04-16 06:36)fatallerror Wrote:  I run ipxe from syslinux.

Now i must to have one config file in syslinux and 3 config files in ipxe.

iPXE has script files, not config files (this might seem like a small difference, or the same thing, but it changes the concept of thinking quite a lot)

You haven't considered moving to iPXE based menues instead?


(2018-04-16 06:36)fatallerror Wrote:  I desire to have one config file in syslinux and one config file in ipxe.

Code:
LABEL
menu label Image1
kernel /ipxe/ipxe.lkrn  http://10.80.1.44/Image1.iso
initrd /ipxe/loadimage.ipxe

loadimage.ipxe:
[code]#!ipxe
dhcp
sanboot --no-describe %Arg1%

It is possible to send in arguments over the cmdline, but that replaces the script, but in your case you can just do:
Code:
LABEL
menu label Image1
kernel /ipxe/ipxe.lkrn dhcp && sanboot --no-describe  http://10.80.1.44/Image1.iso

The alternative would be to have kernel /ipxe/ipxe.lkrn dhcp && set imagename=image1.iso && chain http://10.80.1.44/loadimage.ipxe

where loadimage.ipxe would have:
sanboot --no-describe ${imagename}

But as I mentioned, moving to iPXE based menues is probably the best actual solution for this. (this allows you to only use iPXE and skip PXELINUX completely)

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
2018-04-16, 09:32
Post: #5
RE: Is it posible to use variable arguments (parameters) when run ipxe and then pars it i
Great. Thanks!
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)