slitaz-dev-tools annotate mirror-tools/slitaz/mirror/floppies/mkfdrolling.sh @ rev 307

mirror: build next floppies
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Dec 03 21:16:53 2017 +0100 (2017-12-03)
parents 1c207a9e6d0c
children a6b28f1e53eb
rev   line source
pascal@302 1 #!/bin/sh
pascal@302 2
pascal@302 3 WD=$(cd $(dirname $0); pwd)
pascal@302 4 while read name iso; do
pascal@307 5 [ -d $WD/$name ] || continue
pascal@302 6 cd $WD/$name
pascal@307 7 ISO=$(ls -t ../../$iso | sed q)
pascal@307 8 [ -s "$ISO" ] || continue
pascal@302 9 if [ ! -s fd001.img ] || [ $ISO -nt fd001.img ]; then
pascal@302 10 rm -f fd* 2> /dev/null
pascal@302 11 taziso $ISO floppyset > /dev/null
pascal@302 12 md5sum fd* > md5sum
pascal@302 13 mnt=/mnt$$
pascal@302 14 mkdir $mnt
pascal@302 15 mount -o loop,ro $ISO $mnt
pascal@302 16 mtime=$(stat -c %y $mnt/md5sum | cut -f1 -d ' ')
pascal@307 17 [ $(date --help 2>&1 | sed '/^BusyB/!d;s/.* v\([^ ]*\).*/\1/;s/\./ /g'\
pascal@307 18 | awk '{ printf "%d%02d\n",$1,$2 }') -gt 126 ] &&
pascal@307 19 mtime=$(LC_ALL=C date '+%d %B %Y' -d $mtime)
pascal@302 20 set -- $(sed '/ifmem/!d;s/.*ifmem //' $mnt/boot/isolinux/isolinux.cfg \
pascal@302 21 | sed 's|^|echo |;s|\([0-9][0-9]*\) |$((\1/1024))M |g' | sh)
pascal@302 22 umount $mnt
pascal@302 23 rmdir $mnt
pascal@307 24 cat > description.html <<EOT
pascal@307 25 <p>This floppy set uses the BIOS instead of the linux driver. You can boot
pascal@307 26 SliTaz using unsupported floppy drives such as some PCMCIA devices.</p>
pascal@307 27 EOT
pascal@307 28 if [ -z "$1" ]; then
pascal@307 29 echo "Built on $mtime" > title
pascal@307 30 else
pascal@307 31 echo "Built on $mtime, needs up to ${1}b of RAM" > title
pascal@307 32 n=0; x=1; while [ -n "$x" ]; do n=$(($n+2)); eval x=\$$n; done
pascal@307 33 n=$((($n - 2) / 2))
pascal@307 34 cat >> description.html <<EOT
pascal@302 35 <p>You can start with one of the $n following flavors:</p>
pascal@302 36
pascal@302 37 <ul>
pascal@302 38 EOT
pascal@307 39 i=0
pascal@307 40 while [ $i -lt $n ]; do
pascal@307 41 eval flavor=\$$((($n - $i)*2))
pascal@307 42 eval ram=\$$((($n - $i)*2 -1))
pascal@307 43 cat >> description.html <<EOT
pascal@302 44 <li><b>$flavor</b> needs ${ram}B of RAM and $(ls fd* | \
pascal@302 45 awk "/fd$(($i+1))/{q=1}{if(!q)n++}END{print n}") floppies:
pascal@302 46 <tt>fd001.img</tt> to <tt>$(ls -r fd${i}* | sed q)</tt>.<br>
pascal@302 47 $flavor provides $(while read f d; do
pascal@302 48 [ $f == $flavor ] && echo $d; done <<EOT
pascal@302 49 base the minimum SliTaz distribution subset in text mode
pascal@302 50 justx the minimum SliTaz distribution subset with X11 support
pascal@302 51 gtkonly the minimum SliTaz distribution subset with GTK+ support
pascal@302 52 core the default SliTaz distribution
pascal@302 53 EOT
pascal@307 54 ).</li>
pascal@302 55 EOT
pascal@307 56 i=$(($i+1))
pascal@307 57 done
pascal@307 58 echo "</ul>" >> description.html
pascal@307 59 fi
pascal@302 60 cat >> description.html <<EOT
pascal@302 61
pascal@302 62 <p>Start your computer with <tt>fd001.img</tt>. It will show the kernel version
pascal@302 63 string and the kernel cmdline line. You can edit the cmdline. Most users can
pascal@302 64 just press Enter.</p>
pascal@302 65
pascal@302 66 <p>The floppy is then loaded into memory (one dot each 64KB) and you will be
pascal@302 67 prompted to insert the next floppy, <tt>fd002.img</tt>. And so on up to last
pascal@302 68 floppy.</p>
pascal@307 69 EOT
pascal@307 70 [ -n "$1" ] && cat >> description.html <<EOT
pascal@302 71
pascal@302 72 <p>You will be prompted to insert extra floppies for the next flavors.
pascal@302 73 You can bypass this by using B to boot without loading extra floppies.</p>
pascal@302 74 EOT
pascal@302 75 cd ..
pascal@302 76 ./mkindex.sh $name > index-$name.html
pascal@302 77 fi
pascal@302 78 done <<EOT
pascal@302 79 rolling iso/rolling/slitaz-rolling.iso
pascal@302 80 loram-rolling iso/rolling/slitaz-rolling-loram.iso
pascal@307 81 next iso/next/slitaz-next-*.iso
pascal@302 82 EOT