nixpkgs/nixos/modules/system/boot
Ricardo M. Correia e9affb4274 nixos: Add system-wide option to set the hostid
The old boot.spl.hostid option was not working correctly due to an
upstream bug.

Instead, now we will create the /etc/hostid file so that all applications
(including the ZFS kernel modules, ZFS user-space applications and other
unrelated programs) pick-up the same system-wide host id. Note that glibc
(and by extension, the `hostid` program) also respect the host id configured in
/etc/hostid, if it exists.

The hostid option is now mandatory when using ZFS because otherwise, ZFS will
require you to force-import your ZFS pools if you want to use them, which is
undesirable because it disables some of the checks that ZFS does to make sure it
is safe to import a ZFS pool.

The /etc/hostid file must also exist when booting the initrd, before the SPL
kernel module is loaded, so that ZFS picks up the hostid correctly.

The complexity in creating the /etc/hostid file is due to having to
write the host ID as a 32-bit binary value, taking into account the
endianness of the machine, while using only shell commands and/or simple
utilities (to avoid exploding the size of the initrd).
2014-11-12 22:31:49 +01:00
..
loader Add cryptodisk support for Grub 2014-09-24 21:48:55 +01:00
emergency-mode.nix nixos: tmp on tmpfs option 2014-07-30 16:19:26 +02:00
kernel.nix initrd.availableKernelModules: add support for keyboards 2014-08-12 20:00:01 +02:00
kexec.nix Move all of NixOS to nixos/ in preparation of the repository merge 2013-10-10 13:28:20 +02:00
luksroot.nix Remove useless use of optionSet. 2014-08-29 18:43:03 +02:00
modprobe.nix Load EHCI befor OHCI and UHCI; from patch by Mathnerd314 2014-09-02 02:12:46 +04:00
pbkdf2-sha512.c Update to the Yubikey PBA 2014-02-08 14:59:52 +01:00
readonly-mountpoint.c Move all of NixOS to nixos/ in preparation of the repository merge 2013-10-10 13:28:20 +02:00
shutdown.nix Don't run hwclock if /dev/rtc doesn't exist 2014-05-05 16:47:51 +02:00
stage-1-init.sh nixos: Add system-wide option to set the hostid 2014-11-12 22:31:49 +01:00
stage-1.nix nixos: Add system-wide option to set the hostid 2014-11-12 22:31:49 +01:00
stage-2-init.sh Containers: Don't remount / 2014-08-18 17:14:43 +02:00
stage-2.nix nixos: tmp on tmpfs option 2014-07-30 16:19:26 +02:00
systemd-unit-options.nix Replace hasAttr/getAttr calls with the ? and . operators 2014-10-05 01:11:06 +02:00
systemd.nix nixos/systemd: Also escape \ characters 2014-10-19 16:34:53 -07:00
tmp.nix nixos: tmp on tmpfs option 2014-07-30 16:19:26 +02:00