diff options
author | Jörg Thalheim <Mic92@users.noreply.github.com> | 2019-01-17 07:42:32 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-17 07:42:32 +0000 |
commit | a6b97bd1bbce75b0a6a2baa83126b603696e500e (patch) | |
tree | 4a1dfed1cfa17287aa8c69d1d55556de5983519c /nixos/modules | |
parent | c052da08dcb3235ee0e3f7c353fc9a664b12dbef (diff) | |
parent | 62d21f251194ba93541239adc22afd0fb4f38f71 (diff) | |
download | nixpkgs-a6b97bd1bbce75b0a6a2baa83126b603696e500e.tar nixpkgs-a6b97bd1bbce75b0a6a2baa83126b603696e500e.tar.gz nixpkgs-a6b97bd1bbce75b0a6a2baa83126b603696e500e.tar.bz2 nixpkgs-a6b97bd1bbce75b0a6a2baa83126b603696e500e.tar.lz nixpkgs-a6b97bd1bbce75b0a6a2baa83126b603696e500e.tar.xz nixpkgs-a6b97bd1bbce75b0a6a2baa83126b603696e500e.tar.zst nixpkgs-a6b97bd1bbce75b0a6a2baa83126b603696e500e.zip |
Merge pull request #42183 from kisik21/master
nixos/stage-1, nixos/f2fs: added F2FS resizing
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/system/boot/stage-1-init.sh | 4 | ||||
-rw-r--r-- | nixos/modules/system/boot/stage-1.nix | 4 | ||||
-rw-r--r-- | nixos/modules/tasks/filesystems/f2fs.nix | 6 |
3 files changed, 12 insertions, 2 deletions
diff --git a/nixos/modules/system/boot/stage-1-init.sh b/nixos/modules/system/boot/stage-1-init.sh index 6a4ac8128ab..6dafc6cddde 100644 --- a/nixos/modules/system/boot/stage-1-init.sh +++ b/nixos/modules/system/boot/stage-1-init.sh @@ -340,6 +340,10 @@ mountFS() { echo "resizing $device..." e2fsck -fp "$device" resize2fs "$device" + elif [ "$fsType" = f2fs ]; then + echo "resizing $device..." + fsck.f2fs -fp "$device" + resize.f2fs "$device" fi ;; esac diff --git a/nixos/modules/system/boot/stage-1.nix b/nixos/modules/system/boot/stage-1.nix index e7167999a6f..c8ea1401528 100644 --- a/nixos/modules/system/boot/stage-1.nix +++ b/nixos/modules/system/boot/stage-1.nix @@ -127,8 +127,8 @@ let copy_bin_and_libs ${pkgs.kmod}/bin/kmod ln -sf kmod $out/bin/modprobe - # Copy resize2fs if needed. - ${optionalString (any (fs: fs.autoResize) fileSystems) '' + # Copy resize2fs if any ext* filesystems are to be resized + ${optionalString (any (fs: fs.autoResize && (lib.hasPrefix "ext" fs.fsType)) fileSystems) '' # We need mke2fs in the initrd. copy_bin_and_libs ${pkgs.e2fsprogs}/sbin/resize2fs ''} diff --git a/nixos/modules/tasks/filesystems/f2fs.nix b/nixos/modules/tasks/filesystems/f2fs.nix index d103ff1a57b..a305235979a 100644 --- a/nixos/modules/tasks/filesystems/f2fs.nix +++ b/nixos/modules/tasks/filesystems/f2fs.nix @@ -4,6 +4,7 @@ with lib; let inInitrd = any (fs: fs == "f2fs") config.boot.initrd.supportedFilesystems; + fileSystems = filter (x: x.fsType == "f2fs") config.system.build.fileSystems; in { config = mkIf (any (fs: fs == "f2fs") config.boot.supportedFilesystems) { @@ -14,6 +15,11 @@ in boot.initrd.extraUtilsCommands = mkIf inInitrd '' copy_bin_and_libs ${pkgs.f2fs-tools}/sbin/fsck.f2fs + ${optionalString (any (fs: fs.autoResize) fileSystems) '' + # We need f2fs-tools' tools to resize filesystems + copy_bin_and_libs ${pkgs.f2fs-tools}/sbin/resize.f2fs + ''} + ''; }; } |