[yast-devel] Modify Kernel parameters call
Hi list, with grub2 we have problem with old API that bootloader provide as it modify sections, but grub2 generate parameters from global parameters. Result is that old method work unreliable and we get some serious bug reports about it especially with xen. It also need nasty hack in perl-bootloader that choose first modified section and convert parameters to global one, which do not work nice. So I propose new API[1] and would like to know your opinions. It is documented and contain also examples of usage. It is designed more like swiss knife then single purpose API as current usage is very different ( some need to add only to common kernel like cio_ignore and do not have it in failsafe, others like crashdump should be everywhere and others like yast2-vm need only xen related ). Other option is to create specialized methods that set given type of kernel, but in some case it create more code then needed. Packages that should use this new api are: - installation - kdump - s390 - vm - tune Josef [1] https://github.com/yast/yast-bootloader/pull/87 -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On Tue, 13 May 2014 10:41:26 +0200 Josef Reidinger <jreidinger@suse.cz> wrote:
Hi list, with grub2 we have problem with old API that bootloader provide as it modify sections, but grub2 generate parameters from global parameters. Result is that old method work unreliable and we get some serious bug reports about it especially with xen. It also need nasty hack in perl-bootloader that choose first modified section and convert parameters to global one, which do not work nice.
So I propose new API[1] and would like to know your opinions. It is documented and contain also examples of usage. It is designed more like swiss knife then single purpose API as current usage is very different ( some need to add only to common kernel like cio_ignore and do not have it in failsafe, others like crashdump should be everywhere and others like yast2-vm need only xen related ). Other option is to create specialized methods that set given type of kernel, but in some case it create more code then needed.
Packages that should use this new api are: - installation - kdump - s390 - vm - tune
Josef
After discussions on lunch, IRC and also directly in pull request I change slightly API. If noone have objections I will add it tomorrow and start modifying users of API to use it. Examples of usage: # getter Bootloader.kernel_param("crashkernel") # => "256M@64B" Bootloader.kernel_param("cio_ignore", :recovery) # => :missing Bootloader.kernel_param("verbose", :xen_guest) # => :present # setter Bootloader.modify_kernel_params(:common, :recovery, :xen_guest, "crashkernel" => "256M@64M") # alternative with array as first argument targets = [:common, :recovery, :xen_guest] Bootloader.modify_kernel_params(targets, "crashkernel" => "256M@64M") Bootloader.modify_kernel_params("cio_ignore" => :missing) Bootloader.modify_kernel_params(:xen_host, "verbose" => :present) Josef -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On Tue, May 13, 2014 at 03:05:56PM +0200, Josef Reidinger wrote:
On Tue, 13 May 2014 10:41:26 +0200 Josef Reidinger <jreidinger@suse.cz> wrote:
After discussions on lunch, IRC and also directly in pull request I change slightly API.
If noone have objections I will add it tomorrow and start modifying users of API to use it.
Examples of usage:
# getter Bootloader.kernel_param("cio_ignore", :recovery)
# setter Bootloader.modify_kernel_params(:common, :recovery, :xen_guest, "crashkernel" => "256M@64M")
I think it's confusing to once pass the target as second parameter and the other time the value. Regards, Arvin -- Arvin Schnell, <aschnell@suse.de> Senior Software Engineer, Research & Development SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Maxfeldstraße 5 90409 Nürnberg Germany -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On Tue, 13 May 2014 15:10:24 +0200 Arvin Schnell <aschnell@suse.de> wrote:
On Tue, May 13, 2014 at 03:05:56PM +0200, Josef Reidinger wrote:
On Tue, 13 May 2014 10:41:26 +0200 Josef Reidinger <jreidinger@suse.cz> wrote:
After discussions on lunch, IRC and also directly in pull request I change slightly API.
If noone have objections I will add it tomorrow and start modifying users of API to use it.
Examples of usage:
# getter Bootloader.kernel_param("cio_ignore", :recovery)
# setter Bootloader.modify_kernel_params(:common, :recovery, :xen_guest, "crashkernel" => "256M@64M")
I think it's confusing to once pass the target as second parameter and the other time the value.
Regards, Arvin
OK, valid objection. If I change it to Bootloader.kernel_param(:recovery, "cio_ignore") then it won't be possible to specify default value of flavor ( now :common ). So it is question what worse. but I think non-confusing API is more important, so I just remove default for flavor Josef -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
participants (2)
-
Arvin Schnell
-
Josef Reidinger