[PATCH] ash: add built-in $ASH_VERSION variable

Kang-Che Sung explorer09 at gmail.com
Thu Mar 11 07:12:58 UTC 2021


On Thu, Mar 11, 2021 at 2:55 PM Ariadne Conill <ariadne at dereferenced.org> wrote:
>
> This is helpful for detecting if the shell is busybox ash or not,
> which is necessary for enabling ash-specific features in /etc/profile
> and Alpine's default $ENV.
>
> https://gitlab.alpinelinux.org/alpine/aports/-/issues/12398 outlines
> the rationale for detecting what shell is running in /etc/profile and
> similar.
>
> function                                             old     new   delta
> varinit_data                                         360     384     +24
> .rodata                                            77899   77922     +23
> bbconfig_config_bz2                                 6127    6120      -7
> ------------------------------------------------------------------------------
> (add/remove: 0/0 grow/shrink: 2/1 up/down: 47/-7)              Total: 40 bytes
>
> Signed-off-by: Ariadne Conill <ariadne at dereferenced.org>

Setting ASH_VERSION to BusyBox's version seems to be a bad idea.
There are many variants of ash shell and BusyBox's is just one of them.
A quick Google search also shows that ASH_VERSION (as an env variable) is used
by someone else. The variable name is not exclusive to us.


More information about the busybox mailing list