Commit d3738a21 authored by Matthias Klumpp's avatar Matthias Klumpp

Spawn PureOS OEM installer after session setup on OEM live image

parent c1615542
From 887b57926439278915be25a7fd656502061ccb75 Mon Sep 17 00:00:00 2001
From: Matthias Klumpp <matthias@tenstral.net>
Date: Thu, 15 Mar 2018 22:52:45 +0100
Subject: [PATCH] pureos: Spawn installer after setup on OEM live image
---
gnome-initial-setup/gnome-initial-setup.c | 15 +++++++++------
gnome-initial-setup/gnome-initial-setup.h | 2 +-
gnome-initial-setup/pages/summary/gis-summary-page.c | 9 ++++++++-
3 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/gnome-initial-setup/gnome-initial-setup.c b/gnome-initial-setup/gnome-initial-setup.c
index 5671cae..6d0cc08 100644
--- a/gnome-initial-setup/gnome-initial-setup.c
+++ b/gnome-initial-setup/gnome-initial-setup.c
@@ -258,21 +258,24 @@ main (int argc, char *argv[])
g_object_unref (driver);
g_option_context_free (context);
+
return status;
}
void
-gis_ensure_stamp_files (void)
+gis_ensure_stamp_files (gboolean with_welcome_tour)
{
gchar *file;
GError *error = NULL;
- file = g_build_filename (g_get_user_config_dir (), "run-welcome-tour", NULL);
- if (!g_file_set_contents (file, "yes", -1, &error)) {
- g_warning ("Unable to create %s: %s", file, error->message);
- g_clear_error (&error);
+ if (with_welcome_tour) {
+ file = g_build_filename (g_get_user_config_dir (), "run-welcome-tour", NULL);
+ if (!g_file_set_contents (file, "yes", -1, &error)) {
+ g_warning ("Unable to create %s: %s", file, error->message);
+ g_clear_error (&error);
+ }
+ g_free (file);
}
- g_free (file);
file = g_build_filename (g_get_user_config_dir (), "gnome-initial-setup-done", NULL);
if (!g_file_set_contents (file, "yes", -1, &error)) {
diff --git a/gnome-initial-setup/gnome-initial-setup.h b/gnome-initial-setup/gnome-initial-setup.h
index dc5cf60..1071f79 100644
--- a/gnome-initial-setup/gnome-initial-setup.h
+++ b/gnome-initial-setup/gnome-initial-setup.h
@@ -35,7 +35,7 @@ typedef struct _GisPage GisPage;
#include "gis-page.h"
#include "gis-keyring.h"
-void gis_ensure_stamp_files (void);
+void gis_ensure_stamp_files (gboolean with_welcome_tour);
#endif /* __GNOME_INITIAL_SETUP_H__ */
diff --git a/gnome-initial-setup/pages/summary/gis-summary-page.c b/gnome-initial-setup/pages/summary/gis-summary-page.c
index 4261b92..a945a6f 100644
--- a/gnome-initial-setup/pages/summary/gis-summary-page.c
+++ b/gnome-initial-setup/pages/summary/gis-summary-page.c
@@ -216,7 +216,10 @@ log_user_in (GisSummaryPage *page)
static void
done_cb (GtkButton *button, GisSummaryPage *page)
{
- gis_ensure_stamp_files ();
+ /* launch the OEM installer directly after the initial setup on PureOS live media */
+ gboolean launch_oem_installer = g_file_test ("/etc/casper.conf", G_FILE_TEST_EXISTS) &&
+ g_file_test ("/usr/bin/pureos-installer-oem", G_FILE_TEST_EXISTS);
+ gis_ensure_stamp_files (!launch_oem_installer);
switch (gis_driver_get_mode (GIS_PAGE (page)->driver))
{
@@ -225,6 +228,10 @@ done_cb (GtkButton *button, GisSummaryPage *page)
log_user_in (page);
break;
case GIS_DRIVER_MODE_EXISTING_USER:
+ /* quick & dirty method of spawning the PureOS OEM installer - we ignore all errors */
+ if (launch_oem_installer)
+ g_spawn_command_line_sync ("/usr/bin/systemd-run --user /usr/bin/pureos-installer-oem", NULL, NULL, NULL, NULL);
+
g_application_quit (G_APPLICATION (GIS_PAGE (page)->driver));
default:
break;
--
2.16.2
01_pureos-default-goa-providers.patch
02_pureos-data-transmission-privacy-default-off.patch
03_pureos-spawn-oem-installer-after-setup-on-live.patch
tmp_localegen-hack.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment