From 0f84a1039cf18b94e8d486282ed8f70df7197aff Mon Sep 17 00:00:00 2001 From: Zhong Jianxin Date: Tue, 7 May 2024 19:18:07 +0800 Subject: [PATCH] login: Do not dereference proot binds `/bin` and `/etc` `/bin` and `/etc` are symlinks to `/system/bin` and `/system/etc`, by default proot will dereference and override them with new contents. After this change, `/system/bin` and `/system/etc` are kept untouched, so commands like `/system/bin/ping` can be run directly. --- AUTHORS | 1 + modules/environment/login/login.nix | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index 95a3b729..60042334 100644 --- a/AUTHORS +++ b/AUTHORS @@ -2,3 +2,4 @@ Alexander Sosedkin Tobias Happ Bruno Bigras Evgeny Kurnevsky +Zhong Jianxin diff --git a/modules/environment/login/login.nix b/modules/environment/login/login.nix index a7cfe8c2..4052d73e 100644 --- a/modules/environment/login/login.nix +++ b/modules/environment/login/login.nix @@ -48,8 +48,8 @@ writeScript "login" '' exec ${installationDir}/bin/proot-static \ -b ${installationDir}/nix:/nix \ - -b ${installationDir}/bin:/bin \ - -b ${installationDir}/etc:/etc \ + -b ${installationDir}/bin:/bin! \ + -b ${installationDir}/etc:/etc! \ -b ${installationDir}/tmp:/tmp \ -b ${installationDir}/usr:/usr \ -b ${installationDir}/dev/shm:/dev/shm \