Compare commits

..

5 commits

Author SHA1 Message Date
Peter Robinson
304411ada3 package is dead 2012-11-30 09:13:48 +00:00
Dennis Gilmore
9e8b94b246 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild 2012-07-21 21:19:13 -05:00
Dennis Gilmore
c0f27b3a58 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild 2012-01-14 01:42:52 -06:00
Dennis Gilmore
58be5dead1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild 2011-02-07 18:49:50 -06:00
Peter Robinson
1fe6f69473 Add patch to load mutter netbook plugins 2010-12-05 14:17:34 +00:00
10 changed files with 1 additions and 644 deletions

1
.gitignore vendored
View file

@ -1,3 +1,2 @@
uxlaunch-0.53.tar.bz2
/uxlaunch-0.56.tar.bz2
/uxlaunch-0.51.2.tar.bz2

1
dead.package Normal file
View file

@ -0,0 +1 @@
This package is dead

View file

@ -1,8 +0,0 @@
[Desktop Entry]
Encoding=UTF-8
Type=Application
Exec=startmoblin
TryExec=startmoblin
Name=Fedora Netbook
Comment=Fedora's MeeGo User eXperience.
Name[en_GB]=Fedora Netbook

View file

@ -1 +0,0 @@
8f17863c8e1aa16f912fb5a55b97baab uxlaunch-0.51.2.tar.bz2

View file

@ -1,11 +0,0 @@
#!/bin/sh
# export GCONF_DEFAULT_SOURCE_PATH=/etc/gconf/2/moblin.path
export XDG_MENU_PREFIX=moblin-
export XDG_DATA_DIRS=$HOME/.local/share/applications:/usr/share
# load modmap settings
test -r /etc/X11/Xmodmap && xmodmap /etc/X11/Xmodmap
test -r $HOME/.Xmodmap && xmodmap $HOME/.Xmodmap
exec /usr/sbin/uxlaunch -x -v > ~/uxlaunch.log 2>&1

View file

@ -1,459 +0,0 @@
diff --git a/desktop.c b/desktop.c
index c591fa7..88784f5 100644
--- a/desktop.c
+++ b/desktop.c
@@ -17,8 +17,10 @@
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
+#include <sys/wait.h>
#include <dirent.h>
#include <time.h>
+#include <errno.h>
#include <glib.h>
#include <limits.h>
#include <pwd.h>
@@ -395,12 +397,31 @@ void do_autostart(void)
ptrs[++count] = strtok(NULL, " \t");
usleep(delay);
- lprintf("Starting %s with prio %d at %d", entry->exec, entry->prio, delay);
+ lprintf("Starting session '%s' %s with prio %d at %d",
+ session, entry->exec, entry->prio, delay);
execvp(ptrs[0], ptrs);
exit(ret);
}
}
+void wait_for_session_exit(void)
+{
+ lprintf("wait_for_session_exit");
+ for (;;) {
+ errno = 0;
+ if (waitpid (session_pid, NULL, 0) < 0) {
+ if (errno == EINTR) {
+ continue;
+ } else if (errno == ECHILD)
+ break; /* child already reaped */
+ else
+ lprintf("waidpid error '%s'", strerror (errno));
+ }
+ break;
+ }
+
+ lprintf("session exited");
+}
void start_desktop_session(void)
{
diff --git a/lib.c b/lib.c
index 4788fef..b530bfd 100644
--- a/lib.c
+++ b/lib.c
@@ -24,8 +24,6 @@
#include "uxlaunch.h"
-#define LOGFILE "/var/log/uxlaunch.log"
-
extern char **environ;
static int first_time = 1;
@@ -36,10 +34,14 @@ struct timeval start;
static FILE *log;
-void open_log(void)
+void open_log(const char *logfile)
{
/* truncate log */
log = fopen(LOGFILE, "w");
+ if (!logfile)
+ log = stdout;
+ else
+ log = fopen(logfile, "w");
if (!log)
logfile_enabled = 0;
}
diff --git a/misc.c b/misc.c
index 9dae4fc..3a3f1b6 100644
--- a/misc.c
+++ b/misc.c
@@ -103,6 +103,17 @@ void start_gconf(void)
lprintf("failed to start gconftool-2: %d", ret);
}
+/*
+ * Stop gconfd to save gconf keys before shutdown
+ */
+void stop_gconf(void)
+{
+ int ret;
+
+ ret = system("gconftool-2 --shutdown");
+ if (ret)
+ lprintf("failed to shut down gconf %d", ret);
+}
void init_screensaver(int lock_now)
{
diff --git a/options.c b/options.c
index 11d550a..5a16d87 100644
--- a/options.c
+++ b/options.c
@@ -29,6 +29,7 @@ char session[256] = "/usr/bin/mutter --sm-disable";
char username[256] = "meego";
int verbose = 0;
+int x_session_only = 0;
static struct option opts[] = {
{ "user", 1, NULL, 'u' },
@@ -46,6 +47,7 @@ void usage(const char *name)
printf(" -u, --user Start session as specific username\n");
printf(" -t, --tty Start session on alternative tty number\n");
printf(" -s, --session Start a non-default session\n");
+ printf(" -x, --xsession Start X apps inside an existing X session\n");
printf(" -v, --verbose Display lots of output to the console\n");
printf(" -h, --help Display this help message\n");
}
@@ -132,7 +134,7 @@ void get_options(int argc, char **argv)
/* parse cmdline - overrides */
while (1) {
- c = getopt_long(argc, argv, "u:t:s:hv", opts, &i);
+ c = getopt_long(argc, argv, "u:t:s:hvx", opts, &i);
if (c == -1)
break;
@@ -153,6 +155,11 @@ void get_options(int argc, char **argv)
case 'v':
verbose = 1;
break;
+ case 'x':
+ x_session_only = 1;
+ if (getenv ("USER"))
+ strncpy (username, getenv ("USER"), 256);
+ break;
default:
break;
}
@@ -170,12 +177,14 @@ void get_options(int argc, char **argv)
}
}
- lprintf("uxlaunch v%s started.", VERSION);
+ open_log(!x_session_only ? LOGFILE : NULL);
+
+ lprintf("uxlaunch v%s started%s.", VERSION, x_session_only ? " for x session only" : "" );
lprintf("user \"%s\", tty #%d, session \"%s\"", username, tty, session);
pass = getpwnam(username);
- if (!pass)
+ if (!pass) {
+ lprintf("Error: can't find user \"%s\"", username);
exit(EXIT_FAILURE);
-
-
+ }
}
diff --git a/pam.c b/pam.c
index f6ecf69..e5cf5c3 100644
--- a/pam.c
+++ b/pam.c
@@ -5,6 +5,7 @@
* Authors:
* Auke Kok <auke@linux.intel.com>
* Arjan van de Ven <arjan@linux.intel.com>
+ * Michael Meeks <michael.meeks@novell.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -25,6 +26,48 @@ pam_handle_t *ph;
struct pam_conv pc;
/*
+ * Sometimes PAM likes to chat with you, before it is assured
+ * enough to let you log-in: fun.
+ */
+static int
+pam_conversation_fn (int msg_count,
+ const struct pam_message **messages,
+ struct pam_response **responses,
+ void *user_data)
+{
+ int i;
+ (void)user_data;
+
+ lprintf ("pam conversation with %d messages", msg_count);
+ if (responses)
+ *responses = NULL;
+
+ if (msg_count < 1) /* ping */
+ return PAM_SUCCESS;
+
+ /* otherwise find any helpful data we can to print, and bail */
+ if (!responses || !messages) {
+ lprintf ("pam conversation with no message, or response");
+ return PAM_CONV_ERR;
+ }
+ *responses = calloc (msg_count, sizeof (struct pam_response));
+ for (i = 0; i < msg_count; i++) {
+ const struct pam_message *msg = messages[i];
+
+ if (msg->msg_style == PAM_TEXT_INFO)
+ lprintf ("pam chats to us: '%s'", msg->msg);
+ else if (msg->msg_style == PAM_ERROR_MSG)
+ lprintf ("Error: pam error msg '%s'", msg->msg);
+ else
+ lprintf ("pam message %d style %d: '%s'",
+ i, msg->msg_style, msg->msg);
+ (*responses)[i].resp = NULL;
+ (*responses)[i].resp_retcode = PAM_SUCCESS;
+ }
+ return PAM_SUCCESS;
+}
+
+/*
* Creating a PAM session. We need a pam "login" session so that the dbus
* "at_console" logic will work correctly, as well as various /dev file
* permissions.
@@ -40,6 +83,9 @@ void setup_pam_session(void)
snprintf(x, 256, "tty%d", tty);
+ pc.conv = pam_conversation_fn;
+ pc.appdata_ptr = NULL;
+
err = pam_start("login", pass->pw_name, &pc, &ph);
err = pam_set_item(ph, PAM_TTY, &x);
diff --git a/user.c b/user.c
index 111201a..91d38c0 100644
--- a/user.c
+++ b/user.c
@@ -52,13 +52,6 @@ static void do_env(void)
setenv("PATH", buf, 1);
snprintf(user_xauth_path, PATH_MAX, "%s/.Xauthority", pass->pw_dir);
setenv("XAUTHORITY", user_xauth_path, 1);
- snprintf(buf, PATH_MAX, "%s/.cache", pass->pw_dir);
- mkdir(buf, 0700);
- setenv("XDG_CACHE_HOME", buf, 0);
- snprintf(buf, PATH_MAX, "%s/.config", pass->pw_dir);
- setenv("XDG_CONFIG_HOME", buf, 0);
- setenv("OOO_FORCE_DESKTOP","gnome", 0);
- setenv("LIBC_FATAL_STDERR_", "1", 0);
file = popen("/bin/bash -l -c export", "r");
if (!file)
@@ -200,12 +193,34 @@ void switch_to_user(void)
static char *scim_languages[] = { "zh_", "ja_", "ko_", "lo_", "th_" };
+void setup_user_environment (void)
+{
+ unsigned int i;
+ char buf[PATH_MAX];
+ const char *lang = getenv ("LANG");
+
+ for (i = 0; lang && i < sizeof(scim_languages) / sizeof(scim_languages[0]); i++) {
+ if (strstr (lang, scim_languages[i])) {
+ setenv("GTK_IM_MODULE", "scim-bridge", 0);
+ setenv("CLUTTER_IM_MODULE","scim-bridge", 0);
+ }
+ }
+
+ /* setup misc. user directories and variables */
+ snprintf(buf, PATH_MAX, "%s/.cache", pass->pw_dir);
+ mkdir(buf, 0700);
+ setenv("XDG_CACHE_HOME", buf, 0);
+ snprintf(buf, PATH_MAX, "%s/.config", pass->pw_dir);
+ setenv("XDG_CONFIG_HOME", buf, 0);
+ setenv("OOO_FORCE_DESKTOP","gnome", 0);
+ setenv("LIBC_FATAL_STDERR_", "1", 0);
+}
+
void set_i18n(void)
{
FILE *f;
lprintf("entering set_i18n");
-
/*
* /etc/sysconfig/i18n contains shell code that sets
* various i18n options in environment, typically:
@@ -235,16 +250,8 @@ void set_i18n(void)
/* grab the stuff we need, avoiding comments
* and other user stuff we don't care for now */
- if (!strcmp(key, "LANG")) {
- unsigned int i;
+ if (!strcmp(key, "LANG"))
setenv(key, val, 1);
- for (i = 0; i < sizeof(scim_languages) / sizeof(scim_languages[0]); i++) {
- if (strstr(val, scim_languages[i])) {
- setenv("GTK_IM_MODULE", "scim-bridge", 0);
- setenv("CLUTTER_IM_MODULE","scim-bridge", 0);
- }
- }
- }
if (!strcmp(key, "SYSFONT"))
setenv(key, val, 1);
}
diff --git a/uxlaunch.c b/uxlaunch.c
index 2c680ab..dd06326 100644
--- a/uxlaunch.c
+++ b/uxlaunch.c
@@ -20,13 +20,44 @@
#include "uxlaunch.h"
-
-int main(int argc, char **argv)
+/*
+ * Launch apps that form the user's X session
+ */
+static void
+launch_user_session(void)
{
char xhost_cmd[80];
- open_log();
+ setup_user_environment();
+
+ start_ssh_agent();
+
+ setup_consolekit_session();
+
+ /* dbus needs the CK env var */
+ start_dbus_session_bus();
+
+ /* gconf needs dbus */
+ start_gconf();
+
+ maybe_start_screensaver();
+
+ start_desktop_session();
+
+ /* finally, set local username to be allowed at any time,
+ * which is not depenedent on hostname changes */
+ snprintf(xhost_cmd, 80, "/usr/bin/xhost +SI:localuser:%s",
+ pass->pw_name);
+ if (system(xhost_cmd) != 0)
+ lprintf("%s failed", xhost_cmd);
+
+ get_session_type();
+ autostart_desktop_files();
+ do_autostart();
+}
+int main(int argc, char **argv)
+{
/*
* General objective:
* Do the things that need root privs first,
@@ -53,6 +84,13 @@ int main(int argc, char **argv)
get_options(argc, argv);
+ if (x_session_only) {
+ launch_user_session();
+ wait_for_session_exit();
+ stop_gconf();
+ return 0;
+ }
+
setup_xauth();
setup_efs();
@@ -81,33 +119,9 @@ int main(int argc, char **argv)
* so can happen while X is talking to the
* hardware
*/
-
wait_for_X_signal();
- start_ssh_agent();
-
- setup_consolekit_session();
-
- /* dbus needs the CK env var */
- start_dbus_session_bus();
-
- /* gconf needs dbus */
- start_gconf();
-
- maybe_start_screensaver();
-
- start_desktop_session();
-
- /* finally, set local username to be allowed at any time,
- * which is not depenedent on hostname changes */
- snprintf(xhost_cmd, 80, "/usr/bin/xhost +SI:localuser:%s",
- pass->pw_name);
- if (system(xhost_cmd) != 0)
- lprintf("%s failed", xhost_cmd);
-
- get_session_type();
- autostart_desktop_files();
- do_autostart();
+ launch_user_session();
/*
* we do this now to make sure dbus etc are not spawning
@@ -124,6 +138,8 @@ int main(int argc, char **argv)
*/
wait_for_X_exit();
+ stop_gconf();
+
set_text_mode();
// close_consolekit_session();
diff --git a/uxlaunch.h b/uxlaunch.h
index 58d24e2..97d7160 100644
--- a/uxlaunch.h
+++ b/uxlaunch.h
@@ -24,12 +24,14 @@ extern int session_pid;
extern int xpid;
extern int verbose;
+extern int x_session_only;
extern void get_options(int argc, char **argv);
extern void set_i18n(void);
extern void setup_pam_session(void);
extern void close_pam_session(void);
extern void switch_to_user(void);
+extern void setup_user_environment (void);
extern void set_tty(void);
extern void setup_xauth(void);
extern void start_X_server(void);
@@ -40,12 +42,14 @@ extern void setup_consolekit_session(void);
extern void start_ssh_agent(void);
extern void stop_ssh_agent(void);
extern void start_gconf(void);
+extern void stop_gconf(void);
extern void init_screensaver(int);
extern void maybe_start_screensaver(void);
extern void get_session_type(void);
extern void autostart_desktop_files(void);
extern void do_autostart(void);
extern void start_desktop_session(void);
+extern void wait_for_session_exit(void);
extern void start_bash(void);
extern void wait_for_X_exit(void);
extern void set_text_mode(void);
@@ -54,7 +58,9 @@ extern void oom_adj(int, int);
extern void start_oom_task(void);
extern void stop_oom_task(void);
-extern void open_log(void);
+#define LOGFILE "/var/log/uxlaunch.log"
+
+extern void open_log(const char *);
extern void lprintf(const char *, ...);
extern void log_environment(void);

View file

@ -1,12 +0,0 @@
--- uxlaunch-0.51.2/desktop.c.orig 2010-10-10 20:19:36.031054179 +0100
+++ uxlaunch-0.51.2/desktop.c 2010-10-10 20:20:51.391067621 +0100
@@ -387,6 +387,9 @@
while (ptrs[count] && count < 255)
ptrs[++count] = strtok(NULL, " \t");
+ /* give myzone a couple of seconds of un-interrupted grace */
+ if (entry->prio >= 0)
+ delay += 2000000;
usleep(delay);
lprintf("Starting session '%s' %s with prio %d at %d",
session, entry->exec, entry->prio, delay);

View file

@ -1,11 +0,0 @@
--- uxlaunch-0.56/options.c.orig 2010-12-05 12:59:31.942503917 +0000
+++ uxlaunch-0.56/options.c 2010-12-05 13:00:52.896500511 +0000
@@ -25,7 +25,7 @@
/* builtin defaults */
int tty = 2;
-char session[256] = "/usr/bin/mutter --sm-disable";
+char session[256] = "/usr/bin/mutter --sm-disable --mutter-plugins=moblin-netbook";
char username[256] = "meego";
int verbose = 0;

View file

@ -1,13 +0,0 @@
--- uxlaunch-0.51.2/desktop.c.orig 2010-10-10 20:21:33.000000000 +0100
+++ uxlaunch-0.51.2/desktop.c 2010-10-10 20:23:18.190054018 +0100
@@ -33,6 +33,10 @@
# define __NR_ioprio_set 251
#elif defined(__arm__)
# define __NR_ioprio_set 314
+#elif defined (__powerpc__)
+# define __NR_ioprio_set 273
+#elif defined (__s390__)
+# define __NR_ioprio_set 282
#else
# error "Unsupported arch"
#endif

View file

@ -1,128 +0,0 @@
# Tarfile created using git
# git clone git://gitorious.org/meego-os-base/uxlaunch.git
# git archive --format=tar --prefix=%{name}-%{version}/ v%{version} | bzip2 > ~/%{name}-%{version}.tar.bz2
%define tarfile %{name}-%{version}.tar.bz2
Name: uxlaunch
Version: 0.51.2
Release: 2%{?dist}
Epoch: 1
Summary: A small and quick interface to start the Moblin Desktop
Group: User Interface/X
License: GPLv2
URL: http://www.meego.com/
Source0: %{tarfile}
Source1: fedora-netbook.desktop
Source2: startmoblin
Patch0: uxlaunch-fixes.patch
Patch1: uxlaunch-myzone-speed.patch
Patch2: uxlaunch-secondaryarches.patch
Patch3: uxlaunch-options.patch
BuildRequires: ConsoleKit-devel
BuildRequires: desktop-file-utils
BuildRequires: dbus-glib-devel
BuildRequires: libXau-devel
BuildRequires: pam-devel
Requires: dbus
Provides: moblin-session = %{version}
Obsoletes: moblin-session < 0.13
%description
An ultra-lightweight, very cut down gdm and gnome-session replacement
designed to get the Moblin Desktop running as quick as possible.
%prep
%setup -q
%patch0 -p1 -b .fixes
%patch1 -p1 -b .myzone-speed
%patch2 -p1 -b .secondaryarches
%patch3 -p1 -b .options
# make build verbose
sed -i 's!^\(\t\+\)@!\1!' Makefile
%build
%configure
make %{?_smp_mflags} mutterlibexecdir=/usr/lib/mutter-moblin
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot} INSTALL='install -p'
# Remove execute bit from config and man files
chmod -x %{buildroot}/%{_sysconfdir}/sysconfig/uxlaunch
chmod -x %{buildroot}/%{_datadir}/man/man1/uxlaunch*
# To use this as a user session launcher
mkdir -p $RPM_BUILD_ROOT%{_bindir}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/xsessions
desktop-file-install --dir=%{buildroot}%{_datadir}/xsessions/ %{SOURCE1}
install -m 755 %{SOURCE2} %{buildroot}%{_bindir}/startmoblin
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc COPYING
%doc %{_datadir}/man/man1/uxlaunch.1.gz
%config(noreplace) %{_sysconfdir}/sysconfig/uxlaunch
%{_sbindir}/uxlaunch
%{_bindir}/startmoblin
%{_datadir}/xsessions/fedora-netbook.desktop
%changelog
* Tue Dec 7 2010 Peter Robinson <pbrobinson@gmail.com> 0.51.2-2
- Add patch to ensure loading of plugins
* Sun Jul 11 2010 Peter Robinson <pbrobinson@gmail.com> 0.51.2-1
- New 0.51.2 release, add epoch, obsolete moblin-session
* Fri Apr 16 2010 Peter Robinson <pbrobinson@gmail.com> 0.49-2
- Upload the new source file
* Fri Apr 16 2010 Peter Robinson <pbrobinson@gmail.com> 0.49-1
- New upstream 0.49 release
* Wed Mar 24 2010 Peter Robinson <pbrobinson@gmail.com> 0.47-1
- New upstream 0.47 release
* Mon Mar 15 2010 Peter Robinson <pbrobinson@gmail.com> 0.46-1
- New upstream 0.46 release
* Sun Feb 28 2010 Peter Robinson <pbrobinson@gmail.com> 0.44-1
- New upstream 0.44 release
* Sun Feb 21 2010 Peter Robinson <pbrobinson@gmail.com> 0.41-1
- New upstream 0.41 release
* Mon Feb 15 2010 Peter Robinson <pbrobinson@gmail.com> 0.40-1
- New upstream 0.40 release
* Thu Feb 11 2010 Peter Robinson <pbrobinson@gmail.com> 0.39-1
- New upstream 0.39 release
* Tue Feb 9 2010 Peter Robinson <pbrobinson@gmail.com> 0.37-1
- New upstream 0.37 release
* Fri Jan 22 2010 Peter Robinson <pbrobinson@gmail.com> 0.35-1
- New upstream 0.35 release
* Fri Jan 15 2010 Peter Robinson <pbrobinson@gmail.com> 0.34-1
- New upstream 0.34 release
* Mon Oct 26 2009 Peter Robinson <pbrobinson@gmail.com> 0.30-1
- New upstream 0.30 release
* Wed Oct 14 2009 Peter Robinson <pbrobinson@gmail.com> 0.29-1
- New upstream 0.29 release
* Tue Oct 13 2009 Peter Robinson <pbrobinson@gmail.com> 0.28-1
- New upstream 0.28 release, updates from review
* Tue Sep 8 2009 Peter Robinson <pbrobinson@gmail.com> 0.23-1
- Initial packaging