There Is Finally Work To Allow Sysctl Parameters To Be Set From The Linux Kernel Command Line
Written by Michael Larabel in Linux Kernel on 26 March 2020 at 12:07 AM EDT. Add A Comment
LINUX KERNEL --
File this under the "I can't believe it took this long" or "why wasn't this done before" section... Thanks to SUSE, there are finally patches pending to allow easily setting sysctl parameters from the kernel command line using a generic infrastructure.

Rather than setting parameters via the likes /etc/sysctl.d or manually/scripted with the sysctl command or programmed via the initramfs sysctl.conf, SUSE's Vlastimil Babka sent out a set of patches allowing sysctl parameters to be set via the kernel command-line when booting the system. He sent out the original patches last week and today followed up with the revised patches.

Under the proposal, sysctl.xxx= could be used for setting the sysctl parameter right before loading the init process. For example, sysctl.vm.swappiness= would be a valid kernel command option that could be passed from the boot-loader to the kernel.

Surprisingly this infrastructure hasn't existed in general until now. That is while some sysctl parameters have been wired up to other kernel parameter handling for setting different attributes but nothing in a unified manner for all sysctl options.

We'll see if this gets picked up for mainline soon.
Related News
About The Author
Author picture

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter or contacted via MichaelLarabel.com.

Popular News This Week