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