Page MenuHomeFreeBSD

Support URI scheme for root-path in netbooting
ClosedPublic

Authored by bapt on May 26 2017, 8:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 27 2024, 11:52 PM
Unknown Object (File)
Feb 26 2024, 9:13 PM
Unknown Object (File)
Feb 4 2024, 4:32 PM
Unknown Object (File)
Feb 1 2024, 10:40 PM
Unknown Object (File)
Jan 6 2024, 9:42 AM
Unknown Object (File)
Jan 6 2024, 9:41 AM
Unknown Object (File)
Dec 28 2023, 2:48 AM
Unknown Object (File)
Dec 27 2023, 2:15 AM
Subscribers

Details

Summary

It supports the following scheme:
compat with before all the changes:
NFS for:
root-path = /path
root-path = <ip>:/path

New schemes:
tftpfs for
tftp:/path
tftp://ip/path

nfs for
nfs:/path
nfs://ip/path

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Other than the comment expansion request I like this, very clean, very easy to understand, and even easier to expand in the future.

Other than the comment expansion request I like this, very clean, very easy to understand, and even easier to expand in the future.

You mean you want more comments in that code? if yes I can do that yes :)

sys/boot/common/dev_net.c
431 ↗(On Diff #28884)

for pointer arithmetics it is good to use ((uintptr_t)val - (uintptr_t)ptr) - just to be at safe side, because we do have 64 and 32 bit builds there.

442 ↗(On Diff #28884)

There is still the confusion about return types; we do get n_long as address from inet_addr, yet this function is stated to return uint32_t. And this may be problem with 64-bit binary.

Better pointer arithmetics

bapt added inline comments.
sys/boot/common/dev_net.c
442 ↗(On Diff #28884)

I agree and this should be addressed in a second commit imho

Use size_t instead of unsigned long

This revision is now accepted and ready to land.May 27 2017, 12:01 PM
This revision was automatically updated to reflect the committed changes.
In D10947#226718, @bapt wrote:

Other than the comment expansion request I like this, very clean, very easy to understand, and even easier to expand in the future.

You mean you want more comments in that code? if yes I can do that yes :)

Yes please, basically this function was re-written and enhanced without any change to the describing block comment that should exists before each function in the FreeBSD source tree. (see style(9)).

head/sys/boot/common/dev_net.c
391

The above is the block comment for the net_parse_rootpath() function, it is rather out of date now that this function has been greatly enhanced, so yes I would like to see a new block comment that more accurately describes what this function now does.