about summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorannalee <150648636+a-n-n-a-l-e-e@users.noreply.github.com>2024-03-25 18:04:41 +0000
committerannalee <150648636+a-n-n-a-l-e-e@users.noreply.github.com>2024-03-25 18:04:41 +0000
commit7541ec60b6f2d38b76e057135bb5942b78d3370c (patch)
tree319913607bb3ec024577259fdc2c561a651afba7 /pkgs/build-support
parent90e2c2cda5f3650c46c00bebf02fcdc34129cbd4 (diff)
parent88e7ad7c3029b39166da303c8f30c8ee96ccd233 (diff)
Merge remote-tracking branch 'upstream/master' into staging-next
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/build-fhsenv-bubblewrap/default.nix10
1 files changed, 9 insertions, 1 deletions
diff --git a/pkgs/build-support/build-fhsenv-bubblewrap/default.nix b/pkgs/build-support/build-fhsenv-bubblewrap/default.nix
index 56dce551870e8..e06fb51dd4b67 100644
--- a/pkgs/build-support/build-fhsenv-bubblewrap/default.nix
+++ b/pkgs/build-support/build-fhsenv-bubblewrap/default.nix
@@ -133,6 +133,8 @@ let
     ro_mounts=()
     symlinks=()
     etc_ignored=()
+
+    # loop through all entries of root in the fhs environment, except its /etc.
     for i in ${fhsenv}/*; do
       path="/''${i##*/}"
       if [[ $path == '/etc' ]]; then
@@ -146,6 +148,7 @@ let
       fi
     done
 
+    # loop through the entries of /etc in the fhs environment.
     if [[ -d ${fhsenv}/etc ]]; then
       for i in ${fhsenv}/etc/*; do
         path="/''${i##*/}"
@@ -154,7 +157,11 @@ let
         if [[ $path == '/fonts' || $path == '/ssl' ]]; then
           continue
         fi
-        ro_mounts+=(--ro-bind "$i" "/etc$path")
+        if [[ -L $i ]]; then
+          symlinks+=(--symlink "$i" "/etc$path")
+        else
+          ro_mounts+=(--ro-bind "$i" "/etc$path")
+        fi
         etc_ignored+=("/etc$path")
       done
     fi
@@ -166,6 +173,7 @@ let
       ro_mounts+=(--ro-bind /etc /.host-etc)
     fi
 
+    # link selected etc entries from the actual root
     for i in ${escapeShellArgs etcBindEntries}; do
       if [[ "''${etc_ignored[@]}" =~ "$i" ]]; then
         continue