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: 159b63aac0d0
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: 7aee0dac1f09
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Apr 25, 2018

  1. Fix root volume resizing on EC2 KVM instances (M5, C5, etc) (#39488)

    (cherry picked from commit 3a47c7e)
    ngortheone authored and Mic92 committed Apr 25, 2018

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    dhess Drew Hess
    Copy the full SHA
    7aee0da View commit details
Showing with 9 additions and 2 deletions.
  1. +9 −2 nixos/modules/virtualisation/grow-partition.nix
11 changes: 9 additions & 2 deletions nixos/modules/virtualisation/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
'';