Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/lib/make-squashfs: set root mode to 0755 #363247

Merged
merged 1 commit into from
Dec 8, 2024

Conversation

adamcstephens
Copy link
Contributor

default is 0777 which is likely undesirable in all situations

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

default is 0777 which is likely undesirable in all situations
@github-actions github-actions bot added the 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS label Dec 8, 2024
@adamcstephens
Copy link
Contributor Author

Using a simple builder of this

let                                                                                                                  
  pkgs = import <nixpkgs> { };                                                                                       
in                                                                                                                   
pkgs.callPackage ./nixos/lib/make-squashfs.nix {                                                                     
  fileName = "test";                                                                                                 
                                                                                                                     
  noStrip = true; # keep directory structure                                                                         
  comp = "zstd -Xcompression-level 6";                                                                               
                                                                                                                     
  storeContents = [ pkgs.hello ];                                                                                    
                                                                                                                     
  pseudoFiles = [                                                                                                    
    "/sbin d 0755 0 0"                                                                                               
    "/dev d 0755 0 0"                                                                                                
    "/proc d 0555 0 0"                                                                                               
    "/sys d 0555 0 0"                                                                                                
  ];                                                                                                                 
}

I had before:

bsh─❯ unsquashfs -ll result | head
drwxrwxrwx root/root               113 1979-12-31 19:00 squashfs-root

and after:

bsh─❯ unsquashfs -ll result | head -n 1
drwxr-xr-x root/root               113 1979-12-31 19:00 squashfs-root

@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Dec 8, 2024
@adamcstephens
Copy link
Contributor Author

/nix/store/lzbfk4nsx1gaza6k4mw9456vh7dlbm7w-vm-test-run-boot-netboot-uefi
/nix/store/ki5hpym36qh1mijiigbh23hi3ywhsf4c-vm-test-run-boot-netboot-bios
/nix/store/hphgjy8vab0gr8pvxm8z3zqfiyfqghsc-vm-test-run-installer-simple
/nix/store/2vqi0b2yf0k1hnlz49ac1rd6yz5x6m12-vm-test-run-container-systemd-init

@mweinelt mweinelt merged commit e5bddbc into NixOS:master Dec 8, 2024
20 of 21 checks passed
@adamcstephens adamcstephens deleted the push-zulqpssvvkkz branch December 8, 2024 18:20
@mweinelt mweinelt added the backport release-24.11 Backport PR automatically label Dec 8, 2024
@nix-backports
Copy link

nix-backports bot commented Dec 8, 2024

Successfully created backport PR for release-24.11:

@nix-backports
Copy link

nix-backports bot commented Dec 8, 2024

Git push to origin failed for release-24.11 with exitcode 1

@nix-backports
Copy link

nix-backports bot commented Dec 8, 2024

Backport failed for release-24.05, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release-24.05
git worktree add -d .worktree/backport-363247-to-release-24.05 origin/release-24.05
cd .worktree/backport-363247-to-release-24.05
git switch --create backport-363247-to-release-24.05
git cherry-pick -x da18b9bc79a0c5a82c11fe303f35db4b38013e6e

@nix-backports
Copy link

nix-backports bot commented Dec 8, 2024

Git push to origin failed for release-24.11 with exitcode 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 backport release-24.11 Backport PR automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants