# HG changeset patch # User Pascal Bellard # Date 1627058472 0 # Node ID ade20bc3ae19763683523cc3947e62321a02abe9 # Parent cfad9fa3f53c356b857ae5c65c8d58a0ff723553 mirror/floppies: multi-format support diff -r cfad9fa3f53c -r ade20bc3ae19 mirror/floppies/format.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mirror/floppies/format.js Fri Jul 23 16:41:12 2021 +0000 @@ -0,0 +1,79 @@ +window.URL = window.URL || window.webkitURL; +function download(ref, range, name) { + var xhr = new XMLHttpRequest(); + + xhr.open('GET', ref, true); + xhr.setRequestHeader("Range", "bytes="+range); + xhr.responseType = 'blob'; + xhr.onload = function () { + var a = document.createElement('a'), file; + file = new Blob([xhr.response], { type : 'application/octet-stream' }); + a.href = window.URL.createObjectURL(file); + a.download = name; + a.click(); + }; + xhr.send(); +} + +function format(size) { + var max = sets[sets.length-1]; + var cols = Math.floor(Math.sqrt(max/size)+2); + var lines = Math.floor(((max/size)+1)/cols+1); + var e = document.getElementById('floppies'); + var s, i, j, ofs, fd, fds, curset; + for (i = 0, ofs = 0, curset = 0, fd = 1, s = ""; i < lines; i++) { + s += ""; + for (j = 0; j < cols; j++) { + fds = ""+fd; if (fd < 100) fds = "0"+fds; if (fd < 10) fds = "0"+fds; + s += ""; + if (ofs < max) { + s += "fd"+fds+""; + if (ofs >= sets[curset]) { + curset++; + fd = (Math.floor(fd/100)+1)*100; + } else fd++; + } + if (i == lines-1 && j == cols-1) { + s += "md5" + } + s += ""; + } + s += ""; + } + e.innerHTML = s; + for (i = 0, ofs = 0, curset = 0, fd = 0; ofs < max;) { + i++; fd++; + ofs = Number.parseInt(ofs)+Number.parseInt(size); + if (ofs >= sets[curset]) { + fds = ""+fd; if (fd < 100) fds = "0"+fds; if (fd < 10) fds = "0"+fds; + e = document.getElementById('cnt'+curset); + if (e) e.innerHTML = i; + e = document.getElementById('last'+curset); + if (e) e.innerHTML = fds; + curset++; + fd = (Math.floor(fd/100)+1)*100-1; + } + } +} + +var e = document.getElementById('format'); +try { + var dummy = new Blob(); + e.innerHTML=""; +} +catch (err) { + e.innerHTML="1.44MB"; +} diff -r cfad9fa3f53c -r ade20bc3ae19 mirror/floppies/mkfdrolling.sh --- a/mirror/floppies/mkfdrolling.sh Mon Feb 01 10:57:24 2021 +0000 +++ b/mirror/floppies/mkfdrolling.sh Fri Jul 23 16:41:12 2021 +0000 @@ -19,7 +19,7 @@ mtime=$(LC_ALL=C date '+%d %B %Y' -d $mtime) set -- $(sed '/ifmem/!d;s/.*ifmem //' $mnt/boot/isolinux/isolinux.cfg \ | sed 's|^|echo |;s|\([0-9][0-9]*\) |$((\1/1024))M |g' | sh) - umount $mnt + umount $mnt 2> /dev/null || umount -l $mnt rmdir $mnt cat > description.html <This floppy set uses the BIOS instead of the linux driver. You can boot @@ -41,9 +41,9 @@ eval flavor=\$$((($n - $i)*2)) eval ram=\$$((($n - $i)*2 -1)) cat >> description.html <$flavor needs ${ram}B of RAM and $(ls fd* | \ - awk "/fd$(($i+1))/{q=1}{if(!q)n++}END{print n}") floppies: - fd001.img to $(ls -r fd${i}* | sed q).
+
  • $flavor needs ${ram}B of RAM and $(ls fd* | \ + awk "/fd$(($i+1))/{q=1}{if(!q)n++}END{print n}") floppies: + fd001.img to fd$(ls -r fd${i}* | sed 's|fd||;s|.img||;q').img.
    $flavor provides $(while read f d; do [ $f = $flavor ] && echo $d; done <