Merge branch 'pr/posh-profile-loading' into 'master'

pkgs/posh: spawn login shell

See merge request steveeJ/infra!29
This commit is contained in:
steveej 2019-12-13 11:52:44 +00:00
commit 4a6c541c0b

View file

@ -167,7 +167,7 @@ in
source /etc/profile source /etc/profile
test -S "$SSH_AUTH_SOCK" && ssh="-v $SSH_AUTH_SOCK:$SSH_AUTH_SOCK -e SSH_AUTH_SOCK" test -S "$SSH_AUTH_SOCK" && ssh="-v $SSH_AUTH_SOCK:$SSH_AUTH_SOCK -e SSH_AUTH_SOCK"
tty -s && tty="-t" || quiet="-q" tty -s && tty="-t" entrypoint=--entrypoint='["/usr/bin/env","bash","-il"]' || quiet="-q"
# define these as variables so we can override them at runtime # define these as variables so we can override them at runtime
POSH_IMAGE=${image} POSH_IMAGE=${image}
@ -179,6 +179,8 @@ in
# TODO parse the beginning of the command for POSH_* overrides # TODO parse the beginning of the command for POSH_* overrides
fi fi
test "$@" && cmd=( -c "$@")
HOME_CONTAINERS_CONFIGDIR="$HOME/.config/containers" HOME_CONTAINERS_CONFIGDIR="$HOME/.config/containers"
HOME_POLICY_JSON="$HOME_CONTAINERS_CONFIGDIR/policy.json" HOME_POLICY_JSON="$HOME_CONTAINERS_CONFIGDIR/policy.json"
test -d $HOME_CONTAINERS_CONFIGIDR || mkdir $HOME_CONTAINERS_CONFIGIDR test -d $HOME_CONTAINERS_CONFIGIDR || mkdir $HOME_CONTAINERS_CONFIGIDR
@ -188,7 +190,8 @@ in
${global_args} run --rm -i $tty $ssh -v ~/:/root -w /root --network host --pull=''${POSH_PULL} \ ${global_args} run --rm -i $tty $ssh -v ~/:/root -w /root --network host --pull=''${POSH_PULL} \
--conmon ${pkgs.conmon}/bin/conmon --runtime ${pkgs.runc}/bin/runc \ --conmon ${pkgs.conmon}/bin/conmon --runtime ${pkgs.runc}/bin/runc \
--config ${podmanConfig} \ --config ${podmanConfig} \
${run_args} ''${POSH_IMAGE} $@ ${run_args} \
''${POSH_IMAGE} /usr/bin/env bash -l "''${cmd[@]}"
'') '')
.overrideAttrs(attrs: attrs // { .overrideAttrs(attrs: attrs // {
passthru = { passthru = {