In the grub.conf configuration file I can specify command line parameters that the kernel will use, i.e.:

kernel /boot/kernel-3-2-1-gentoo root=/dev/sda1 vga=791 plasticDuck

After booting up a given kernel, is there a way to tell if all parameters were passed 'correctly'?

I.e. there is no plasticDuck kernel parameter, but:

dmesg | grep plasticDuck

only returns:

Kernel command line: root=/dev/sda1 vga=791 plasticDuck

(no error)

  • Not sure I understand the question entirely. You want to know if a parameter was actually taken into account/acted on? (i.e. in your example, you'd like to know that plasticDuck was ignored since the actual kernel parameter is plasticPenguin, i.e. you got a typo.) – Mat Sep 19 '12 at 13:03
  • @Mat Exactly something like that. The background of the story: I have found the 'atkbd.softraw' kernel parameter and I this parameter works for kernels 2.6.x, but my kernel version is 3.2.12. And I'm wondering if I can still use that parameter or not. – colemik Sep 19 '12 at 13:14
  • Ok, understood. Don't know of anything generic though, sorry. – Mat Sep 19 '12 at 13:16
  • vga parameter is deprecated! but works for backward compatibility. – PersianGulf Sep 19 '12 at 13:49
  • Valid? Looks like you just want to tell if it's actually used by kernel? If your see it in /proc/cmdline, it's being used, but whether it effects is unknown. – daisy Sep 19 '12 at 14:09

I don't think there's a command that lists built-in modules parameters and their values. If you know the path to the driver files you could list the parameters for that module e.g. if you used ipv6.autoconf=0 as a kernel boot parameter you could run:

ls -1 /sys/module/ipv6/parameters/

and then, if the specified parameter is in the list (i.e. it is valid), check its value:

cat /sys/module/ipv6/parameters/autoconf 

Or, in your particular case - atkbd:

cat /sys/bus/serio/drivers/atkbd/serio0/softraw

As per gilles post, for loadable modules you could use modinfo to list specific parameters and possible values but that doesn't work for built-in modules (although there have been attempts to add support for built-in modules):

modinfo ipv6
modinfo: ERROR: Module ipv6 not found.
  • Is there any way I can apply this procedure to a built-in kernel module? (I can't switch the atkbd module so it is compiled as a module). By a built-in kernel module I mean a module that is 'hard-compiled' into the kernel - I can't even disable it (or I don't know how). And thanks for the 'module' part. I didn't know I can pass parameters to kernel modules, in comparison to the kernels 'core'. – colemik Sep 19 '12 at 17:13

You can't tell whether a parameter is valid. Parameters passed to the kernel are also passed to modules (in addition to the parameters passed when loading the module itself), and maybe a module that you haven't loaded yet will understand this parameter.

The modinfo command lists the parameters that a module understands. You can see the parameters of a loaded module in /sys/module/$module_name/parameteres/. I am not aware of anything similar for the kernel itself.


/proc/cmdline file contains the parameters which were passed to the kernel.

  • Does this mean that plasticDuck does not show up in cmdline? – Marco Sep 19 '12 at 13:16
  • @Marco it still shows up in cmdline, even if 'not valid'. – colemik Sep 19 '12 at 13:18
  • This answer is totally irrelevant to the question then. – Marco Sep 19 '12 at 13:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.