Commit graph

453 commits

Author SHA1 Message Date
Eelco Dolstra 21da462ad5 Merge pull request #25 from shlevy/required-kernel-config
Required kernel config
2012-08-08 10:33:41 -07:00
Shea Levy c39f493ebb Minor reorganization 2012-08-07 18:09:08 -04:00
Eelco Dolstra 66ff6a382a stage-1-init: Close temporary file descriptor
Otherwise this fd will be inherited all the way into the Upstart jobs.
2012-08-07 10:05:33 -04:00
Shea Levy 0ea2643c63 The initrd mounts some tmpfses 2012-08-07 06:57:01 -04:00
Eelco Dolstra 52b6e10315 Use systemd-modules-load.service to load required kernel modules 2012-08-06 16:52:08 -04:00
Rickard Nilsson e33dfa936f Use busybox mount instead of klibc nfsmount for nfs mounts in initrd. 2012-08-06 16:25:22 -04:00
Eelco Dolstra d33fd9a1f8 switch-to-configuration: Assume that services that are auto-restarting are going to fail 2012-08-06 15:48:46 -04:00
Eelco Dolstra b11c5d5991 nscd: Ensure that invalidate-nscd starts after nscd 2012-08-06 12:26:52 -04:00
Eelco Dolstra 9f9ae7c7e9 Share option definitions between the systemd and Upstart compatibility modules 2012-08-06 11:45:59 -04:00
Eelco Dolstra f74ffe3550 Remove obsolete Upstart shutdown job 2012-08-06 10:58:27 -04:00
Eelco Dolstra 2a91bb5282 switch-to-configuration: Print new units 2012-08-03 17:13:34 -04:00
Eelco Dolstra 320682a558 switch-to-configuration: Don't ellipsize log output 2012-08-03 14:39:59 -04:00
Eelco Dolstra 0d6b96a525 switch-to-configuration: Fix the call to install the boot loader 2012-08-03 14:07:43 -04:00
Eelco Dolstra aa6fd9f8a2 switch-to-configuration: Handle unit template instances 2012-08-03 13:47:59 -04:00
Eelco Dolstra bd3c9febc9 switch-to-configuration: Stop units in one call to systemctl 2012-08-03 13:29:56 -04:00
Eelco Dolstra b6bd0a4f84 switch-to-configuration: Restart services that were manually started 2012-08-03 11:53:14 -04:00
Eelco Dolstra 56ce5614f9 switch-to-configuration: Print all failed services 2012-08-03 10:40:01 -04:00
Eelco Dolstra 4d2deff7af Stop obsolete units, restart changed units, start new units 2012-08-02 17:26:23 -04:00
Eelco Dolstra 0fc68a3d1d Rewrite switch-to-configuration in Perl
This will make it more efficient to do systemd dependency graph
processing (if necessary).
2012-08-02 15:11:29 -04:00
Eelco Dolstra d4fec178fd Merge remote-tracking branch 'origin/master' into systemd 2012-08-02 13:44:16 -04:00
Rickard Nilsson a6039e1be2 LUKS root: Fix key file check
Check for null instead of empty string
2012-08-02 11:39:31 +02:00
Rickard Nilsson 0958b224ac LUKS root: Add option for using a key file instead of a passphrase. 2012-08-02 11:30:33 +02:00
Rickard Nilsson ecdbc94e05 LUKS root: Add option allowDiscards (for SSD disks) 2012-08-02 11:27:28 +02:00
Shea Levy feb010a366 NixOS kernels should support ELF executables 2012-08-02 00:47:36 -04:00
Shea Levy 9e300052bd Add test to check that a machine with a minimal kernel but all of the requiredKernelConfig options set boots and shuts down 2012-08-01 22:32:16 -04:00
Shea Levy 2a983acaff Enable specifying which kernel config options are needed for a given module 2012-08-01 21:50:43 -04:00
Eelco Dolstra 5f57110e1f install-grub.pl: Fix Xen support 2012-08-01 21:48:29 +02:00
Eelco Dolstra 6576d81ff1 Fix "please: command not found" in switch-to-configuration 2012-07-30 15:19:30 -04:00
Eelco Dolstra 174d6a07e0 Fix whitespace 2012-07-30 13:49:10 -04:00
Eelco Dolstra 557f39aa0f install-grub.pl: Apply the configuration limit only to old generations 2012-07-25 16:37:29 -04:00
Eelco Dolstra b52117c34d Treat init-script as a boot loader 2012-07-25 11:30:16 -04:00
Eelco Dolstra 8b91a5f2ff Move boot loader modules to modules/system/boot/loader 2012-07-25 10:59:03 -04:00
Eelco Dolstra b15e1fbb08 Boot loader refactoring
- Renamed system.build.menuBuilder to system.build.installBootLoader.

- ‘install-grub.pl’ (formerly grub-menu-builder.pl) now generates the
  GRUB menu *and* installs GRUB (if necessary).

- ‘switch-to-configuration.sh’ has no boot loader specific knowledge
  anymore.  It just calls installBootLoader.
2012-07-25 10:47:32 -04:00
Eelco Dolstra a0721ad2b3 stage-1-init: Use mount --move to move /sys etc. to the target root
This fixes warnings about /sys/kernel/security during shutdown and
cleans up /proc/mounts.
2012-07-24 22:04:28 -04:00
Eelco Dolstra f0c82f4543 Pass the ‘--recheck’ flag to grub-install 2012-07-24 19:22:19 -04:00
Eelco Dolstra f07f221f0e Replace grub-menu-builder with a much faster version
The old GRUB menu builder script is quite slow, typically taking
several seconds.  This is a real annoyance since it's run every time
you switch to a new configuration.  Therefore this patch replaces the
Bash script with a much faster Perl script.  In a VirtualBox test, the
execution time went from 2.7s to 0.1s.  The Perl version is also more
correct because it uses XML to get the GRUB configuration (through
builtins.toXML), so there are no shell escaping issues.

The new script currently lacks support for subconfigurations defined
through "nesting.children".
2012-07-24 19:16:27 -04:00
Your Name 8bde72d99c Mount securityfs needed for AppArmor and some TPM drivers.
Should be harmless.
2012-07-22 16:31:49 +03:00
Eelco Dolstra 71ca633431 Start agetty on tty1
‘logind’ automatically starts agetty on all virtual consoles except
tty1.  We have to do that ourselves.
2012-07-20 18:32:24 -04:00
Eelco Dolstra 0edf138fc7 switch-to-configuration: Initial systemd support
It reloads the configuration, but doesn't (re)start jobs yet.
2012-07-20 18:25:36 -04:00
Eelco Dolstra fd2cef50cd Don't pull in Upstart 2012-07-20 18:25:23 -04:00
Eelco Dolstra 0b865edb16 switch-to-configuration: require a reboot going from Upstart to systemd 2012-07-20 16:23:52 -04:00
Eelco Dolstra 5fabcf63a3 Get delayed shutdowns to work 2012-07-20 15:40:50 -04:00
Eelco Dolstra 1375e7951d Enable systemd-journal-flush.service (added by systemd 187) 2012-07-20 12:02:42 -04:00
Eelco Dolstra 02e37ba6b0 Shorten filenames of start scripts to make log messages more readable 2012-07-19 17:41:42 -04:00
Eelco Dolstra 6419172bc2 journald: enable logging to the console 2012-07-19 17:32:50 -04:00
Eelco Dolstra 63742a942e Don't create /var/log/upstart/<jobname> unless necessary 2012-07-18 17:09:00 -04:00
Eelco Dolstra 917e53a2d2 Update units names for systemd-186 2012-07-16 17:47:11 -04:00
Eelco Dolstra 94daecd90b save-hwclock.service: support time.hardwareClockInLocalTime 2012-07-16 17:32:26 -04:00
Eelco Dolstra 44d091674b Merge branch 'master' of github.com:NixOS/nixos into systemd
Conflicts:
	modules/config/networking.nix
	modules/services/networking/ssh/sshd.nix
	modules/services/ttys/agetty.nix
	modules/system/boot/stage-2-init.sh
	modules/system/upstart-events/shutdown.nix
2012-07-16 17:27:11 -04:00
Eelco Dolstra 98459eb675 Global replace /var/run/booted-system -> /run/booted-system 2012-07-16 11:34:21 -04:00
Eelco Dolstra 73532c3855 Global replace /var/run/current-system -> /run/current-system 2012-07-16 11:34:21 -04:00
Eelco Dolstra 7de6a7e8b0 Rename time.clockLocal -> time.hardwareClockInLocalTime. 2012-07-11 15:33:34 -04:00
Carles Pagès 008493f94c Add option to keep hardware clock in local time. 2012-07-11 15:31:46 -04:00
Eelco Dolstra bf15293b1e Merge branch 'master' of github.com:NixOS/nixos into systemd
Conflicts:
	modules/services/hardware/udev.nix
2012-06-28 14:19:38 -04:00
Eelco Dolstra 76c74cd7c7 initrd: Detect filesystem type before doing fsck/mount
BusyBox doesn't handle the "auto" filesystem type very well: fsck will
just ignore such filesystems, and mount will only work properly if the
required kernel module is already loaded.  Therefore, use blkid to
determine the filesystem type.

Also generate an /etc/fstab in the initrd rootfs on the fly.  This is
useful if you're dropped into an emergency shell since it allows you
to say "fsck /dev/sda1" or "mount /dev/sda" and have the right thing
happen.
2012-06-28 10:55:44 -04:00
Shea Levy bb5d2d53fe try isn't used, so use the more compatct seq 10 2012-06-27 09:43:54 -04:00
Mathijs Kwik 061a998840 luks root: c-style for-loop -> seq
The ash shell no longer supports this bash-specific syntax.
This left systems that use luksroot unable to boot.
2012-06-27 09:42:55 -04:00
Eelco Dolstra e64bdda52b Don't use weird 777 permissions on unmounted /dev/shm 2012-06-27 09:35:53 -04:00
Eelco Dolstra bd0f065c05 Merge branch 'master' of github.com:NixOS/nixos into systemd 2012-06-22 18:20:26 -04:00
Eelco Dolstra 980ba4d5a5 stage-1: mount /proc, /sys, /dev in the target root
The switch_root in BusyBox doesn't do this (while the one in
util-linux does).  So we have to do this ourselves.
2012-06-22 13:51:42 -04:00
Eelco Dolstra 872a76b177 Merge branch 'master' of github.com:NixOS/nixos into systemd 2012-06-22 11:11:21 -04:00
Eelco Dolstra 9692495df0 Use BusyBox in the initrd
Using BusyBox instead of Bash plus a bunch of other tools gives us a
much more feature-full, yet smaller initrd.  In particular, BusyBox
contains networking commands such as ip and a DHCP client, useful for
NFS boots.  It's also much more convenient for rescue situations
because the shell has builtin readline support and there are many more
tools (including vi).
2012-06-22 10:43:06 -04:00
Eelco Dolstra 337423af8e Backdoor: depend on /dev/hvc0
Systemd is the shit: units can declare a dependency on the appearance
of device nodes.  Yay!
2012-06-19 17:36:02 -04:00
Eelco Dolstra 2fa1ba85c6 Enable the systemd password agents 2012-06-19 17:02:54 -04:00
Eelco Dolstra d692a0807a Don't mount /dev/pts since systemd does that for us 2012-06-19 15:25:56 -04:00
Eelco Dolstra cacd608c37 Mount devtmpfs in the initrd
It seems that udev now requires devtmpfs, so enable it.
2012-06-19 15:15:40 -04:00
Eelco Dolstra c73d642db2 Don't put quotes around environment values 2012-06-18 23:30:26 -04:00
Eelco Dolstra c3fb248bcb Get rid of the Upstart shutdown job
The only thing that Upstart's shutdown job did that systemd doesn't do
natively is update the hardware clock.  So added a service for that.
2012-06-18 18:15:34 -04:00
Eelco Dolstra 9f5051b76c Rename mingetty module to agetty 2012-06-18 17:55:27 -04:00
Eelco Dolstra 4c21857ee1 Upstart ‘boot.systemd.services’ for the Upstart compatibility layer 2012-06-18 17:42:26 -04:00
Eelco Dolstra 352510c208 Add an option ‘boot.systemd.services’
This option makes it more convenient to define services because it
automates stuff like setting $PATH, having a pre-start script, and so on.
2012-06-18 15:28:31 -04:00
Eelco Dolstra 673bf12b1d Improve the dependencies of units generated by the Upstart emulation 2012-06-18 00:22:18 -04:00
Eelco Dolstra 42ee3b4209 Add a ‘wantedBy’ attribute to unit definitions
This attribute allows a unit to make itself a dependency of another unit.

Also, add an option to set the default target unit.
2012-06-17 23:31:21 -04:00
Eelco Dolstra 4a95f8996b To ease migration to systemd, generate units from the ‘jobs’ option
Also get rid of the ‘buildHook’ job option because it wasn't very useful.
2012-06-16 00:19:43 -04:00
Eelco Dolstra 66f4d10843 Use pam_systemd.so to set up device ownership
This removes the need for ConsoleKit, so it's gone.
2012-06-15 14:51:48 -04:00
Eelco Dolstra ab86759eb3 Use kmod instead of module-init-tools 2012-06-15 14:18:26 -04:00
Eelco Dolstra 164d6e6ab2 Use udev from systemd 2012-06-15 13:09:22 -04:00
Eelco Dolstra a46894b960 Get lots more systemd stuff working
Enabled a bunch of units that ship with systemd.  Also added an option
‘boot.systemd.units’ that can be used to define additional units
(e.g. ‘sshd.service’).
2012-06-14 18:44:56 -04:00
Eelco Dolstra fae777c264 Merge branch 'master' of github.com:NixOS/nixos into systemd 2012-06-14 12:02:17 -04:00
Peter Simons 25155a02e6 Add findutils dependency for /tmp cleaning.
This dependency is only added if the setting is activated.

svn path=/nixos/trunk/; revision=34434
2012-06-11 07:05:15 +00:00
Peter Simons 4931188684 Integrate cleanTmpDir in stage-2-init.sh.
We're using find in order to remove dotfiles, too.

svn path=/nixos/trunk/; revision=34433
2012-06-11 07:05:13 +00:00
Peter Simons fbf53168f3 Add new option config.boot.cleanTmpDir.
This option is to control if the user wants to have its /tmp directory cleaned
up during system boot.

svn path=/nixos/trunk/; revision=34432
2012-06-11 07:05:11 +00:00
Lluís Batlle i Rossell 9125d3af50 Adding creation of /dev/ptmx in stage-2, in case stage-1 did not run.
Upstart requires /dev/ptmx since its 1.4, and will lock up in case of it missing.

I was hitting this in the fuloong, where I don't use the nixos initrd.


svn path=/nixos/trunk/; revision=34429
2012-06-10 22:37:20 +00:00
Eelco Dolstra f21aa7d22c First attempt at using systemd
Basic booting works.  Systemd starts agetty instances on tty1 and
tty2.  Shutdown and journald also work.
2012-06-04 12:51:48 -04:00
Eelco Dolstra a6892051ef * Allow building with boot.loader.grub.enable set to "false".
svn path=/nixos/trunk/; revision=34218
2012-05-23 15:52:29 +00:00
Mathijs Kwik be69799f35 better workaround for building nested child configurations
svn path=/nixos/trunk/; revision=34164
2012-05-18 06:17:08 +00:00
Mathijs Kwik 7fca5408f3 Revert "Provided a workaround for grub's missing-devices check, so nested child configurations can still build."
This reverts commit a89e8831e3d95bcf3ddc19ee34b938db7e8aa572.

svn path=/nixos/trunk/; revision=34163
2012-05-18 06:17:05 +00:00
Eelco Dolstra f889ebc488 * Allow runtime changes to boot.devShmSize and friends.
svn path=/nixos/trunk/; revision=34160
2012-05-17 19:33:55 +00:00
Eelco Dolstra e9e6885d3b * Lower the limits on /run and /dev.
svn path=/nixos/trunk/; revision=34159
2012-05-17 19:33:12 +00:00
Eelco Dolstra 91acb81b11 * Support globbing in the source attribute of environment.etc entries.
svn path=/nixos/trunk/; revision=34158
2012-05-17 18:43:45 +00:00
Mathijs Kwik 88b3c4b82e Provided a workaround for grub's missing-devices check, so nested child configurations can still build.
svn path=/nixos/trunk/; revision=34153
2012-05-17 10:17:32 +00:00
Eelco Dolstra 07fcf5baee * Make the boot.initrd.luks.enable option obsolete. It's enough to
see that boot.initrd.luks.devices is non-empty.

svn path=/nixos/trunk/; revision=34120
2012-05-15 20:45:01 +00:00
Eelco Dolstra 3dd0718939 * Give an error at evaluation time if boot.loader.grub.device or
boot.loader.grub.devices are not set, rather than complaining about
  it when it's too late.

svn path=/nixos/trunk/; revision=34081
2012-05-14 01:53:47 +00:00
Eelco Dolstra 67d5f2b444 * Require fileSystems to be set.
svn path=/nixos/trunk/; revision=34080
2012-05-14 01:33:11 +00:00
Eelco Dolstra c4aa833e56 * Use optionSet to check environment.etc.
svn path=/nixos/trunk/; revision=34064
2012-05-11 23:06:35 +00:00
Eelco Dolstra e4200d7e61 * Some more trivial builders with lots of dependencies that should be
built locally.

svn path=/nixos/trunk/; revision=34034
2012-05-09 21:35:47 +00:00
Eelco Dolstra 03f2847054 * Set preferLocalBuild on a few trivial top-level derivations. These
tend to cause a lot of unnecessary I/O to the build machines.

svn path=/nixos/trunk/; revision=33936
2012-04-26 15:19:23 +00:00
Eelco Dolstra 836fa3b6ae * Fix missing semicolon.
svn path=/nixos/trunk/; revision=33933
2012-04-26 14:53:58 +00:00
Peter Simons 8c93993e1b modules/system/boot/luksroot.nix: fixed the descriptions of the options defined in this module
svn path=/nixos/trunk/; revision=33927
2012-04-26 12:21:45 +00:00
Eelco Dolstra e3879fe365 * Store the NixOS version in the top-level derivation.
* Change the name of the top-level derivation from "system" to
  "nixos-<version>".
* Show the NixOS version in the GRUB boot menu instead of the kernel
  version.

svn path=/nixos/trunk/; revision=33785
2012-04-14 17:09:59 +00:00