Skip to content

Commit

Permalink
Gentoo: Remove the suid bit to allow LD_PRELOAD for libcroutonfreon.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Jezak committed Mar 24, 2017
1 parent 835ccde commit 40a0601
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
23 changes: 23 additions & 0 deletions installer/gentoo/prepare
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,29 @@ set_flags() {
done
}

# Set a package specific use flag
# Usage: set_package_flag <package> <use flag> <crouton target for comment>
set_package_flag() {
# Check if the directory exists
if [ ! -d /etc/portage/package.use ]; then
mkdir /etc/portage/package.use
fi

# Check if the package use file exists
if [ ! -f /etc/portage/package.use/crouton ]; then
touch /etc/portage/package.use/crouton
fi

# Check if the requested package/use is already in the file
USEFLAG=`grep -e "^$1 $2$" /etc/portage/package.use/crouton | cut -f1 -d1`

# Set the use flag
if [ -z "${USEFLAG}" ]; then
echo "# Added flag $2 to $1 for crouton target $3" >> /etc/portage/package.use/crouton
echo "$1 $2" >> /etc/portage/package.use/crouton
fi
}

# Set unstable keywords for a package
# Usage: keyword_package <package> <crouton target for comment>
keyword_package() {
Expand Down
3 changes: 3 additions & 0 deletions targets/xiwi
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ if [ "${DISTROAKA:-"$DISTRO"}" = 'gentoo' ]; then
echo "INPUT_DEVICES=\"keyboard libinput mouse evdev\"" >> /etc/portage/make.conf
fi

# We remove the suid bit because it breaks LD_PRELOAD'ing libcroutonfreon.so
set_package_flag x11-base/xorg-server -suid xorg

set_flags X dbus
install xorg-x11 xorg-server
set_flags xcb xkb
Expand Down
3 changes: 3 additions & 0 deletions targets/xorg
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ 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

# 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
Expand Down

0 comments on commit 40a0601

Please sign in to comment.