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

Re: /bin/sh (was Re: jessie release goals)



On Tue, May 07, 2013 at 07:46:43PM +0200, Marc Haber wrote:
> On Tue, 7 May 2013 16:46:46 +0200, md@Linux.IT (Marco d'Itri) wrote:
> >On May 07, Thorsten Glaser <tg@debian.org> wrote:
> >> My stated goal here is, indeed, to be able to run at least some useful
> >> configurations of a Debian installation without *both* bash and dash
> >> installed.
> >What is the point?
> 
> A smaller footprint of the intalled system? This may be interesting
> for embedded things.
> 
> Greetings
> Marc

While that might be of some interest the real goal of the change was
to be able to have more than *2* packages provide /bin/sh.

Currently, due to the totaly screwed up way this is done, only dash or
bash can be /bin/sh.

But we already have 4 working candidates for /bin/sh:
bash, bash-static, dash, mksh

Add 2 more if dash and mksh build static flavours too. posh, ksh93,
(yash or zsh) could also become candidates with a little work it seems.

Double that for multiarch on amd64/i386 because there is bash:i386 and
bash:amd64 that both work just fine as /bin/sh. Trying to install a
foreign bash or dash fails horribly though with the current diversion
hack.

Double that for kfreebsd with multiarch. kfreebsd-amd64 currently has
16 /bin/sh candidates.

The current implementation of /bin/sh handling simply restricts the
freedom to choose a /bin/sh. Not because only 2 shells are suitable
and maintainable but simply because of the way the /bin/sh link is
managed with diversions. Debian is about freedom and choice, right?


Proposed solution:

- New virtual package system-shell with something essential
  depending on it (base-files?)

- bash, dash pre-depend on system-shell for the transition

- new packages system-shell-<name>
  Provides, Replaces, Conflicts: system-shell
  contains /bin/sh -> /bin/<name> symlink

None of system-shell-* would be essential but through the dependency
of something essential at least one would always be installed
(pseudo-essential). One of them (system-shell-dash) should have a
higher priority than the rest to be singled out as the default and
the essential package would depend system-shell-dash | system-shell.

Choosing /bin/sh is then simply done by installing the right package
and dpkg does the change atomically. No messing around in
pre/postinst/rm scripts or race conditions where the link might
disapear for a while. No artificial limit on how many system-shell-*
packages there could be. 

MfG
	Goswin


Reply to: