Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 973aeb046625
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c34507d795fa
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Jun 19, 2020

  1. nixos-install: error out if $mountPoint has bad permissions

    The nix store more-or-less requires o+rx on all parent directories.
    This is primarily because nix runs builders in a uid/gid mapped
    user-namespace, and those builders have to be able to operate on the nix
    store.
    
    This check is especially helpful because nix does not produce a helpful
    error on its own (rather, creating directories and such works, it's not
    until 'mount --bind' that it gets an EACCES).
    
    Helps users who run into this opaque error, such as in #67465.
    Possibly fixes that issue if bad permissions were the only cause.
    euank committed Jun 19, 2020
    Copy the full SHA
    460c0d6 View commit details

Commits on Jul 5, 2020

  1. Merge pull request #90431 from euank/nixos-install-warn

    nixos-install: error out if $mountPoint has bad permissions
    matthewbauer authored Jul 5, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c34507d View commit details
Showing with 11 additions and 0 deletions.
  1. +11 −0 nixos/modules/installer/tools/nixos-install.sh
11 changes: 11 additions & 0 deletions nixos/modules/installer/tools/nixos-install.sh
Original file line number Diff line number Diff line change
@@ -71,6 +71,17 @@ if ! test -e "$mountPoint"; then
exit 1
fi

# Verify permissions are okay-enough
checkPath="$(realpath "$mountPoint")"
while [[ "$checkPath" != "/" ]]; do
mode="$(stat -c '%a' "$checkPath")"
if [[ "${mode: -1}" -lt "5" ]]; then
echo "path $checkPath should have permissions 755, but had permissions $mode. Consider running 'chmod o+rx $checkPath'."
exit 1
fi
checkPath="$(dirname "$checkPath")"
done

# Get the path of the NixOS configuration file.
if [[ -z $NIXOS_CONFIG ]]; then
NIXOS_CONFIG=$mountPoint/etc/nixos/configuration.nix