[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Towards a graphical installer?
From: |
Mathieu Othacehe |
Subject: |
Towards a graphical installer? |
Date: |
Mon, 11 May 2020 15:27:29 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Hello,
A way to move forward with the installer could be to propose an ISO
image starting a desktop-environment by default. The attached patch
modifies the installation image so that it starts a GNOME session. The
installer is then automatically started, inside a gnome-terminal.
The resulting ISO image is bigger: 3.9G without compression and 1.7G
with compression.
Now, I'm not sure this is something we want to merge as-is. Maybe, it's
time to port the installer to a GTK3 application, or a Web
application. As we already have something working, porting (gnu
installer) to a new graphical backend, could be not so hard.
I don't think I'll have the bandwidth to do this anytime soon, but is
someone is interested, I'm willing to help/review :).
Thanks,
Mathieu
installer.png
Description: PNG image
>From 3ec7528c0a7bcc318e380f41f7cbd91df9927b8a Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <address@hidden>
Date: Mon, 11 May 2020 15:25:08 +0200
Subject: [PATCH] installer: Use GNOME3 desktop-environment.
---
gnu/installer.scm | 33 ++++++++++++++++++++++++-
gnu/system/install.scm | 55 ++++++++++++++++++++++++++++++------------
2 files changed, 71 insertions(+), 17 deletions(-)
diff --git a/gnu/installer.scm b/gnu/installer.scm
index 79113cb0ef..adaec0db83 100644
--- a/gnu/installer.scm
+++ b/gnu/installer.scm
@@ -37,6 +37,7 @@
#:use-module (gnu packages cryptsetup)
#:use-module (gnu packages disk)
#:use-module (gnu packages file-systems)
+ #:use-module (gnu packages gnome)
#:use-module (gnu packages guile)
#:use-module (gnu packages guile-xyz)
#:autoload (gnu packages gnupg) (guile-gcrypt)
@@ -45,10 +46,13 @@
#:use-module (gnu packages ncurses)
#:use-module (gnu packages package-management)
#:use-module (gnu packages xorg)
+ #:use-module (gnu services)
+ #:use-module (gnu services shepherd)
#:use-module (gnu system locale)
#:use-module (ice-9 match)
#:use-module (srfi srfi-1)
- #:export (installer-program))
+ #:export (installer-program
+ installer-skel))
(define module-to-import?
;; Return true for modules that should be imported. For (gnu system …) and
@@ -442,3 +446,30 @@ selected keymap."
(setenv "LANG" "en_US.UTF-8")
(execl #$(program-file "installer-real" installer-builder)
"installer-real"))))
+
+(define (desktop-installer)
+ (program-file
+ "desktop-installer"
+ #~(begin
+ (let ((program
+ (string-append "sleep 3 ; " #$(installer-program))))
+ (execl "/run/setuid-programs/sudo"
+ "sudo"
+ #$(file-append gnome-terminal "/bin/gnome-terminal")
+ "--maximize"
+ "--"
+ "/bin/sh" "-c"
+ program)))))
+
+(define (installer-skel)
+ `((".config"
+ ,(file-union
+ "installer-skel"
+ `(("autostart/installer.desktop"
+ ,(mixed-text-file "installer.desktop" "[Desktop Entry]
+Version=1.0
+Terminal=False
+Type=Application
+Name=Guix System Installer
+Exec=" (desktop-installer) "
+")))))))
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index fe49ffdb94..37816e5839 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -32,10 +32,13 @@
#:use-module ((guix packages) #:select (package-version))
#:use-module ((guix store) #:select (%store-prefix))
#:use-module (gnu installer)
+ #:use-module (gnu services avahi)
+ #:use-module (gnu services desktop)
#:use-module (gnu services dbus)
#:use-module (gnu services networking)
#:use-module (gnu services shepherd)
#:use-module (gnu services ssh)
+ #:use-module (gnu services xorg)
#:use-module (gnu packages admin)
#:use-module (gnu packages bash)
#:use-module (gnu packages bootloaders)
@@ -341,10 +344,7 @@ Access documentation at any time by pressing Alt-F2.\x1b[0m
(list (service virtual-terminal-service-type)
- (service kmscon-service-type
- (kmscon-configuration
- (virtual-terminal "tty1")
- (login-program (installer-program))))
+ (normal-tty "tty1")
(login-service (login-configuration
(motd motd)))
@@ -448,7 +448,28 @@ Access documentation at any time by pressing Alt-F2.\x1b[0m
;; current AMD GPUs, SiS GPUs, ...) need uvesafb to show the GUI
;; installer. Some may also need a kernel parameter like nomodeset
;; or vga=793, but we leave that for the user to specify in GRUB.
- (service uvesafb-service-type))))
+ (service uvesafb-service-type)
+
+ ;; GNOME related services.
+ (service slim-service-type
+ (slim-configuration
+ (auto-login? #t)
+ (default-user "guest")))
+
+ polkit-wheel-service
+ x11-socket-directory-service
+
+ (service avahi-service-type)
+ (udisks-service)
+ (service upower-service-type)
+ (accountsservice-service)
+ (service colord-service-type)
+ (geoclue-service)
+ (service polkit-service-type)
+ (elogind-service)
+ (service ntp-service-type)
+
+ (service gnome-desktop-service-type))))
(define %issue
;; Greeting.
@@ -465,7 +486,7 @@ Access documentation at any time by pressing Alt-F2.\x1b[0m
(timezone "Europe/Paris")
(locale "en_US.utf8")
(bootloader (bootloader-configuration
- (bootloader grub-bootloader)
+ (bootloader grub-efi-bootloader)
(target "/dev/sda")))
(label (string-append "GNU Guix installation "
(package-version guix)))
@@ -490,25 +511,27 @@ Access documentation at any time by pressing
Alt-F2.\x1b[0m
(type "tmpfs")
(check? #f))
- ;; XXX: This should be %BASE-FILE-SYSTEMS but we don't need
- ;; elogind's cgroup file systems.
- (list %pseudo-terminal-file-system
- %shared-memory-file-system
- %immutable-store)))
+ %base-file-systems))
+
+ ;; Our /etc/sudoers file. Since 'guest' initially has an empty password,
+ ;; allow for password-less sudo.
+ (sudoers-file (plain-file "sudoers" "\
+root ALL=(ALL) ALL
+%wheel ALL=NOPASSWD: ALL\n"))
- (users (list (user-account
+ (users (cons (user-account
(name "guest")
(group "users")
(supplementary-groups '("wheel")) ; allow use of sudo
(password "")
- (comment "Guest of GNU"))))
+ (comment "Guest of GNU"))
+ %base-user-accounts))
(issue %issue)
(services %installation-services)
- ;; We don't need setuid programs, except for 'passwd', which can be handy
- ;; if one is to allow remote SSH login to the machine being installed.
- (setuid-programs (list (file-append shadow "/bin/passwd")))
+ (skeletons (append (installer-skel)
+ (default-skeletons)))
(pam-services
;; Explicitly allow for empty passwords.
--
2.26.2
- Towards a graphical installer?,
Mathieu Othacehe <=