* Split final md5sum of images out from Makefile into tools/imagesums;

if we've made jigdo files then *don't* waste time running md5sum on
  the images as well!
This commit is contained in:
Steve McIntyre 2006-11-25 02:08:38 +00:00
parent 9924a80b78
commit 04dcde6a8b
3 changed files with 39 additions and 11 deletions

View File

@ -779,18 +779,9 @@ image: bin-image
bin-image: check-number-given bin-images
src-image: check-number-given src-images
#Calculate the md5sums for the images (if available), or get from templates
# Calculate the md5sums for the images (if available), or get from templates
imagesums:
$(Q)cd $(OUT); :> MD5SUMS; for file in `find * -name \*.raw`; do \
$(md5sum) $$file >>MD5SUMS; \
done; \
for file in `find * -name \*.template`; do \
if [ "`tail --bytes=33 "$$file" | head --bytes=1 | od -tx1 -An | sed -e 's/ //g'`" != 05 ]; then \
echo "Possibly invalid template $$file"; exit 1; \
fi; \
grep -q " $${file%%.template}.raw"'$$' MD5SUMS \
|| echo "`tail --bytes=26 "$$file" | head --bytes=16 | od -tx1 -An | sed -e 's/ //g'` $${file%%.template}.raw" >>MD5SUMS; \
done
$(Q)$(BASEDIR)/tools/imagesums $(OUT)
# Likewise, the file size can be extracted from the .template with:
# tail --bytes=32 $$file | head --bytes=6 | od -tx1 -An \

5
debian/changelog vendored
View File

@ -61,6 +61,11 @@ debian-cd (2.2.26) UNRELEASED; urgency=low
[ Frans Pop ]
* Include floppy disk images again for i386.
[ Steve McIntyre ]
* Split final md5sum of images out from Makefile into tools/imagesums;
if we've made jigdo files then *don't* waste time running md5sum on
the images as well!
-- Frans Pop <fjp@debian.org> Thu, 23 Nov 2006 01:42:00 +0100
debian-cd (2.2.25) unstable; urgency=low

32
tools/imagesums Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
cd $1
:> MD5SUMS
case $DO_JIGDO in
0)
for file in `find * -name \*.raw`
do
md5sum $file >> MD5SUMS
done
;;
1|2)
for file in `find * -name \*.template`
do
if [ "`tail --bytes=33 "$file" | head --bytes=1 | od -tx1 -An | sed -e 's/ //g'`" != 05 ]; then
echo "Possibly invalid template $file"
exit
fi
grep -q " ${file%%.template}.raw"'$$' MD5SUMS \
|| echo "`tail --bytes=26 "$file" | \
head --bytes=16 | \
od -tx1 -An | \
sed -e 's/ //g'` ${file%%.template}.raw" >> MD5SUMS
done
;;
*)
echo "DO_JIGDO not defined!"
exit 1
;;
esac