Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
iPXE with multiple initrd permissions
2012-07-31, 22:15
Post: #1
iPXE with multiple initrd permissions
I've been messing around with iPXE for a little while now, trying to get various aspects figured out, and one thing I'm having trouble with is booting with multiple initrd commands...
Code:
#!ipxe
kernel http://web/boot/vmlinuz
initrd http://web/boot/core.gz
initrd http://web/boot/bootlocal.sh /opt/bootlocal.sh
boot
This works just fine. I boot up and can see /opt/bootlocal.sh, the contents haven't change a bit... except that no matter how many times I change the file permissions on http://web/boot/bootlocal.sh, when I boot up and check /opt/bootlocal.sh it has the wrong permissions. I need that script to have execute permission so it can run on boot. The original bootlocal.sh in core.gz has execute, and the server copy of bootlocal.sh has execute, but after booting it doesn't and I'm having a hard time finding the magic words that google wants to lead me to understanding why.

If anyone could point me in the right direction on permissions with extra files loaded with initrd I'd appreciate it.
Find all posts by this user
Quote this message in a reply
2012-08-01, 15:18
Post: #2
RE: iPXE with multiple initrd permissions
As far as I know, setting ownership and/or permissions on the file loaded this way is not supported.

Most likely the most correct way to implement this is to make chown and chmod equivalent commands in iPXE, but I'm unsure how complicated that would be. I think this is a question more suited for the developer mailing-list.

A workaround is to create a script on the initrd that changes the permissions of /opt/bootlocal.sh before it tries to execute it, or invokes it explicitly with the shell, like this:

Code:
$ /bin/sh /opt/bootlocal.sh
$ /opt/bootlocal.sh # NOT THIS WAY

That should avoid the execute bit problem.
Visit this user's website Find all posts by this user
Quote this message in a reply
2012-08-01, 17:27
Post: #3
RE: iPXE with multiple initrd permissions
It looks like I'll have to use that sort of workaround for the time being. After some digging it appears that when you pull down a file with initrd it does not preserve the meta-data, so everything is just being reset by the umask of the system that boots. I'll write something up in the dev mailing list just to see if this is something that might make its way into production.
Find all posts by this user
Quote this message in a reply
2012-08-03, 15:12
Post: #4
RE: iPXE with multiple initrd permissions
The dev mailing list did an amazing job of exceeding my expectations and Michael Brown resolved the issue by adding the mode=755 feature to the initrd command. http://git.ipxe.org/ipxe.git/commitdiff/d97c6a3
Find all posts by this user
Quote this message in a reply
Post Reply 




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