Merge pull request #110825 from andresilva/appimage-fixes

build-fhs-userenv: fixes for mount points
This commit is contained in:
Kevin Cox 2021-02-03 09:56:14 -05:00 committed by GitHub
commit ab5a9d5746
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -24,8 +24,6 @@ let
"unshareUser" "unshareCgroup" "unshareUts" "unshareNet" "unsharePid" "unshareIpc"
]);
chrootenv = callPackage ./chrootenv {};
etcBindFlags = let
files = [
# NixOS Compatibility
@ -37,6 +35,8 @@ let
"hosts"
"resolv.conf"
"nsswitch.conf"
# User profiles
"profiles"
# Sudo & Su
"login.defs"
"sudoers"
@ -80,6 +80,11 @@ let
if [[ -d ${env}/etc ]]; then
for i in ${env}/etc/*; do
path="/''${i##*/}"
# NOTE: we're binding /etc/fonts from the host so we don't want to
# override it with a path from the FHS environment.
if [[ $path == '/fonts' ]]; then
continue
fi
ro_mounts+=(--ro-bind "$i" "/etc$path")
done
fi

View File

@ -89,6 +89,9 @@ let
ln -s /host/etc/resolv.conf resolv.conf
ln -s /host/etc/nsswitch.conf nsswitch.conf
# symlink user profiles
ln -s /host/etc/profiles profiles
# symlink sudo and su stuff
ln -s /host/etc/login.defs login.defs
ln -s /host/etc/sudoers sudoers