Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 767841

Summary: [RAP] superuser access required during prefix bootstrap
Product: Gentoo/Alt Reporter: Maoyin Sun <simonmysun>
Component: Prefix SupportAssignee: Gentoo Prefix <prefix>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Maoyin Sun 2021-01-29 10:56:20 UTC
Hi,

I was trying to install Gentoo Prefix on RHEL7.7 and got this message at stage 3:

```
Type here what you want to wish me [luck] luck

* Bootstrapping Gentoo prefixed portage installation using
* host:   x86_64-pc-linux-gnu
* prefix: /opt/risk/tmp/xz4a0b2/gentoo
* ready to bootstrap stage3_log
* Triggering Linux RAP bootstrap
* running emerge -u system
!!! Directory initialization failed: '/opt/risk/tmp/xz4a0b2/gentoo/var/lib/portage'
!!! chown('/opt/risk/tmp/xz4a0b2/gentoo/var/lib/portage', -1, 250)
!!! Directory initialization failed: '/opt/risk/tmp/xz4a0b2/gentoo/var/cache/edb'
!!! chown('/opt/risk/tmp/xz4a0b2/gentoo/var/cache/edb', -1, 250)
emerge: superuser access is required

Hmmmm, I was already afraid of this to happen.  Running
  /opt/risk/tmp/xz4a0b2/gentoo/bin/bash ./bootstrap-prefix.sh "/opt/risk/tmp/xz4a0b2/gentoo" stage3
somewhere failed :(  Details might be found in the build log:
  (no build logs found?!?)
I have no clue, really.  Please find friendly folks in #gentoo-prefix on
irc.gentoo.org, gentoo-alt@lists.gentoo.org mailing list, or file a bug
at bugs.gentoo.org under Gentoo/Alt, Prefix Support.  This is most
inconvenient, and it crushed my ego.  Sorry, I give up.
Should you want to give it a try, there is /opt/risk/tmp/xz4a0b2/gentoo/stage3.log

```

there was another problem before this one, which is `portage: 'portage' user or group missing.` (also stage 3). I solved it by adding portage to `$(EPREFIX)/etc/passwd` and `$(EPREFIX)/etc/group`. I'm not sure whether this is related. 

My environment: Linux uit-algo-d-21 3.10.0-1062.18.1.el7.x86_64 #1 SMP Wed Feb 12 14:08:31 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Comment 1 Fabian Groffen gentoo-dev 2021-01-29 10:58:34 UTC
what user are you running this with?  what are your numeric user and group ids?
Comment 2 Fabian Groffen gentoo-dev 2021-01-29 10:59:38 UTC
@heroxbd: is there any user-mapping taking place in RAP?
Comment 3 Maoyin Sun 2021-01-29 11:09:34 UTC
Hi Fabian,

The user running bootstrap script:

```
uid=12261(xz4a0b2) gid=10031(uit) groups=10031(uit),9978(uitew)
```

$(EPREFIX)/etc/passwd (masked)
```
xz4a0b2:x:12261:10031:xxxxxx:/home/ext/xz4a0b2:/bin/bash
portage:x:250:250:portage:/var/tmp/portage:/bin/false
```

$(EPREFIX)/etc/group
```
uit:x:10031:
portage::250:portage
```

$(EPREFIX)/etc/passwd and $(EPREFIX)/etc/group previously look like copies of /etc/passwd and /etc/group and didn't have portage. I replaced them by myself.
Comment 4 Fabian Groffen gentoo-dev 2021-01-29 11:14:39 UTC
I'm not too familiar with how RAP deals with this, but it feels "weird".  It feels like there should be no special users, Portage should pick up your user and group id.

Do you even have a const_autotool.py in $EPREFIX/usr/lib/python3.8/site-packages/portage/const_autotool.py?
Comment 5 Maoyin Sun 2021-01-29 11:22:29 UTC
(In reply to Fabian Groffen from comment #4)

> Do you even have a const_autotool.py in
> $EPREFIX/usr/lib/python3.8/site-packages/portage/const_autotool.py?

No, I don't

Thank you very much for your instant help anyway!
Comment 6 Maoyin Sun 2021-01-29 11:48:13 UTC
typo fix in bug summary
Comment 7 Fabian Groffen gentoo-dev 2021-01-29 11:51:55 UTC
Ok, for this someone from RAP should chime in here on what is supposed to happen.  Your setup doesn't sound too weird to me.
Comment 8 Benda Xu gentoo-dev 2021-01-29 12:44:47 UTC
I remember this is a portage bug.  What's the permission bits of /opt/risk/tmp/xz4a0b2/gentoo?
Comment 9 Benda Xu gentoo-dev 2021-01-29 12:45:41 UTC

*** This bug has been marked as a duplicate of bug 766417 ***
Comment 10 Maoyin Sun 2021-01-29 13:16:59 UTC
(In reply to Benda Xu from comment #8)
> I remember this is a portage bug.  What's the permission bits of
> /opt/risk/tmp/xz4a0b2/gentoo?

It's drwxrwxrwx and belongs to user xz4a0b2 group uit.

(In reply to Benda Xu from comment #9)
> 
> *** This bug has been marked as a duplicate of bug 766417 ***

Thank you. I believe it's the same problem, except that I manually added portage to $EPREFIX/etc/passwd and $EPREFIX/etc/group. I am sorry for not reporting under the previous bug post although I did searched.