Hi, there have been systems failing to boot in the past (#532324) because there was no consensus about what scripts may assume that /bin/sh implements.
Due disagreement on #532324, the Technical Committee was called to decide in #539158. Their decision was: | 1. The Technical Committee refuses to overrule the udev maintainer, as | requested by Bug 539158. The committee suggests that the policy | maintainers document in the policy what the current best practices on | providing printf (and similar functions used in the initrd like [ and | test) by shells. I think not overruling udev's maintainer was correct, because #532324 was just one symptom of an underlying problem and just fighting symptoms is wrong. The underlying problem is that the policy does not reflect reality, or, vice versa, that reality does not care about section 10.4 of the policy. Imagine, for example, what could happen if 'which' would not work until /usr/ is mounted[1]. 'setupcon', that is used to setup the console during boot, also uses 'printf', but luckily not the part that currently is run before mounting. Not requiring '[' as builtin command without providing /bin/[ is also wrong, and even if nobody ever would build such a shell, policy and reality should match (at least for documentation purposes). There are also a few bugs somehow related to /bin/sh, among them #538822 and #540512. A sane solution to the /bin/sh related bugs might enable additional shells to become /bin/sh. This would significantly raise the probability of bugs similar to #532324 to occur. I see two possible ways solve this problem without requiring to remove 'printf' from various scripts: 1. Move the binaries 'printf', '[' and 'test' to /bin with compatibility symlinks in /usr/bin. 2. Adapt the Debian policy to require 'printf', '[' and 'test' as builtin commands for all shells that can be used as /bin/sh. Moving the binaries to /bin has already been requested in #532343. Quoting the relevant part[2]: | >would you be willing to move [, printf and test to /bin/ and place | >symlinks to them in /usr/bin/ to help resolving this problem? | | Not really, as to be consistent you'd need *all* posix utilities in | /bin. I'd rather just say that debian supports all posix commands, shell | builtin or not, once /usr is mounted. Anything else is just too | complicated (and affects more than just this specific case, and more | than just coreutils). Your decision seems to be based on the assumption that the reason why this was requested was to comply with POSIX, even before /usr is mounted. A more appropriate reason for this request is to improve the conformance between Debian's policy and its userland. Having these binaries in /bin/ would also: * avoid the need to adapt (nearly?) all shells before they are eligible to become /bin/sh in Debian * avoid the need to adapt the Debian policy accordingly[3] * make the way 'printf' is provided consistent to the way its predecessor[4] 'echo' is provided Please reconsider your decision regarding moving these binaries to /bin. If you do not want to move them, please reassign this bug to "debian-policy" and retitle it to "debian-policy: please require builtin printf, test and [ by system shells". Thanks Carsten [1] /bin/which uses printf on non-ksh shells, though there is a possible workaround for this: http://git.eyrie.org/?p=devel/c-tap-harness.git;a=commitdiff;h=83dc5bef09e6dd6fef60debf257039b758f2a43b [2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=532343#57 [3] Otherwise at least the '[' and 'test' part would require to be fixed and very likely the 'printf' part too. [4] POSIX reads: "New applications are encouraged to use printf instead of echo". -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org