From 3ccc448bdd712f78b6ed1a6ced76ae0e8597ee85 Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Wed, 6 Jan 2021 23:29:02 +0100 Subject: [PATCH] emmc-image: faster build --- emmc-image.nix | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/emmc-image.nix b/emmc-image.nix index f94de2d..a2f0745 100644 --- a/emmc-image.nix +++ b/emmc-image.nix @@ -37,13 +37,8 @@ buildCommand = '' mkdir -p $out/nix-support $out/sd-image - export img=$out/sd-image/${config.sdImage.imageName} + export img=${config.sdImage.imageName} echo "${pkgs.stdenv.buildPlatform.system}" > $out/nix-support/system - if test -n "$compressImage"; then - echo "file sd-image $img.bz2" >> $out/nix-support/hydra-build-products - else - echo "file sd-image $img" >> $out/nix-support/hydra-build-products - fi echo "Decompressing rootfs image" zstd -d --no-progress "${rootfsImage}" -o ./root-fs.img @@ -66,19 +61,17 @@ # Copy the rootfs into the SD image eval $(partx $img -o START,SECTORS --nr 3 --pairs) - dd conv=notrunc if=./root-fs.img of=$img seek=$START count=$SECTORS + dd conv=notrunc if=./root-fs.img of=$img seek=$((START/64)) count=$((SECTORS/64)) bs=$((512*64)) # Copy u-boot into the SD image eval $(partx $img -o START,SECTORS --nr 2 --pairs) - dd conv=notrunc if=${pkgs.ubootHelios64}/u-boot.itb of=$img seek=$START count=$SECTORS + dd conv=notrunc if=${pkgs.ubootHelios64}/u-boot.itb of=$img seek=$((START/64)) count=$((SECTORS/64)) bs=$((512*64)) # Copy bootloader into the SD image eval $(partx $img -o START,SECTORS --nr 1 --pairs) - dd conv=notrunc if=${pkgs.ubootHelios64}/idbloader.img of=$img seek=$START count=$SECTORS + dd conv=notrunc if=${pkgs.ubootHelios64}/idbloader.img of=$img seek=$((START/64)) count=$((SECTORS/64)) bs=$((512*64)) - if test -n "$compressImage"; then - zstd -v --no-progress $img - fi + zstd -v --no-progress $img -o $out/sd-image/${config.sdImage.imageName}.zstd ''; }) {}; }