rpm-ostree kernel parameters

I’ve been messing around with one of my boxes because of a faulty onboard ethernet adapter. I was trying to use a usb-c to ethernet adapter in it’s place for network connectivity, but have been running into weird stability issues. It works for hours at a time and then just disconnects. If I reboot or reseat the usb, it works again for a few hours and then drops. I thought it might have been something to do with the DHCP lease, but the lease expirations don’t line up.

Anyway, the box is one of my OpenShift bare metal nodes, which is running an rpm-ostree based OS. For those unaware, the os is “immutable”, and thus most changes don’t last a reboot. I’ve been trying to find if there is a linux kernel parameter that I could use to adjust the behavior on the usb adapter. Along the way, I found some info and wanted to document.

What can I do with kernel parameters?

You can find a full list and some documentation about what the kernel parameters are: https://www.kernel.org/doc/html/v5.0/admin-guide/kernel-parameters.html. But that doesn’t tell you everything that available.

On the device you can see all the kernel boot parameters by performing a sysctl -a and grepping for what you might be looking for. Here’s an example of the kernel boot params I could use for the enp57s0u1 device, which is my usb eth adapter.

[core@nuc1 ~]$ sudo sysctl -a | grep enp57s0u1
net.ipv4.conf.enp57s0u1.accept_local = 0
net.ipv4.conf.enp57s0u1.accept_redirects = 1
net.ipv4.conf.enp57s0u1.accept_source_route = 0
net.ipv4.conf.enp57s0u1.arp_accept = 0
net.ipv4.conf.enp57s0u1.arp_announce = 0
net.ipv4.conf.enp57s0u1.arp_filter = 0
net.ipv4.conf.enp57s0u1.arp_ignore = 0
net.ipv4.conf.enp57s0u1.arp_notify = 0
net.ipv4.conf.enp57s0u1.bc_forwarding = 0

You can see what the current boot command line looks like.

[core@nuc1 ~]$ cat /proc/cmdline
BOOT_IMAGE=(hd1,gpt3)/ostree/rhcos-54b88b82bd57562eb83d612b74685072720de0d27a05c556a8a4bbfa6bd0211d/vmlinuz-5.14.0-284.48.1.el9_2.x86_64 ignition.platform.id=metal ostree=/ostree/boot.1/rhcos/54b88b82bd57562eb83d612b74685072720de0d27a05c556a8a4bbfa6bd0211d/0 ip=enp57s0u1:dhcp root=UUID=4bb0d4d7-c26c-4028-aa28-7d4ec50dfc64 rw rootflags=prjquota boot=UUID=6001d81f-4cd3-4688-8504-3f27e49d988c systemd.unified_cgroup_hierarchy=1 cgroup_no_v1=all psi=1 usbcore.autosuspend=-1

On a RHEL CoreOS box, to update one of these parameters, you have to use the command line. Here’s an example.

sudo rpm-ostree kargs --append=usbcore.autosuspend=-1