[ipxe-devel] Multiple initrd files and their permissions

Me bryce.zimmerman at gmail.com
Wed Aug 1 19:48:09 UTC 2012

I posted this <http://forum.ipxe.org/showthread.php?tid=3730> in the iPXE
forum and was directed to try the dev mailing list.

While messing around with iPXE loading multiple initrd files I ran into an
issue with file permissions not being maintained.

Here is my iPXE script:

kernel http://web/boot/vmlinuz
initrd http://web/boot/core.gz
initrd http://web/boot/bootlocal.sh /opt/bootlocal.sh

Here is the listing for /opt/bootlocal.sh in core.gz directory:
4 -rwxrwxr-x 1 root staff 51 Mar 4 2010 bootlocal.sh

Here is the listing for http://web/boot/bootlocal.sh:
4.0K -rwxrwxrwx  1 root root   38 Aug  1 13:33 bootlocal.sh

For reference, core.gz is from TinyCore 4.5 and http://web/ is CentOS 6
(not that I think it makes a difference, just trying to be thorough). The
script works. The system boots up and /opt/bootlocal.sh (which already
exists in core.gz) is overwritten by http://web/boot/bootlocal.sh, except
that it no longer has the permissions that exist on the original
bootlocal.sh in core.gz or on the web server copy. Along with new
permissions it's got a new date stamp of Jan 1, 1970... so basically it's
dropping all meta-data and umask is setting default create permissions.
Digging through the iPXE source I found the acquire function that actually
pulls the file off the server, and it's pretty much just wget (if I'm
reading this right), which explains why I'm losing file permissions and

Which finally leads me to my question: how can I set file permissions in
iPXE after the file has been acquired?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ipxe.org/pipermail/ipxe-devel/attachments/20120801/80f39245/attachment.htm>

More information about the ipxe-devel mailing list