Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 01bcf3f2f22f
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c9ab6a583538
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Apr 25, 2018

  1. growPartition: fix volume resizing on EC2 NVME instances

    The previous code for this accidentally picked up a "p" when computing the partition number.
    This logic should be more robust
    
    fixes #39491
    
    (cherry picked from commit 3a47c7e)
    Ihor Antonov authored and Mic92 committed Apr 25, 2018
    Copy the full SHA
    c9ab6a5 View commit details
Showing with 9 additions and 2 deletions.
  1. +9 −2 nixos/modules/system/boot/grow-partition.nix
11 changes: 9 additions & 2 deletions nixos/modules/system/boot/grow-partition.nix
Original file line number Diff line number Diff line change
@@ -32,8 +32,15 @@ with lib;
rootDevice="${config.fileSystems."/".device}"
if [ -e "$rootDevice" ]; then
rootDevice="$(readlink -f "$rootDevice")"
parentDevice="$(lsblk -npo PKNAME "$rootDevice")"
TMPDIR=/run sh $(type -P growpart) "$parentDevice" "''${rootDevice#$parentDevice}"
parentDevice="$rootDevice"
while [ "''${parentDevice%[0-9]}" != "''${parentDevice}" ]; do
parentDevice="''${parentDevice%[0-9]}";
done
partNum="''${rootDevice#''${parentDevice}}"
if [ "''${parentDevice%[0-9]p}" != "''${parentDevice}" ] && [ -b "''${parentDevice%p}" ]; then
parentDevice="''${parentDevice%p}"
fi
TMPDIR=/run sh $(type -P growpart) "$parentDevice" "$partNum"
udevadm settle
fi
'';