Page MenuHomeVyOS Platform

Add grub-settings to system section in VyOS config-mode
Open, WishlistPublicFEATURE REQUEST

Description

There might be one or another reason for why someone wants to add one or more options to the linux boot string configured by grub.

Today the workaround is to manually edit /boot/grub/grub.cfg each time you perform an upgrade through "add system image" which would be handy if the added text to the linux boot options could be handled by a configure option through VyOS config-mode.

While adding this it would also be nice to add ability to alter the "set timeout=" value of grub.cfg

That is this feature request is to add these two options to the system section of VyOS config-mode:

set system boot timeout [0-3600]
set system boot appendstring "string" [0-256 chars]

For timeout 0 it means it will boot the default option directly otherwise it will countdown the number of seconds specified. 300 seconds (5 minute) should be used as an upper limit (havent found what the true upper limit is for the timeout but 300 seconds "should be more than enough", but also as a safe upper limit in case somebody mistypes this setting compared to allowing lets say 3600 seonds).

For the bootstring it should be encapsulated by " because it might contain spaces. Whats written here will be appended to the already existing linux bootstring in grub.cfg. The maxlength depends on archicture according to: https://www.kernel.org/doc/html/v6.1/admin-guide/kernel-parameters.html

The number of kernel parameters is not limited, but the length of the complete command line (parameters including spaces etc.) is limited to a fixed number of characters. This limit depends on the architecture and is between 256 and 4096 characters. It is defined in the file ./include/uapi/asm-generic/setup.h as COMMAND_LINE_SIZE.

The content of the above in current LInux kernel LTS 6.1.42 is https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/include/uapi/asm-generic/setup.h?h=v6.1.42:

#define COMMAND_LINE_SIZE	512

Which gives that "set system boot appendstring" should allow for max 512 bytes string but the true limit is smaller since one must take into account already existing string length. Since this string in VyOS 1.4-rolling-202308020317 is 201 bytes a safe upper limit for "set system boot appendstring" perhaps should be set to max 256 bytes?

Ref: https://www.gnu.org/software/grub/manual/grub/html_node/timeout.html

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Improvement (missing useful functionality)