Commit graph

301 commits

Author SHA1 Message Date
Eelco Dolstra 4f4c529979 Stage 1 improvements:
* Load scsi_wait_scan after all other kernel modules to ensure that
  all SCSI device nodes have been created.
* Increase the timeout for the appearance of the root device to 20
  seconds.
* Do a "udevadm settle" just after the root device has appeared to
  make sure that udev isn't accessing the device anymore (hopefully).
  On EC2 (Xen), I've seen fsck on the root fail randomly with "device
  in use" errors.

svn path=/nixos/trunk/; revision=33650
2012-04-06 14:20:43 +00:00
Eelco Dolstra 1e8e83408b * Revert unintended commit.
svn path=/nixos/trunk/; revision=33646
2012-04-06 12:23:44 +00:00
Eelco Dolstra 852e513638 * Handle booting from /dev/xvda.
svn path=/nixos/trunk/; revision=33645
2012-04-06 12:23:12 +00:00
Eelco Dolstra e44b87dd31 * Pass --no-sessions to Upstart to make sure users cannot start
Upstart jobs (even when Upstart has attached to D-Bus).

svn path=/nixos/trunk/; revision=33617
2012-04-05 12:27:21 +00:00
Lluís Batlle i Rossell f4883572d8 Making the init interactive shells handle well console kernel parameters
with extra parameters, like console=ttyS0,115200.


svn path=/nixos/trunk/; revision=33458
2012-03-28 19:58:44 +00:00
Lluís Batlle i Rossell 9fb07d4036 Making a reference single-quoted for grubDevices, as after substitution, there
will be doublequoted elements.

Suggested by Kirelagin.


svn path=/nixos/trunk/; revision=33403
2012-03-25 12:36:43 +00:00
Eelco Dolstra 43b5ced96c * Ignore SIGHUP and write errors on stderr to ensure that
switch-to-configuration runs to completion (e.g. if the tty we're on
  got killed).

svn path=/nixos/trunk/; revision=33382
2012-03-23 13:37:22 +00:00
Eelco Dolstra 293e3a784d * Ensure a consitent umask in the activation script (reported by
Lluís).

svn path=/nixos/trunk/; revision=33347
2012-03-22 10:17:10 +00:00
Eelco Dolstra 6f03065dce * Move the setting of $MODULE_DIR to modprobe.nix.
* Add a slash to the end of $MODULE_DIR, as expected by depmod.  (Not
  that running depmod from the command line is all that useful, since
  you can't use it to update the tree in the Nix store.  But at least
  commands like "depmod -n" work now.)  Reported by Kirill Elagin on
  IRC.

svn path=/nixos/trunk/; revision=33312
2012-03-20 22:02:27 +00:00
Eelco Dolstra e86427f037 * Remove an obsolete line.
svn path=/nixos/trunk/; revision=33308
2012-03-20 21:43:13 +00:00
Eelco Dolstra d9e28560d1 * Emit "expect daemon" for the mountall task. Otherwise it may get a
USR1 signal before it has forked into the background (because it
  will be in the start/running state immediately).

svn path=/nixos/trunk/; revision=33288
2012-03-20 10:17:08 +00:00
Eelco Dolstra a51a83bd8c * Drop obsolete line.
svn path=/nixos/trunk/; revision=33276
2012-03-19 19:34:06 +00:00
Eelco Dolstra 533448ae37 * udev: don't set the STARTUP flag anymore, since LVM no longer uses
it.
* Don't call "vgscan" anymore; VG scans are supposed to be automatic.

svn path=/nixos/trunk/; revision=33275
2012-03-19 19:10:27 +00:00
Eelco Dolstra f546837cdf * Don't use replaceChars. It's slow.
svn path=/nixos/trunk/; revision=33270
2012-03-19 18:07:28 +00:00
Eelco Dolstra fcc2e985a2 * Handle jobs that fail while a post-start script is waiting for them.
svn path=/nixos/trunk/; revision=33269
2012-03-19 18:07:05 +00:00
Eelco Dolstra ebc6d7f435 * Attempt to fix the random "udevadm settle - timeout of 120 seconds
reached, the event queue contains: /sys/devices/virtual/tty/hvc1" VM
  failures.

svn path=/nixos/trunk/; revision=33259
2012-03-19 15:10:39 +00:00
Eelco Dolstra b1fd71038e * Slight speedup. It's amazing how quickly shell scripts become
slow: calling basename in a loop somewhere has a noticable impact on
  performance.  We really shouldn't use bash scripts.

svn path=/nixos/trunk/; revision=33242
2012-03-18 19:05:44 +00:00
Eelco Dolstra 8ca2aff772 * Get rid of some grep hackery on the Upstart jobs.
svn path=/nixos/trunk/; revision=33240
2012-03-18 18:53:50 +00:00
Eelco Dolstra 9ba5f09e44 * More tasks that shouldn't be restarted (though they're harmless).
svn path=/nixos/trunk/; revision=33238
2012-03-18 18:09:17 +00:00
Eelco Dolstra 4acc48fc2d * Mark tasks such as mount-failed as not to be restarted.
svn path=/nixos/trunk/; revision=33237
2012-03-18 18:04:49 +00:00
Eelco Dolstra 362d1389d3 * mountall: make the "console output" Upstart stanza do its work. We
were redirecting output to /var/log/upstart/<job>, so it didn't work
  properly.
* mountall-ip-up: send the USR1 signal to the mountall process by
  looking up its PID, rather than doing "pkill -USR1 mountall".  This
  prevents a very subtle race condition where USR1 is delivered to a
  child process of mountall (such as fsck), if pkill sees the child
  just before its execve().  There is actually still a race condition
  because mountall installs its USR1 handler *after* daemonising, so
  mountall-ip-up could accidentally kill mountall.  Should report this
  to upstream.

svn path=/nixos/trunk/; revision=33236
2012-03-18 17:48:19 +00:00
Eelco Dolstra 2cc8d0363e * Move the implementation of boot.kernelModules to udev's postStart.
It needs udevd to be running because the modules may require
  firmware.  Thanks to Mathijs and Arie for pointing this out.

svn path=/nixos/trunk/; revision=33234
2012-03-18 14:03:42 +00:00
Eelco Dolstra 21393eed1e * Use the --quiet flag.
svn path=/nixos/trunk/; revision=33225
2012-03-18 02:36:44 +00:00
Eelco Dolstra 86d8d62d16 * Allow Upstart jobs to declare that they shouldn't be restarted by
switch-to-configuration.  E.g. the X server shouldn't be restarted
  because that kills all the X clients.

svn path=/nixos/trunk/; revision=33223
2012-03-18 02:10:39 +00:00
Eelco Dolstra 3495a773f9 * Improved Upstart job handling in switch-to-configuration. It no
longer compares the current configuration to the previous
  configuration, but instead compares the current Upstart state to the
  intended state.  Thus, if the switch script is interrupted, running
  nixos-rebuild again will resume starting/stopping Upstart jobs where
  the previous run left off.

  We determine if an Upstart job has changed by having the pre-start
  script of each Upstart job put a symlink to its .conf file in
  /var/run/upstart-jobs.  So if this symlink differs from the target
  of /etc/init/<job>.conf, then the job has changed.  This also
  prevents multiple restarts of dependent jobs.  E.g., if job B has
  "start on started A" and "stop on stopping A", then restarting A
  will cause B to be restarted, so B shouldn't B restarted a second
  time.

  We only start jobs that are not running if 1) they're tasks that
  have been previously run (like mountall); or 2) they're jobs that
  have a "start on" condition.  This seems a reasonable heuristic.

svn path=/nixos/trunk/; revision=33222
2012-03-18 01:53:35 +00:00
Eelco Dolstra ee6c9bb998 * Provide two utility functions in Upstart jobs: "ensure JOBNAME"
starts the given job and waits until it's running; "stop_check"
  checks that the current job hasn't been asked to stop.

svn path=/nixos/trunk/; revision=33214
2012-03-17 19:12:33 +00:00
Eelco Dolstra 573877c1ac * Use boot.kernelModules everywhere instead of explicit calls to
modprobe.
* Move the implementation of boot.kernelModules from the udev job to
  the activation script.  This prevents races with the udev job.
* Drop references to the "capability" kernel module, which no longer
  exists.

svn path=/nixos/trunk/; revision=33208
2012-03-17 17:26:17 +00:00
Shea Levy 8ad872ca03 Revert r33139
I didn't end up needing it and there's a better way to do what I wanted if I
did.

svn path=/nixos/trunk/; revision=33150
2012-03-16 12:01:08 +00:00
Shea Levy b89a65e54c Allow multiple definitions of boot.loader.kernelFile as long as they are all the same
svn path=/nixos/trunk/; revision=33139
2012-03-16 03:20:12 +00:00
Shea Levy 001fcad421 First shot at EFI booting.
Note: This feature is INCOMPLETE. Moreover, when runEfibootmgr is true it will
MODIFY NVRAM and, on Apple systems, possibly brick your firmware. PLEASE be
careful while further testing is performed

svn path=/nixos/trunk/; revision=33047
2012-03-13 19:27:59 +00:00
Lluís Batlle i Rossell dd6eb81797 Adding /etc/mdadm.conf, with the contents supplied at boot.initrd.mdadmConf.
This allows setting a fixed device name per array, thus ensuring that at boot,
the arrays will always be mounted with the same names. I think this allows
solving the problem of grub getting confused about softraid device names
(prefix and root), if the devices always get the same naming at initrd.


svn path=/nixos/trunk/; revision=33033
2012-03-13 13:26:21 +00:00
Eelco Dolstra b6d43e1aca * Fix Amazon image generation (broken by r32913).
svn path=/nixos/trunk/; revision=33032
2012-03-13 13:17:43 +00:00
Eelco Dolstra 7281a851b3 * Create a /usr/bin/env symlink. This allows scripts from other
distributions with shebang lines such as

    #! /usr/bin/env python

  to work correctly.

svn path=/nixos/trunk/; revision=33011
2012-03-12 10:41:39 +00:00
Lluís Batlle i Rossell 9e980235bd Properly filter a possible lack of "grub.device", in case of using only "grub.devices".
svn path=/nixos/trunk/; revision=33009
2012-03-12 09:42:24 +00:00
Lluís Batlle i Rossell 3c0fdaf877 Adding /dev/tty to the stage1, so 'more' and 'less' now page well.
svn path=/nixos/trunk/; revision=33006
2012-03-11 23:04:29 +00:00
Lluís Batlle i Rossell ee163c2c80 Making the stage2 interpreter bash non-interactive, while keeping the
interactive shell with bash interactive. Suggested by Eelco.


svn path=/nixos/trunk/; revision=33005
2012-03-11 22:43:37 +00:00
Lluís Batlle i Rossell 1a48572b75 Disabling the initrd extra tools by default, until further review.
svn path=/nixos/trunk/; revision=33004
2012-03-11 22:28:31 +00:00
Lluís Batlle i Rossell 2fc537277b Removing a 'set -x' in the stage1 extra tools.
svn path=/nixos/trunk/; revision=33003
2012-03-11 22:26:01 +00:00
Lluís Batlle i Rossell d2e2bb4bc4 Typo
svn path=/nixos/trunk/; revision=33002
2012-03-11 22:07:37 +00:00
Lluís Batlle i Rossell 331b1f46d3 Making the stage2 'debug2' spawn a shell with job control, like in stage1, running it in a
virtual terminal and not in the console. This brings wonderful things like ^C.


svn path=/nixos/trunk/; revision=33001
2012-03-11 22:01:46 +00:00
Lluís Batlle i Rossell bbebba68f7 A more friendly stage1, with interactive bash, busybox plenty of tools, etc.
I set it as default because users can benefit of this without having to prepare
their nixos first, and I don't think it will break any nixos for the initrd
size increase.

It can be disabled with 'boot.initrd.withExtraTools = false'.


svn path=/nixos/trunk/; revision=33000
2012-03-11 21:56:47 +00:00
Lluís Batlle i Rossell 6a0958cc06 Making stage2 get a full interactive bash for the stage2 init, so there the shell has readline,
jobs, etc.


svn path=/nixos/trunk/; revision=32999
2012-03-11 21:50:35 +00:00
Eelco Dolstra 03ebb883d1 * Modularize filesystem support. Filesystems such as btrfs and
reiserfs now have separate modules that are conditional on
  boot.supportedFilesystems and boot.initrd.supportedFilesystems.
  By default, these include the filesystems specified in the fsType
  attribute in fileSystems.  Ext2/3/4 support is currently
  unconditional.

  Also unbreak the installer test (http://hydra.nixos.org/build/2272302). 

svn path=/nixos/trunk/; revision=32954
2012-03-09 14:37:58 +00:00
Lluís Batlle i Rossell 13ac0a309b Allow a way to install grub to multiple devices (for /boot on soft raid arrays).
svn path=/nixos/trunk/; revision=32913
2012-03-08 21:37:30 +00:00
Lluís Batlle i Rossell 98dde13782 If enabling luks on initrd, also adding cryptsetup to system packages. I think it's useful.
svn path=/nixos/trunk/; revision=32910
2012-03-08 20:49:26 +00:00
Lluís Batlle i Rossell 1adaabef58 Adding an option to luksroot, so it allows to define whether to launch cryptsetup after or before LVM.
To allow dmcrypt over lvm and lvm over dmcrypt.


svn path=/nixos/trunk/; revision=32784
2012-03-04 21:00:35 +00:00
Eelco Dolstra 8935db253c * Upstart jobs: don't emit a description if there is none.
svn path=/nixos/trunk/; revision=32775
2012-03-04 16:17:56 +00:00
Mathijs Kwik dc8ca0ea4a upstart: options for setuid and setgid
as jobs running as different users cannot create their logfile, I moved that to an activationScript

svn path=/nixos/trunk/; revision=32762
2012-03-04 12:58:06 +00:00
Lluís Batlle i Rossell 79d4b11aeb Making the luks thing of initrd a bit more flexible. I used it to get a
ciphered swap, where I could hibernate ciphered.


svn path=/nixos/trunk/; revision=32754
2012-03-03 16:07:18 +00:00
Eelco Dolstra ee0769cc42 * If debug2 is passed on the kernel command line, run Upstart with
the --verbose flag to see what it's doing.

svn path=/nixos/trunk/; revision=32747
2012-03-02 16:37:28 +00:00