Dear BusyBox devs,

Could you take a look at this Alpine Linux issue?
https://gitlab.alpinelinux.org/alpine/aports/-/issues/13578

I believe that init command from BusyBox overrides HOME and TERM environment variables that were set in boot params.

As a result, the following env vars that were set in boot params:
HOME=/root
TERM=linux

are changed to:
HOME=/
TERM=vt102

I suggest to check if HOME env var is set instead of hardcoding it:

        putenv((char *) "HOME=/");

When it comes to TERM env var, a more sophisticated check is made:

#ifdef VT_OPENQRY
        if (ioctl(STDIN_FILENO, VT_OPENQRY, &vtno) != 0) {
                /* Not a linux terminal, probably serial console.
                 * Force the TERM setting to vt102
                 * if TERM is set to linux (the default) */
                if (!s || strcmp(s, "linux") == 0)
                        putenv((char*)"TERM=vt102");
# if !ENABLE_FEATURE_INIT_SYSLOG
                G.log_console = NULL;
# endif
        } else
#endif

Maybe adding a CONFIG_CHECK_VT_OPENQRY in order to make this check optional would be a good idea?

Please share your thoughts.

Regards,
jkm


_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to