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

Bug 734002

Summary: acct-user.eclass user.eclass do not respect ROOT variable
Product: Gentoo Linux Reporter: Stefan Langenmaier <stefan.langenmaier+gentoo>
Component: EclassesAssignee: Michał Górny <mgorny>
Status: RESOLVED FIXED    
Severity: normal CC: base-system, bertrand, futurehypoon, johannes.geiss, sam
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=541406
https://bugs.gentoo.org/show_bug.cgi?id=671300
https://github.com/gentoo/gentoo/pull/19204
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: account-creation.patch

Description Stefan Langenmaier 2020-07-26 21:20:25 UTC
Created attachment 650900 [details]
account-creation.patch

I'm using the ROOT variable to create system images. This works fine but user and group accounts are always created in `/`.

I have added a patch that works for me, but like to discuss it here as I have no experience in eclass development a.k.a. please be gentle. :)
Comment 1 Hypoon 2020-08-17 20:55:11 UTC
I just ran into the same issue.

I disagree with the patch, however. In EAPI 7, the default ROOT variable is "", not "/", which will (probably?) break commands with '-R ${ROOT}'.

Instead I suggest adding it to opts only when ROOT is changed from the default value.
Comment 2 Hypoon 2020-08-18 05:42:25 UTC
Possible duplicate, please note bug #541406.
Also, for my patch concerns, please note bug #671300.
Comment 3 Mike Gilbert gentoo-dev 2022-04-23 19:37:57 UTC
commit 6b1d4e40db188e64fb0731195b87b261d76e060c
Author:     Jérémy Connat <morderca@morderca.net>
AuthorDate: Mon Feb 1 13:25:12 2021 +0100
Commit:     Sam James <sam@gentoo.org>
CommitDate: Sat Apr 23 02:26:52 2022 +0100

    acct-user.eclass: Fixing user/group creation when using different ROOT
    
    Signed-off-by: Jérémy Connat <morderca@morderca.net>
    Closes: https://github.com/gentoo/gentoo/pull/19204
    Signed-off-by: Sam James <sam@gentoo.org>