diff --git a/installer/gentoo/prepare b/installer/gentoo/prepare index 4978f50a5..9ba8e722b 100644 --- a/installer/gentoo/prepare +++ b/installer/gentoo/prepare @@ -88,6 +88,24 @@ By installing $3, the license $2 has been enabled. " } +# Set a use expand flag +# Usage: set_use_expand +set_use_expand() { + # Check if the variable is already present + EXPAND=`grep "$1" /etc/portage/make.conf | cut -f2 -d\"` + # If not, add it with the desired flag + if [ -z "$EXPAND" ]; then + echo "$1=\"$2\"" >> /etc/portage/make.conf + # If the variable is already present, check if the flag is already set + else + FLAG_SET=`echo $EXPAND | grep $2 | cut -f1 -d\"` + # Add the flag + if [ -z "$FLAG_SET" ]; then + sed -i -e "s|$1=\"\(.*\)\"|$1=\"\1 $2\"|" /etc/portage/make.conf + fi + fi +} + # install_dist: see install() in prepare.sh for details. install_dist() { local pkgs='' diff --git a/targets/xiwi b/targets/xiwi index c2bec7093..b131cc492 100755 --- a/targets/xiwi +++ b/targets/xiwi @@ -29,17 +29,20 @@ if [ "${DISTROAKA:-"$DISTRO"}" = 'debian' ]; then fi if [ "${DISTROAKA:-"$DISTRO"}" = 'gentoo' ]; then - VIDEO_CARDS=`grep VIDEO_CARDS /etc/portage/make.conf | cut -d= -f1` - if [ -z ${VIDEO_CARDS} ]; then - echo "VIDEO_CARDS=\"dummy\"" >> /etc/portage/make.conf - echo "INPUT_DEVICES=\"keyboard libinput mouse evdev\"" >> /etc/portage/make.conf - fi + # Set video card and input devices + set_use_expand VIDEO_CARDS dummy + set_use_expand INPUT_DEVICES keyboard + set_use_expand INPUT_DEVICES libinput + set_use_expand INPUT_DEVICES mouse + set_use_expand INPUT_DEVICES evdev + # Set use flags for X set_flags X dbus # We remove the suid bit because it breaks LD_PRELOAD'ing libcroutonfreon.so set_package_flag x11-base/xorg-server -suid xorg - + # Install xorg install xorg-x11 xorg-server + # Set the flags for i3 and install it set_flags xcb xkb install i3 else diff --git a/targets/xorg b/targets/xorg index 80f25f2a3..ff946a57b 100644 --- a/targets/xorg +++ b/targets/xorg @@ -17,17 +17,17 @@ rm -f '/etc/crouton/xserverrc-x11' # Set the use flags on gentoo that we'll need for X if [ "${DISTROAKA:-"$DISTRO"}" = 'gentoo' ]; then - set_flags libkms uxa dri3 xvmc opengl -suid - # We remove the suid bit because it breaks LD_PRELOAD'ing libcroutonfreon.so - set_package_flag x11-base/xorg-server -suid xorg - - # Set VIDEO_CARDS and INPUT_DEVICES - # FIXME: Perhaps make this more flexible, right now just pick all of them - VIDEO_CARDS=`grep VIDEO_CARDS /etc/portage/make.conf | cut -d= -f1` - if [ -z ${VIDEO_CARDS} ]; then - echo "VIDEO_CARDS=\"intel fbdev vesa dummy\"" >> /etc/portage/make.conf - echo "INPUT_DEVICES=\"keyboard libinput mouse evdev\"" >> /etc/portage/make.conf - fi + set_flags libkms uxa dri3 xvmc opengl -suid + # We remove the suid bit because it breaks LD_PRELOAD'ing libcroutonfreon.so + set_package_flag x11-base/xorg-server -suid xorg + # Set video card and input devices + # FIXME: ARM, non-intel? + set_use_expand VIDEO_CARDS intel + set_use_expand INPUT_DEVICES keyboard + set_use_expand INPUT_DEVICES libinput + set_use_expand INPUT_DEVICES mouse + set_use_expand INPUT_DEVICES evdev + set_use_expand INPUT_DEVICES synaptics fi # Figure out what we need on this system