From 735c6dd7faec036adbfa44d927c823ffa9ea1243 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 29 Jan 2014 13:04:00 +0100 Subject: gnu: Lower initrd makers from packages to monadic procedures. * gnu/packages/linux-initrd.scm: Remove. * gnu/system/linux-initrd.scm: New file. * gnu-system.am (GNU_SYSTEM_MODULES): Adjust accordingly. * gnu/system.scm (): Change default 'initrd' value to (gnu-system-initrd). (operating-system-derivation): Bind 'operating-system-initrd'. Pass 'menu-entry' an initrd file name instead of a package. * gnu/system/grub.scm (grub-configuration-file): Expect 'initrd' to be file name. --- gnu/system.scm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'gnu/system.scm') diff --git a/gnu/system.scm b/gnu/system.scm index 6fd753f8fd..5fb4a7483e 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013 Ludovic Courtès +;;; Copyright © 2013, 2014 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -22,7 +22,6 @@ #:use-module (guix records) #:use-module (guix packages) #:use-module (guix derivations) - #:use-module (gnu packages linux-initrd) #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages admin) @@ -31,6 +30,7 @@ #:use-module (gnu system grub) #:use-module (gnu system shadow) #:use-module (gnu system linux) + #:use-module (gnu system linux-initrd) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) @@ -58,8 +58,8 @@ (default grub)) (bootloader-entries operating-system-bootloader-entries ; list (default '())) - (initrd operating-system-initrd - (default gnu-system-initrd)) + (initrd operating-system-initrd ; monadic derivation + (default (gnu-system-initrd))) (host-name operating-system-host-name) ; string @@ -321,8 +321,9 @@ alias ll='ls -l' "--config" ,dmd-conf)))) (kernel -> (operating-system-kernel os)) (kernel-dir (package-file kernel)) - (initrd -> (operating-system-initrd os)) - (initrd-file (package-file initrd)) + (initrd (operating-system-initrd os)) + (initrd-file -> (string-append (derivation->output-path initrd) + "/initrd")) (entries -> (list (menu-entry (label (string-append "GNU system with " @@ -331,7 +332,7 @@ alias ll='ls -l' (linux kernel) (linux-arguments `("--root=/dev/vda1" ,(string-append "--load=" boot))) - (initrd initrd)))) + (initrd initrd-file)))) (grub.cfg (grub-configuration-file entries)) (extras (links (delete-duplicates (append (append-map service-inputs services) -- cgit v1.2.3 From fc4bc4b6debecf9acc7e86ecb519c03b5b598bc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 31 Jan 2014 01:43:16 +0100 Subject: gnu: linux-initrd: Properly distinguish between /dev/sda* and /dev/vda*. * guix/build/linux-initrd.scm (make-essential-device-nodes): Rename devices with major = 8 to /dev/sda*. Make /dev/vda* devices. * gnu/system/vm.scm (qemu-image): Change '/dev/vda' to '/dev/sda'. * gnu/system.scm (operating-system-derivation): Likewise. --- gnu/system.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/system.scm') diff --git a/gnu/system.scm b/gnu/system.scm index 5fb4a7483e..e9ecfd2732 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -330,7 +330,7 @@ alias ll='ls -l' (package-full-name kernel) " (technology preview)")) (linux kernel) - (linux-arguments `("--root=/dev/vda1" + (linux-arguments `("--root=/dev/sda1" ,(string-append "--load=" boot))) (initrd initrd-file)))) (grub.cfg (grub-configuration-file entries)) -- cgit v1.2.3 From fd3bfc44ff65e166d1c515721c7870391dceb799 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 31 Jan 2014 14:36:48 +0100 Subject: gnu: vm: Add support for running a VM that shares its store with the host. * gnu/system/vm.scm (qemu-image): Check whether GUIX is #f. (operating-system-build-gid, operating-system-default-contents): New procedures. (system-qemu-image): Use 'operating-system-build-gid'. (system-qemu-image/shared-store, system-qemu-image/shared-store-script): New procedures. * gnu/system.scm: Add missing exports. --- gnu/system.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gnu/system.scm') diff --git a/gnu/system.scm b/gnu/system.scm index e9ecfd2732..afea976165 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -38,6 +38,16 @@ operating-system? operating-system-services operating-system-packages + operating-system-bootloader-entries + operating-system-host-name + operating-system-kernel + operating-system-initrd + operating-system-users + operating-system-groups + operating-system-packages + operating-system-timezone + operating-system-locale + operating-system-services operating-system-derivation)) -- cgit v1.2.3 From f6a9d0484c6cdd1554f6ce0e7372ec8b7f2a52ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 2 Feb 2014 01:34:33 +0100 Subject: gnu: vm: Add /run/current-system and /bin/sh. * gnu/system/vm.scm (operating-system-default-contents): Populate /run/current-system and create /bin/sh. * gnu/system.scm (operating-system-profile-derivation, operating-system-profile-directory): New procedures. (operating-system-derivation): Use it. --- gnu/system.scm | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'gnu/system.scm') diff --git a/gnu/system.scm b/gnu/system.scm index afea976165..514e67ab9a 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -49,6 +49,7 @@ operating-system-locale operating-system-services + operating-system-profile-directory operating-system-derivation)) ;;; Commentary: @@ -284,6 +285,17 @@ alias ll='ls -l' ("pam.d" ,pam.d)) #:name "etc"))) +(define (operating-system-profile-derivation os) + "Return a derivation that builds the default profile of OS." + ;; TODO: Replace with a real profile with a manifest. + (union (operating-system-packages os) + #:name "default-profile")) + +(define (operating-system-profile-directory os) + "Return the directory name of the default profile of OS." + (mlet %store-monad ((drv (operating-system-profile-derivation os))) + (return (derivation->output-path drv)))) + (define (operating-system-derivation os) "Return a derivation that builds OS." (mlet* %store-monad @@ -310,11 +322,8 @@ alias ll='ls -l' services)))) (groups -> (append (operating-system-groups os) (append-map service-user-groups services))) - (packages -> (operating-system-packages os)) - ;; TODO: Replace with a real profile with a manifest. - (profile-drv (union packages - #:name "default-profile")) + (profile-drv (operating-system-profile-derivation os)) (profile -> (derivation->output-path profile-drv)) (etc-drv (etc-directory #:accounts accounts #:groups groups #:pam-services pam-services -- cgit v1.2.3 From 7aec36830faf5de613ca2ae64b1845545ad12da9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 5 Feb 2014 22:22:51 +0100 Subject: gnu: system: Build /etc/localtime. * gnu/system.scm (etc-directory)[bashrc]: Use 'text-file*' instead of 'text-file'. Adjust users accordingly. [files]: Add the /etc/localtime file for TIMEZONE. Add TZDATA to the 'file-union' inputs. (operating-system-derivation): Pass 'etc-directory' PROFILE-DRV instead of PROFILE. --- gnu/system.scm | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'gnu/system.scm') diff --git a/gnu/system.scm b/gnu/system.scm index 514e67ab9a..e06b8103a5 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -251,38 +251,39 @@ GNU dmd (http://www.gnu.org/software/dmd/). You can log in as 'guest' or 'root' with no password. ")) - ;; Assume TZDATA is installed---e.g., as part of the system packages. - ;; Users can choose not to have it. - (tzdir (package-file tzdata "share/zoneinfo")) - ;; TODO: Generate bashrc from packages' search-paths. - (bashrc (text-file "bashrc" (string-append " + (bashrc (text-file* "bashrc" " export PS1='\\u@\\h\\$ ' export LC_ALL=\"" locale "\" export TZ=\"" timezone "\" -export TZDIR=\"" tzdir "\" +export TZDIR=\"" tzdata "/share/zoneinfo\" export PATH=$HOME/.guix-profile/bin:" profile "/bin:" profile "/sbin export CPATH=$HOME/.guix-profile/include:" profile "/include export LIBRARY_PATH=$HOME/.guix-profile/lib:" profile "/lib alias ls='ls -p --color' alias ll='ls -l' -"))) +")) + (tz-file (package-file tzdata + (string-append "share/zoneinfo/" timezone))) (files -> `(("services" ,services) ("protocols" ,protocols) ("rpc" ,rpc) ("pam.d" ,(derivation->output-path pam.d)) ("login.defs" ,login.defs) ("issue" ,issue) - ("profile" ,bashrc) + ("profile" ,(derivation->output-path bashrc)) + ("localtime" ,tz-file) ("passwd" ,passwd) ("shadow" ,shadow) ("group" ,group)))) (file-union files #:inputs `(("net" ,net-base) - ("pam.d" ,pam.d)) + ("pam.d" ,pam.d) + ("bashrc" ,bashrc) + ("tzdata" ,tzdata)) #:name "etc"))) (define (operating-system-profile-derivation os) @@ -329,7 +330,7 @@ alias ll='ls -l' #:pam-services pam-services #:locale (operating-system-locale os) #:timezone (operating-system-timezone os) - #:profile profile)) + #:profile profile-drv)) (etc -> (derivation->output-path etc-drv)) (dmd-conf (dmd-configuration-file services etc)) -- cgit v1.2.3 From ea0e9ce2e6d0c99106c47ee32203b92933a837de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 8 Feb 2014 00:18:25 +0100 Subject: gnu: Move root's home directory to /root. * gnu/system.scm (operating-system-derivation): Change root's 'home-directory' to "/root". * gnu/system/vm.scm (operating-system-default-contents): Add /root. --- gnu/system.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/system.scm') diff --git a/gnu/system.scm b/gnu/system.scm index e06b8103a5..6918d5bcb8 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -317,7 +317,7 @@ alias ll='ls -l' (password "") (uid 0) (gid 0) (comment "System administrator") - (home-directory "/")) + (home-directory "/root")) (append (operating-system-users os) (append-map service-user-accounts services)))) -- cgit v1.2.3 From db4fdc04cc05495788ee54ae25baf8cd056917dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 19 Feb 2014 20:58:24 +0100 Subject: gnu: Introduce the (gnu services ...) modules. * gnu/system/dmd.scm: Remove file. Move contents to... * gnu/services.scm, gnu/services/base.scm, gnu/services/dmd.scm, gnu/services/networking.scm, gnu/services/xorg.scm: ... here. New files. * gnu/system.scm, gnu/system/vm.scm: Adjust accordingly. * guix/scripts/system.scm (%user-module): Likewise. * doc/guix.texi (Using the Configuration System): Likewise. (Defining Services): Likewise. --- gnu/system.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gnu/system.scm') diff --git a/gnu/system.scm b/gnu/system.scm index 6918d5bcb8..f05b7a092a 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -26,7 +26,11 @@ #:use-module (gnu packages bash) #:use-module (gnu packages admin) #:use-module (gnu packages package-management) - #:use-module (gnu system dmd) + #:use-module (gnu services) + #:use-module (gnu services dmd) + #:use-module (gnu services base) + #:use-module ((gnu services networking) + #:select (static-networking-service)) #:use-module (gnu system grub) #:use-module (gnu system shadow) #:use-module (gnu system linux) -- cgit v1.2.3 From 8b198abecde8c846eaa464ac1b41cbc18556b5e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 19 Feb 2014 21:08:28 +0100 Subject: gnu: Define '%base-services'. * gnu/services/base.scm (%base-services): New variable. * gnu/system.scm ()[services]: Change the default value to %BASE-SERVICES. * doc/guix.texi (Using the Configuration System): Change '%standard-services' to '%base-services'. --- gnu/system.scm | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'gnu/system.scm') diff --git a/gnu/system.scm b/gnu/system.scm index f05b7a092a..e6346106a2 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -29,8 +29,6 @@ #:use-module (gnu services) #:use-module (gnu services dmd) #:use-module (gnu services base) - #:use-module ((gnu services networking) - #:select (static-networking-service)) #:use-module (gnu system grub) #:use-module (gnu system shadow) #:use-module (gnu system linux) @@ -107,23 +105,7 @@ (locale operating-system-locale) ; string (services operating-system-services ; list of monadic services - (default - (let ((motd (text-file "motd" " -This is the GNU operating system, welcome!\n\n"))) - (list (mingetty-service "tty1" #:motd motd) - (mingetty-service "tty2" #:motd motd) - (mingetty-service "tty3" #:motd motd) - (mingetty-service "tty4" #:motd motd) - (mingetty-service "tty5" #:motd motd) - (mingetty-service "tty6" #:motd motd) - (syslog-service) - (guix-service) - (nscd-service) - - ;; QEMU networking settings. - (static-networking-service "eth0" "10.0.2.10" - #:name-servers '("10.0.2.3") - #:gateway "10.0.2.2")))))) + (default %base-services))) -- cgit v1.2.3 From 9038298cbf645cc85ab85e5fe47cab9737a15c50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 19 Feb 2014 21:30:16 +0100 Subject: gnu: Add /etc/shells. * gnu/system.scm (etc-directory): Add /etc/shells. --- gnu/system.scm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gnu/system.scm') diff --git a/gnu/system.scm b/gnu/system.scm index e6346106a2..d28738140f 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -227,6 +227,11 @@ directories or regular files." (group (group-file groups)) (pam.d (pam-services->directory pam-services)) (login.defs (text-file "login.defs" "# Empty for now.\n")) + (shells (text-file "shells" ; used by xterm and others + "\ +/bin/sh +/run/current-system/bin/sh +/run/current-system/bin/bash\n")) (issue (text-file "issue" " This is an alpha preview of the GNU system. Welcome. @@ -260,6 +265,7 @@ alias ll='ls -l' ("pam.d" ,(derivation->output-path pam.d)) ("login.defs" ,login.defs) ("issue" ,issue) + ("shells" ,shells) ("profile" ,(derivation->output-path bashrc)) ("localtime" ,tz-file) ("passwd" ,passwd) -- cgit v1.2.3