On 01/11/2024 at 00:28, Alexander Andreyev wrote:

Proposed solution: backslash ('\') and dollar sign ('$') should be
properly escaped when copying kernel parameters from /proc/cmd to /etc/grub/defaults.

For example, this parameter from /proc/cmd

     memmap=0x1000$0x2f1ac000,0x1000$0x6af53000

can be written in /etc/grub/defaults as follows:

     GRUB_CMDLINE_LINUX="memmap=0x1000\\\$0x2f1ac000,0x1000\\\$0x6af53000"

AFAIK grub-installer only writes the kernel parameters into debconf database and grub-<platform> postinst script reads them from debconf and writes them into /etc/default/grub. I wonder if '$' escaping should be done by grub-installer or by grub-<platform> package postinst script. IMO the latter would be best, so that the plain unescaped kernel parameters are registered in debconf.

Reply via email to