Commit graph

65 commits

Author SHA1 Message Date
Shea Levy be4f69519b iso-image: Use unionfs-fuse instead of aufs 2012-12-16 11:31:52 -05:00
Eelco Dolstra b1da38f564 Merge remote-tracking branch 'origin/master' into systemd 2012-11-30 16:12:04 +01:00
Lluís Batlle i Rossell 82d39c9ca4 Fixing stage1 about getting a shell with job control in case of error
It's a busybox faq:
http://www.busybox.net/FAQ.html#job_control
2012-10-24 21:49:10 +02:00
Eelco Dolstra 3ad370ae0a Merge remote-tracking branch 'origin/master' into systemd
Conflicts:
	modules/misc/ids.nix
	modules/services/mail/postfix.nix
	modules/services/system/nscd.nix
	modules/services/x11/desktop-managers/xfce.nix
	modules/system/boot/stage-1.nix
2012-09-28 11:35:27 -04:00
Eelco Dolstra 08f14b33c1 Merge branch 'master' of github.com:NixOS/nixos into systemd 2012-08-20 11:27:38 -04:00
Eelco Dolstra 88bfdca8e0 stage-1: Use systemd-udevd instead of the old udevd 2012-08-14 15:31:15 -04:00
aszlig c9e05f1ed8 stage-1: Load boot-time keymap by default.
This also removes the configuration option, as suggested by @edolstra.
2012-08-12 16:54:31 +02: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
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 d4fec178fd Merge remote-tracking branch 'origin/master' into systemd 2012-08-02 13:44:16 -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
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 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
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 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 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
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
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
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 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
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 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
Florian Friesdorf 90756a787c add preLVMCommands hook
svn path=/nixos/trunk/; revision=31130
2011-12-28 21:46:45 +00:00
Eelco Dolstra 926091c265 * Make the permissions on /run less liberal.
svn path=/nixos/trunk/; revision=30065
2011-10-27 17:34:16 +00:00
Nicolas Pierron 38bc39c299 Add support for NFS root file system.
Patch by Rickard Nilsson.

svn path=/nixos/trunk/; revision=29855
2011-10-15 21:01:30 +00:00
Eelco Dolstra 3fa2bbd029 * Properly shut down udevd in stage 1. Otherwise there is a slight
possibility that a udevd process survives, preventing udevd from
  starting in stage 2:

  machine# udevd[1421]: bind failed: Address already in use
  machine# udevd[1421]: error binding udev control socket

svn path=/nixos/trunk/; revision=29434
2011-09-22 08:26:58 +00:00
Peter Simons a499049ce5 Strip trailing whitespace.
svn path=/nixos/trunk/; revision=29246
2011-09-13 18:49:50 +00:00
Peter Simons d3528a3c4e modules/system/boot/stage-1-init.sh: added "boot.runSize" option to determine the maximum size of the /run tmpfs
svn path=/nixos/trunk/; revision=29245
2011-09-13 18:49:47 +00:00
Eelco Dolstra 1e5bd11a53 * Create /run in the initrd and bind-mount it into the target root.
This allows Udev to share its database between stage 1 and 2, which
  in turn is expected by the LVM Udev rules.

svn path=/nixos/trunk/; revision=27926
2011-07-24 23:36:30 +00:00
Eelco Dolstra 97a37f7c12 * "stage1panic" -> "stage1panic=1" to get rid of a harmless warning.
svn path=/nixos/trunk/; revision=26756
2011-04-08 14:42:35 +00:00
Michael Raskin 295df77f21 Move resume section after udev launch - on some systems devices are recognized by kernel only after udev works.
svn path=/nixos/trunk/; revision=23176
2010-08-14 20:12:05 +00:00
Eelco Dolstra e8e7ee356c * In the installation CD, pass the label of the CD through the
root=... kernel command line parameter, instead of hard-coding it in
  `fileSystems'.  This is to allow CD-to-USB converters such as
  UNetbootin to rewrite the kernel command line to the label or UUID
  of the USB stick.

svn path=/nixos/trunk/; revision=23024
2010-08-07 14:16:18 +00:00
Eelco Dolstra d659488209 * Use the regular GRUB menu builder for Amazon. There are two issues:
we want to generate the GRUB menu without actually installing GRUB
  (because Amazon supplies its own pv-grub), and each menu entry
  requires "root (hd0)".  For the first, allow boot.loader.grub.device
  to be set to "nodev" to indicate that the GRUB menu should be
  generated without installing GRUB.  For the second, add an option
  boot.loader.grub.extraPerEntryConfig to allow commands to be added
  to each GRUB menu entry (in this case, "root (hd0)").

svn path=/nixos/trunk/; revision=22712
2010-07-22 14:40:29 +00:00
Eelco Dolstra 63962dd7d6 * Disable the test to see whether $stage2Init exists. For some
unfathomable reason this test fails on EC2 if it's a symlink
  (despite the -L test).  I give up.

svn path=/nixos/trunk/; revision=22676
2010-07-20 13:49:04 +00:00
Eelco Dolstra b076121430 * Don't use the -v flag because not every fsck backend knows it.
svn path=/nixos/trunk/; revision=22512
2010-07-07 14:25:16 +00:00
Eelco Dolstra dc49a0ce3f * Don't use klibc in the initrd. It's simpler (and slightly smaller)
to use the standard (coreutils) tools.
* Use util-linux's `switch_root' to switch over to the target root
  FS.  It automatically moves over the /dev, /proc and /sys from stage
  1, so stage 2 doesn't need to set them up again.

svn path=/nixos/trunk/; revision=22085
2010-06-01 15:53:24 +00:00
Eelco Dolstra 7484774172 * Activate software RAID devices from udev. This makes the swraid
Upstart jobs unnecessary.
* Support having the root filesystem on swraid.

svn path=/nixos/trunk/; revision=21807
2010-05-16 20:40:04 +00:00
Eelco Dolstra edee370883 * The default action for udevadm trigger' changed from add' to
`change'.  At boot time, however, we want an `add' event to trigger
  certain rules (e.g. LVM and mdadm).

svn path=/nixos/trunk/; revision=21804
2010-05-16 19:02:45 +00:00
Eelco Dolstra ee005424bf * Doh, subtle race condition: STARTUP must be cleared after "udevadm
settle".  Otherwise some rules may be processed with STARTUP
  cleared, causing LVM devices not to be created.

svn path=/nixos/trunk/; revision=19341
2010-01-10 20:08:35 +00:00
Eelco Dolstra ac8a2ae577 * Use the LVM udev rules in stage 1. This makes
/dev/disk/by-{label,uuid} paths available for LVM volumes.

svn path=/nixos/trunk/; revision=19334
2010-01-10 19:00:29 +00:00
Eelco Dolstra e50a7e5f32 * Removed the boot.initrd.lvm option for simplicity.
svn path=/nixos/trunk/; revision=19330
2010-01-10 16:32:30 +00:00
Eelco Dolstra 39796e26b4 * Removed the boot.isLiveCD option. Moved the code for mounting a
tmpfs on top of the CD to iso-image.nix.

svn path=/nixos/trunk/; revision=19318
2010-01-09 15:13:06 +00:00
Eelco Dolstra c9e4b46d48 * Ugly hack: for CIFS mounts, retry the mount a few times (just as in
pkgs/build-support/vm).  This should make the NixOS regression tests
  more robust on heavily loaded systems, where they now frequently
  fail:

  server# mounting //10.0.2.4/qemu on /hostfs...
  server# [    8.233991] Slow work thread pool: Starting up
  server# [    8.234721] Slow work thread pool: Ready
  server# [   23.271708]  CIFS VFS: No response for cmd 114 mid 1
  server# [   23.272443]  CIFS VFS: cifs_mount failed w/return code = -112
  server# mount: Host is down
  server# [   23.275188] Kernel panic - not syncing: Attempted to kill init!

  Maybe there is a configurable timeout somewhere, which would be much
  nicer...

svn path=/nixos/trunk/; revision=19248
2010-01-06 00:25:14 +00:00
Eelco Dolstra 170331be30 * Don't use /hostfs to signal the test driver that a VM is up, but
write some magic string to ttyS0.  This removes the dependency on
  having a CIFS mount.
* Use a thread to process the stdout/stderr of each QEMU instance.
* Add a kernel command line parameter "stage1panic" to tell stage 1 to
  panic if an error occurs.  This is faster than waiting until
  connect() times out.

svn path=/nixos/trunk/; revision=19212
2010-01-04 18:04:57 +00:00