You are not logged in.

#1 2019-02-23 09:23:15

zerophase
Member
Registered: 2015-09-03
Posts: 239

[solved]Is there any means of mkinitcpio taking multiple presets?

I have a script for a hook that rebuilds kernels, but avoids doing that when that kernel was also updated that upgrade. The only problem is mkinitcpio needs multiple -p flags to build multiple presets at once, but not all. Requiring multiple -p flags just makes the logic for my script more complicated. Currently, how my script is written mkinitcpio only accepts the first item of a list of arguments passed to -p for building. Are there any switches for mkinitcpio that can take multiple kernel preset arguments at once?

Last edited by zerophase (2019-02-23 19:40:12)

Offline

#2 2019-02-23 10:28:30

ondoho
Member
Registered: 2013-04-30
Posts: 692
Website

Re: [solved]Is there any means of mkinitcpio taking multiple presets?

according to 'man mkinitcpio' you can use -P or -p or -p multiple times.
i don't see a problem there.
are you asking if mkinitcpio can accomodate your script, instead of the other way around?

...

i guess we should rather try to change your script, no?

Offline

#3 2019-02-23 18:24:39

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [solved]Is there any means of mkinitcpio taking multiple presets?

man mkinitcpio

Moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2019-02-23 18:30:12

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,531
Website

Re: [solved]Is there any means of mkinitcpio taking multiple presets?

This is not very clear.  Do you mean you have a list of presets that need to be built but you haven't found a way to construct the proper mkinitcpio line?

presets="first second third"
mkinitcpio $(printf '-p %s ' $presets)

"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2019-02-23 19:39:48

zerophase
Member
Registered: 2015-09-03
Posts: 239

Re: [solved]Is there any means of mkinitcpio taking multiple presets?

Trilby wrote:

This is not very clear.  Do you mean you have a list of presets that need to be built but you haven't found a way to construct the proper mkinitcpio line?

presets="first second third"
mkinitcpio $(printf '-p %s ' $presets)

Thanks. Yeah, printf would work for adding the -p. I was just hoping there might have been an undocumented feature allowing for multiple presets, without multiple -p flags.

Offline

Board footer

Powered by FluxBB