From 55b977dcbf97619c2c6e5d68c0c361df1b66091f Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Mon, 31 Dec 2007 08:55:40 +0000 Subject: [PATCH] Changes to xserver to export configuration and to allow not to run the job on boot, changes to filesystems job to autocreate some mountpoints (/dev/shm..) svn path=/nixos/trunk/; revision=9987 --- upstart-jobs/default.nix | 2 ++ upstart-jobs/filesystems.nix | 8 +++++++- upstart-jobs/xserver.nix | 17 +++++++++++++++-- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/upstart-jobs/default.nix b/upstart-jobs/default.nix index d0677b66e0c4..7b7c64af36f0 100644 --- a/upstart-jobs/default.nix +++ b/upstart-jobs/default.nix @@ -154,6 +154,8 @@ let libXext = pkgs.xlibs.libXext; fontDirectories = import ../system/fonts.nix {inherit pkgs config;}; isClone = config.services.xserver.isClone; + autorun = config.services.xserver.autorun; + exportConfiguration = config.services.xserver.exportConfiguration; }) # Apache httpd. diff --git a/upstart-jobs/filesystems.nix b/upstart-jobs/filesystems.nix index b8d1fd9dab58..ac0abaf3770c 100644 --- a/upstart-jobs/filesystems.nix +++ b/upstart-jobs/filesystems.nix @@ -7,6 +7,7 @@ let devices = map (fs: if fs ? device then fs.device else "LABEL=" + fs.label) fileSystems; fsTypes = map (fs: if fs ? fsType then fs.fsType else "auto") fileSystems; optionss = map (fs: if fs ? options then fs.options else "defaults") fileSystems; + autocreates = map (fs: if fs ? autocreate then fs.autocreate else "0") fileSystems; in @@ -25,6 +26,7 @@ script devices=(${toString devices}) fsTypes=(${toString fsTypes}) optionss=(${toString optionss}) + autocreates=(${toString autocreates}) newDevices=1 @@ -41,12 +43,14 @@ script device=\${devices[$n]} fsType=\${fsTypes[$n]} options=\${optionss[$n]} + autocreate=\${autocreates[$n]} isLabel= if echo \"$device\" | grep -q '^LABEL='; then isLabel=1; fi isPseudo= - if test \"$fsType\" = \"nfs\" || test \"$fsType\" = \"ext3cow\"; then isPseudo=1; fi + if test \"$fsType\" = \"nfs\" || test \"$fsType\" = \"tmpfs\" || + test \"$fsType\" = \"ext3cow\"; then isPseudo=1; fi if ! test -n \"$isLabel\" -o -n \"$isPseudo\" -o -e \"$device\"; then echo \"skipping $device, doesn't exist (yet)\" @@ -100,6 +104,8 @@ script fsck -a \"$device\" || true fi + if test \"\$autocreate\" = 1; then mkdir -p \"\$mountPoint\"; fi + if ${utillinux}/bin/mount -t \"$fsType\" -o \"$options\" \"$device\" \"$mountPoint\"; then newDevices=1 fi diff --git a/upstart-jobs/xserver.nix b/upstart-jobs/xserver.nix index 06bf572df995..989460a46c6b 100644 --- a/upstart-jobs/xserver.nix +++ b/upstart-jobs/xserver.nix @@ -19,6 +19,12 @@ , # Is Clone mode on? isClone ? "on" + +, # Do we want it to run or just to prepare everything? + autorun ? true + +, # Create unneeded links in /etc? + exportConfiguration ? false }: let @@ -364,11 +370,18 @@ rec { optional (sessionType == "kde") { source = "${xkeyboard_config}/etc/X11/xkb"; target = "X11/xkb"; - }; + } + ++ + optional (exportConfiguration) + { + source = "${configFile}"; + target = "X11/xorg.conf"; + } + ; job = " - start on network-interfaces + start on ${if autorun then "network-interfaces" else "never"} start script