Skip to content

Commit

Permalink
Force trusty to use -lts-xenial and remove kernel 3.4 hacks
Browse files Browse the repository at this point in the history
  • Loading branch information
dnschneid committed Oct 28, 2022
1 parent 8970eb6 commit 9befc9c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 89 deletions.
12 changes: 0 additions & 12 deletions chroot-etc/xorg-intel-sna.conf

This file was deleted.

83 changes: 6 additions & 77 deletions targets/xorg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ REQUIRES='audio'
PROVIDES='x11'
DESCRIPTION='X.Org X11 backend. Enables GPU acceleration on supported platforms.'
CHROOTBIN='croutoncycle croutontriggerd croutonxinitrc-wrapper setres xinit'
CHROOTETC='xbindkeysrc.scm xorg-intel-sna.conf xserverrc xserverrc-xorg xserverrc-local.example'
CHROOTETC='xbindkeysrc.scm xserverrc xserverrc-xorg xserverrc-local.example'
if [ -z "$TARGETNOINSTALL" -a -f "/sys/class/tty/tty0/active" ]; then
error 99 "xorg target is only supported on Freon-based systems."
fi
Expand All @@ -25,29 +25,19 @@ rm -f '/etc/crouton/xserverrc-x11'
backport=''
if release -eq precise; then
if [ "${ARCH#arm}" = "$ARCH" ]; then
# Note: lts-trusty mesa requires kernel version >=3.6
if ! uname -r | grep -q "^3.4."; then
backport='-lts-trusty'
fi
backport='-lts-trusty'
else
# ARM only offers quantal backport at the moment
backport='-lts-quantal'
fi
elif release -eq trusty; then
backport='-lts-xenial'
fi

# Intel?
inteldriver=''
pinmesa=''
if [ "${ARCH#arm}" = "$ARCH" ]; then
inteldriver="xserver-xorg-video-intel$backport"

# On saucy onwards, if kernel version is 3.4, manually pin down old mesa
# libraries, as new ones require version >=3.6 (see issue #704).
# This is only required on non-Atom Intel chipsets (Atom uses i915 dri driver)
if release -ge saucy && uname -r | grep -q "^3.4." &&
! grep -q 0xa0 /sys/class/graphics/fb0/device/device; then
pinmesa='y'
fi
fi

# Catalog relevant and irrelevant video drivers
Expand All @@ -67,72 +57,11 @@ removevideodrivers="$fbdev $inteldriver"
# Compile crazy xorg hacks
compile freon '-ldl -ldrm -I/usr/include/libdrm' so libdrm-dev

# Pin precise's version of mesa if necessary
# No systems use kernel 3.4 anymore, so remove the mesa hack
pinfile='/etc/apt/preferences.d/precise-mesa-pin'
pinlist='/etc/apt/sources.list.d/precise.list'
pindummypkg='libwayland-egl1-dummy'
if [ -n "$pinmesa" ]; then
# Create a dummy libwayland-egl1 package, to satisfy dependencies
# (the libraries are actually provided by libegl1-mesa-drivers in precise)
install --minimal --asdeps equivs

DEBTMP="`mktemp -d crouton.XXXXXX --tmpdir=/tmp`"
addtrap "rm -rf --one-file-system '$DEBTMP'"

( cd "$DEBTMP"; equivs-build - ) <<END
Section: misc
Priority: optional
Standards-Version: 3.9.2
Package: $pindummypkg
Version: 8.0.4
Depends: libegl1-mesa-drivers
Provides: libwayland-egl1
Description: Dummy package providing libwayland-egl1
END

# Add precise package sources
mirror="`detect_mirror`"

cat > "$pinlist" <<END
deb $mirror precise main
deb $mirror precise-updates main
deb $mirror precise-security main
END

cat > "$pinfile" <<END
# Do not install any packages from precise by default
Package: *
Pin: release n=precise
Pin-Priority: -10
# Install mesa packages and their dependencies from precise
Package: libegl1-mesa:* libegl1-mesa-dbg:* libegl1-mesa-dev:* \
libegl1-mesa-drivers:* libegl1-mesa-drivers-dbg:* \
libgl1-mesa-dev:* libgl1-mesa-dri:* libgl1-mesa-dri-dbg:* \
libgl1-mesa-glx:* libgl1-mesa-glx-dbg:* \
libglapi-mesa:* libglapi-mesa-dbg:* \
libgles1-mesa:* libgles1-mesa-dbg:* libgles1-mesa-dev:* \
libgles2-mesa:* libgles2-mesa-dbg:* libgles2-mesa-dev:* \
libdrm-nouveau1a:* libllvm3.0:* libudev0:*
Pin: release n=precise
Pin-Priority: 1100
END

# Fetch new package sources
apt-get update || true

# Forcibly replace libwayland-egl1-mesa by libwayland-egl1-dummy
# (dpkg -r does not fail if package does not exist)
dpkg -r --force-depends libwayland-egl1-mesa libwayland-egl1-mesa:i386
dpkg -i --force-depends "$DEBTMP"/libwayland-egl1-dummy_*_all.deb

# Downgrade packages, -f is needed as dependencies are broken
# This happens to install python2.7-minimal as well, pulled in by a wrong
# dependency of ubuntu-minimal-1.267 (precise), which we did not install.
# Looks like an apt bug, I guess we can live with that.
apt-get -y --force-yes --no-install-recommends dist-upgrade -f
elif [ -f "$pinfile" -o -f "$pinlist" ]; then
if [ -f "$pinfile" -o -f "$pinlist" ]; then
# No longer need the pin; remove it
rm -f "$pinfile" "$pinlist"
apt-get update || true
Expand Down

0 comments on commit 9befc9c

Please sign in to comment.