The significance of — in kernel parameters

bootkernel

I've been customising some kernel parameters and notice that on some guides it has something like

initrd=/blahblah.gz -- quiet

and others only have

initrd=/blahblah.gz quiet

I've tried both and noticed no difference – is there one? if so, what does the double dash do?

Best Answer

  • Let's suppose you want to pass a file as the parameter to the kernel. The filename of a file contains a dash at the first character of the filename (i.e. -Justin). If you'd write:

    kernel-2.3.4 -Justin --
    

    then -Justin would be treated as a kernel _parameter_ (or maybe I should say, 'a flag', as killermist wrote it). Thank God, such parameter (such flag) does not exist.

    If on the other hand, you'd write:

    kernel-2.3.4 -- -Justin
    

    then '-Justin` would be treated as an actual _file[name]_.

    kernel-2.3.4 -param1 -param2 -param3 -- file1 file2 -Justin
    

    If you invoke a program from the command line, -- is used to inform a program, that _after_ -- there will only be filenames / some other objects (objects different than the 'native' switches for the program - by native switches i mean i.e. -a -b -c -s etc.).

  • Related Question