Merge pull request #4807 from wizeman/u/zfs-improvements
ZFS improvements
This commit is contained in:
@@ -122,6 +122,9 @@ for o in $(cat /proc/cmdline); do
|
||||
esac
|
||||
done
|
||||
|
||||
# Set hostid before modules are loaded.
|
||||
# This is needed by the spl/zfs modules.
|
||||
@setHostId@
|
||||
|
||||
# Load the required kernel modules.
|
||||
mkdir -p /lib
|
||||
|
||||
@@ -188,6 +188,15 @@ let
|
||||
fsInfo =
|
||||
let f = fs: [ fs.mountPoint (if fs.device != null then fs.device else "/dev/disk/by-label/${fs.label}") fs.fsType fs.options ];
|
||||
in pkgs.writeText "initrd-fsinfo" (concatStringsSep "\n" (concatMap f fileSystems));
|
||||
|
||||
setHostId = optionalString (config.networking.hostId != null) ''
|
||||
hi="${config.networking.hostId}"
|
||||
${if pkgs.stdenv.isBigEndian then ''
|
||||
echo -ne "\x''${hi:0:2}\x''${hi:2:2}\x''${hi:4:2}\x''${hi:6:2}" > /etc/hostid
|
||||
'' else ''
|
||||
echo -ne "\x''${hi:6:2}\x''${hi:4:2}\x''${hi:2:2}\x''${hi:0:2}" > /etc/hostid
|
||||
''}
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user