Commit Graph

65 Commits

Author SHA1 Message Date
Eelco Dolstra
3e6bb7d1de Move setting ownership of /nix/store to stage-2-init
This is necessary because the store might be bind-mounted read-only.
2012-09-28 10:59:58 -04:00
Eelco Dolstra
a139fa14b1 Optionally make the Nix store read-only to enforce immutability
This will be the default once Nix 1.2 is released.
2012-09-25 16:33:21 -04:00
Eelco Dolstra
83c6b1cf3a Set $LOCALE_ARCHIVE in systemd services
Systemd sets locale variables like $LANG when running services, so
$LOCALE_ARCHIVE should also be set to prevent warnings like "perl:
warning: Setting locale failed.".
2012-09-18 18:12:39 -04:00
Eelco Dolstra
aac6fe44b6 Merge branch 'master' of github.com:NixOS/nixos into systemd 2012-09-11 10:58:57 -04:00
Mathijs Kwik
aba9f76105 change permission of /run/lock to allow non-root access to subdirectories 2012-08-26 10:17:22 +02:00
Eelco Dolstra
08f14b33c1 Merge branch 'master' of github.com:NixOS/nixos into systemd 2012-08-20 11:27:38 -04:00
Eelco Dolstra
7a7d04af8a systemd: Use the kernel modules from /run/booted-system
This prevents failures in systemd-modules-load.service like "Failed to
lookup alias 'ipv6': Function not implemented".
2012-08-14 17:09:44 -04:00
Eelco Dolstra
4475294f57 Fix a hang during shutdown
Subtle: dhcpcd.service would call resolvconf during shutdown, which in
turn would start invalidate-nscd.service, causing the shutdown to be
cancelled.  Instead, give nscd.service a proper reload action, and do
"systemctl reload --no-block nscd.service".  The --no-block is
necessary to prevent that command from waiting until a timeout occurs
(bug in systemd?).
2012-08-14 16:45:50 -04:00
Lluís Batlle i Rossell
746b572ee6 stage2init: fix respecting 'noatime' mount options for /
We had a "mount -o remount,rw none /" that was setting back 'relatime',
although we had set 'noatime' at initrd mount. Removing the word 'none' fixed
it.

Specifying a device (in this case 'none'), makes mount to forget previous
device options. According to manpage, it says not to read fstab or mtab. But the
effect is that of setting 'relatime', if it was mounted 'noatime.
2012-08-10 20:51:13 +02: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
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
e64bdda52b Don't use weird 777 permissions on unmounted /dev/shm 2012-06-27 09:35:53 -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
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
ab86759eb3 Use kmod instead of module-init-tools 2012-06-15 14:18:26 -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
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
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
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
Eelco Dolstra
e86427f037 * Remove an obsolete line.
svn path=/nixos/trunk/; revision=33308
2012-03-20 21:43:13 +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
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
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
Eelco Dolstra
f61ad97833 * Run the stage 2 debug shell at a more useful point (just before
starting Upstart).  This also causes $PATH to be set to something
  more sensible.

svn path=/nixos/trunk/; revision=32740
2012-03-02 13:17:05 +00:00
Eelco Dolstra
a218a602d4 * Use openresolv to set the static nameserver configuration. Next
step is to get the DHCP client, OpenVPN etc. to use openresolv as
  well.

svn path=/nixos/trunk/; revision=32411
2012-02-20 00:00:50 +00:00
Eelco Dolstra
fe566d84ae * Remove references to the "safemode" boot option, which doesn't do
anything.

svn path=/nixos/trunk/; revision=30199
2011-11-03 00:46:29 +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
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
14636ba057 * The Powers That Be have decided that there shall be a /run to
replace /var/run and /var/lock.  For instance, udev now keeps state
  in /run/udev instead of /dev/.udev.  See

    http://lists.fedoraproject.org/pipermail/devel/2011-March/150031.html
    http://bugs.freestandards.org/show_bug.cgi?id=718

  So this patch creates /run as a tmpfs, and symlinks /var/run to /run
  and /var/lock to /run/lock.

  TODO: create /run in stage 1 and propagate it to stage 2.    

svn path=/nixos/trunk/; revision=27803
2011-07-16 19:27:45 +00:00
Eelco Dolstra
c4f910f550 * Substitute the path of the system derivation directly in the stage 2
init script.  This removes the need for the `systemConfig' boot
  parameter; `init=<stage-2-init>' is enough.  However, the GRUB menu
  builder still needs to add `systemConfig' to the kernel command line
  for compatibility with old configurations.

svn path=/nixos/trunk/; revision=23775
2010-09-13 22:10:25 +00:00
Eelco Dolstra
4046056cdc * In the activation script, don't require the path to the "system"
derivation on the command line.

svn path=/nixos/trunk/; revision=23770
2010-09-13 18:19:15 +00:00
Eelco Dolstra
f067d179ab * Create /nix/var/nix/gcroots/tmp in the activation script. The
build hook uses this directory to store temporary GC roots.  (It
  creates it if it doesn't exist, but it's better to do it here as
  well to ensure the right ownership and permissions.)
* Clear /nix/var/nix/gcroots/tmp and /nix/var/nix/temproots at boot
  time.

svn path=/nixos/trunk/; revision=23417
2010-08-25 11:59:04 +00:00
Eelco Dolstra
e41e6a65bb * Make sure that /tmp/.ICE-unix is owned by root and has 1777
permissions.  Otherwise it ends up being owned by the first user to
  log in, and other users' iceauth calls fail.

svn path=/nixos/trunk/; revision=23052
2010-08-09 10:59:20 +00:00
Eelco Dolstra
1b04d3a813 * Absolutise $systemConfig in case it's a symlink.
svn path=/nixos/trunk/; revision=22677
2010-07-20 13:50:10 +00:00
Eelco Dolstra
bfe46a653b * Mount /dev, /proc and /sys when booting without a stage 1 (e.g. on
Amazon).

svn path=/nixos/trunk/; revision=22598
2010-07-14 10:55:45 +00:00
Eelco Dolstra
d43d321e86 * Sync with the trunk.
svn path=/nixos/branches/boot-order/; revision=22349
2010-06-20 20:54:31 +00:00
Eelco Dolstra
a5c433696c * Put all of /var/run (not just /var/run/nscd) on a tmpfs to simplify
shutdown.  (Portmap and statd are needed during shutdown to unmount
  NFS volumes but have open files in /var/run.)
* In the shutdown job, don't kill PIDs belonging to Upstart jobs that
  are still running.  If they don't stop on the "starting shutdown"
  event, then they're needed during shutdown (such as portmap and
  statd).
* NFS test: test whether the shutdown quickly unmounts NFS volumes
  (i.e. whether portmap and statd are still running).

svn path=/nixos/branches/boot-order/; revision=22204
2010-06-09 22:29:06 +00:00
Eelco Dolstra
3eac003800 * Maintain /var/log/wtmp correctly during boot/shutdown.
svn path=/nixos/branches/boot-order/; revision=22182
2010-06-08 12:48:16 +00:00
Eelco Dolstra
95a9c5dd77 * Log the standard output/error of Upstart jobs to
/var/log/upstart/<jobname> rather than spamming the console with it.

svn path=/nixos/trunk/; revision=22093
2010-06-01 19:44:23 +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