Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 581198 - user.eclass does not support ROOT != /
Summary: user.eclass does not support ROOT != /
Status: RESOLVED DUPLICATE of bug 541406
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: AMD64 Linux
: Normal major (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-25 19:19 UTC by fariouche
Modified: 2016-04-25 19:55 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fariouche 2016-04-25 19:19:28 UTC
Hi,

I have an issue when emerging to a different root folder than the "/". Users and groups are not created.
This is the case for example with the lighttpd package. If I do:
ROOT=/sysroot emerge -v lighttpd

The package is properly emerge in /sysroot, but the use and group lighttpd are not created.

I've looked inside user.eclass and I checked egroupadd function:
- it is checking if the group exists using "getent group $egroup".... problem is that this function does not support a --root argument and ony checks for the /etc/group file and not /sysroot/etc/group. In my case the lighttpd is already install in my "/".
- latter, it is doing a "groupadd -r ${opts} "${egroup}"". This function does has a --root option (at least on linux...). So we may actually modify the call to "groupadd --root ${EROOT} -r $ {opts} "${egroup}"

I can try to replace the getent function with an equivalent (at least for linux): using grep --color=never "^${key}" ${EROOT}/etc/group for example seems to do exactly the same ouptut as getent ${key} group.
I will also do the same with user creation...


Now, the strange part is that I'm unable to see my modifications inside the eclass.
I've created also an overlay, with an eclass/user.eclass file, but I still cannot see my modifications (it still behaves exactly as if I didn't modify anything.
Tried emerge --regen ....

And I can see the ebuild outputs. If I remove the group from my /etc/group file, I can see the traces too... I'm most likely missing something (A cached version of the eclass somewhere?)


Thank you

Reproducible: Always

Steps to Reproduce:
1. ROOT=/sysroot emerge -v sys-power/nut (or lighttpd)
2. Check that /sysroot/etc/group and /sysroot/etc/passwd does contain the nut user/group
3.
Actual Results:  
sysroot/etc/group and /sysroot/etc/passwd does NOT contain the nut user and group

In fact the user and group are added to "/etc/"

Expected Results:  
/sysroot/etc/group and /sysroot/etc/passwd should be updated

emerge --info
Portage 2.2.28 (python 2.7.11-final-0, hardened/linux/amd64/no-multilib, gcc-5.3.0, glibc-2.23-r2, 2.6.36-gentoo-r5 x86_64)
=================================================================
System uname: Linux-2.6.36-gentoo-r5-x86_64-Intel-R-_Core-TM-_i7_CPU_960_@_3.20GHz-with-gentoo-2.2
KiB Mem:     8196264 total,   6645256 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Tue, 19 Apr 2016 18:03:47 +0000
sh bash 4.3_p42-r2
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p42-r2::gentoo
dev-lang/perl:            5.22.1::gentoo
dev-lang/python:          2.7.11-r2::gentoo
dev-util/pkgconfig:       0.29.1::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.20.5::gentoo
sys-apps/sandbox:         2.10-r2::gentoo
sys-devel/autoconf:       2.69-r2::gentoo
sys-devel/automake:       1.14.1-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            5.3.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r2::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.5::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r2::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo
    priority: -1000

localRepo
    location: /etc/portage/localRepo
    masters: gentoo

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=core2 -mssse3 -mfpmath=sse -fomit-frame-pointer -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=core2 -mssse3 -mfpmath=sse -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--ask-enter-invalid --load-average=4"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news nodoc noinfo noman parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4 -l4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="acl amd64 berkdb bzip2 cli crypt cxx dri gdbm hardened ipv6 justify lm_sensors mdev minimal mmx mmxext modules ncurses nptl openmp pax_kernel pcre pie readline samba seccomp session smp sse sse2 ssl ssp tcpd threads unicode urandom xattr xml xtpax zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 sse3 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USE_PYTHON="2.7"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Mike Gilbert gentoo-dev 2016-04-25 19:51:14 UTC
This isn't a problem with portage itself. Re-assigning to base-system.
Comment 2 Mike Gilbert gentoo-dev 2016-04-25 19:55:20 UTC

*** This bug has been marked as a duplicate of bug 541406 ***