mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 11:36:07 +01:00
Install login scripts and proot only if needed
This commit is contained in:
parent
eb2fcc80f5
commit
ed05a33fc0
3 changed files with 43 additions and 36 deletions
|
|
@ -50,15 +50,33 @@ in
|
|||
config = {
|
||||
|
||||
build.activation = {
|
||||
installLoginScripts = ''
|
||||
$DRY_RUN_CMD mkdir $VERBOSE_ARG --parents /bin /usr/lib
|
||||
$DRY_RUN_CMD cp $VERBOSE_ARG ${login} /bin/login
|
||||
$DRY_RUN_CMD cp $VERBOSE_ARG ${loginInner} /usr/lib/login-inner
|
||||
installLogin = ''
|
||||
if ! diff /bin/login ${login} > /dev/null; then
|
||||
$DRY_RUN_CMD mkdir $VERBOSE_ARG --parents /bin
|
||||
$DRY_RUN_CMD cp $VERBOSE_ARG ${login} /bin/.login.tmp
|
||||
$DRY_RUN_CMD chmod $VERBOSE_ARG u+w /bin/.login.tmp
|
||||
$DRY_RUN_CMD mv $VERBOSE_ARG /bin/.login.tmp /bin/login
|
||||
fi
|
||||
'';
|
||||
|
||||
installLoginInner = ''
|
||||
if (test -e /usr/lib/.login-inner.new && ! diff /usr/lib/.login-inner.new ${loginInner} > /dev/null) || \
|
||||
(! test -e /usr/lib/.login-inner.new && ! diff /usr/lib/login-inner ${loginInner} > /dev/null); then
|
||||
$DRY_RUN_CMD mkdir $VERBOSE_ARG --parents /usr/lib
|
||||
$DRY_RUN_CMD cp $VERBOSE_ARG ${loginInner} /usr/lib/.login-inner.tmp
|
||||
$DRY_RUN_CMD chmod $VERBOSE_ARG u+w /usr/lib/.login-inner.tmp
|
||||
$DRY_RUN_CMD mv $VERBOSE_ARG /usr/lib/.login-inner.tmp /usr/lib/.login-inner.new
|
||||
fi
|
||||
'';
|
||||
|
||||
installProotStatic = ''
|
||||
$DRY_RUN_CMD mkdir $VERBOSE_ARG --parents /bin
|
||||
$DRY_RUN_CMD cp $VERBOSE_ARG ${cfg.prootStatic}/bin/proot-static /bin/.proot-static.new
|
||||
if (test -e /bin/.proot-static.new && ! diff /bin/.proot-static.new ${cfg.prootStatic}/bin/proot-static > /dev/null) || \
|
||||
(! test -e /bin/.proot-static.new && ! diff /bin/proot-static ${cfg.prootStatic}/bin/proot-static > /dev/null); then
|
||||
$DRY_RUN_CMD mkdir $VERBOSE_ARG --parents /bin
|
||||
$DRY_RUN_CMD cp $VERBOSE_ARG ${cfg.prootStatic}/bin/proot-static /bin/.proot-static.tmp
|
||||
$DRY_RUN_CMD chmod $VERBOSE_ARG u+w /bin/.proot-static.tmp
|
||||
$DRY_RUN_CMD mv $VERBOSE_ARG /bin/.proot-static.tmp /bin/.proot-static.new
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue