diff --git a/pmb/chroot/root.py b/pmb/chroot/root.py index a46b5dd8..d4e0f20b 100644 --- a/pmb/chroot/root.py +++ b/pmb/chroot/root.py @@ -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"} diff --git a/pmb/chroot/user.py b/pmb/chroot/user.py index cb5cb236..fa614cd4 100644 --- a/pmb/chroot/user.py +++ b/pmb/chroot/user.py @@ -34,6 +34,9 @@ def user(args, cmd, suffix="native", working_dir="/", output="log", See pmb.helpers.run_core.core() for a detailed description of all other arguments and the return value. """ + if "HOME" not in env: + env["HOME"] = "/home/pmos" + flat_cmd = pmb.helpers.run.flat_cmd(cmd, env=env) cmd = ["busybox", "su", "pmos", "-c", flat_cmd] return pmb.chroot.root(args, cmd, suffix, working_dir, output,