slitaz-forge view mirror/floppies/mkfdrolling.sh @ rev 698

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