Commit graph

337 commits

Author SHA1 Message Date
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 63742a942e Don't create /var/log/upstart/<jobname> unless necessary 2012-07-18 17:09:00 -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 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 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 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
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 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
Eelco Dolstra 2821289aeb * Ugly hack: force udev to exit to prevent random "Device or resource
busy while trying to open /dev/xvda" errors from fsck.

svn path=/nixos/trunk/; revision=33766
2012-04-12 18:01:19 +00:00
Peter Simons ec3dca188c Dropped the unused/unknown/obsolete module i8042 from 'boot.initrd.kernelModules'.
svn path=/nixos/trunk/; revision=33654
2012-04-06 19:21:50 +00:00
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