diff options
author | Nikolay Amiantov <ab@fmap.me> | 2016-08-27 13:29:38 +0300 |
---|---|---|
committer | Nikolay Amiantov <ab@fmap.me> | 2016-08-27 13:38:20 +0300 |
commit | 6efcfe03ae4ef426b77a6827243433b5296613a4 (patch) | |
tree | d71e9494714de0dd1d4c5e05aedfa2c35d58a9e7 /nixos/modules/system/activation | |
parent | 3f70fcd4c1512345a5a8a5e41da8a83839a1b16e (diff) | |
download | nixlib-6efcfe03ae4ef426b77a6827243433b5296613a4.tar nixlib-6efcfe03ae4ef426b77a6827243433b5296613a4.tar.gz nixlib-6efcfe03ae4ef426b77a6827243433b5296613a4.tar.bz2 nixlib-6efcfe03ae4ef426b77a6827243433b5296613a4.tar.lz nixlib-6efcfe03ae4ef426b77a6827243433b5296613a4.tar.xz nixlib-6efcfe03ae4ef426b77a6827243433b5296613a4.tar.zst nixlib-6efcfe03ae4ef426b77a6827243433b5296613a4.zip |
nixos filesystems: unify early filesystems handling
A new internal config option `fileSystems.<name>.early` is added to indicate that the filesystem needs to be loaded very early (i.e. in initrd). They are transformed to a shell script in `system.build.earlyMountScript` with calls to an undefined `specialMount` function, which is expected to be caller-specific. This option is used by stage-1, stage-2 and activation script to set up and remount those filesystems. Options for them are updated according to systemd defaults.
Diffstat (limited to 'nixos/modules/system/activation')
-rw-r--r-- | nixos/modules/system/activation/activation-script.nix | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/nixos/modules/system/activation/activation-script.nix b/nixos/modules/system/activation/activation-script.nix index 4489e34831da..1c587413121e 100644 --- a/nixos/modules/system/activation/activation-script.nix +++ b/nixos/modules/system/activation/activation-script.nix @@ -154,9 +154,15 @@ in system.activationScripts.tmpfs = '' - ${pkgs.utillinux}/bin/mount -o "remount,size=${config.boot.devSize}" none /dev - ${pkgs.utillinux}/bin/mount -o "remount,size=${config.boot.devShmSize}" none /dev/shm - ${pkgs.utillinux}/bin/mount -o "remount,size=${config.boot.runSize}" none /run + specialMount() { + local device="$1" + local mountPoint="$2" + local options="$3" + local fsType="$4" + + ${pkgs.utillinux}/bin/mount -t "$fsType" -o "remount,$options" "$device" "$mountPoint" + } + source ${config.system.build.earlyMountScript} ''; }; |