From mboxrd@z Thu Jan 1 00:00:00 1970 From: Efraim Flashner Subject: Re: [PATCH] gnu: Add systemd. Date: Sun, 1 Apr 2018 17:04:19 +0300 Message-ID: <20180401140419.GC26203@macbook41> References: <20180401122259.9688-1-mbakke@fastmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="0H629O+sVkh21xTi" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f2dat-000419-UC for guix-devel@gnu.org; Sun, 01 Apr 2018 10:04:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f2dap-0003Zd-Pm for guix-devel@gnu.org; Sun, 01 Apr 2018 10:04:27 -0400 Received: from flashner.co.il ([178.62.234.194]:51850) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f2dap-0003Xo-Eg for guix-devel@gnu.org; Sun, 01 Apr 2018 10:04:23 -0400 Content-Disposition: inline In-Reply-To: <20180401122259.9688-1-mbakke@fastmail.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Marius Bakke Cc: guix-devel@gnu.org --0H629O+sVkh21xTi Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 01, 2018 at 02:22:59PM +0200, Marius Bakke wrote: > Guix, >=20 > As discussed at FOSDEM, it is clear that The Shepherd does not have what > it takes to boot a modern Linux system. While it works today, adding > bootloader, DNS server, NTP client, syslog, udev, seat management, > dishwasher, hardware database, network management and other essential > PID 1 features is going to take too much effort and duplicate work. >=20 > Meanwhile, GuixSD keeps drifting away from other distributions. This > patch is the first of many in order to gain feature parity with the > modern GNU/Linux world. 2018 is surely the year of the GuixSD desktop! This also allows us to save time with all of these services and allow us to focus on adding new features that we need. >=20 > Note: It requires the patch from . >=20 > * gnu/packages/systemd.scm: New file. > * gnu/local.mk (GNU_SYSTEM_MODULES): Register it. > --- > gnu/local.mk | 1 + > gnu/packages/systemd.scm | 251 +++++++++++++++++++++++++++++++++++++++++= ++++++ > 2 files changed, 252 insertions(+) > create mode 100644 gnu/packages/systemd.scm >=20 > diff --git a/gnu/local.mk b/gnu/local.mk > index 2705fb37a..dbefd8cca 100644 > --- a/gnu/local.mk > +++ b/gnu/local.mk > @@ -402,6 +402,7 @@ GNU_SYSTEM_MODULES =3D \ > %D%/packages/statistics.scm \ > %D%/packages/storage.scm \ > %D%/packages/suckless.scm \ > + %D%/packages/systemd.scm \ > %D%/packages/swig.scm \ > %D%/packages/sync.scm \ > %D%/packages/syncthing.scm \ > diff --git a/gnu/packages/systemd.scm b/gnu/packages/systemd.scm > new file mode 100644 > index 000000000..e90ed65cc > --- /dev/null > +++ b/gnu/packages/systemd.scm > @@ -0,0 +1,251 @@ > +;;; GNU Guix --- Functional package management for GNU > +;;; Copyright =C2=A9 2018 Marius Bakke > +;;; > +;;; This file is part of GNU Guix. > +;;; > +;;; GNU Guix is free software; you can redistribute it and/or modify it > +;;; under the terms of the GNU General Public License as published by > +;;; the Free Software Foundation; either version 3 of the License, or (at > +;;; your option) any later version. > +;;; > +;;; GNU Guix is distributed in the hope that it will be useful, but > +;;; WITHOUT ANY WARRANTY; without even the implied warranty of > +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +;;; GNU General Public License for more details. > +;;; > +;;; You should have received a copy of the GNU General Public License > +;;; along with GNU Guix. If not, see . > + > +(define-module (gnu packages systemd) > + #:use-module (guix packages) > + #:use-module (guix download) > + #:use-module (guix build-system meson) > + #:use-module ((guix licenses) #:prefix license:) > + #:use-module (gnu packages acl) > + #:use-module (gnu packages admin) > + #:use-module (gnu packages aidc) > + #:use-module (gnu packages base) > + #:use-module (gnu packages bash) > + #:use-module (gnu packages compression) > + #:use-module (gnu packages cryptsetup) > + #:use-module (gnu packages curl) > + #:use-module (gnu packages docbook) > + #:use-module (gnu packages elf) > + #:use-module (gnu packages gettext) > + #:use-module (gnu packages glib) > + #:use-module (gnu packages gnunet) > + #:use-module (gnu packages gnupg) > + #:use-module (gnu packages gperf) > + #:use-module (gnu packages libidn) > + #:use-module (gnu packages linux) > + #:use-module (gnu packages m4) > + #:use-module (gnu packages package-management) > + #:use-module (gnu packages pcre) > + #:use-module (gnu packages pkg-config) > + #:use-module (gnu packages python) > + #:use-module (gnu packages tls) > + #:use-module (gnu packages xdisorg) > + #:use-module (gnu packages xml)) > + > +(define-public systemd > + (package > + (name "systemd") > + (version "238") > + (source (origin > + (method url-fetch) > + (uri (string-append "https://github.com/systemd/systemd/ar= chive/v" > + version ".tar.gz")) > + (file-name (string-append name "-" version ".tar.gz")) This should be a git-checkout, as per bug FILL-IN, with the changing github tarballs. > + (sha256 > + (base32 > + "08p0wf6qby2hksa890hbybdfr274chjb3ykdi1rl4g1fmfdmkj5v"))= )) > + (build-system meson-build-system) > + (arguments > + `(#:tests? #f ;FIXME: The disable-broken-tests phase is= ineffective. > + #:configure-flags > + (let ((bash (assoc-ref %build-inputs "bash")) > + (coreutils (assoc-ref %build-inputs "coreutils")) > + (kbd (assoc-ref %build-inputs "kbd")) > + (kmod (assoc-ref %build-inputs "kmod")) > + (util-linux (assoc-ref %build-inputs "util-linux")) > + > + (out (assoc-ref %outputs "out"))) > + (list (string-append "-Dkill-path=3D" coreutils "/bin/kill") > + (string-append "-Dkmod-path=3D" kmod "/bin/kmod") > + (string-append "-Dsulogin-path=3D" util-linux "/bin/sulog= in") > + (string-append "-Dmount-path=3D" util-linux "/bin/mount") > + (string-append "-Dumount-path=3D" util-linux "/bin/umount= ") > + (string-append "-Dloadkeys-path=3D" kbd "/bin/loadkeys") > + (string-append "-Dsetfont-path=3D" kbd "/bin/setfont") > + (string-append "-Ddebug-shell=3D" bash "/bin/sh") > + > + ;; XXX: Can we reuse %ntp-servers here? > + (string-append "-Dntp-servers=3D" > + (string-join (map (lambda (n) > + (string-append (number= ->string n) > + ".guix.= pool.ntp.org")) > + '(0 1 2 3)) > + ",")) > + > + ;; Use localhost for DNS with fallback to Quad9 (instead = of Google). > + "-Ddns-servers=3D127.0.0.1,::1,9.9.9.10,2620:fe::10" > + > + ;; FIXME: "Attempt to load external entity http://docbook= =2Esf.net". > + "-Dman=3Dfalse" > + > + ;; Don't install SysV compatibility scripts. > + "-Dsysvinit-path=3D" > + "-Dsysvrcnd-path=3D" ;; Don't record build time. "-Dtime-epoch=3D1" > + > + (string-append "-Dbashcompletiondir=3D" out "/etc/bash_co= mpletion.d") > + (string-append "-Dsysconfdir=3D" out "/etc") > + (string-append "-Drootprefix=3D" out) > + (string-append "-Drootlibdir=3D" out "/lib") > + (string-append "-Ddbuspolicydir=3D" out "/etc/dbus-1/syst= em.d") > + (string-append "-Dpamconfdir=3D" out "/etc/pam.d"))) > + #:phases (modify-phases %standard-phases > + (add-after 'unpack 'patch-paths > + (lambda* (#:key inputs outputs #:allow-other-keys) > + (let ((bash (assoc-ref inputs "bash")) > + (coreutils (assoc-ref inputs "coreutil= s")) > + (glibc (assoc-ref inputs "glibc")) > + (util-linux (assoc-ref inputs "util-lin= ux")) > + > + (out (assoc-ref outputs "out"))) > + > + (substitute* '("src/core/swap.c" > + "src/fsck/fsck.c" > + "src/journal/cat.c" > + "src/nspawn/nspawn.c" > + "src/nspawn/nspawn-setuid.c") > + (("/bin/sh") (string-append bash "/bin/sh")) this could be (which "sh") > + (("/bin/bash") (string-append bash "/bin/bash"= )) > + (("/bin/cat") (string-append coreutils "/bin/c= at")) > + (("/bin/echo") (string-append coreutils "/bin/= echo")) > + (("/bin/getent") (string-append glibc "/bin/ge= tent")) > + (("/sbin/fsck") (string-append util-linux "/sb= in/fsck")) > + (("/sbin/swapon") (string-append util-linux "/= sbin/swapon")) > + (("/sbin/swapoff") (string-append util-linux "= /sbin/swapoff"))) > + (substitute* "src/journal/catalog.c" > + (("/usr/lib/systemd/catalog") > + (string-append out "/lib/systemd/catalog"))) > + #t))) > + (add-after 'patch-paths 'fix-install > + (lambda* (#:key outputs #:allow-other-keys) > + (let ((out (assoc-ref outputs "out"))) > + ;; Don't create /var/lib/systemd during install. > + (substitute* "meson.build" > + ((".*mkdir_p\\.format\\(systemdstatedir\\)\\)"= ) "")) > + ;; Nor /var/lib/systemd/catalog. > + (substitute* "catalog/meson.build" > + (("journalctl --update-catalog") "journalctl -= -version")) > + ;; Likewise for /var/log/journal. > + (substitute* '("src/journal/meson.build" > + "src/journal-remote/meson.build") > + (("/var/log/journal") "/tmp/journal")) we'll need to keep an eye on this: This will become a hard error in a future Meson release. = 'chown 0:0 $DESTDIR/tmp/journal/remote && 64 33 > + ;; Create the hwdb in out/etc/udev/hwdb.d, not /= etc/udev. > + (substitute* "hwdb/meson.build" > + (("systemd-hwdb update") > + (string-append "systemd-hwdb -r " out > + "/etc/udev/hwdb.d update"))) > + #t))) > + (add-before 'configure 'set-runpath > + (lambda* (#:key outputs #:allow-other-keys) > + (let ((out (assoc-ref outputs "out"))) > + ;; We need out/lib and out/lib/systemd in RUNPAT= H. > + (setenv "LDFLAGS" (string-append "-Wl,-rpath=3D"= out "/lib," > + "-rpath=3D" out= "/lib/systemd")) > + #t))) > + (add-before 'check 'disable-broken-tests > + (lambda _ > + (delete-file "test-network") ;requires l= oopback > + (delete-file "test-engine") ;requires c= groups > + (delete-file "test-unit-name") ;likewise > + (delete-file "test-unit-file") ;likewise > + (delete-file "test-copy") ;FIXME > + (delete-file "test-condition") ;requires c= ontainers > + (delete-file "test-mount-util") ;requires /= sys > + (delete-file "test-exec-util") ;FIXME > + (delete-file "test-xattr-util") ;FIXME > + (delete-file "test-fs-util") ;requires /= var/tmp > + (delete-file "test-stat-util") ;FIXME > + (delete-file "test-user-util") ;needs "roo= t" user > + (delete-file "test-path-lookup") ;expects sy= stemd paths > + (delete-file "test-namespace") ;requires c= ontainers > + (delete-file "test-bpf") ;requires c= groups > + (delete-file "test-fileio") ;FIXME > + (delete-file "test-time-util") ;FIXME tzda= ta > + (delete-file "test-date") ;likewise > + (delete-file "test-calendarspec") ;likewise > + (delete-file "test-cgroup-util") ;requires c= group (duh) > + (delete-file "test-strv") ;FIXME > + (delete-file "test-path-util") ;FIXME /bin= /sh > + (delete-file "test-path") ;requires c= group > + (delete-file "test-sched-prio") ;requires c= group > + (delete-file "test-id128") ;FIXME > + (delete-file "test-journal-flush") ;FIXME > + (delete-file "test-bus-creds") ;requires c= group > + (delete-file "test-login") ;FIXME > + (delete-file "test-dhcp-client") ;requires n= etwork > + (delete-file "test-dhcp6-client") ;likewise > + #t)) > + (add-after 'install 'fix-environment-symlink > + (lambda* (#:key outputs #:allow-other-keys) > + ;; The install phase creates this dangling symlink: > + ;; lib/environment.d/00-environment.conf -> ../../= etc/environment > + ;; ...which causes the 'fix-runpath' phase to erro= r out. > + ;; XXX: This should probably use /etc/environment = instead. > + (mkdir-p (string-append (assoc-ref outputs "out") > + "/etc/environment")) > + #t))))) > + (native-inputs > + `(("docbook-xml" ,docbook-xml) > + ("docbook-xsl" ,docbook-xsl) > + ("gettext" ,gettext-minimal) > + ("gperf" ,gperf) > + ("lxml" ,python-lxml) > + ("m4" ,m4) > + ("pkg-config" ,pkg-config) > + ("xsltproc" ,libxslt))) > + (inputs > + `(("acl" ,acl) > + ("audit" ,audit) > + ("bash" ,bash) we probably don't need to include bash specifically, isn't it part of the build system? Also, it should be bash-minimal > + ("bzip2" ,bzip2) > + ("coreutils" ,coreutils) > + ("cryptsetup" ,cryptsetup) > + ("curl" ,curl) > + ("dbus" ,dbus) > + ;; TODO: Add gnu-efi for bootloader functionality. > + ("elfutils" ,elfutils) Currently elfutils fails its test phase on armhf and aarch64, so we'll need to fix this before rolling it out so we don't cut out users on these platforms > + ("glib" ,glib) > + ("glibc" ,glibc) what about our future Hurd users? > + ("gnutls" ,gnutls) > + ("kbd" ,kbd) > + ("kmod" ,kmod) > + ("libcap" ,libcap) > + ("libgcrypt" ,libgcrypt) > + ("libidn2" ,libidn2) > + ("libmicrohttpd" ,libmicrohttpd) > + ("libseccomp" ,libseccomp) > + ("libxkbcommon" ,libxkbcommon) > + ("linux-pam" ,linux-pam) > + ("lz4" ,lz4) > + ("pcre2" ,pcre2) > + ("python" ,python) > + ("qrencode" ,qrencode) > + ("util-linux" ,util-linux) > + ("xz" ,xz) > + ("zlib" ,zlib))) > + (home-page "https://www.freedesktop.org/wiki/Software/systemd/") > + (synopsis "System and service manager") > + (description > + "@code{systemd} is a suite of basic building blocks for a Linux sys= tem. > +It provides a system and service manager that runs as PID 1 and starts t= he > +rest of the system. systemd provides aggressive parallelization capabil= ities, > +uses socket and D-Bus activation for starting services, offers on-demand > +starting of daemons, keeps track of processes using Linux control groups, > +maintains mount and automount points, and implements an elaborate transa= ctional > +dependency-based service control logic.") > + (license license:lgpl2.1+))) > + > --=20 > 2.16.3 >=20 >=20 Currently installing fails with the error: Failed to run install script '/gnu/store/rl5m6cysqhizqr2nminx2nxficpiadmi-b= ash-4.4.12/bin/sh -c test -n "$DESTDIR" || /gnu/store/mqgzqi600k8yqhih863r6= ngw0bmamqkq-systemd-238/bin/journalctl --version' FAILED: meson-install I'll take a look at it. --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --0H629O+sVkh21xTi Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAlrA5uAACgkQQarn3Mo9 g1G+Aw//X9ZyFlPlFs2UV8pozmq+TbgyxFOufQ3N6lD7KohMEe7sIspjko95P0Vn cQH1Iyn/8MFVRkSjEp45T2RUKoBR89JVTw295QJNgBGQ9Sl4ZTKnqXoV+31q5ZqC FK22ORgVWIIgGdrXRaTG2AlsbS2lD0X8hKx6lNANviFCPTJOP35kOANc37xEr17/ S1rZkK/gMKE9U1mjgt80C6T/IYanyKp3tSchZPwKYorPu/4jIwPLzO0CI0Y/R4ER j8EgU4VPuhDT4buQFrGSsUa9KIE3t47279QtnXxpOLTEkqPx8BxPN+ixVQNfP+Pi /xrfxWGdzcq6lCylVqs7H6GfYgTYaKrOnfm7pPZxUfzsL836UJk6Z3E78ptGUyNK oB2P1IyUfVij6+94l6NrubBgvGN3EF9Bov+rb/QIbeV769toZOZrhmnSL5sc5eK2 +GMUjHrDiFEqz2pv90HG8J1VT/xF032eLIkFB533qoG4+h8qdIzazsNwAedK2Lsa LhqsYUmR14Xw/xFjRy5AKAOKYUh1MPqK/8HcSoDDxEWmGHcGsd0X3wUm0uVCYC6G IYcQ6TnEnK5prQNa/ibJkPGBkhdKbgXzGcoYWsvfXjyfkdJyXSEMHNuXmRVULXMx 50/t7Gs3c+2Bsc0kKBfA4I1Hz1LNvD3RumnQnrI9Zbu+MQxhuS8= =kfMp -----END PGP SIGNATURE----- --0H629O+sVkh21xTi--