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/etc: file content missing in generated erofs when using overlay #392109

Open
3 tasks done
SaltyKitkat opened this issue Mar 22, 2025 · 4 comments
Open
3 tasks done
Labels
0.kind: bug Something is broken 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS

Comments

@SaltyKitkat
Copy link
Contributor

SaltyKitkat commented Mar 22, 2025

Nixpkgs version

  • Unstable (25.05)

Describe the bug

I notice the sudoers is not working as expected after enabling the etc.overlay option. Then I dumped the erofs generated by nix. I found the sudoers file is filled with all 0x00 bytes, but the same size as the sudoers source in the nix store. Then I learnt how the erofs image is generated, so I checked the etc-json and etc-dump file. In etc-json, I got

{"enable":true,"gid":0,"group":"+0","mode":"0440","source":"/nix/store/1ihajf7jmz3x30v918j3p5y2b6karrxy-sudoers","target":"sudoers","text":null,"uid":0,"user":"+0"}

while in etc-dump, I got

/sudoers 781 100440 1 0 0 0 1.0 sudoers - -

It seems there's something wrong when converting the json to the dump file, since the source info is lost.

Steps to reproduce

set system.etc.overlay.enable = true;

Expected behaviour

generate a normal etc erofs image

Screenshots

No response

Relevant log output

Additional context

By the way, I found that there's a lot of char files named from 00 to ff in the erofs image. Is this expected?

ls -l
total 252
crw-r--r-- 1 root root 0, 0 Jan  1  1970 00
crw-r--r-- 1 root root 0, 0 Jan  1  1970 01
crw-r--r-- 1 root root 0, 0 Jan  1  1970 02
crw-r--r-- 1 root root 0, 0 Jan  1  1970 03
crw-r--r-- 1 root root 0, 0 Jan  1  1970 04
crw-r--r-- 1 root root 0, 0 Jan  1  1970 05
crw-r--r-- 1 root root 0, 0 Jan  1  1970 06
crw-r--r-- 1 root root 0, 0 Jan  1  1970 07
crw-r--r-- 1 root root 0, 0 Jan  1  1970 08
crw-r--r-- 1 root root 0, 0 Jan  1  1970 09
crw-r--r-- 1 root root 0, 0 Jan  1  1970 0a
crw-r--r-- 1 root root 0, 0 Jan  1  1970 0b
crw-r--r-- 1 root root 0, 0 Jan  1  1970 0c
crw-r--r-- 1 root root 0, 0 Jan  1  1970 0d
crw-r--r-- 1 root root 0, 0 Jan  1  1970 0e
crw-r--r-- 1 root root 0, 0 Jan  1  1970 0f
crw-r--r-- 1 root root 0, 0 Jan  1  1970 10
crw-r--r-- 1 root root 0, 0 Jan  1  1970 11
crw-r--r-- 1 root root 0, 0 Jan  1  1970 12
crw-r--r-- 1 root root 0, 0 Jan  1  1970 13
crw-r--r-- 1 root root 0, 0 Jan  1  1970 14
crw-r--r-- 1 root root 0, 0 Jan  1  1970 15
crw-r--r-- 1 root root 0, 0 Jan  1  1970 16
crw-r--r-- 1 root root 0, 0 Jan  1  1970 17
crw-r--r-- 1 root root 0, 0 Jan  1  1970 18
crw-r--r-- 1 root root 0, 0 Jan  1  1970 19
crw-r--r-- 1 root root 0, 0 Jan  1  1970 1a
crw-r--r-- 1 root root 0, 0 Jan  1  1970 1b
crw-r--r-- 1 root root 0, 0 Jan  1  1970 1c
crw-r--r-- 1 root root 0, 0 Jan  1  1970 1d
crw-r--r-- 1 root root 0, 0 Jan  1  1970 1e
crw-r--r-- 1 root root 0, 0 Jan  1  1970 1f
crw-r--r-- 1 root root 0, 0 Jan  1  1970 20
crw-r--r-- 1 root root 0, 0 Jan  1  1970 21
crw-r--r-- 1 root root 0, 0 Jan  1  1970 22
crw-r--r-- 1 root root 0, 0 Jan  1  1970 23
crw-r--r-- 1 root root 0, 0 Jan  1  1970 24
crw-r--r-- 1 root root 0, 0 Jan  1  1970 25
crw-r--r-- 1 root root 0, 0 Jan  1  1970 26
crw-r--r-- 1 root root 0, 0 Jan  1  1970 27
crw-r--r-- 1 root root 0, 0 Jan  1  1970 28
crw-r--r-- 1 root root 0, 0 Jan  1  1970 29
crw-r--r-- 1 root root 0, 0 Jan  1  1970 2a
crw-r--r-- 1 root root 0, 0 Jan  1  1970 2b
crw-r--r-- 1 root root 0, 0 Jan  1  1970 2c
crw-r--r-- 1 root root 0, 0 Jan  1  1970 2d
crw-r--r-- 1 root root 0, 0 Jan  1  1970 2e
crw-r--r-- 1 root root 0, 0 Jan  1  1970 2f
crw-r--r-- 1 root root 0, 0 Jan  1  1970 30
crw-r--r-- 1 root root 0, 0 Jan  1  1970 31
crw-r--r-- 1 root root 0, 0 Jan  1  1970 32
crw-r--r-- 1 root root 0, 0 Jan  1  1970 33
crw-r--r-- 1 root root 0, 0 Jan  1  1970 34
crw-r--r-- 1 root root 0, 0 Jan  1  1970 35
crw-r--r-- 1 root root 0, 0 Jan  1  1970 36
crw-r--r-- 1 root root 0, 0 Jan  1  1970 37
crw-r--r-- 1 root root 0, 0 Jan  1  1970 38
crw-r--r-- 1 root root 0, 0 Jan  1  1970 39
crw-r--r-- 1 root root 0, 0 Jan  1  1970 3a
crw-r--r-- 1 root root 0, 0 Jan  1  1970 3b
crw-r--r-- 1 root root 0, 0 Jan  1  1970 3c
crw-r--r-- 1 root root 0, 0 Jan  1  1970 3d
crw-r--r-- 1 root root 0, 0 Jan  1  1970 3e
crw-r--r-- 1 root root 0, 0 Jan  1  1970 3f
crw-r--r-- 1 root root 0, 0 Jan  1  1970 40
crw-r--r-- 1 root root 0, 0 Jan  1  1970 41
crw-r--r-- 1 root root 0, 0 Jan  1  1970 42
crw-r--r-- 1 root root 0, 0 Jan  1  1970 43
crw-r--r-- 1 root root 0, 0 Jan  1  1970 44
crw-r--r-- 1 root root 0, 0 Jan  1  1970 45
crw-r--r-- 1 root root 0, 0 Jan  1  1970 46
crw-r--r-- 1 root root 0, 0 Jan  1  1970 47
crw-r--r-- 1 root root 0, 0 Jan  1  1970 48
crw-r--r-- 1 root root 0, 0 Jan  1  1970 49
crw-r--r-- 1 root root 0, 0 Jan  1  1970 4a
crw-r--r-- 1 root root 0, 0 Jan  1  1970 4b
crw-r--r-- 1 root root 0, 0 Jan  1  1970 4c
crw-r--r-- 1 root root 0, 0 Jan  1  1970 4d
crw-r--r-- 1 root root 0, 0 Jan  1  1970 4e
crw-r--r-- 1 root root 0, 0 Jan  1  1970 4f
crw-r--r-- 1 root root 0, 0 Jan  1  1970 50
crw-r--r-- 1 root root 0, 0 Jan  1  1970 51
crw-r--r-- 1 root root 0, 0 Jan  1  1970 52
crw-r--r-- 1 root root 0, 0 Jan  1  1970 53
crw-r--r-- 1 root root 0, 0 Jan  1  1970 54
crw-r--r-- 1 root root 0, 0 Jan  1  1970 55
crw-r--r-- 1 root root 0, 0 Jan  1  1970 56
crw-r--r-- 1 root root 0, 0 Jan  1  1970 57
crw-r--r-- 1 root root 0, 0 Jan  1  1970 58
crw-r--r-- 1 root root 0, 0 Jan  1  1970 59
crw-r--r-- 1 root root 0, 0 Jan  1  1970 5a
crw-r--r-- 1 root root 0, 0 Jan  1  1970 5b
crw-r--r-- 1 root root 0, 0 Jan  1  1970 5c
crw-r--r-- 1 root root 0, 0 Jan  1  1970 5d
crw-r--r-- 1 root root 0, 0 Jan  1  1970 5e
crw-r--r-- 1 root root 0, 0 Jan  1  1970 5f
crw-r--r-- 1 root root 0, 0 Jan  1  1970 60
crw-r--r-- 1 root root 0, 0 Jan  1  1970 61
crw-r--r-- 1 root root 0, 0 Jan  1  1970 62
crw-r--r-- 1 root root 0, 0 Jan  1  1970 63
crw-r--r-- 1 root root 0, 0 Jan  1  1970 64
crw-r--r-- 1 root root 0, 0 Jan  1  1970 65
crw-r--r-- 1 root root 0, 0 Jan  1  1970 66
crw-r--r-- 1 root root 0, 0 Jan  1  1970 67
crw-r--r-- 1 root root 0, 0 Jan  1  1970 68
crw-r--r-- 1 root root 0, 0 Jan  1  1970 69
crw-r--r-- 1 root root 0, 0 Jan  1  1970 6a
crw-r--r-- 1 root root 0, 0 Jan  1  1970 6b
crw-r--r-- 1 root root 0, 0 Jan  1  1970 6c
crw-r--r-- 1 root root 0, 0 Jan  1  1970 6d
crw-r--r-- 1 root root 0, 0 Jan  1  1970 6e
crw-r--r-- 1 root root 0, 0 Jan  1  1970 6f
crw-r--r-- 1 root root 0, 0 Jan  1  1970 70
crw-r--r-- 1 root root 0, 0 Jan  1  1970 71
crw-r--r-- 1 root root 0, 0 Jan  1  1970 72
crw-r--r-- 1 root root 0, 0 Jan  1  1970 73
crw-r--r-- 1 root root 0, 0 Jan  1  1970 74
crw-r--r-- 1 root root 0, 0 Jan  1  1970 75
crw-r--r-- 1 root root 0, 0 Jan  1  1970 76
crw-r--r-- 1 root root 0, 0 Jan  1  1970 77
crw-r--r-- 1 root root 0, 0 Jan  1  1970 78
crw-r--r-- 1 root root 0, 0 Jan  1  1970 79
crw-r--r-- 1 root root 0, 0 Jan  1  1970 7a
crw-r--r-- 1 root root 0, 0 Jan  1  1970 7b
crw-r--r-- 1 root root 0, 0 Jan  1  1970 7c
crw-r--r-- 1 root root 0, 0 Jan  1  1970 7d
crw-r--r-- 1 root root 0, 0 Jan  1  1970 7e
crw-r--r-- 1 root root 0, 0 Jan  1  1970 7f
crw-r--r-- 1 root root 0, 0 Jan  1  1970 80
crw-r--r-- 1 root root 0, 0 Jan  1  1970 81
crw-r--r-- 1 root root 0, 0 Jan  1  1970 82
crw-r--r-- 1 root root 0, 0 Jan  1  1970 83
crw-r--r-- 1 root root 0, 0 Jan  1  1970 84
crw-r--r-- 1 root root 0, 0 Jan  1  1970 85
crw-r--r-- 1 root root 0, 0 Jan  1  1970 86
crw-r--r-- 1 root root 0, 0 Jan  1  1970 87
crw-r--r-- 1 root root 0, 0 Jan  1  1970 88
crw-r--r-- 1 root root 0, 0 Jan  1  1970 89
crw-r--r-- 1 root root 0, 0 Jan  1  1970 8a
crw-r--r-- 1 root root 0, 0 Jan  1  1970 8b
crw-r--r-- 1 root root 0, 0 Jan  1  1970 8c
crw-r--r-- 1 root root 0, 0 Jan  1  1970 8d
crw-r--r-- 1 root root 0, 0 Jan  1  1970 8e
crw-r--r-- 1 root root 0, 0 Jan  1  1970 8f
crw-r--r-- 1 root root 0, 0 Jan  1  1970 90
crw-r--r-- 1 root root 0, 0 Jan  1  1970 91
crw-r--r-- 1 root root 0, 0 Jan  1  1970 92
crw-r--r-- 1 root root 0, 0 Jan  1  1970 93
crw-r--r-- 1 root root 0, 0 Jan  1  1970 94
crw-r--r-- 1 root root 0, 0 Jan  1  1970 95
crw-r--r-- 1 root root 0, 0 Jan  1  1970 96
crw-r--r-- 1 root root 0, 0 Jan  1  1970 97
crw-r--r-- 1 root root 0, 0 Jan  1  1970 98
crw-r--r-- 1 root root 0, 0 Jan  1  1970 99
crw-r--r-- 1 root root 0, 0 Jan  1  1970 9a
crw-r--r-- 1 root root 0, 0 Jan  1  1970 9b
crw-r--r-- 1 root root 0, 0 Jan  1  1970 9c
crw-r--r-- 1 root root 0, 0 Jan  1  1970 9d
crw-r--r-- 1 root root 0, 0 Jan  1  1970 9e
crw-r--r-- 1 root root 0, 0 Jan  1  1970 9f
drwxr-xr-x 3 root root   82 Jan  1  1970 NetworkManager
drwxr-xr-x 2 root root   50 Jan  1  1970 UPower
drwxr-xr-x 3 root root   65 Jan  1  1970 X11
crw-r--r-- 1 root root 0, 0 Jan  1  1970 a0
crw-r--r-- 1 root root 0, 0 Jan  1  1970 a1
crw-r--r-- 1 root root 0, 0 Jan  1  1970 a2
crw-r--r-- 1 root root 0, 0 Jan  1  1970 a3
crw-r--r-- 1 root root 0, 0 Jan  1  1970 a4
crw-r--r-- 1 root root 0, 0 Jan  1  1970 a5
crw-r--r-- 1 root root 0, 0 Jan  1  1970 a6
crw-r--r-- 1 root root 0, 0 Jan  1  1970 a7
crw-r--r-- 1 root root 0, 0 Jan  1  1970 a8
crw-r--r-- 1 root root 0, 0 Jan  1  1970 a9
crw-r--r-- 1 root root 0, 0 Jan  1  1970 aa
crw-r--r-- 1 root root 0, 0 Jan  1  1970 ab
crw-r--r-- 1 root root 0, 0 Jan  1  1970 ac
crw-r--r-- 1 root root 0, 0 Jan  1  1970 ad
crw-r--r-- 1 root root 0, 0 Jan  1  1970 ae
crw-r--r-- 1 root root 0, 0 Jan  1  1970 af
drwxr-xr-x 3 root root   45 Jan  1  1970 alsa
crw-r--r-- 1 root root 0, 0 Jan  1  1970 b0
crw-r--r-- 1 root root 0, 0 Jan  1  1970 b1
crw-r--r-- 1 root root 0, 0 Jan  1  1970 b2
crw-r--r-- 1 root root 0, 0 Jan  1  1970 b3
crw-r--r-- 1 root root 0, 0 Jan  1  1970 b4
crw-r--r-- 1 root root 0, 0 Jan  1  1970 b5
crw-r--r-- 1 root root 0, 0 Jan  1  1970 b6
crw-r--r-- 1 root root 0, 0 Jan  1  1970 b7
crw-r--r-- 1 root root 0, 0 Jan  1  1970 b8
crw-r--r-- 1 root root 0, 0 Jan  1  1970 b9
crw-r--r-- 1 root root 0, 0 Jan  1  1970 ba
lrwxrwxrwx 1 root root   54 Jan  1  1970 bashrc -> /nix/store/iilvr9ciz72mmydgpsv6fiydmjmvmwrm-etc-bashrc
crw-r--r-- 1 root root 0, 0 Jan  1  1970 bb
crw-r--r-- 1 root root 0, 0 Jan  1  1970 bc
crw-r--r-- 1 root root 0, 0 Jan  1  1970 bd
crw-r--r-- 1 root root 0, 0 Jan  1  1970 be
crw-r--r-- 1 root root 0, 0 Jan  1  1970 bf
drwxr-xr-x 2 root root   49 Jan  1  1970 binfmt.d
drwxr-xr-x 2 root root   94 Jan  1  1970 bluetooth
drwxr-xr-x 2 root root   48 Jan  1  1970 btrbk
crw-r--r-- 1 root root 0, 0 Jan  1  1970 c0
crw-r--r-- 1 root root 0, 0 Jan  1  1970 c1
crw-r--r-- 1 root root 0, 0 Jan  1  1970 c2
crw-r--r-- 1 root root 0, 0 Jan  1  1970 c3
crw-r--r-- 1 root root 0, 0 Jan  1  1970 c4
crw-r--r-- 1 root root 0, 0 Jan  1  1970 c5
crw-r--r-- 1 root root 0, 0 Jan  1  1970 c6
crw-r--r-- 1 root root 0, 0 Jan  1  1970 c7
crw-r--r-- 1 root root 0, 0 Jan  1  1970 c8
crw-r--r-- 1 root root 0, 0 Jan  1  1970 c9
crw-r--r-- 1 root root 0, 0 Jan  1  1970 ca
crw-r--r-- 1 root root 0, 0 Jan  1  1970 cb
crw-r--r-- 1 root root 0, 0 Jan  1  1970 cc
crw-r--r-- 1 root root 0, 0 Jan  1  1970 cd
crw-r--r-- 1 root root 0, 0 Jan  1  1970 ce
crw-r--r-- 1 root root 0, 0 Jan  1  1970 cf
crw-r--r-- 1 root root 0, 0 Jan  1  1970 d0
crw-r--r-- 1 root root 0, 0 Jan  1  1970 d1
crw-r--r-- 1 root root 0, 0 Jan  1  1970 d2
crw-r--r-- 1 root root 0, 0 Jan  1  1970 d3
crw-r--r-- 1 root root 0, 0 Jan  1  1970 d4
crw-r--r-- 1 root root 0, 0 Jan  1  1970 d5
crw-r--r-- 1 root root 0, 0 Jan  1  1970 d6
crw-r--r-- 1 root root 0, 0 Jan  1  1970 d7
crw-r--r-- 1 root root 0, 0 Jan  1  1970 d8
crw-r--r-- 1 root root 0, 0 Jan  1  1970 d9
crw-r--r-- 1 root root 0, 0 Jan  1  1970 da
crw-r--r-- 1 root root 0, 0 Jan  1  1970 db
lrwxrwxrwx 1 root root   50 Jan  1  1970 dbus-1 -> /nix/store/zx4qna96kmh7cca4iwnccrasr2qp6kih-dbus-1
crw-r--r-- 1 root root 0, 0 Jan  1  1970 dc
crw-r--r-- 1 root root 0, 0 Jan  1  1970 dd
crw-r--r-- 1 root root 0, 0 Jan  1  1970 de
drwxr-xr-x 2 root root   46 Jan  1  1970 default
crw-r--r-- 1 root root 0, 0 Jan  1  1970 df
crw-r--r-- 1 root root 0, 0 Jan  1  1970 e0
crw-r--r-- 1 root root 0, 0 Jan  1  1970 e1
crw-r--r-- 1 root root 0, 0 Jan  1  1970 e2
crw-r--r-- 1 root root 0, 0 Jan  1  1970 e3
crw-r--r-- 1 root root 0, 0 Jan  1  1970 e4
crw-r--r-- 1 root root 0, 0 Jan  1  1970 e5
crw-r--r-- 1 root root 0, 0 Jan  1  1970 e6
crw-r--r-- 1 root root 0, 0 Jan  1  1970 e7
crw-r--r-- 1 root root 0, 0 Jan  1  1970 e8
crw-r--r-- 1 root root 0, 0 Jan  1  1970 e9
crw-r--r-- 1 root root 0, 0 Jan  1  1970 ea
crw-r--r-- 1 root root 0, 0 Jan  1  1970 eb
crw-r--r-- 1 root root 0, 0 Jan  1  1970 ec
crw-r--r-- 1 root root 0, 0 Jan  1  1970 ed
crw-r--r-- 1 root root 0, 0 Jan  1  1970 ee
crw-r--r-- 1 root root 0, 0 Jan  1  1970 ef
crw-r--r-- 1 root root 0, 0 Jan  1  1970 f0
crw-r--r-- 1 root root 0, 0 Jan  1  1970 f1
crw-r--r-- 1 root root 0, 0 Jan  1  1970 f2
crw-r--r-- 1 root root 0, 0 Jan  1  1970 f3
crw-r--r-- 1 root root 0, 0 Jan  1  1970 f4
crw-r--r-- 1 root root 0, 0 Jan  1  1970 f5
crw-r--r-- 1 root root 0, 0 Jan  1  1970 f6
crw-r--r-- 1 root root 0, 0 Jan  1  1970 f7
crw-r--r-- 1 root root 0, 0 Jan  1  1970 f8
crw-r--r-- 1 root root 0, 0 Jan  1  1970 f9
crw-r--r-- 1 root root 0, 0 Jan  1  1970 fa
crw-r--r-- 1 root root 0, 0 Jan  1  1970 fb
crw-r--r-- 1 root root 0, 0 Jan  1  1970 fc
crw-r--r-- 1 root root 0, 0 Jan  1  1970 fd
crw-r--r-- 1 root root 0, 0 Jan  1  1970 fe
crw-r--r-- 1 root root 0, 0 Jan  1  1970 ff
lrwxrwxrwx 1 root root   69 Jan  1  1970 fonts -> /nix/store/2agxv0zb5rif3986b5hkj4jllsyqs2y3-fontconfig-etc/etc/fonts/
lrwxrwxrwx 1 root root   53 Jan  1  1970 fstab -> /nix/store/wirrc09z3hky3gng5i4qqa132cac88w2-etc-fstab
lrwxrwxrwx 1 root root   57 Jan  1  1970 fuse.conf -> /nix/store/k21igh39lc6526gw1yvgkpkvgbibyyr8-etc-fuse.conf
lrwxrwxrwx 1 root root   57 Jan  1  1970 gitconfig -> /nix/store/aybi7b0q9kwxqhw8qyw0d22d3xhcbygp-etc-gitconfig
lrwxrwxrwx 1 root root   57 Jan  1  1970 host.conf -> /nix/store/rfmxnngix13s5q80sb5fxrglrk3zxjx1-etc-host.conf
lrwxrwxrwx 1 root root   56 Jan  1  1970 hostname -> /nix/store/6a8l6vlp7yd193bjyj3vvas7zwcmv69y-etc-hostname
lrwxrwxrwx 1 root root   49 Jan  1  1970 hosts -> /nix/store/ac9hbv20nw2l0lr35bp7jyrnv7qxxxkf-hosts
lrwxrwxrwx 1 root root   51 Jan  1  1970 inputrc -> /nix/store/dwv0wf3szv3ipgyyyrf1zxh4iqlckiip-inputrc
lrwxrwxrwx 1 root root   61 Jan  1  1970 ipsec.secrets -> /nix/store/8ilqsfb4f86la6dz8rmk16fn74ny9d14-etc-ipsec.secrets
lrwxrwxrwx 1 root root   49 Jan  1  1970 issue -> /nix/store/ypv4gvzx7grkmrx4by6b2h6cqlkdf9jk-issue
lrwxrwxrwx 1 root root   61 Jan  1  1970 kbd -> /nix/store/xddi76fsw1hdgrq4826v50dv10jmv1vr-console-env/share
drwxr-xr-x 3 root root   40 Jan  1  1970 libblockdev
lrwxrwxrwx 1 root root   55 Jan  1  1970 locale.conf -> /nix/store/kwdi0rbxhbbshzmnrijik51hd3136265-locale.conf
lrwxrwxrwx 1 root root   27 Jan  1  1970 localtime -> /etc/zoneinfo/Asia/Shanghai
lrwxrwxrwx 1 root root   54 Jan  1  1970 login.defs -> /nix/store/8zxc9k1v472j1fx763pq37z2q7nzrlkh-login.defs
lrwxrwxrwx 1 root root   59 Jan  1  1970 lsb-release -> /nix/store/455qfy3w57xqy5gdcj5y32f5dkslbrpl-etc-lsb-release
drwxr-xr-x 2 root root   47 Jan  1  1970 lvm
lrwxrwxrwx 1 root root   59 Jan  1  1970 man_db.conf -> /nix/store/hvq8qg8cwjfmir7cr5xwqz69cnh6c5d1-etc-man_db.conf
drwxr-xr-x 2 root root  144 Jan  1  1970 modprobe.d
drwxr-xr-x 2 root root   49 Jan  1  1970 modules-load.d
lrwxrwxrwx 1 root root   12 Jan  1  1970 mtab -> /proc/mounts
lrwxrwxrwx 1 root root   54 Jan  1  1970 nanorc -> /nix/store/r034gqx9xfy5iw3qrkibjc8cdvxsds6h-etc-nanorc
lrwxrwxrwx 1 root root   56 Jan  1  1970 netgroup -> /nix/store/6wlhhg2g6yvzx10dnirkg1hynm0k1a41-etc-netgroup
drwxr-xr-x 2 root root   72 Jan  1  1970 nix
lrwxrwxrwx 1 root root   57 Jan  1  1970 nscd.conf -> /nix/store/8lygz41621zdz36k370n01zkgd0lc55r-etc-nscd.conf
lrwxrwxrwx 1 root root   61 Jan  1  1970 nsswitch.conf -> /nix/store/cdmkc2v38i7d9nbpj739j41bimkx9zkj-etc-nsswitch.conf
lrwxrwxrwx 1 root root   58 Jan  1  1970 os-release -> /nix/store/v6ckpgx9iihyffhimcchmxvyl0dhbvxz-etc-os-release
drwxr-xr-x 2 root root   50 Jan  1  1970 pam
drwxr-xr-x 2 root root  564 Jan  1  1970 pam.d
lrwxrwxrwx 1 root root   75 Jan  1  1970 pipewire -> /nix/store/c9sp72yrrcqx5pnqbf59as4yd6m6qbic-pipewire-configs/share/pipewire
drwxr-xr-x 3 root root   42 Jan  1  1970 pki
drwxr-xr-x 3 root root   46 Jan  1  1970 polkit-1
lrwxrwxrwx 1 root root   55 Jan  1  1970 profile -> /nix/store/83qam9bxgrd2l1wzk7m7hfwvpnv1ac8y-etc-profile
drwxr-xr-x 3 root root   47 Jan  1  1970 profiles
lrwxrwxrwx 1 root root   75 Jan  1  1970 protocols -> /nix/store/0rbxbi1il5cryd8m0ki9dj0gqd6f26q0-iana-etc-20250108/etc/protocols
lrwxrwxrwx 1 root root   63 Jan  1  1970 resolvconf.conf -> /nix/store/y7v9sgh9ghfal8azwm6rfskkn37xsrrf-etc-resolvconf.conf
lrwxrwxrwx 1 root root   65 Jan  1  1970 rpc -> /nix/store/cmpyglinc9xl9pr4ymx8akl286ygl64x-glibc-2.40-66/etc/rpc
lrwxrwxrwx 1 root root   53 Jan  1  1970 sddm.conf -> /nix/store/x6s5lpb0xqs4xq88g37rjslpm745iljs-sddm.conf
lrwxrwxrwx 1 root root   74 Jan  1  1970 services -> /nix/store/0rbxbi1il5cryd8m0ki9dj0gqd6f26q0-iana-etc-20250108/etc/services
lrwxrwxrwx 1 root root   59 Jan  1  1970 set-environment -> /nix/store/lwdyd8b6fh35aalajyf0g9jwf11lhf6i-set-environment
lrwxrwxrwx 1 root root   54 Jan  1  1970 shells -> /nix/store/if4dp92ir9q5mf1cl58nzpfbcn52ypza-etc-shells
drwxr-xr-x 2 root root   76 Jan  1  1970 ssh
drwxr-xr-x 3 root root   68 Jan  1  1970 ssl
-r--r----- 1 root root  781 Jan  1  1970 sudoers
drwxr-xr-x 2 root root  107 Jan  1  1970 sysctl.d
drwxr-xr-x 4 root root  378 Jan  1  1970 systemd
lrwxrwxrwx 1 root root   70 Jan  1  1970 terminfo -> /nix/store/lm05g7paddd0052lm46ipmbdma5igzm1-system-path/share/terminfo
lrwxrwxrwx 1 root root   56 Jan  1  1970 tlp.conf -> /nix/store/7m50sqxvqqkgfgzwkam7hpva2snrf9ya-etc-tlp.conf
drwxr-xr-x 2 root root  458 Jan  1  1970 tmpfiles.d
drwxr-xr-x 2 root root   66 Jan  1  1970 udev
drwxr-xr-x 2 root root   51 Jan  1  1970 udisks2
lrwxrwxrwx 1 root root   57 Jan  1  1970 vconsole.conf -> /nix/store/18axyn9i7z7ycsdkndw5kwyzafgj49p3-vconsole.conf
lrwxrwxrwx 1 root root   71 Jan  1  1970 zoneinfo -> /nix/store/swcnsg3jzac44md8r2mm73ljgdxycjw9-tzdata-2025a/share/zoneinfo

System metadata

nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.13.7, NixOS, 25.05 (Warbler), 25.05.20250319.a84ebe2`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.24.12`
 - nixpkgs: `/nix/store/1728d3jg85mkz2w2cvk6vi74i30fn6x7-source`

Notify maintainers

@ivan770 @nikstur

Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)

I assert that this issue is relevant for Nixpkgs

Is this issue important to you?

Add a 👍 reaction to issues you find important.

@SaltyKitkat SaltyKitkat added 0.kind: bug Something is broken 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS labels Mar 22, 2025
@ivan770
Copy link
Member

ivan770 commented Mar 23, 2025

I'm not able to reproduce the issue after modifying nixpkgs' NixOS tests related to /etc overlay. Could you provide more details about your system configuration?

@SaltyKitkat
Copy link
Contributor Author

Thank you for your kind reply. I know nothing about etc.overlay feature, but I'm just wondering does the line in etc-dump

/sudoers 781 100440 1 0 0 0 1.0 sudoers - -

looks like a correct result? because I think its nix store source path is missing here, while appears in the etc-json file, so it should looks like

/sudoers 781 100440 1 0 0 0 1.0 /nix/store/xxxxhashstrxxxx-sudoers - -

please correct me if I got it wrong :P

If the line in etc-dump is actually not right, maybe there's something wrong in the python script used to generate it. So maybe I can provide the origin etc-json file, to make the debug process easier. So the etc-json and etc-dump is in the attachment.

n9wqbdwz4q5zv4kyrihxggnakl3vh6k6-etc-json.json

7zrclhm261smhj278lmchl5ifimr26v8-etc-dump.txt

(I manually appended .json and .txt to the filenames to make my file picker can recognize them as files to upload)

I'm not able to reproduce the issue after modifying nixpkgs' NixOS tests related to /etc overlay. Could you provide more details about your system configuration?

I'm glad to help providing more information. But my configuration files are messed up and ... I need some time to clean up.

@SaltyKitkat
Copy link
Contributor Author

SaltyKitkat commented Mar 24, 2025

I made a search on the etc-dump file and found that the sudoers is the only "file", all other things are symlinks. I don't know why.

But I think here's the direct cause:
In this line, the payload is set to target, instead of source.

And the sudoers file, the only file in /etc, becomes the victim.


edit: I misunderstood how composefs works. It only stores metadata. So previous lines are wrong, and I need to find now the backing dir for overlay etc works now...
Sorry for my stupid…

@SaltyKitkat
Copy link
Contributor Author

I found something new:

nix-repl> (builtins.elemAt nixosConfigurations.SaltyKitkat.config.boot.initrd.systemd.mounts 1).options
"relatime,redirect_dir=on,metacopy=on,lowerdir=/run/nixos-etc-metadata::/etc-basedir,rw,upperdir=/sysroot/.rw-etc/upper,workdir=/sysroot/.rw-etc/work"
nix-repl> "${nixosConfigurations.SaltyKitkat.config.system.build.etcBasedir}"
"/nix/store/68n1pxl1dsijrrrr0z0pff3jxfbkszaa-etc-lowerdir"

The lowerdir seems not set correctly. It should be /sysroot/nix/store/68n1pxl1dsijrrrr0z0pff3jxfbkszaa-etc-lowerdir, but we got a /etc-basedir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants