[Libre-soc-dev] Coriolis2 Non-Chroot Script
Andrey Miroshnikov
andrey at technepisteme.xyz
Sun Sep 12 17:17:57 BST 2021
On 11/09/2021 22:59, Andrey Miroshnikov wrote:
> Now that I understand "mk-deb-chroot" better, I ran it and made the
> chroot environment. Next I'll do the coriolis install without a
> "coriolis" chroot.
Currently working on this, and have an issue with "runuser" command.
This script is run from inside a chroot, as root (sudo bash).
Here's the block of code in question (using ellipsis for clarity):
runuser $SUDO_USER --preserve-environment -c '
...
git checkout 049e3abf9baf795e69b9ecb9c4f19de6131f8418
...
'
And I get the error:
warning: unable to access '/root/.config/git/ignore': Permission denied
HEAD is now at 049e3abf...
The command does complete, however the environment variables are
probably wrong as it tries to access root's git configuration.
Running without the --preserve-environment flag, the command works
without warnings.
Looking at runuser man page, --preserve-environment does not set HOME,
SHELL, USER, nor LOGNAME. Checking those variables by running:
runuser $SUDO_USER -c "echo $HOME
echo $SHELL
echo $USER
echo $LOGNAME"
With and without --preserve-environment I see no difference (refer to root).
Do you know which environment variables might be affecting git checkout?
The man page for git-checkout, I saw no mention of environment variables.
Andrey
More information about the Libre-soc-dev
mailing list