From 2ef8d8b7ca6eb59083e97703377d0426ff82054b523b273efa1165013c2c915c Mon Sep 17 00:00:00 2001 From: Stefan Dirsch Date: Mon, 16 Oct 2017 08:52:57 +0000 Subject: [PATCH 1/2] Accepting request 533960 from home:dimstar:Factory Resubmit, without breaking Leap 42.x; TW/SLE15 and Leap 15 will all use this method OBS-URL: https://build.opensuse.org/request/show/533960 OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xdm?expand=0&rev=148 --- xdm-with-update-alternative.patch | 38 ++++++++++++++++++++++++++++++ xdm.changes | 16 +++++++++++++ xdm.spec | 39 +++++++++++++++++++++++++++---- 3 files changed, 89 insertions(+), 4 deletions(-) create mode 100644 xdm-with-update-alternative.patch diff --git a/xdm-with-update-alternative.patch b/xdm-with-update-alternative.patch new file mode 100644 index 0000000..6180265 --- /dev/null +++ b/xdm-with-update-alternative.patch @@ -0,0 +1,38 @@ +diff -ur xdm.old/usr/lib/X11/display-manager xdm.new/usr/lib/X11/display-manager +--- xdm.old/usr/lib/X11/display-manager 2017-02-06 14:19:33.541035000 +0100 ++++ xdm.new/usr/lib/X11/display-manager 2017-10-12 15:44:06.592204792 +0200 +@@ -109,6 +109,8 @@ + + #set -x + ++# DISPLAYMANAGER used to be set in /etc/sysconfig/displaymanager, but the default is now set by update-alternatives ++DISPLAYMANAGER=$(realpath --relative-base=/usr/lib/X11/displaymanagers /usr/lib/X11/displaymanagers/default-displaymanager) + DM=${DISPLAYMANAGER##*/} + + case "$DM" in +@@ -127,6 +129,7 @@ + do + name="${i}_vars" + PIDFILE=/var/run/$i.pid; ++ type $name > /dev/null || continue; + $name $DM && break; + done + if [ -z "$DISPLAYMANAGER" -o ! -x "$DISPLAYMANAGER" ] +diff -ur xdm.old/var/adm/fillup-templates/sysconfig.displaymanager xdm.new/var/adm/fillup-templates/sysconfig.displaymanager +--- xdm.old/var/adm/fillup-templates/sysconfig.displaymanager 2017-01-04 11:15:56.259500000 +0100 ++++ xdm.new/var/adm/fillup-templates/sysconfig.displaymanager 2017-10-12 16:35:23.775259305 +0200 +@@ -1,14 +1,6 @@ + ## Path: Desktop/Display manager + ## Description: settings to generate a proper displaymanager config + +-## Type: string(kdm,xdm,gdm,wdm,entrance,console,lightdm,sddm) +-## Default: "" +-# +-# Here you can set the default Display manager (kdm/xdm/gdm/wdm/entrance/console). +-# all changes in this file require a restart of the displaymanager +-# +-DISPLAYMANAGER="" +- + ## Type: yesno + ## Default: no + # diff --git a/xdm.changes b/xdm.changes index b52db0a..3b3cf2f 100644 --- a/xdm.changes +++ b/xdm.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Thu Oct 12 10:08:28 UTC 2017 - dimstar@opensuse.org + +- Have update-alternatives handle Xinit's integration of the + displaymanager, replacing /etc/sysconfig/displaymanager. +- Add a dummy entry for 'console' - which is special-cased in the + display-manager script to 'exit early'. In order for it to become + an option for update-alternatives, the target needs to exist. +- Update /usr/lib/X11/display-manager to get the + default-displaymanager from the update-alternative setting + instead of reading it from /etc/sysconfig/displaymanager. +- Remove DISPLAYMANAGER from displaymanager.sysconfig template. +- Add xdm-with-update-alternative.patch so the needed changes can + be applied for suse_version >= 1330 only, not breaking Leap 42.x. +- All that together solves boo#1053863. + ------------------------------------------------------------------- Tue Jul 25 09:58:56 UTC 2017 - sndirsch@suse.com diff --git a/xdm.spec b/xdm.spec index c77dbc3..2a15b25 100644 --- a/xdm.spec +++ b/xdm.spec @@ -36,7 +36,7 @@ Release: 0 Summary: X Display Manager License: MIT Group: System/X11/Utilities -Url: http://xorg.freedesktop.org/ +URL: http://xorg.freedesktop.org/ Source0: http://xorg.freedesktop.org/releases/individual/app/%{name}-%{version}.tar.bz2 Source1: xdm.tar.bz2 Source2: HOWTO.xdm @@ -44,10 +44,12 @@ Source3: xdm-fallbacks.tar.bz2 Source4: display-manager.service Source5: xsession.desktop Patch1: xdm-tolerant-hostname-changes.diff +# PATCH-FEATURE-OPENSUSE xdm-with-update-alternative.patch dimstar@opensuse.org -- Choice of default DM by means of u-a +Patch2: xdm-with-update-alternative.patch # needed for patch0, patch2, patch3, patch4 BuildRequires: libtool BuildRequires: pam-devel -BuildRequires: pkg-config +BuildRequires: pkgconfig BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(xau) BuildRequires: pkgconfig(xaw7) @@ -72,7 +74,6 @@ Requires: xsetroot Recommends: dbus-1-x11 # This was part of the xorg-x11 package up to version 7.6 Conflicts: xorg-x11 <= 7.6 -BuildRoot: %{_tmppath}/%{name}-%{version}-build %if !%with_systemd Patch0: xdm-consolekit.diff %endif @@ -117,6 +118,8 @@ cp %{SOURCE2} . pushd xdm %patch1 -p1 popd +# Special note: patch 2 is applied in install section; tagging it here for the source validator only +#patch2 -p1 %build # needed for patch0 @@ -137,6 +140,9 @@ rm %{buildroot}%{_sysconfdir}/X11/xdm/{GiveConsole,TakeConsole,Xsetup_0} pushd %{buildroot} # SuSE default XDM configuration tar xf %{SOURCE1} +%if 0%{?suse_version} >= 1330 +patch -p1 < %{PATCH2} +%endif %if %dm_fallbacks tar xf %{SOURCE3} %endif @@ -171,6 +177,14 @@ cat > %{buildroot}%{_sbindir}/rcxdm <<-'EOF' EOF chmod 0755 %{buildroot}%{_sbindir}/rcxdm %endif +%if 0%{?suse_version} >= 1330 +# prepare for defaul-dm to be chosen by means of update-alternatives +mkdir -p %{buildroot}%{_sysconfdir}/alternatives +touch %{buildroot}%{_sysconfdir}/alternatives/default-displaymanager +ln -s %{_sysconfdir}/alternatives/default-displaymanager %{buildroot}%{_libexecdir}/X11/displaymanagers/default-displaymanager +# Inject a dummy 'console' selection - which used to be choice in /etc/sysconfig/displaymanager +touch %{buildroot}%{_libexecdir}/X11/displaymanagers/console +%endif %post %if 0%{?suse_version} < 1315 @@ -184,9 +198,15 @@ chmod 0755 %{buildroot}%{_sbindir}/rcxdm %ifarch aarch64 ppc64le if ! [ -c /dev/fb* -o -d /dev/dri ]; then sed -i -e "s+DISPLAYMANAGER_STARTS_XSERVER=.*+DISPLAYMANAGER_STARTS_XSERVER=\"no\"+g" \ - /etc/sysconfig/displaymanager + %{_sysconfdir}/sysconfig/displaymanager fi %endif +%if 0%{?suse_version} >= 1330 +%{_sbindir}/update-alternatives --install %{_libexecdir}/X11/displaymanagers/default-displaymanager \ + default-displaymanager %{_libexecdir}/X11/displaymanagers/console 5 +%{_sbindir}/update-alternatives --install %{_libexecdir}/X11/displaymanagers/default-displaymanager \ + default-displaymanager %{_libexecdir}/X11/displaymanagers/xdm 10 +%endif %pre %if !0%{?suse_version} < 1315 @@ -200,6 +220,12 @@ fi # Do not restart DM on update (bnc#886641) %service_del_postun -n display-manager.service %endif +%if 0%{?suse_version} >= 1330 +[ -f %{_libexecdir}/X11/displaymanagers/console ] || %{_sbindir}/update-alternatives \ + --remove default-displaymanager %{_libexecdir}/X11/displaymanagers/console +[ -f %{_libexecdir}/X11/displaymanagers/xdm ] || %{_sbindir}/update-alternatives \ + --remove default-displaymanager %{_libexecdir}/X11/displaymanagers/xdm +%endif %preun %if !0%{?suse_version} < 1315 @@ -212,6 +238,11 @@ fi %doc HOWTO.xdm %dir %{_dminitdir} %{_dminitdir}/xdm +%if 0%{?suse_version} >= 1330 +%{_dminitdir}/console +%{_libexecdir}/X11/displaymanagers/default-displaymanager +%ghost %{_sysconfdir}/alternatives/default-displaymanager +%endif %if %dm_fallbacks %{_dminitdir}/entrance.fallback %{_dminitdir}/gdm.fallback From f107370f3f3c5d5fc135f1d5a7cf27b68dfdbc71e75f4005b6b1a5cebc744b11 Mon Sep 17 00:00:00 2001 From: Stefan Dirsch Date: Wed, 18 Oct 2017 15:20:44 +0000 Subject: [PATCH 2/2] - reintroduced /etc/X11/xdm/keytable script and the hook-up in /usr/lib/X11/display-manager to setup X11 keymaps, since YaST is not able to use localectl already during installation due to dbus and appropriate systemd services not running :-( (bsc#1046436) OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xdm?expand=0&rev=149 --- xdm.changes | 9 +++++++++ xdm.spec | 2 +- xdm.tar.bz2 | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/xdm.changes b/xdm.changes index 3b3cf2f..afb5f6d 100644 --- a/xdm.changes +++ b/xdm.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Wed Oct 18 15:01:24 UTC 2017 - sndirsch@suse.com + +- reintroduced /etc/X11/xdm/keytable script and the hook-up in + /usr/lib/X11/display-manager to setup X11 keymaps, since YaST + is not able to use localectl already during installation due to + dbus and appropriate systemd services not running :-( + (bsc#1046436) + ------------------------------------------------------------------- Thu Oct 12 10:08:28 UTC 2017 - dimstar@opensuse.org diff --git a/xdm.spec b/xdm.spec index 2a15b25..4300ec3 100644 --- a/xdm.spec +++ b/xdm.spec @@ -36,7 +36,7 @@ Release: 0 Summary: X Display Manager License: MIT Group: System/X11/Utilities -URL: http://xorg.freedesktop.org/ +Url: http://xorg.freedesktop.org/ Source0: http://xorg.freedesktop.org/releases/individual/app/%{name}-%{version}.tar.bz2 Source1: xdm.tar.bz2 Source2: HOWTO.xdm diff --git a/xdm.tar.bz2 b/xdm.tar.bz2 index c7641e8..b1b90e1 100644 --- a/xdm.tar.bz2 +++ b/xdm.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d59ef63f70affbfc4311270cebcb14efdf08e65cbe520fe8bb013a6cd4d55f0b -size 22914 +oid sha256:e33d18017a26e2f228d5a55dcc045ce3606f9be3e6e5e49fd1ca11984151a2f0 +size 23537