Export HOME in pmb.chroot.root() and -.user()

Set HOME to /root for commands started with pmb.chroot.root() and to
/home/pmos for commands started with pmb.chroot.user().

POSIX requires this variable to be set, see:
<http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html>

And this prevents a crash in "adb", which takes and alternative code
path if HOME is not set, that does not work with musl (fixes #1638).
Thanks to @ryang2678 for figuring this out!
This commit is contained in:
Oliver Smith 2018-10-25 07:18:43 +02:00
parent 8d461b2ecf
commit 5b33eb7520
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
2 changed files with 4 additions and 0 deletions

View file

@ -70,6 +70,7 @@ def root(args, cmd, suffix="native", working_dir="/", output="log",
# Merge env with defaults into env_all
env_all = {"CHARSET": "UTF-8",
"HISTFILE": "~/.ash_history",
"HOME": "/root",
"PATH": pmb.config.chroot_path,
"SHELL": "/bin/ash",
"TERM": "xterm"}