Skip to content

Adding new method of system configuration#13

Open
JJL772 wants to merge 5 commits into
br-2019.08from
pr-kernel-cmdline-opts-2019.08
Open

Adding new method of system configuration#13
JJL772 wants to merge 5 commits into
br-2019.08from
pr-kernel-cmdline-opts-2019.08

Conversation

@JJL772

@JJL772 JJL772 commented May 27, 2026

Copy link
Copy Markdown
Member

Command line (option 129, sometimes called uarg) is replaced by:

  • CMDLINE=...

Root mounts are defined using:

  • ROOTMNT=SRV:REMOTEPATH:MNTPT
  • ROOTTYPE=nfs|nfs4|...
  • ROOTOPTS=vers=3,...

ROOTTYPE defines the filesystem type, i.e. nfs4 or nfs. You may use other options too, like 9p, if that is supported by the image.

ROOTOPTS defines options passed to the mount command in /etc/fstab

ROOTMNT defines the actual mounts

Tested only locally for now

Command line (option 129, sometimes called uarg) is replaced by:
* CMDLINE=...

Root mounts are defined using:
* ROOTMNT=SRV:REMOTEPATH:MNTPT
* ROOTTYPE=nfs|nfs4|...
* ROOTOPTS=vers=3,...

ROOTTYPE defines the filesystem type, i.e. nfs4 or nfs. You may use
other options too, like 9p, if that is supported by the image.

ROOTOPTS defines options passed to the mount command in /etc/fstab

ROOTMNT defines the actual mounts
@JJL772
JJL772 requested a review from a team May 27, 2026 00:51

@marciodo marciodo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if the parameters are sent both via DHCP and kernel options? I think you protected BOOTFILE parameter in fs_skeleton/etc/init.d/S90local, but I believe that there will be duplicated entries in fstab because fs_skeleton/usr/share/udhcpc/site.script will still run.

@JJL772

JJL772 commented May 27, 2026

Copy link
Copy Markdown
Member Author

@marciodo Thanks for the feedback; yes that is what would happen.

I have an uncommitted patch that fixes this, but haven't tested it yet.

@JJL772

JJL772 commented May 27, 2026

Copy link
Copy Markdown
Member Author

My intent is to have the new method be 1st priority:

DHCP Kernel Command Line Result
Y Y Kernel command line
Y N DHCP
N Y Kernel command line
N N Sadness

@JJL772
JJL772 marked this pull request as ready for review May 28, 2026 21:37
@JJL772
JJL772 requested a review from marciodo May 28, 2026 21:37
Comment thread fs_skeleton/etc/init.d/S36fstab Outdated

# Append NFS specific options
case "${FT}" in
nfs|nfs4)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to do anything here about using NFS 4.1 instead of 4.0?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also going to change the behavior of the case. If ROOTOPTS is supplied, it should take precedence over the built-in options, particularly for deployments where i.e., noresvport is not needed

Comment thread fs_skeleton/etc/init.d/S90local Outdated
# Continue here and let then also specify a BOOTFILE
fi
# New path: Parse the boot file out of the kernel parameters
if `cat /proc/cmdline | grep -q 'CMDLINE='`; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be simplified by if grep -q 'CMDLINE=' /proc/cmdline; then.

Comment thread fs_skeleton/etc/init.d/S90local Outdated
fi
# New path: Parse the boot file out of the kernel parameters
if `cat /proc/cmdline | grep -q 'CMDLINE='`; then
BOOTFILE=`cat /proc/cmdline | grep -Eo 'CMDLINE=\S+' | cut -d '=' -f2`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just in case CMDLINE has entries with more than one =, you could use -f2- in cut.

Comment thread fs_skeleton/etc/init.d/S36fstab Outdated
start)
MO=`cat /proc/cmdline | grep -Eo 'ROOTOPTS=\S+' | sed 's/ROOTOPTS=//g'`
FT=`cat /proc/cmdline | grep -Eo 'ROOTTYPE=\S+' | cut -d '=' -f2`
ROOTMNT=`cat /proc/cmdline | grep -Eo 'ROOTMNT=\S+' | cut -d '=' -f2`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just in case ROOTTYPE and ROOTMNT have entries with more than one =, you could use -f2- in cut.

@JJL772
JJL772 requested a review from marciodo July 17, 2026 16:02
marciodo added 2 commits July 19, 2026 14:50
…e were saved by linux-menuconfig when the selection was made for NFS v4.1.
…IG_SMP=y. Removing it to simplify the config.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants