Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gentoo Support #3175

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
8493f95
Gentoo: Add initial support for the core target.
Mar 21, 2017
30e634a
Gentoo: Add support for the audio target.
Mar 21, 2017
7a18dbd
Gentoo: Make portage rebuild packages if the use flags have changed.
Mar 21, 2017
48d0585
Gentoo: Add support for the cli-extra target.
Mar 21, 2017
a9d7b84
Gentoo: Add support for the xorg and x11-common targets.
Mar 21, 2017
06f3ccc
Gentoo: Fix sudo duplication and group GID.
Mar 21, 2017
d191fd2
Gentoo: Support the gtk-extra target.
Mar 22, 2017
96cc337
Gentoo: Update the portage tree during a core update.
Mar 22, 2017
5eaeb25
Gentoo: Add support for the xfce and xfce-desktop targets.
Mar 22, 2017
53ce0cb
Gentoo: Don't call install when there's nothing passed to install.
Mar 22, 2017
495a933
Gentoo: Add support for extension target.
Mar 22, 2017
c07cc92
Gentoo: Add support for enlightenment.
Mar 22, 2017
4dcbe08
Gentoo: Add the ability to keyword packages and accept licenses.
Mar 23, 2017
2db07c6
Gentoo: Add support for the chrome targets.
Mar 23, 2017
a6ed7f7
Gentoo: Add support for lxde target.
Mar 23, 2017
835ccde
Gentoo: Add support for the xiwi target.
Mar 23, 2017
40a0601
Gentoo: Remove the suid bit to allow LD_PRELOAD for libcroutonfreon.
Mar 23, 2017
0ba9260
Gentoo: Support use expand variables for simultaneous xiwi and xorg.
Mar 24, 2017
a026730
Gentoo: Add support for RSYNC_PROXY.
Mar 24, 2017
acbc6a2
Gentoo: Add support for MIRROR, remove debugging code.
Mar 25, 2017
28e09e8
Gentoo: Use CHOST from make.conf to determine architecture.
Mar 25, 2017
fd765fb
Gentoo: Simplify prepare functions.
Mar 25, 2017
2051ba1
Gentoo: Simplify changes to prepare.sh.
Mar 25, 2017
70a8ce7
Gentoo: Simplify packages for core target. Add dbus to global use flags.
Mar 25, 2017
a875747
Gentoo: Clean up audio target changes, remove redundant check.
Mar 25, 2017
ddabc68
Gentoo: Remove extra dbus use flag setting from cli-extra.
Mar 25, 2017
27cce46
Gentoo: Remove unused X utils from extension target.
Mar 25, 2017
8f71234
Gentoo: Simplify the gtk-extra target's install logic.
Mar 25, 2017
9bc8bef
Gentoo: Fix lxde-desktop target, remove lightdm.
Mar 25, 2017
fafe25e
Gentoo: Fix use flags, clean up package installation for X targets.
Mar 25, 2017
d9b3507
Gentoo: Update cpu flag code for cpuid2cflags >=2.
Mar 26, 2017
c9379bd
Gentoo: Add ability to turn off use flags in prepare.
Mar 26, 2017
6b58f4f
Gentoo: Make sure to trigger a world update in core.
Mar 26, 2017
4d0b883
Gentoo: Add support for other arches, remove temporary files.
Mar 31, 2017
f90cc28
Gentoo: Patch xf86-video-dummy and xf86-video-intel before the build.
Mar 31, 2017
85f1b94
Gentoo: Change xorg input targets to remove unused targets.
Mar 30, 2017
2ef3ccf
Gentoo: Make Gentoo update chrome using the package manager.
Mar 30, 2017
6f82d65
Let the user change the /tmp directory for low memory devices.
Mar 30, 2017
b430183
Gentoo: Simplify audio dependency code.
Mar 31, 2017
5ef61c3
Gentoo: Simplify creating the sudo group in core.
Mar 31, 2017
69ed164
Gentoo: Add support for extra arm targets, fix ARCH variable usage.
Apr 2, 2017
ec2bbfb
Gentoo: Rework intel and fbdev video_cards use expand.
Apr 2, 2017
821d21d
Gentoo: Add note for users installing *-desktop targets.
Apr 2, 2017
9d5e783
Gentoo: Adjust CPU use expand code to be more reliable.
Apr 2, 2017
a61e162
Gentoo: Set flags earlier to prevent recompiles. Add i915, i965 to VI…
Apr 3, 2017
fb56dff
Gentoo: Support switching profiles. Add support for kde and gnome tar…
Apr 3, 2017
8928954
Gentoo: Add kodi support and make the xbmc package work with kodi.
Apr 3, 2017
723dd74
Gentoo: Update copyright year for all of the files I've touched.
Apr 3, 2017
5655d86
Gentoo: Fix issue where disabled flags would cause prepare script to …
Apr 6, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions chroot-etc/intel-geteuid.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
diff --git a/src/intel_device.c b/src/intel_device.c
index 140e153..56ef7ef 100644
--- a/src/intel_device.c
+++ b/src/intel_device.c
@@ -579,7 +579,7 @@ int intel_open_device(int entity_num,
master_count++;

/* Non-root user holding MASTER, don't let go */
- if (geteuid() && is_master(fd))
+ if (0 && is_master(fd))
master_count++;

if (pci)
diff --git a/src/legacy/i810/xvmc/I810XvMC.c b/src/legacy/i810/xvmc/I810XvMC.c
index e6b63d3..c4ff9e3 100644
--- a/src/legacy/i810/xvmc/I810XvMC.c
+++ b/src/legacy/i810/xvmc/I810XvMC.c
@@ -146,7 +146,7 @@ _X_EXPORT Status XvMCCreateContext(Display *display, XvPortID port,
}

/* Limit use to root for now */
- if(geteuid()) {
+ if(0) {
printf("Use of XvMC on i810 is currently limited to root\n");
return BadAccess;
}
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index baf5f60..cc830c1 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -17966,7 +17966,7 @@ void sna_accel_leave(struct sna *sna)
DBG(("%s\n", __FUNCTION__));

/* as root we always have permission to render */
- if (geteuid() == 0)
+ if (1)
return;

/* as a user, we can only render now if we have a rendernode */
286 changes: 286 additions & 0 deletions chroot-etc/xorg-dummy.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,286 @@
diff --git a/src/dummy_driver.c b/src/dummy_driver.c
index 2656602..0718e1f 100644
--- a/src/dummy_driver.c
+++ b/src/dummy_driver.c
@@ -34,6 +34,8 @@
#include <X11/extensions/Xv.h>
#endif

+#include "xf86Crtc.h"
+
/*
* Driver data structures.
*/
@@ -175,6 +177,115 @@ dummySetup(pointer module, pointer opts, int *errmaj, int *errmin)
#endif /* XFree86LOADER */

static Bool
+size_valid(ScrnInfoPtr pScrn, int width, int height)
+{
+ /* Guard against invalid parameters */
+ if (width == 0 || height == 0 ||
+ width > DUMMY_MAX_WIDTH || height > DUMMY_MAX_HEIGHT)
+ return FALSE;
+
+ /* videoRam is in kb, divide first to avoid 32-bit int overflow */
+ if ((width*height+1023)/1024*pScrn->bitsPerPixel/8 > pScrn->videoRam)
+ return FALSE;
+
+ return TRUE;
+}
+
+static Bool
+dummy_xf86crtc_resize(ScrnInfoPtr pScrn, int width, int height)
+{
+ int old_width, old_height;
+
+ old_width = pScrn->virtualX;
+ old_height = pScrn->virtualY;
+
+ if (size_valid(pScrn, width, height)) {
+ PixmapPtr rootPixmap;
+ ScreenPtr pScreen = pScrn->pScreen;
+
+ pScrn->virtualX = width;
+ pScrn->virtualY = height;
+
+ rootPixmap = pScreen->GetScreenPixmap(pScreen);
+ if (!pScreen->ModifyPixmapHeader(rootPixmap, width, height,
+ -1, -1, -1, NULL)) {
+ pScrn->virtualX = old_width;
+ pScrn->virtualY = old_height;
+ return FALSE;
+ }
+
+ pScrn->displayWidth = rootPixmap->devKind /
+ (rootPixmap->drawable.bitsPerPixel / 8);
+
+ return TRUE;
+ } else {
+ return FALSE;
+ }
+}
+
+static const xf86CrtcConfigFuncsRec dummy_xf86crtc_config_funcs = {
+ dummy_xf86crtc_resize
+};
+
+static xf86OutputStatus
+dummy_output_detect(xf86OutputPtr output)
+{
+ return XF86OutputStatusConnected;
+}
+
+static int
+dummy_output_mode_valid(xf86OutputPtr output, DisplayModePtr pMode)
+{
+ if (size_valid(output->scrn, pMode->HDisplay, pMode->VDisplay)) {
+ return MODE_OK;
+ } else {
+ return MODE_MEM;
+ }
+}
+
+static DisplayModePtr
+dummy_output_get_modes(xf86OutputPtr output)
+{
+ return NULL;
+}
+
+static void
+dummy_output_dpms(xf86OutputPtr output, int dpms)
+{
+ return;
+}
+
+static const xf86OutputFuncsRec dummy_output_funcs = {
+ .detect = dummy_output_detect,
+ .mode_valid = dummy_output_mode_valid,
+ .get_modes = dummy_output_get_modes,
+ .dpms = dummy_output_dpms,
+};
+
+static Bool
+dummy_crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
+ Rotation rotation, int x, int y)
+{
+ crtc->mode = *mode;
+ crtc->x = x;
+ crtc->y = y;
+ crtc->rotation = rotation;
+
+ return TRUE;
+}
+
+static void
+dummy_crtc_dpms(xf86CrtcPtr output, int dpms)
+{
+ return;
+}
+
+static const xf86CrtcFuncsRec dummy_crtc_funcs = {
+ .set_mode_major = dummy_crtc_set_mode_major,
+ .dpms = dummy_crtc_dpms,
+};
+
+static Bool
DUMMYGetRec(ScrnInfoPtr pScrn)
{
/*
@@ -280,6 +391,8 @@ DUMMYPreInit(ScrnInfoPtr pScrn, int flags)
DUMMYPtr dPtr;
int maxClock = 300000;
GDevPtr device = xf86GetEntityInfo(pScrn->entityList[0])->device;
+ xf86OutputPtr output;
+ xf86CrtcPtr crtc;

if (flags & PROBE_DETECT)
return TRUE;
@@ -343,13 +456,6 @@ DUMMYPreInit(ScrnInfoPtr pScrn, int flags)
if (!xf86SetDefaultVisual(pScrn, -1))
return FALSE;

- if (pScrn->depth > 1) {
- Gamma zeros = {0.0, 0.0, 0.0};
-
- if (!xf86SetGamma(pScrn, zeros))
- return FALSE;
- }
-
xf86CollectOptions(pScrn, device->options);
/* Process the options */
if (!(dPtr->Options = malloc(sizeof(DUMMYOptions))))
@@ -379,64 +485,45 @@ DUMMYPreInit(ScrnInfoPtr pScrn, int flags)
maxClock);
}

- pScrn->progClock = TRUE;
- /*
- * Setup the ClockRanges, which describe what clock ranges are available,
- * and what sort of modes they can be used for.
- */
- clockRanges = (ClockRangePtr)xnfcalloc(sizeof(ClockRange), 1);
- clockRanges->next = NULL;
- clockRanges->ClockMulFactor = 1;
- clockRanges->minClock = 11000; /* guessed §§§ */
- clockRanges->maxClock = maxClock;
- clockRanges->clockIndex = -1; /* programmable */
- clockRanges->interlaceAllowed = TRUE;
- clockRanges->doubleScanAllowed = TRUE;
-
- /* Subtract memory for HW cursor */
-
-
- {
- int apertureSize = (pScrn->videoRam * 1024);
- i = xf86ValidateModes(pScrn, pScrn->monitor->Modes,
- pScrn->display->modes, clockRanges,
- NULL, 256, DUMMY_MAX_WIDTH,
- (8 * pScrn->bitsPerPixel),
- 128, DUMMY_MAX_HEIGHT, pScrn->display->virtualX,
- pScrn->display->virtualY, apertureSize,
- LOOKUP_BEST_REFRESH);
-
- if (i == -1)
- RETURN;
- }
+ xf86CrtcConfigInit(pScrn, &dummy_xf86crtc_config_funcs);
+
+ xf86CrtcSetSizeRange(pScrn, 256, 256, DUMMY_MAX_WIDTH, DUMMY_MAX_HEIGHT);
+
+ crtc = xf86CrtcCreate(pScrn, &dummy_crtc_funcs);
+
+ output = xf86OutputCreate (pScrn, &dummy_output_funcs, "default");

- /* Prune the modes marked as invalid */
- xf86PruneDriverModes(pScrn);
+ output->possible_crtcs = 0x7f;

- if (i == 0 || pScrn->modes == NULL) {
+ xf86InitialConfiguration(pScrn, TRUE);
+
+ if (pScrn->depth > 1) {
+ Gamma zeros = {0.0, 0.0, 0.0};
+
+ if (!xf86SetGamma(pScrn, zeros))
+ return FALSE;
+ }
+
+ if (pScrn->modes == NULL) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes found\n");
RETURN;
}

- /*
- * Set the CRTC parameters for all of the modes based on the type
- * of mode, and the chipset's interlace requirements.
- *
- * Calling this is required if the mode->Crtc* values are used by the
- * driver and if the driver doesn't provide code to set them. They
- * are not pre-initialised at all.
- */
- xf86SetCrtcForModes(pScrn, 0);
-
/* Set the current mode to the first in the list */
pScrn->currentMode = pScrn->modes;

- /* Print the list of modes being used */
- xf86PrintModes(pScrn);
+ /* Set default mode in CRTC */
+ crtc->funcs->set_mode_major(crtc, pScrn->currentMode, RR_Rotate_0, 0, 0);

/* If monitor resolution is set on the command line, use it */
xf86SetDpi(pScrn, 0, 0);

+ /* Set monitor size based on DPI */
+ output->mm_width = pScrn->xDpi > 0 ?
+ (pScrn->virtualX * 254 / (10*pScrn->xDpi)) : 0;
+ output->mm_height = pScrn->yDpi > 0 ?
+ (pScrn->virtualY * 254 / (10*pScrn->yDpi)) : 0;
+
if (xf86LoadSubModule(pScrn, "fb") == NULL) {
RETURN;
}
@@ -537,6 +624,8 @@ DUMMYScreenInit(SCREEN_INIT_ARGS_DECL)

if (!miSetPixmapDepths ()) return FALSE;

+ pScrn->displayWidth = pScrn->virtualX;
+
/*
* Call the framebuffer layer's ScreenInit function, and fill in other
* pScreen fields.
@@ -575,23 +664,6 @@ DUMMYScreenInit(SCREEN_INIT_ARGS_DECL)
if (dPtr->swCursor)
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using Software Cursor.\n");

- {
-
-
- BoxRec AvailFBArea;
- int lines = pScrn->videoRam * 1024 /
- (pScrn->displayWidth * (pScrn->bitsPerPixel >> 3));
- AvailFBArea.x1 = 0;
- AvailFBArea.y1 = 0;
- AvailFBArea.x2 = pScrn->displayWidth;
- AvailFBArea.y2 = lines;
- xf86InitFBManager(pScreen, &AvailFBArea);
-
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Using %i scanlines of offscreen memory \n"
- , lines - pScrn->virtualY);
- }
-
xf86SetBackingStore(pScreen);
xf86SetSilkenMouse(pScreen);

@@ -618,6 +690,9 @@ DUMMYScreenInit(SCREEN_INIT_ARGS_DECL)
| CMAP_RELOAD_ON_MODE_SWITCH))
return FALSE;

+ if (!xf86CrtcScreenInit(pScreen))
+ return FALSE;
+
/* DUMMYInitVideo(pScreen); */

pScreen->SaveScreen = DUMMYSaveScreen;
18 changes: 18 additions & 0 deletions host-bin/startkodi
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh -e
# Copyright (c) 2017 The crouton Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

set -e

APPLICATION="${0##*/}"

USAGE="$APPLICATION [options]

Wraps enter-chroot to start a Kodi session.
By default, it will log into the primary user on the first chroot found.

Options are directly passed to enter-chroot; run enter-chroot to list them."

exec sh -e "`dirname "\`readlink -f "$0"\`"`/enter-chroot" -t kodi "$@" "" \
exec xinit /usr/bin/kodi
Loading