Project:Prefix/FAQ

From Gentoo Wiki
Jump to:navigation Jump to:search

This guide covers questions frequently asked by users of Gentoo Prefix

Gentoo Prefix Frequently Asked Questions

How can I contribute?

Due to the depth of the Gentoo Prefix project, we really like to have users become involved. It helps us immensely. Here are some possibilities:

  • Report bugs! Unreported bugs are very bad for the health of the project, please do report bugs
  • Fix bugs! Most of the bugs result from EPREFIX not being respected.
  • Report working packages that you may have imported
  • Test packages - We cannot make sure that every package on every arch works by ourselves.
  • Bootstrapping must always work, rebootstrapping often and reporting issues would benefit all and you might learn something as well.

I made a fix, what is the best way to report this?

The absolute best way to report fixes is through Gentoo's Bugzilla. Use the "Gentoo/Alt" Product with the "Prefix Support" component, or click here. The second best way is to report them on the gentoo-alt mailing list, however, items may get forgotten or overlooked on the mailing list. Finally, you may report items in irc, but be sure you are speaking to a Gentoo Prefix developer, otherwise it is likely to not be noticed.

XXX ebuild works for me, now what?

Please report it! See above and also see here.

I want to run Gentoo Prefix within my company, am I allowed to do so?

Of course, see above for support ;) Also, you must obey whichever license as applies.

How mature is Gentoo Prefix?

Many of us use Gentoo Prefix everyday and it has been in existance since 2004. Keep in mind that you are riding the tip of the portage code and the latest packages as they exist in the gentoo-x86 tree. Gentoo Prefix is believed to have a reasonable maturity. However, as always, our software comes without warranty.

What is the "::gentoo tree" ?

::gentoo (previously: gx86, gentoo-x86) is what Gentoo Linux calls their tree that contains all the ebuilds. See here.

On which platforms does Gentoo Prefix run on?

Many platforms, including but not limited to: GNU/Linux, AIX, Solaris, Mac OS X, Cygwin.

What is the best way to contact a Gentoo Prefix developer?

Please do not send us private mail. We prefer to receive list mail. See above for info on the gentoo-alt mailing list.

I want to import an ebuild, how do I go about that?

You don't import an ebuild any more, you just fix it in gentoo-x86. (Or provide a patch with bug.)

I want to uninstall Gentoo Prefix from my system, how?

Uninstalling Gentoo Prefix is a simple as removing the directory:

root #rm -rf "${EPREFIX}"

A fix was committed, but I don't have it, how come?

Gentoo Prefix users no longer are using a git snapshot as their portage tree. This means a commit made by a developer is not directly accessible to users. Instead, users are using an rsync version of the portage tree that is amongst others enriched with metadata for improved performance. This tree is generated twice an hour, at 01 and 31. The generation usually takes about 5 minutes, but may take up to 25 minutes when lots of changes have been committed. From the moment the generation is done, the rsync slaves have to pick up the updated copy from the main generation server. The slaves will sync with the main server in the last 5 minutes, thus from 25th till 30th minute.

In short this means that you can only safely sync to get the fix 60 minutes after the commit has taken place.

My PATH does not include the Prefix directories after I ran ./startprefix

You probably override PATH in your ~/.profile, ~/.bashrc, ~/.cshrc, or ~/.tcshrc (or what else is your shell initialization file).

What should I do when the bootstrap script fails?

There are infinite way the bootstrap could fail. But more of them fall into some common senarios. Here are some tips:

  1. Inspect EPREFIX/stage*.log, make a case-insensitive search for the first occurence of "Error", search the fine web for that message and the file name.
  2. Seek help on IRC (wait 24h for answers), mailing list or report to [1] under "Gentoo alt" product "prefix support" with with EPREFIX/stage*.log attached or uploaded to a pastebin.
  3. For a specific bug in a package, build.log and config.log will contain useful information, too.
  4. If EPREFIX/stage*.log is too big, upload only the last 1000 lines.
  5. If a fix is to be tested, modify a ebuild file or mask a package under EPREFIX. Then rerun bootstrap-prefix.sh with the same $EPREFIX. If it again fails, it is recommended to restart bootstrap-prefix.sh in an empty EPREFIX before submitting bugs.

Can other users on the same host use the Gentoo Prefix?

Yes, but they cannot use eselect or gcc-config to switch between versions of the many tools. They can call gcc-4.1.2 or python-3.4 directly. Only the user who has write permissions to Gentoo Prefix installation can adjust the'system-wide defaults.

Username becomes invalid inside Prefix

On Linux, Gentoo Prefix can use its own glibc, which performs independent name service from the host. The uid to username mapping is managed by nss within glibc. A new install of glibc requires a new set of mappings.

The bootstrap script first tries to generate passwd and group from getent and links host /etc/{passwd,group} as fallback:

user $getent passwd > ${EPREFIX}/etc/passwd || ln -s /etc/passwd ${EPREFIX}/etc/passwd
user $getent group > ${EPREFIX}/etc/group || ln -s /etc/group ${EPREFIX}/etc/group

If usernames are provided by LDAP, sometimes the system is configured such that a normal user cannot query the entire passwd or group by getent; in such a case portage breaks, portage will not be able to resolve the username and group. A quick fix is to show yourself to Prefix by specifying who you are:

user $alias id=$(which -a id | tail -n1) # use host id
user $alias getent=$(which -a getent | tail -n1) # use host getent
user $getent passwd $(id -u) > "${EPREFIX}/etc/passwd"
user $getent group $(id -g) > "${EPREFIX}/etc/group"

But other users on the host cannot be resolved. To get a fair sample of all users on the system, enumerate the /home directory:

user $alias getent=$(which -a getent | tail -n1) # use host getent
user $alias stat=$(which -a stat | tail -n1) # use host stat
user $for d in /home/*; do stat -c '%u' $d; done | sort -u | xargs getent passwd > "${EPREFIX}/etc/passwd"
user $for d in /home/*; do stat -c '%g' $d; done | sort -u | xargs getent group > "${EPREFIX}/etc/group"

The files maybe get a bit outdated over the time as new users are added to the host's passwd/group files. The above id mapping needs to be regenerated.

Another solution is to use host nss_ldap library. (nss is part of glibc, which resolves uid/gid.)

user $LIBDIR=$(portageq envvar LIBDIR_$(portageq envvar ABI))
user $ln -s /${LIBDIR}/libnss_ldap.so.2 ${EPREFIX}/${LIBDIR}/

Then set nsswitch to query ldap.

FILE EPREFIX/etc/nsswitch.conf
passwd: ldap compat
group: ldap compat

Compile inside memory

On a cluster node with large memory and shared network filesystem, compiling in a memory tmpfs can be significantly faster. /dev/shm is mounted as tmpfs by many distributions. For example:

FILE ${EPREFIX}/etc/portage/make.conf
PORTAGE_TMPDIR=/dev/shm

During bootstrap, PORTAGE_TMPDIR can be changed with:

user $export PORTAGE_TMPDIR=/dev/shm

On systemd/RedHat systems tmpfs (shm) is mounted by default on /tmp, /dev/shm doesn't exist any more there.


Add an en_US.UTF-8 locale

If Prefix uses it's own libc, the locales should be generated in the Prefix. Add an entry to EPREFIX/etc/locale.gen

FILE ${EPREFIX}/etc/locale.gen
en_US.UTF-8 UTF-8

Then generate the locale by running:

user $locale-gen
 * Using locale.gen from ROOT /auto/external/buffalo/data02a/gentoo/etc/
 * Generating locale-archive: forcing # of jobs to 1
 * Generating 1 locales (this might take a while) with 1 jobs
 *  (1/1) Generating en_US.UTF-8
 * Generation complete

For more details, refer to the handbook.


Use a nearby mirror during bootstrap

The bootstrap script needs to download quite a bit. It can be accelerated by using a Gentoo mirror nearby. To use a mirror, GENTOO_MIRRORS should be set both in the environment

user $export GENTOO_MIRRORS=http://mirrors.tuna.tsinghua.edu.cn/gentoo
user $./bootstrap-prefix.sh

And make.conf:

FILE ${EPREFIX}/etc/portage/make.conf ${EPREFIX}/tmp/etc/portage/make.conf
GENTOO_MIRRORS=http://mirrors.tuna.tsinghua.edu.cn/gentoo

Replace http://mirrors.tuna.tsinghua.edu.cn/gentoo with a favorite mirror.

For more details, refer to the GENTOO_MIRRORS article.

The rsync mirror is set in repos.conf:

FILE ${EPREFIX}/etc/portage/repos.conf
[gentoo]

sync-type = rsync
sync-uri = rsync://mirrors.tuna.tsinghua.edu.cn/gentoo-portage

Replace rsync://mirrors.tuna.tsinghua.edu.cn/gentoo-portage with your favorite mirror. Refer to repos.conf for details.

Similarly, you can set the GNU mirror via GNU_URL variable during stage 1 of the bootstrap.

What is Gentoo Prefix not good for?

Java binaries, even the Oracle jre/jdk packages contain some binary code which needs glib-2.17. If the host glibc is older, getting some key parts of java environment installed on Gentoo Prefix will not work.

Can Gentoo Prefix execute 32bit and 64bit binaries (aka having multilib support)?

In principle, multilib can be supported out of box. But in practice to keep it simple, the profile used is are no-multilib variants. Bootstrapping a multilib Prefix requires the host to support multilib as a starting point, which is universally true.

If 32bit application is really needed, it is straight-forward to bootstrap another 32bit Prefix on an 64bit host.

Any pressing issue with Gentoo Prefix?

Respection of EPREFIX in overlays! Many perl-based packages do not install because of 'Aborting due to QA concerns: double prefix files installed' (sci-biology/TransDecoder-2.1.0::science and many other). For example, bug #587702.


Can I switch from an rpath profile to a glibc one?

No. Although it is possible, bootstrapping a new one costs far less time and effort. The bootstrap script will detect portage of Gentoo:Prefix in your PATH and take a shortcut.

Can I move binaries to another host?

The binaries with rpath may not work on another system unless LD_LIBRARY_PATH redirects the paths. If the dynamic loader is prefixified, it should be found at runtime.

Install elfutils on the hosting operating system. See for example:

user $ldd ${EPREFIX}/bin/bash
user $readelf --relocs ${EPREFIX}/bin/bash
user $readelf --all ${EPREFIX}/bin/bash


I don't understand something in this FAQ!

Please join #gentoo-prefix on irc.gentoo.org or utilize the gentoo-alt mailing list.


This page is based on a document formerly found on our main website gentoo.org.
The following people contributed to the original document: Jeremy Olexa
They are listed here because wiki history does not allow for any external attribution. If you edit the wiki article, please do not add yourself here; your contributions are recorded on each article's associated history page.