1
0

Compare commits

..

1 Commits

3 changed files with 7 additions and 3 deletions

6
flake.lock generated
View File

@@ -666,11 +666,11 @@
}, },
"nixpkgs_5": { "nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1758277210, "lastModified": 1753549186,
"narHash": "sha256-iCGWf/LTy+aY0zFu8q12lK8KuZp7yvdhStehhyX1v8w=", "narHash": "sha256-Znl7rzuxKg/Mdm6AhimcKynM7V3YeNDIcLjBuoBcmNs=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "8eaee110344796db060382e15d3af0a9fc396e0e", "rev": "17f6bd177404d6d43017595c5264756764444ab8",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -10,6 +10,7 @@ writeShellApplication {
text = builtins.readFile ./grow-last-partition-and-filesystem.sh; text = builtins.readFile ./grow-last-partition-and-filesystem.sh;
runtimeInputs = [ runtimeInputs = [
e2fsprogs e2fsprogs
gptfdisk
jq jq
parted parted
]; ];

View File

@@ -11,6 +11,9 @@ fi
DEVICE="$1" DEVICE="$1"
echo "Move GTP backup header to end of disk"
sgdisk "${DEVICE}" --move-second-header
PARTITIONDATA="$(parted --script --json --fix "${DEVICE}" print)" PARTITIONDATA="$(parted --script --json --fix "${DEVICE}" print)"
PARTNUMBER="$(echo "${PARTITIONDATA}" | jq -r '.disk.partitions | last | .number')" PARTNUMBER="$(echo "${PARTITIONDATA}" | jq -r '.disk.partitions | last | .number')"
PARTNAME="$(echo "${PARTITIONDATA}" | jq -r '.disk.partitions | last | .name')" PARTNAME="$(echo "${PARTITIONDATA}" | jq -r '.disk.partitions | last | .name')"