Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow ${srv} in the kernel cmdline #1321

Open
alkisg opened this issue Jan 20, 2020 · 5 comments
Open

Allow ${srv} in the kernel cmdline #1321

alkisg opened this issue Jan 20, 2020 · 5 comments

Comments

@alkisg
Copy link

alkisg commented Jan 20, 2020

Hi, please allow the ${srv} keyword in the kernel cmdline, replacing it with the boot server IP.
For example, nfsroot=${srv}:/srv/ltsp/raspbian would be passed to the kernel as nfsroot=192.168.67.1:/srv/ltsp/raspbian.
This will allow netbooting Raspberries from a server with a dynamic IP, which is the default in LTSP.

Rationale.
A typical netbooting procedure on Raspberries is as follows:

  • The Pi does a DHCP request; a real and/or a proxy DHCP server might reply
  • Bootcode.bin, cmdline.txt, the kernel etc are fetched from TFTP
  • The kernel is loaded and the cmdline is passed to it

At that point, the DHCP offer packet contents are lost, so there's no way for the kernel to discover the proxyDHCP server and connect to it via nfsroot=. In iPXE (ipxe.org), this is done with the ${srv} variable. In PXELinux, IPAPPEND passes the server in the ip= variable. Raspberries should offer one of those solutions, and the one offered by iPXE is the most flexible.

Note that Raspberries by default do not use the initramfs, so we cannot develop and add programs that would discover the PXE server; this information needs to be passed to the kernel before any userland code has a chance to run.

Of course it's understandable that this solution wouldn't reach rpi3 ROMs and an SD card would be needed there. Thanks!

@JamesH65
Copy link
Contributor

@timg236 I can see this would be possible on the Pi4 (If we chose to implement it), but not sure about earlier models.

@timg236
Copy link

timg236 commented Feb 24, 2020

Kernel command line setup is handled by start.elf which could use the TFTP server IP if someone wants to add it

@JamesH65
Copy link
Contributor

I'll take a look, just need to know where to get the IP address from.

@JamesH65
Copy link
Contributor

Bit more complicated than originally thought, might be a while as have other stuff to do.

@alkisg
Copy link
Author

alkisg commented Feb 29, 2020

No hurry; thank you for your efforts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants