From dacfc23c36b32d6b4c5c185236b881b60504f97b Mon Sep 17 00:00:00 2001 From: Matthew Thode Date: Fri, 19 Feb 2016 00:06:38 -0600 Subject: [PATCH] Fix building on gentoo hosts This patch fixes the profile autodetect. If the profile was passed at install time, it would overridden by the environment.d script. This was fixed by accepting the value passed by the user, if one was passed. The enviroment.d file is run outside of chroot, because of this eselect will not be available on non-gentoo systems. We change the behavior to work elsewhere, it was not working on non-gentoo systems and giving bad results on gentoo systems (returing values from the host, not the guest being built). This patch also fixes shm detection by checking if it is mounted already. Change-Id: Ie58d8e19529a731bfbc9eeb4bb246988d1aaa772 --- elements/gentoo/bin/install-packages | 10 +++++++--- .../gentoo/environment.d/00-gentoo-distro-name.bash | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/elements/gentoo/bin/install-packages b/elements/gentoo/bin/install-packages index 8f3d328f..e60cf5f8 100755 --- a/elements/gentoo/bin/install-packages +++ b/elements/gentoo/bin/install-packages @@ -58,9 +58,13 @@ function unfix_shm { function install_gentoo_packages { RUN_ONCE_SHM='1' - fix_shm - emerge $@ - unfix_shm + if ! grep -q /dev/shm /proc/mounts; then + fix_shm + emerge $@ + unfix_shm + else + emerge $@ + fi } TEMP="$(getopt -o huem: -n ${SCRIPTNAME} -- ${@})" diff --git a/elements/gentoo/environment.d/00-gentoo-distro-name.bash b/elements/gentoo/environment.d/00-gentoo-distro-name.bash index 91e5606b..ebfb67a2 100755 --- a/elements/gentoo/environment.d/00-gentoo-distro-name.bash +++ b/elements/gentoo/environment.d/00-gentoo-distro-name.bash @@ -1,2 +1,2 @@ export DISTRO_NAME=gentoo -export GENTOO_PROFILE=$(eselect profile show | tail -n 1) +export GENTOO_PROFILE=${GENTOO_PROFILE:-'default/linux/amd64/13.0'}