]> git.pld-linux.org Git - packages/kde4-kdebase-workspace.git/commitdiff
- pull systemd and plymouth support from FC auto/th/kde4-kdebase-workspace-4.11.21-2
authorJan Rękorajski <baggins@pld-linux.org>
Tue, 4 Aug 2015 22:35:03 +0000 (00:35 +0200)
committerJan Rękorajski <baggins@pld-linux.org>
Tue, 4 Aug 2015 22:35:03 +0000 (00:35 +0200)
- rel 2

kde4-kdebase-workspace-bug796969.patch [new file with mode: 0644]
kde4-kdebase-workspace-kdm-logind-multiseat.patch [new file with mode: 0644]
kde4-kdebase-workspace-kdm_plymouth081.patch [new file with mode: 0644]
kde4-kdebase-workspace-xsession_errors_O_APPEND.patch [new file with mode: 0644]
kde4-kdebase-workspace.spec

diff --git a/kde4-kdebase-workspace-bug796969.patch b/kde4-kdebase-workspace-bug796969.patch
new file mode 100644 (file)
index 0000000..16e2938
--- /dev/null
@@ -0,0 +1,37 @@
+per https://bugzilla.redhat.com/show_bug.cgi?id=796969#c23
+The process that executes kdm/backend/session.c:manageSession() is the leader
+process of the logind session.
+
+manageSession() calls:
+
+    blockTerm();
+    clientExited();
+    unblockTerm();
+
+where clientExited() ends the PAM session.
+With the current systemd-logind, ending the PAM session will cause the leader
+process to be delivered SIGHUP and SIGTERM. The process will die and the
+remainder of manageSession() will not be executed.
+
+Interestingly, at the end of the function there's a call to sessionExit(),
+which calls clientExited() again.
+
+Removing the three lines quoted above makes reboot from KDE work again. I
+haven't noticed any bad effects.
+
+diff -up kde-workspace-4.8.0/kdm/backend/session.c.bz796969 kde-workspace-4.8.0/kdm/backend/session.c
+--- kde-workspace-4.8.0/kdm/backend/session.c.bz796969 2012-01-18 14:08:40.000000000 -0600
++++ kde-workspace-4.8.0/kdm/backend/session.c  2012-02-28 07:17:16.270219932 -0600
+@@ -662,9 +662,9 @@ manageSession(void)
+         sessionExit(EX_AL_RESERVER_DPY);
+     }
+-    blockTerm();
+-    clientExited();
+-    unblockTerm();
++    /* blockTerm(); */
++    /* clientExited(); */
++    /* unblockTerm(); */
+     gSet(&mstrtalk);
+     gSendInt(D_UnUser);
diff --git a/kde4-kdebase-workspace-kdm-logind-multiseat.patch b/kde4-kdebase-workspace-kdm-logind-multiseat.patch
new file mode 100644 (file)
index 0000000..99a259e
--- /dev/null
@@ -0,0 +1,405 @@
+diff -up kde-workspace-4.10.90/CMakeLists.txt.kdm_logind kde-workspace-4.10.90/CMakeLists.txt
+--- kde-workspace-4.10.90/CMakeLists.txt.kdm_logind    2013-06-27 16:27:30.199895076 -0500
++++ kde-workspace-4.10.90/CMakeLists.txt       2013-06-27 16:30:25.167008304 -0500
+@@ -128,6 +128,13 @@ if(Q_WS_X11)
+   endif()
+ endif(Q_WS_X11)
++macro_optional_find_package(Systemd)
++set_package_properties(Systemd PROPERTIES DESCRIPTION "Init and service manager for Linux"
++                       URL "http://www.freedesktop.org/wiki/Software/systemd"
++                       TYPE OPTIONAL
++                       PURPOSE "Provides automatic multi-seat, session and power management features"
++                      )
++
+ macro_optional_find_package(GLIB2 2.0)
+ set_package_properties(GLIB2 PROPERTIES DESCRIPTION "Low-level core library for data structure handling, portability wrappers, etc."
+                        URL "http://www.gtk.org"
+diff -up kde-workspace-4.10.90/cmake/modules/CMakeLists.txt.kdm_logind kde-workspace-4.10.90/cmake/modules/CMakeLists.txt
+--- kde-workspace-4.10.90/cmake/modules/CMakeLists.txt.kdm_logind      2013-06-10 13:51:11.000000000 -0500
++++ kde-workspace-4.10.90/cmake/modules/CMakeLists.txt 2013-06-27 16:27:30.199895076 -0500
+@@ -8,6 +8,7 @@ set(cmakeFiles FindCkConnector.cmake
+                FindOpenGLES.cmake
+                FindPAM.cmake
+                FindSensors.cmake
++               FindSystemd.cmake
+                PkgConfigGetVar.cmake
+                UnixAuth.cmake )
+diff -up kde-workspace-4.10.90/cmake/modules/FindSystemd.cmake.kdm_logind kde-workspace-4.10.90/cmake/modules/FindSystemd.cmake
+--- kde-workspace-4.10.90/cmake/modules/FindSystemd.cmake.kdm_logind   2013-06-27 16:27:30.200895065 -0500
++++ kde-workspace-4.10.90/cmake/modules/FindSystemd.cmake      2013-06-27 16:27:30.200895065 -0500
+@@ -0,0 +1,39 @@
++# Finds systemd and its libraries
++# Not a huge module but sufficient for now
++# Uses the same semantics as pkg_check_modules, i.e. ${LIB}{_FOUND,_INCLUDE_DIR,_LIBRARIES}
++# where ${LIB} can be one of the following:
++#     LIBSYSTEMD_JOURNAL, SYSTEMD, LIBSYSTEMD_DAEMON, LIBSYSTEMD_LOGIN, LIBSYSTEMD_ID128
++#
++# Copyright: Red Hat, Inc. 2013
++# Author: Martin Briza <mbriza@redhat.com>
++#
++# Distributed under the BSD license. See COPYING-CMAKE-SCRIPTS for details.
++
++#defining any of these disables systemd support
++if (NOT LIBSYSTEMD_JOURNAL_FOUND AND
++    NOT SYSTEMD_FOUND AND
++    NOT LIBSYSTEMD_DAEMON_FOUND AND
++    NOT LIBSYSTEMD_LOGIN_FOUND AND
++    NOT LIBSYSTEMD_ID128_FOUND)
++find_package(PkgConfig)
++if (PKG_CONFIG_FOUND)
++    pkg_check_modules(LIBSYSTEMD_JOURNAL QUIET "libsystemd-journal")
++    pkg_check_modules(SYSTEMD QUIET "systemd")
++    pkg_check_modules(LIBSYSTEMD_DAEMON QUIET "libsystemd-daemon")
++    pkg_check_modules(LIBSYSTEMD_LOGIN QUIET "libsystemd-login")
++    pkg_check_modules(LIBSYSTEMD_ID128 QUIET "libsystemd-id128")
++endif (PKG_CONFIG_FOUND)
++
++if (SYSTEMD_FOUND)
++    message(STATUS "Found systemd")
++endif(SYSTEMD_FOUND)
++
++mark_as_advanced(LIBSYSTEMD_JOURNAL_FOUND       SYSTEMD_FOUND       LIBSYSTEMD_DAEMON_FOUND       LIBSYSTEMD_LOGIN_FOUND       LIBSYSTEMD_ID128_FOUND)
++mark_as_advanced(LIBSYSTEMD_JOURNAL_INCLUDE_DIR SYSTEMD_INCLUDE_DIR LIBSYSTEMD_DAEMON_INCLUDE_DIR LIBSYSTEMD_LOGIN_INCLUDE_DIR LIBSYSTEMD_ID128_INCLUDE_DIR)
++mark_as_advanced(LIBSYSTEMD_JOURNAL_LIBRARIES   SYSTEMD_LIBRARIES   LIBSYSTEMD_DAEMON_LIBRARIES   LIBSYSTEMD_LOGIN_LIBRARIES   LIBSYSTEMD_ID128_LIBRARIES)
++
++endif (NOT LIBSYSTEMD_JOURNAL_FOUND AND
++       NOT SYSTEMD_FOUND AND
++       NOT LIBSYSTEMD_DAEMON_FOUND AND
++       NOT LIBSYSTEMD_LOGIN_FOUND AND
++       NOT LIBSYSTEMD_ID128_FOUND)
+diff -up kde-workspace-4.10.90/kdm/backend/CMakeLists.txt.kdm_logind kde-workspace-4.10.90/kdm/backend/CMakeLists.txt
+--- kde-workspace-4.10.90/kdm/backend/CMakeLists.txt.kdm_logind        2013-05-28 13:38:21.000000000 -0500
++++ kde-workspace-4.10.90/kdm/backend/CMakeLists.txt   2013-06-27 16:27:30.201895054 -0500
+@@ -45,6 +45,10 @@ if (SECURE_RPC)
+               rpcauth.c
+       )
+ endif (SECURE_RPC)
++if(LIBSYSTEMD_LOGIN_FOUND AND LIBSYSTEMD_DAEMON_FOUND)
++    add_definitions( -DWITH_SYSTEMD=1 )
++    set(KDM_SYSTEMD_LIBRARIES ${LIBSYSTEMD_DAEMON_LIBRARIES} ${LIBSYSTEMD_LOGIN_LIBRARIES} )
++endif(LIBSYSTEMD_LOGIN_FOUND AND LIBSYSTEMD_DAEMON_FOUND)
+ macro_add_file_dependencies(dm.h ${confci})
+ macro_add_file_dependencies(error.c ${CMAKE_CURRENT_SOURCE_DIR}/printf.c)
+ kde4_add_executable(kdm NOGUI ${kdm_SRCS})
+@@ -61,6 +65,7 @@ target_link_libraries( kdm
+       ${NSL_LIBRARIES}
+       ${RESOLV_LIBRARIES}
+       ${SOCKET_LIBRARIES}
++      ${KDM_SYSTEMD_LIBRARIES}
+ )
+ if (CKCONNECTOR_FOUND)
+       include_directories(${CKCONNECTOR_INCLUDE_DIR} ${DBUS_INCLUDE_DIR} ${DBUS_ARCH_INCLUDE_DIR})
+diff -up kde-workspace-4.10.90/kdm/backend/dm.c.kdm_logind kde-workspace-4.10.90/kdm/backend/dm.c
+--- kde-workspace-4.10.90/kdm/backend/dm.c.kdm_logind  2013-06-27 16:27:30.184895241 -0500
++++ kde-workspace-4.10.90/kdm/backend/dm.c     2013-06-27 16:27:30.201895054 -0500
+@@ -50,6 +50,23 @@ from the copyright holder.
+ # include <sys/vt.h>
+ #endif
++#ifdef WITH_SYSTEMD
++# include <systemd/sd-login.h>
++# include <systemd/sd-daemon.h>
++
++#define SYSTEMD_FAILURE_LIMIT 25
++
++ static int systemdMonitorInit(void);
++ static void systemdMonitorDeinit();
++ static int systemdStartDisplay(char *);
++ static void systemdCheckAdded(char **);
++ static void systemdCheckRemoved(char **);
++ static void systemdHandleChange();
++
++ sd_login_monitor *systemd_monitor = NULL;
++ int systemd_monitor_fd = -1;
++#endif
++
+ static void sigHandler(int n);
+ static int scanConfigs(int force);
+ static void startDisplay(struct display *d);
+@@ -308,7 +325,16 @@ main(int argc, char **argv)
+ #ifdef XDMCP
+     updateListenSockets();
+ #endif
++
++#ifdef WITH_SYSTEMD
++    if (systemdMonitorInit())
++        systemdHandleChange();
++#endif
++
+     mainLoop();
++#ifdef WITH_SYSTEMD
++    systemdMonitorDeinit();
++#endif
+     closeCtrl(0);
+     if (sdRec.how) {
+         int pid;
+@@ -1280,6 +1306,14 @@ mainLoop(void)
+                 }
+                 continue;
+             }
++                logError("STARTING");
++#ifdef WITH_SYSTEMD
++            if (systemd_monitor_fd >= 0 && FD_ISSET(systemd_monitor_fd, &reads)) {
++                systemdHandleChange();
++                sd_login_monitor_flush(systemd_monitor);
++                continue;
++            }
++#endif
+ #ifdef XDMCP
+             if (processListenSockets(&reads))
+                 continue;
+@@ -1304,6 +1338,151 @@ mainLoop(void)
+     }
+ }
++#ifdef WITH_SYSTEMD
++static int
++systemdMonitorInit(void)
++{
++    if (sd_booted() <= 0) {
++        logError("Didn't boot with systemd, automatic multiseat won't be enabled\n");
++        return False;
++    }
++
++    int check = sd_login_monitor_new("seat", &systemd_monitor);
++    if (check < 0) {
++        logError("Can't get systemd monitor: %d, automatic multiseat won't be enabled\n", check);
++        return False;
++    }
++
++    systemd_monitor_fd = sd_login_monitor_get_fd(systemd_monitor);
++    if (systemd_monitor_fd < 0) {
++        logError("Can't retrieve file descriptor from the systemd monitor: %d, automatic multiseat won't be enabled\n", systemd_monitor_fd);
++        sd_login_monitor_unref(systemd_monitor);
++        systemd_monitor_fd = -1;
++        return False;
++    }
++
++    registerInput(systemd_monitor_fd);
++    return True;
++}
++
++static void
++systemdMonitorDeinit(void)
++{
++    if (systemd_monitor) {
++        sd_login_monitor_unref(systemd_monitor);
++    }
++    systemd_monitor_fd = -1;
++}
++
++static int
++systemdStartDisplay(char *seat)
++{
++    struct display *link = NULL;
++    for (link = displays; link; link = link-> next) {
++        if (link->status == reserve)
++            break;
++    }
++    if (!link) {
++        logError("There's not enough reserve displays for all your seats/sessions");
++        return False;
++    }
++    if (!strDup((&link->systemd_seat), seat)) {
++        return False;
++    }
++#ifdef HAVE_VTS
++    link->serverVT = 0;
++#endif
++    link->status = notRunning;
++    link->stillThere = True;
++    link->authorize = True;
++    link->displayType = dLocal | dPermanent;
++    link->reqSrvVT = -1;
++    link->serverPid = -1;
++    return True;
++}
++
++static void
++systemdCheckAdded(char **seat_names) 
++{
++    char **iter_name;
++    struct display *link;
++    for (iter_name = seat_names; *iter_name; iter_name++) {
++        if (strcmp(*iter_name, "seat0") == 0)
++            continue; /* ignore the main seat */
++        int can_graphical = sd_seat_can_graphical(*iter_name);
++        for (link = displays; link; link = link->next) {
++            if (!link->systemd_seat)
++                continue;
++            /* see if the can_graphical property didn't change */
++            if (strcmp(*iter_name, link->systemd_seat) == 0) {
++                if (!can_graphical) {
++                    free(link->systemd_seat);
++                    link->systemd_seat = NULL;
++                    rStopDisplay(link, DS_RESERVE);
++                }
++                break;
++            }
++        }
++        /* the display wasn't found */
++        if (!link) {
++            if (can_graphical) {
++                /* if starting the display failed, skip this round until the next change */
++                if (!systemdStartDisplay(*iter_name))
++                    break;
++            }
++        }
++    }
++}
++
++static void
++systemdCheckRemoved(char **seat_names)
++{
++    char **iter_name;
++    struct display *link;
++    for (link = displays; link; link = link->next) {
++        for (iter_name = seat_names; *iter_name; iter_name++) {
++            if (strcmp(*iter_name, "seat0") == 0)
++                continue; /* ignore the main seat */
++            if (link->systemd_seat && strcmp(*iter_name, link->systemd_seat) == 0)
++                break;
++        }
++        if (!(*iter_name) && link->systemd_seat) { /* was not found, stop this one */
++            free(link->systemd_seat);
++            link->systemd_seat = NULL;
++            rStopDisplay(link, DS_RESERVE);
++        }
++    }
++}
++
++static void
++systemdHandleChange(void)
++{
++    static int failures = 0;
++    char **seat_names;
++    char **iter_name;
++    int check;
++    if ((check = sd_get_seats(&seat_names)) < 0) {
++        logError("Can't obtain systemd seats, error %d\n", -check);
++        failures++;
++        if (failures >= SYSTEMD_FAILURE_LIMIT) {
++            logError("%u failed calls to sd_get_seats, disabling systemd multi-seat support\n", SYSTEMD_FAILURE_LIMIT);
++            systemdMonitorDeinit();
++        }
++        return;
++    }
++
++    if (!check)
++        return;
++
++    systemdCheckAdded(seat_names);
++    systemdCheckRemoved(seat_names);
++
++    for (iter_name = seat_names; *iter_name; iter_name++)
++        free(*iter_name);
++    free(seat_names);
++}
++#endif
++
+ static void
+ checkDisplayStatus(struct display *d)
+ {
+diff -up kde-workspace-4.10.90/kdm/backend/dm.h.kdm_logind kde-workspace-4.10.90/kdm/backend/dm.h
+--- kde-workspace-4.10.90/kdm/backend/dm.h.kdm_logind  2013-06-27 16:27:30.184895241 -0500
++++ kde-workspace-4.10.90/kdm/backend/dm.h     2013-06-27 16:27:30.201895054 -0500
+@@ -306,6 +306,9 @@ struct display {
+     char *greeterAuthFile;      /* file to store authorization for greeter in */
+     
+     int plymouth_vt;            /* Plymouth's VT nr */
++#ifdef WITH_SYSTEMD
++    char *systemd_seat;
++#endif
+ };
+ #define d_location   1
+diff -up kde-workspace-4.10.90/kdm/backend/server.c.kdm_logind kde-workspace-4.10.90/kdm/backend/server.c
+--- kde-workspace-4.10.90/kdm/backend/server.c.kdm_logind      2013-06-27 16:27:30.184895241 -0500
++++ kde-workspace-4.10.90/kdm/backend/server.c 2013-06-27 16:27:30.201895054 -0500
+@@ -43,6 +43,7 @@ from the copyright holder.
+ #include <stdio.h>
+ #include <signal.h>
++#define SYSTEMD_X_WRAPPER "/lib/systemd/systemd-multi-seat-x"
+ struct display *startingServer;
+ time_t serverTimeout = TO_INF;
+@@ -55,9 +56,18 @@ prepareServerArgv(struct display *d, con
+     char vtstr[8];
+ #endif
+-    if (!(argv = parseArgs(0, d->serverCmd)) ||
+-        !(argv = addStrArr(argv, d->name, -1)))
++#if WITH_SYSTEMD
++    FILE *tmpFile = NULL;
++    if ((tmpFile = fopen(SYSTEMD_X_WRAPPER, "rb")) != NULL && fclose(tmpFile) == 0) {
++        if (!(argv = parseArgs(0, SYSTEMD_X_WRAPPER)) || !(argv = addStrArr(argv, d->name, -1))) {
++            exit(47);
++        }
++    }
++    else
++#endif
++    if (!(argv = parseArgs(0, d->serverCmd)) || !(argv = addStrArr(argv, d->name, -1))) {
+         exit(47);
++    }
+ #ifdef HAVE_VTS
+     if (d->serverVT &&
+         !(argv = addStrArr(argv, vtstr,
+@@ -70,6 +80,25 @@ prepareServerArgv(struct display *d, con
+     if (!changeUser(d->serverUID, d->authFile))
+         exit(47);
++#ifdef WITH_SYSTEMD
++    if (d->systemd_seat) {
++        if (!(argv = parseArgs(argv, "-seat")))
++            exit(47);
++        if (!(argv = parseArgs(argv, d->systemd_seat)))
++            exit(47);
++        if (!(argv = parseArgs(argv, "-layout")))
++            exit(47);
++        if (!(argv = parseArgs(argv, d->systemd_seat)))
++            exit(47);
++    }
++    else {
++        if (!(argv = parseArgs(argv, "-seat")))
++            exit(47);
++        if (!(argv = parseArgs(argv, "seat0")))
++            exit(47);
++    }
++#endif
++
+     return argv;
+ }
+--- kde-workspace-4.10.2/kdm/backend/client.c.kdm_logind
++++ kde-workspace-4.10.2/kdm/backend/client.c
+@@ -1460,6 +1460,14 @@ startClient(volatile int *pid)
+ #endif
+     userEnviron = inheritEnv(env, envvars);
+     env = systemEnv(0, curuser);
++#ifdef WITH_SYSTEMD
++    if (td->systemd_seat) {
++        char *envbuf;
++        ASPrintf(&envbuf, "XDG_SEAT=%s", td->systemd_seat);
++        pam_putenv(pamh, envbuf);
++        env = setEnv(env, "XDG_SEAT", td->systemd_seat);
++    }
++#endif
+     systemEnviron = setEnv(env, "HOME", p->pw_dir);
+     debug("user environment:\n%[|''>'\n's"
+           "system environment:\n%[|''>'\n's"
+--- kde-workspace-4.10.2/kdm/backend/session.c.kdm_logind
++++ kde-workspace-4.10.2/kdm/backend/session.c
+@@ -437,6 +437,10 @@ openGreeter()
+     grttalk.pipe = &grtproc.pipe;
+     env = systemEnv(dupEnv(), 0);
++#ifdef WITH_SYSTEMD
++    if (td->systemd_seat)
++        env = setEnv(env, "XDG_SEAT", td->systemd_seat);
++#endif
+     if (gOpen(&grtproc, (char **)0, "_greet", env, name,
+               greeterUID, td->greeterAuthFile, &td->gpipe))
+         sessionExit(EX_UNMANAGE_DPY);
diff --git a/kde4-kdebase-workspace-kdm_plymouth081.patch b/kde4-kdebase-workspace-kdm_plymouth081.patch
new file mode 100644 (file)
index 0000000..3899bbb
--- /dev/null
@@ -0,0 +1,311 @@
+diff --git a/kdm/backend/dm.c b/kdm/backend/dm.c
+index e0f1366..5a5f8a7 100644
+--- a/kdm/backend/dm.c
++++ b/kdm/backend/dm.c
+@@ -1347,54 +1347,207 @@ getBusyVTs(void)
+     return activeVTs;
+ }
++static int
++get_active_vt (void)
++{
++        int console_fd;
++        struct vt_stat console_state = { 0 };
++        console_fd = open ("/dev/tty0", O_RDONLY | O_NOCTTY);
++        if (console_fd < 0) {
++                return 0;
++        }
++        ioctl (console_fd, VT_GETSTATE, &console_state);
++
++        close (console_fd);
++        return console_state.v_active;
++}
++
++static int
++plymouth_is_running (void)
++{
++        static int running = -1;
++        if (running == 0)
++            return 0;
++
++        int status;
++        status = system ("/usr/bin/plymouth --ping");
++
++        running = WIFEXITED (status) && WEXITSTATUS (status) == 0;
++        logWarn ("plymouth is %srunning\n", running?"":"NOT ");
++        return running;
++}
++
++static int
++plymouth_has_active_vt (void)
++{
++        int status;
++        status = system ("/usr/bin/plymouth --has-active-vt");
++
++        return WIFEXITED (status) && WEXITSTATUS (status) == 0;
++}
++
++static int
++plymouth_prepare_for_transition (void)
++{
++        int status;
++        status = system ("/usr/bin/plymouth deactivate");
++
++        return WIFEXITED (status) && WEXITSTATUS (status) == 0;
++}
++
++int
++plymouth_quit_with_transition (void)
++{
++        int status;
++        status = system ("/usr/bin/plymouth --wait quit --retain-splash");
++
++        return WIFEXITED (status) && WEXITSTATUS (status) == 0;
++}
++
++int
++plymouth_quit_without_transition (void)
++{
++        int status;
++        status = system ("/usr/bin/plymouth --wait quit");
++
++        return WIFEXITED (status) && WEXITSTATUS (status) == 0;
++}
++
++static int
++triggered_to_force_display_on_active_vt (void)
++{
++   int should_force_display_on_active_vt;
++   should_force_display_on_active_vt=open("/var/spool/gdm/force-display-on-active-vt", O_RDONLY);
++   if ( should_force_display_on_active_vt >= 0 )
++       close(should_force_display_on_active_vt);
++   unlink("/var/spool/gdm/force-display-on-active-vt");
++   return should_force_display_on_active_vt;
++}
++
+ static void
+ allocateVT(struct display *d)
+ {
+     struct display *cd;
+-    int i, tvt, volun;
++    int i, tvt;
+     if ((d->displayType & d_location) == dLocal &&
+         d->status == notRunning && !d->serverVT && d->reqSrvVT >= 0)
+     {
++        /* Try to find the correct VT.
++         * If ServerVT is specified in the config, use it (if the admin used the
++         * same VT for multiple display, it is his/her own fault, no checks done).
++         * Otherwise, walk the list of specified VTs. Positive numbers are used
++         * even if the VT is already in use by a tty. Negative numbers and 
++         * unspecified numbers (up to #15) are used if not already in use.
++         * VTs already in use (cd->serverVT) or requested (cd->reqSrvVT)
++         * by any display are skipped.
++         */
++
++        /* some special handling is needed for Plymouth:
++         * if no VT is requested, use the active VT from plymouth for the first
++         * started display.
++         * If the display takes over the VT from plymouth, deactivate plymouth
++         */
++
++        char allowedVTs[16] = { 0 };
+         if (d->reqSrvVT && d->reqSrvVT < 16) {
+-            d->serverVT = d->reqSrvVT;
++            allowedVTs[d->reqSrvVT] = 1;
+         } else {
+-            for (i = tvt = 0;;) {
+-                if (serverVTs[i]) {
+-                    tvt = atoi(serverVTs[i++]);
+-                    volun = False;
+-                    if (tvt < 0) {
+-                        tvt = -tvt;
+-                        volun = True;
+-                    }
+-                    if (!tvt || tvt >= 16)
+-                        continue;
+-                } else {
+-                    if (++tvt >= 16)
+-                        break;
+-                    volun = True;
++            for (i = 0; serverVTs[i]; i++) {
++                tvt = atoi(serverVTs[i]);
++                if ((tvt >= 0) && (tvt < 16)) {
++                    allowedVTs[tvt] = 1;
++                } else if (tvt > -16) {
++                    allowedVTs[-tvt] = 2;
+                 }
+-                for (cd = displays; cd; cd = cd->next) {
+-                    if (cd->reqSrvVT == tvt && /* protect from lusers */
+-                            (cd->status != zombie || cd->zstatus != DS_REMOVE))
+-                        goto next;
+-                    if (cd->serverVT == tvt) {
+-                        if (cd->status != zombie || cd->zstatus == DS_REMOTE)
+-                            goto next;
+-                        if (!cd->follower) {
+-                            d->serverVT = -1;
+-                            cd->follower = d;
+-                            return;
+-                        }
+-                    }
++            }
++
++            for (tvt = 15; allowedVTs[tvt] == 0; tvt--) {
++              allowedVTs[tvt] = 2;
++            }
++
++            for (cd = displays; cd; cd = cd->next) {
++                if (cd->status != zombie) {
++                    if (cd->reqSrvVT >= 0) allowedVTs[cd->reqSrvVT] = 0;
++                    if (cd->serverVT >= 0) allowedVTs[cd->serverVT] = 0;
++                } else if (cd->zstatus == DS_REMOTE) {
++                    /* dying, but will spawn new server for remote login */
++                    if (cd->serverVT >= 0) allowedVTs[cd->serverVT] = 0;
++                } else if (cd->zstatus != DS_REMOVE) {
++                    /* dying, but will be restarted or reserved */
++                    if (cd->reqSrvVT >= 0) allowedVTs[cd->reqSrvVT] = 0;
+                 }
+-                if (!volun || !((1 << tvt) & getBusyVTs())) {
+-                    d->serverVT = tvt;
++            }
++        }
++
++        /* check for plymouth using newer methods */
++        d->plymouth_vt = -1;
++        if (plymouth_is_running ()) {
++            if (plymouth_has_active_vt ()) {
++                int vt = get_active_vt ();
++                if (allowedVTs[vt]) {
++                    logWarn ("plymouth is active on VT %d, reusing for %s\n", vt, d->name);
++                    d->serverVT = vt;
++                    d->plymouth_vt = vt;
+                     return;
+                 }
+-          next: ;
++            }
++        /* fallback to old/deprecated method */
++        } else if ( triggered_to_force_display_on_active_vt() >= 0 ) {
++            int vt = get_active_vt ();
++            if (allowedVTs[vt]) {
++                d->serverVT = vt;
++                return;
++            }
++        }
++
++        for (tvt = 0; tvt < 16; tvt++) {
++            if ((allowedVTs[tvt] == 1) ||
++                ((allowedVTs[tvt] == 2) && !((1 << tvt) & getBusyVTs()))) {
++                d->serverVT = tvt;
++                return;
+             }
+         }
++
++        for (cd = displays; cd; cd = cd->next) {
++            if ((cd->status == zombie) && (cd->zstatus != DS_REMOTE) &&
++                (cd->follower == 0) && (cd->reqSrvVT != cd->serverVT)) {
++            /* removed; or restarted/reserved on any VT */
++                    d->serverVT = -1;
++                    cd->follower = d;
++                    return;
++            }
++        }
++    }
++}
++
++static void
++replacePlymouth(void)
++{
++    struct display *cd;
++
++    /* if one display reuses plymouth' VT, plymouth is stopped in the
++     * startServerSuccess/Failed callback (see server.c). In any other
++     * case plymouth is stopped now.
++     */
++    for (cd = displays; cd; cd = cd->next) {
++        if ((cd->serverVT > 0) && (cd->serverVT == cd->plymouth_vt)) {
++            if (cd->status == notRunning) {
++                /* tell plymouth to quit when server has started */
++                logWarn ("plymouth should quit after server startup\n");
++                plymouth_prepare_for_transition ();
++                kickDisplay(cd);
++                return;
++            } else if (cd->status == running) {
++                /* replacing server is starting up, do nothing */
++                return;
++            }
++        }
++    }
++
++    if ( plymouth_is_running ()) {
++        plymouth_prepare_for_transition ();
++        plymouth_quit_without_transition ();
+     }
+ }
+ #endif
+@@ -1407,6 +1560,7 @@ startDisplays(void)
+ #ifdef HAVE_VTS
+     activeVTs = -1;
+     forEachDisplayRev(allocateVT);
++    replacePlymouth();
+ #endif
+     forEachDisplay(kickDisplay);
+ }
+diff --git a/kdm/backend/dm.h b/kdm/backend/dm.h
+index 64e106b..930af0e 100644
+--- a/kdm/backend/dm.h
++++ b/kdm/backend/dm.h
+@@ -304,6 +304,8 @@ struct display {
+     int authNum;                /* number of authorizations */
+     char *authFile;             /* file to store authorization in */
+     char *greeterAuthFile;      /* file to store authorization for greeter in */
++    
++    int plymouth_vt;            /* Plymouth's VT nr */
+ };
+ #define d_location   1
+@@ -428,6 +430,9 @@ int anyDisplaysLeft(void);
+ void forEachDisplay(void (*f)(struct display *));
+ #ifdef HAVE_VTS
+ void forEachDisplayRev(void (*f)(struct display *));
++/* function for plymouth */
++int plymouth_quit_with_transition (void);
++int plymouth_quit_without_transition (void);
+ #endif
+ void removeDisplay(struct display *old);
+ struct display
+diff --git a/kdm/backend/server.c b/kdm/backend/server.c
+index d8dd6f3..8b4708e 100644
+--- a/kdm/backend/server.c
++++ b/kdm/backend/server.c
+@@ -80,6 +80,7 @@ startServerOnce(void)
+     char **argv;
+     debug("startServerOnce for %s, try %d\n", d->name, ++d->startTries);
++
+     d->serverStatus = starting;
+     switch (Fork(&d->serverPid)) {
+     case 0:
+@@ -137,6 +138,12 @@ startServerSuccess()
+     struct display *d = startingServer;
+     d->serverStatus = ignore;
+     serverTimeout = TO_INF;
++    if ((d->serverVT > 0) && (d->serverVT == d->plymouth_vt)) {
++        int plymouth_running;
++        logWarn ("Quitting Plymouth with transition\n" );
++        plymouth_running = !plymouth_quit_with_transition ();
++        logWarn ("Is Plymouth still running? %s\n", plymouth_running ? "yes" : "no");
++    }
+     debug("X server ready, starting session\n");
+     startDisplayP2(d);
+ }
+@@ -154,6 +161,10 @@ startServerFailed()
+         startingServer = 0;
+         logError("X server for display %s cannot be started,"
+                  " session disabled\n", d->name);
++        if ((d->serverVT > 0) && (d->serverVT == d->plymouth_vt)) {
++            logWarn ("Quitting Plymouth without transition\n" );
++            plymouth_quit_without_transition ();
++        }
+         stopDisplay(d);
+     }
+ }
diff --git a/kde4-kdebase-workspace-xsession_errors_O_APPEND.patch b/kde4-kdebase-workspace-xsession_errors_O_APPEND.patch
new file mode 100644 (file)
index 0000000..a7b27d8
--- /dev/null
@@ -0,0 +1,12 @@
+diff -up kdebase-workspace-4.4.92/kdm/backend/client.c.xsession_errors_O_APPEND kdebase-workspace-4.4.92/kdm/backend/client.c
+--- kdebase-workspace-4.4.92/kdm/backend/client.c.xsession_errors_O_APPEND     2010-07-06 01:54:30.000000000 -0500
++++ kdebase-workspace-4.4.92/kdm/backend/client.c      2010-07-07 12:27:24.901922619 -0500
+@@ -1223,7 +1223,7 @@ createClientLog(const char *log)
+         if (!(lname = expandMacros(log, macros)))
+             exit(1);
+         unlink(lname);
+-        if ((lfd = open(lname, O_WRONLY|O_CREAT|O_EXCL, 0600)) >= 0) {
++        if ((lfd = open(lname, O_WRONLY|O_CREAT|O_EXCL|O_APPEND, 0600)) >= 0) {
+             dup2(lfd, 1);
+             dup2(lfd, 2);
+             close(lfd);
index 26cf562fc5457f5084f97155e873d6532dd73dc3..0defb37cbd06ed754e1468bcb9e0f9c28f071844 100644 (file)
@@ -8,7 +8,7 @@ Summary:        KDE 4 base workspace components
 Summary(pl.UTF-8):     Podstawowe komponenty środowiska KDE 4
 Name:          kde4-kdebase-workspace
 Version:       4.11.21
-Release:       1
+Release:       2
 License:       GPL v2+
 Group:         X11/Applications
 Source0:       http://download.kde.org/%{_state}/applications/15.04.3/src/%{orgname}-%{version}.tar.xz
@@ -32,6 +32,10 @@ Patch1:              %{name}-kdmconfig.patch
 Patch2:                %{name}-kdm_revertcrashlogic.patch
 Patch3:                kde4-kdebase-workspace-brightness.patch
 Patch4:                kde4-kdebase-workspace-brightness-step.patch
+Patch5:                %{name}-xsession_errors_O_APPEND.patch
+Patch6:                %{name}-kdm_plymouth081.patch
+Patch7:                %{name}-kdm-logind-multiseat.patch
+Patch8:                %{name}-bug796969.patch
 URL:           http://www.kde.org/
 BuildRequires: ConsoleKit-devel
 BuildRequires: Mesa-libGLES-devel
@@ -78,6 +82,7 @@ BuildRequires:        rpmbuild(macros) >= 1.600
 BuildRequires: shared-desktop-ontologies-devel >= 0.5
 BuildRequires: soprano-devel >= 2.4.64
 BuildRequires: strigi-devel >= 0.7.0
+BuildRequires: systemd-devel
 BuildRequires: utempter-devel
 BuildRequires: xcb-util-devel
 BuildRequires: xcb-util-image-devel
@@ -522,6 +527,10 @@ dialogowych mających na celu rozszerzenie przywilejów użytkownika.
 # https://bugs.kde.org/show_bug.cgi?id=276482
 #%patch3 -p1
 %patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
 
 %build
 install -d build
This page took 0.112335 seconds and 4 git commands to generate.