slitaz-forge rev 717

mirror/floppies: add mkmdsum.sh
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Aug 20 11:39:45 2021 +0000 (2021-08-20)
parents ade20bc3ae19
children 78c2fc348b05
files mirror/floppies/format.js mirror/floppies/mkfdrolling.sh mirror/floppies/mkmdsum.sh
line diff
     1.1 --- a/mirror/floppies/format.js	Fri Jul 23 16:41:12 2021 +0000
     1.2 +++ b/mirror/floppies/format.js	Fri Aug 20 11:39:45 2021 +0000
     1.3 @@ -61,8 +61,7 @@
     1.4  var e = document.getElementById('format');
     1.5  try {
     1.6  	var dummy = new Blob();
     1.7 -	e.innerHTML="<select onChange='format(this.value)' style='background: #666; color: #FFF;'>" +
     1.8 -		"<option value='368640' title='/dev/fd0h360 (2,20) or /dev/fd0d360 (2,4) 5¼'>360K</option>" +
     1.9 +	e.innerHTML="<select onChange='format(this.value)' style='background: #666; color: #FFF;' title='80 tracks 2 sides floppy list'>" +
    1.10  		"<option value='737280' title='/dev/fd0u720 3½ DD (2,16)'>720K</option>" +
    1.11  		"<option value='819200' title='/dev/fd0u800 3½ DD (2,120)'>800K</option>" +
    1.12  		"<option value='1228800' title='/dev/fd0h1200 5¼ (2,8)'>1.2MB</option>" +
     2.1 --- a/mirror/floppies/mkfdrolling.sh	Fri Jul 23 16:41:12 2021 +0000
     2.2 +++ b/mirror/floppies/mkfdrolling.sh	Fri Aug 20 11:39:45 2021 +0000
     2.3 @@ -74,6 +74,8 @@
     2.4  EOT
     2.5  	cd ..
     2.6  	./mkindex.sh $name > index-$name.html
     2.7 +	[ -s $name/fd.img ] && rm $name/fd.img
     2.8 +	./mkmdsum.sh set $name > /dev/null
     2.9      fi
    2.10  done <<EOT
    2.11  rolling		iso/rolling/slitaz-rolling.iso
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/mirror/floppies/mkmdsum.sh	Fri Aug 20 11:39:45 2021 +0000
     3.3 @@ -0,0 +1,39 @@
     3.4 +#!/bin/sh
     3.5 +
     3.6 +case "$1" in
     3.7 +
     3.8 +set)
     3.9 +	shift
    3.10 +	for dir in $@; do
    3.11 +		for i in $dir/*0 ; do
    3.12 +			echo $i
    3.13 +			sh $0 md5sum $dir $(basename $i) | tee $i/md5sum
    3.14 +		done
    3.15 +	done ;;
    3.16 +
    3.17 +md5sum)
    3.18 +	n=1; ofs=0; dir=${2:-4.0}; size=${3:-1474560}
    3.19 +	SETS="$(sed '/sets =/!d;s|.*\[||;s|\].*||;s|,| |g' index-$dir.html)"
    3.20 +
    3.21 +	for max in $SETS; do :; done
    3.22 +	[ ! -s $dir/fd.img ] && cat $dir/fd???.img > $dir/fd.img && dd size=0 bs=1 seek=$max 2>/dev/null
    3.23 +	for max in $SETS; do
    3.24 +		while true; do
    3.25 +			[ $(stat -c %s $dir/fd.img) -gt $ofs ] || break 2
    3.26 +			dd if=$dir/fd.img bs=512 skip=$(($ofs/512)) count=$(($size/512)) \
    3.27 +			  2>/dev/null | md5sum | sed "s|-$|fd$(printf "%03d" $n).img|"
    3.28 +			ofs=$(($ofs+$size)); n=$(($n+1))
    3.29 +			[ $ofs -ge $max ] && n=$(($n-($n%100)+100)) && break
    3.30 +		done
    3.31 +	done ;;
    3.32 +
    3.33 +*)	cat <<EOT
    3.34 +Usage:
    3.35 +
    3.36 +$0 md5sum directory [floppy bytes]
    3.37 +   display the md5sum file
    3.38 +
    3.39 +$0 set directory...
    3.40 +   create every directory/*/md5sum file
    3.41 +EOT
    3.42 +esac