1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-19 20:21:14 +00:00
nixpkgs/nixos/modules/tasks
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
..
filesystems nixos: Add system-wide option to set the hostid 2014-11-12 22:31:49 +01:00
bcache.nix nixos: move bcache udev rule in a new bcache.nix module 2014-11-10 22:19:43 +01:00
cpu-freq.nix Remove non-cpufreq_* modules since they are loaded by udev. 2014-07-14 02:35:09 +02:00
encrypted-devices.nix Get all lib functions from lib, not pkgs.lib, in modules 2014-07-02 12:28:18 -04:00
filesystems.nix Mount unionfs-fuse filesystems using the normal fileSystems option 2014-07-30 16:04:15 +02:00
kbd.nix Allow upstream systemd units to be extended 2014-04-17 18:52:31 +02:00
lvm.nix Don't enable LVM2 in containers 2014-04-15 23:43:39 +02:00
network-interfaces.nix nixos: Add system-wide option to set the hostid 2014-11-12 22:31:49 +01:00
scsi-link-power-management.nix Rewrite ‘with pkgs.lib’ -> ‘with lib’ 2014-04-14 16:26:48 +02:00
swraid.nix nixos: Add boot.initrd.extraUdevRulesCommands 2014-11-10 22:19:43 +01:00
trackpoint.nix trackpoint: Add emulateWheel option 2014-08-13 12:11:20 +02:00
tty-backgrounds-combine.sh Another attempt to eradicate ensureDir 2014-06-30 14:56:10 +02:00