-
-
Save arianvp/2ef35b994b1dd6bbe3a20a501059e863 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> {}}: | |
let inherit (pkgs) stdenv utillnux; | |
in | |
stdenv.mkDerivation { | |
name = "efi"; | |
nativeBuildInputs = [ | |
utillinux | |
]; | |
buildCommand = '' | |
reserved=4096 | |
espSize=14944 | |
rootSize=71176 | |
veritySize=576 | |
fullSize=$(($reserved + $espSize + $rootSize + $veritySize)) | |
echo $fullSize | |
truncate --size $(( $fullSize * 512 )) out.img | |
sfdisk out.img <<EOF | |
label: gpt | |
size=$espSize | |
size=$rootSize | |
size=$veritySize | |
EOF | |
cp out.img $out | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment