grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: are posix-shell-compliant continuation lines valid/supported, or not


From: Dimitri John Ledkov
Subject: Re: are posix-shell-compliant continuation lines valid/supported, or not, in /etc/default/grub ?
Date: Fri, 20 Mar 2020 00:57:21 +0000

Have you opened a launchpad bug report against the grub2 package with both configs before and after? What is the bug number there?

In general, we do parse and rewrite configs using debconf which is Perl / C / Shell processing using tools external to grub. In general, we advise to customize via grub.d drop-in files instead of modifying etc/default/grub file itself.

This is a bit out of scope for the upstream mailing list, as debconf integration is downstream specific on Ubuntu/Debian systems.

On Thu, 19 Mar 2020, 21:20 PGNet Dev, <address@hidden> wrote:
a recent grub package update, in ubuntu 18LTS, is breaking /etc/default/grub by mangling/overwriting users' entries, in the specific case of using continuation lines in the file/config. and, subsequently, the upgrade process on these servers.

as stated clearly at

        https://www.gnu.org/software/grub/manual/grub/html_node/Simple-configuration.html#Simple-configuration-handling

        "...
        The file /etc/default/grub controls the operation of grub-mkconfig. It is sourced by a shell script, and so must be valid POSIX shell input; normally, it will just be a sequence of ‘KEY=value’ lines, but if the value contains spaces or other special characters then it must be quoted
        ..."

per POSIX

        https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02_01

        "...
        Escape Character (Backslash)

        A <backslash> that is not quoted shall preserve the literal value of the following character, with the exception of a <newline>. If a <newline> follows the <backslash>, the shell shall interpret this as line continuation. The <backslash> and <newline> shall be removed before splitting the input into tokens. Since the escaped <newline> is removed entirely from the input and is not replaced by any white space, it cannot serve as a token separator.

        ..."

all that's to say that continuation lines appear to be supported in posix-shell-compliant /etc/default/grub

they've been in use here, on 100s of servers, in grub configs for ages.

with grub 2.04 on other, non Ubu OS, it continues to work fine.

re: the use of continuation lines, ubu dev states that

        "Regardless of what the POSIX spec says, this is highly unusual abuse of POSIX shell semantics, and I do not see a need to support it"

it'd be useful/helpful to get clear on what the 'official' grub project support for use of posix-shell-compliant continuation lines is ...

are they 'supported' as valid use in /etc/default/grub, or not?

also useful to know/understand whether any grub update can/should mangle a user's /etc/default/grub.  allowed? expected?

thx!



_______________________________________________
Grub-devel mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/grub-devel

reply via email to

[Prev in Thread] Current Thread [Next in Thread]