You are not logged in.

#1 2021-02-03 17:15:58

esuhl
Member
From: UK
Registered: 2009-09-16
Posts: 140

[SOLVED] Error in man mkinitcpio(8) ? Default option confusion ?

As a perpetual newbie, I'll bet this is my own silly error/confusion, but...

The online man mkinitcpio(8) page describes this option:

-g, --generate filename
Generate a CPIO image as filename. Default: no; this means nothing will be written to the filesystem unless this option is specified.

It sounds like this option MUST be specified for the command to have any effect.

Yet the mkinitcpio: Manual generation wiki section shows that mkinitcpio -p linux and mkinitcpio -P can be used without the -g option to generate images.

When using these commands, on-screen output shows that the -g option is passed, using the default image file locations.

----------

So... Is the man page correct, in that the -g option is absolutely required and gets passed automatically if omitted?  And some background magic is passing the -g option, rather than it being a baked-in mkinitcpio default?

Or is the man page incorrect in saying that omitting the -g option will result in no changes to the filesystem?

Last edited by esuhl (2021-02-03 22:36:04)

Offline

#2 2021-02-03 17:29:24

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,410

Re: [SOLVED] Error in man mkinitcpio(8) ? Default option confusion ?

This relates to the preset logic which all normal kernel packages will provide, read the ABOUT PRESETS section of the manpage if a file location is mentioned in a preset file that will imply and lead to the -g option being added.

Mkinitcpio is also just a bash script that you can read and if we do so you'll find

preset_image=${p}_image
        if [[ ${!preset_image} ]]; then
            preset_cmd+=(-g "${!preset_image}")
        else
            warning "No image file specified. Skipping image \`%s'" "$p"
            continue
        fi

in the process_preset function.

So no, there's not an error in either documentation smile

Last edited by V1del (2021-02-03 17:34:03)

Offline

#3 2021-02-03 22:35:35

esuhl
Member
From: UK
Registered: 2009-09-16
Posts: 140

Re: [SOLVED] Error in man mkinitcpio(8) ? Default option confusion ?

V1del wrote:

So no, there's not an error in either documentation smile

Awww... of course the error is mine!

Thanks for the explanation.  It makes sense now! :-)

Offline

Board footer

Powered by FluxBB