iPXE discussion forum

Full Version: Pass CGI arguments to kickstart - Bring back uristring encoding?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm migrating from PXELINUX and currently pass CGI parameters to a CentOS kickstart file dynamically generated by PHP. iPXE 1.0.0 works fine but the latest git release no longer supports uristring as removed by:


I think git iPXE automatically URI encodes the first argument to the kernel command which is usually vmlinuz. But I want to pass the parameters onto the kickstart.

Here is a simplified extract of what I'm trying to do:

# read custom settings
echo -n Use RAID [0|1]: ${} && read raid
echo -n Use LVM [0|1]: ${} && read lvm

# create query string
set query raid=${raid:uristring}
set query ${query}&lvm=${lvm:uristring}

kernel centos7/vmlinuz root=live:centos7/squashfs.img ks=${base-url}/ks/ks7.php?${query}

Am I stuck with 1.0.0 or is there a better way to pass args to the kickstart?
(2015-05-19 03:31)nichivo Wrote: [ -> ]# read custom settings
echo -n Use RAID [0|1]: ${} && read raid
echo -n Use LVM [0|1]: ${} && read lvm

For reference how does the data entered on those look?
maybe you can also provide how the full "invalid" url looks, and what you do expect instead?

There is some discussion on the Mailing list already, and this probably falls under that as well.
Input for the lvm and raid values are just zero or one. I just used them as brief examples but they don't include any characters that need encoding! Sorry, a better example is:

echo -n Media: ${}              && read media

for which I would enter something like:

media url --url http://mirror.centos.org/centos/7/os/x86_64/

This contains at least spaces which should be encoded as %20. From what I can tell, git iPXE only automatically encodes the first argument as in the examples from the mailing list you referenced.

Automatic URI encoding (of the first argument) is nice when your using things like:

chain ${url_with_spaces}

but the kickstart URL at the end is not automatically URI encoded and I can no longer manually URI encode it since "uristring" is now an alias for "string":

# ipxe command (abbreviated with ...)
kernel vmlinuz ... ks=http://ks.lan/ks/ks7.php?${query}

# expands to
kernel vmlinuz ... ks=http://ks.lan/ks/ks7.php?raid=1&lvm=1&media=media url --url http://mirror.centos.org/centos/7/os/x86_64/

# actually calls (truncates after first space)
kernel vmlinuz ... ks=http://ks.lan/ks/ks7.php?raid=1&lvm=1&media=media

# should expand to
kernel vmlinuz ... ks=http://ks.lan/ks/ks7.php?raid=1&lvm=1&media=media%20url%20%2d%2durl%20http%3a%2f%2fmirror%2ecentos%2eorg%2fcentos%​2f7%2fos%2fx86_64%2f

I'm currently using v1.0 which supports manual uristring but it would be nice to use newer versions Wink
Reference URL's