From b63a2fdb49b38eedb1ce3b497a5e2d28db38347f Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Wed, 24 May 2017 16:20:25 -0700 Subject: [PATCH] Reorganize build*.sh output directory structure (dir/SERIAL/SUITE/[VARIANT]/...) --- .travis.sh | 2 +- build.sh | 32 +++++++++++++++++++++++++------- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/.travis.sh b/.travis.sh index 09ddc929c..b4ad04429 100755 --- a/.travis.sh +++ b/.travis.sh @@ -9,5 +9,5 @@ set -x ./scripts/debuerreotype-version ./build.sh travis "$SUITE" "@$epoch" -real="$(sha256sum "travis/$serial/$SUITE-amd64.tar.xz" | cut -d' ' -f1)" +real="$(sha256sum "travis/$serial/$SUITE/rootfs-amd64.tar.xz" | cut -d' ' -f1)" [ -z "$SHA256" ] || [ "$SHA256" = "$real" ] diff --git a/build.sh b/build.sh index eed42130a..85296a4f3 100755 --- a/build.sh +++ b/build.sh @@ -58,9 +58,16 @@ docker run \ epoch="$(date --date "$timestamp" +%s)" serial="$(date --date "@$epoch" +%Y%m%d)" exportDir="output" - outputDir="$exportDir/$serial" + outputDir="$exportDir/$serial/$suite" dpkgArch="$(dpkg --print-architecture)" + touch_epoch() { + while [ "$#" -gt 0 ]; do + local f="$1"; shift + touch --no-dereference --date="@$epoch" "$f" + done + } + { debuerreotype-init rootfs "$suite" "@$epoch" @@ -89,12 +96,23 @@ docker run \ debuerreotype-gen-sources-list "$rootfs" "$suite" http://deb.debian.org/debian http://security.debian.org done - mkdir -p "$outputDir" - for variant in "" -slim; do - targetBase="$outputDir/$suite$variant-$dpkgArch" - debuerreotype-tar "rootfs$variant" "$targetBase.tar.xz" - debuerreotype-chroot "rootfs$variant" dpkg-query -W > "$targetBase.manifest" - touch --no-dereference --date="@$epoch" "$targetBase.manifest" + for variant in "" slim; do + variantDir="$outputDir/$variant" + mkdir -p "$variantDir" + + targetBase="$variantDir/rootfs-$dpkgArch" + rootfs="rootfs${variant:+-$variant}" + + debuerreotype-tar "$rootfs" "$targetBase.tar.xz" + + debuerreotype-chroot "$rootfs" dpkg-query -W > "$targetBase.manifest" + echo "$epoch" > "$targetBase.debuerreotype-epoch" + touch_epoch "$targetBase.manifest" "$targetBase.debuerreotype-epoch" + + for f in debian_version os-release; do + cp "$rootfs/etc/$f" "$targetBase.$f" + touch_epoch "$targetBase.$f" + done done } >&2