Gentoo Archives: gentoo-alt

From: Daniel Ibn Zayd <DIZ@×××××××××××××.net>
To: gentoo-alt@l.g.o
Subject: [gentoo-alt] Gentoo Prefix | Mac Leopard 10.5.8 | Permissions issue
Date: Sun, 29 Dec 2013 08:42:14
Message-Id: 20131229104011532872.4094f227@danielibnzayd.net
1 SUMMARY:
2 I'm dealing with the following error:
3 !!! Directory initialization failed: '/Volumes/GENTOO/var/lib/portage'
4 As usual, I imagine the answer is staring me in the face....but here goes.
5
6 BACKGROUND:
7 I have a Quicksilver G4 with a drive partition dedicated to Gentoo/Prefix and Portage.
8
9 Everything runs swimmingly until I have to for whatever reason re-install the main OS, at which point my Gentoo/Prefix breaks.
10
11 The last time this happened, which I posted about, I ended up rebuilding Gentoo/Prefix/Portage from scratch on its own partition.
12
13 I now realize that the issue comes down to user/group permissions, and how Apple messed this up basically in the migration path through the various cat OSes (Panther->Tiger->Leopard). This time I have re-installed Leopard, migrated back my files (Gentoo is on a separate volume) but I wanted to make sure the former problems were solved before continuing. After a week of research on the upgrade bug (in which the change in user, even if migrating, brings about a phantom "unknown" group in file listings) and have managed to bring all the permissions up to fresh-install "Leopard" standards; meaning, user name/#UID (502) as owner, and staff/#GID (20) as group. Everything is working as it should.
14
15 When I came back to test the Prefix/Portage, I got the following error:
16
17 [code]danielibnzayd@boojum /Volumes/GENTOO $ emerge --update
18 !!! Directory initialization failed: '/Volumes/GENTOO/var/lib/portage'
19 !!! chown('/Volumes/GENTOO/var/lib/portage', -1, [b]502[/b])
20 !!! Directory initialization failed: '/Volumes/GENTOO/var/cache/edb'
21 !!! chown('/Volumes/GENTOO/var/cache/edb', -1, [b]502[/b])
22 [Errno 1] Operation not permitted: '/Volumes/GENTOO/var/lib/gentoo/news/.news-gentoo_prefix.unread.portage_lockfile': chown('/Volumes/GENTOO/var/lib/gentoo/news/.news-gentoo_prefix.unread.portage_lockfile', -1, [b]502[/b])
23 Cannot chown a lockfile: '/Volumes/GENTOO/var/lib/gentoo/news/.news-gentoo_prefix.unread.portage_lockfile'
24 [b]Group IDs of current user: 20 98 80[/b]
25
26 These are the packages that would be merged, in order:
27
28 Calculating dependencies [Errno 1] Operation not permitted: '/Volumes/GENTOO/var/db/.pkg.portage_lockfile': chown('/Volumes/GENTOO/var/db/.pkg.portage_lockfile', -1, 502)
29 Cannot chown a lockfile: '/Volumes/GENTOO/var/db/.pkg.portage_lockfile'
30 Group IDs of current user: 20 98 80
31 \... done!
32
33
34 Exiting on signal 2[/code]
35
36 I'm assuming the error regarding "502" concerns the former erroneous [b]group[/b] ID number (which formerly was "501" or "502", and which I have changed to 20, per Leopard standards. When I grepped on "502" as a group ID on the Gentoo partition, I found the [u]etc/make.globals[/u] file which it says not to edit. I changed the group ID to 20 (I left the user ID as 502, which is correct) and the group name to "staff":
37
38 [code]# Default portage user/group
39 PORTAGE_USER='danielibnzayd'
40 PORTAGE_GROUP='staff' [b]#was danielibnzayd[/b]
41 PORTAGE_ROOT_USER='danielibnzayd'
42
43 # Default ownership of installed files.
44 PORTAGE_INST_UID="502"
45 PORTAGE_INST_GID="20"[/code] [b]#was 502[/b]
46
47 ...and the error persists. I imagine there is a config file I am overlooking?
48
49 The problem seems to be with Python? I tried python-updater, and got this error message:
50
51 Total: 6 packages (1 upgrade, 2 new, 1 in new slot, 2 reinstalls), Size of downloads: 0 kB
52
53 Traceback (most recent call last):
54 File "/Volumes/GENTOO/usr/lib/portage/pym/portage/util/__init__.py", line 1054, in apply_permissions
55 os.chown(filename, uid, gid)
56 File "/Volumes/GENTOO/usr/lib/portage/pym/portage/__init__.py", line 260, in __call__
57 rval = self._func(*wrapped_args, **wrapped_kwargs)
58 PermissionError: [Errno 1] Operation not permitted: '/Volumes/GENTOO/var/cache/edb/mtimedb'
59
60 During handling of the above exception, another exception occurred:
61
62 [code]Traceback (most recent call last):
63 File "/Volumes/GENTOO/usr/bin/emerge", line 50, in <module>
64 retval = emerge_main()
65 File "/Volumes/GENTOO/usr/lib/portage/pym/_emerge/main.py", line 1032, in emerge_main
66 return run_action(emerge_config)
67 File "/Volumes/GENTOO/usr/lib/portage/pym/_emerge/actions.py", line 4063, in run_action
68 emerge_config.args, spinner)
69 File "/Volumes/GENTOO/usr/lib/portage/pym/_emerge/actions.py", line 440, in action_build
70 mtimedb.commit()
71 File "/Volumes/GENTOO/usr/lib/portage/pym/portage/util/mtimedb.py", line 127, in commit
72 uid=uid, gid=portage_gid, mode=0o644)
73 File "/Volumes/GENTOO/usr/lib/portage/pym/portage/util/__init__.py", line 1224, in apply_secpass_permissions
74 stat_cached=stat_cached, follow_links=follow_links)
75 File "/Volumes/GENTOO/usr/lib/portage/pym/portage/util/__init__.py", line 1061, in apply_permissions
76 raise OperationNotPermitted(func_call)
77 portage.exception.OperationNotPermitted: chown('/Volumes/GENTOO/var/cache/edb/mtimedb', 502, 502)
78 danielibnzayd@boojum /Volumes/GENTOO $[/code]
79
80 Where do I tell Python to change its idea of group privileges?
81
82 Any leads/ideas? Thanks in advance.

Replies