slitaz-forge view mirror/floppies/mkindex.sh @ rev 570

may resize qrcode
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Jun 26 09:27:30 2014 +0200 (2014-06-26)
parents a33dea8a7991
children 37fadd188b73
line source
1 #!/bin/sh
3 list_version()
4 {
5 ls ?.0 -dr | while read dir ; do
6 echo $dir
7 [ -d loram-$dir ] && echo loram-$dir
8 [ -d bios-$dir ] && echo bios-$dir
9 [ -d mini-$dir ] && echo mini-$dir
10 done
11 }
13 build_page()
14 {
15 DIR=$1
16 VERSION=${DIR#*-}
17 case "$DIR" in
18 bios*) TYPE="&nbsp;bios" ;;
19 mini*) TYPE="&nbsp;mini" ;;
20 loram*) TYPE="&nbsp;loram" ;;
21 *) TYPE=""
22 esac
23 TITLE="Floppy image set"
24 [ -s $DIR/title ] && TITLE="$(cat $DIR/title)"
25 cat <<EOT
26 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
27 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
28 <html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
29 <head>
30 <title>SliTaz Boot Floppies</title>
31 <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
32 <meta name="description" content="slitaz$TYPE boot floppies $VERSION" />
33 <meta name="robots" content="index, nofollow" />
34 <meta name="author" content="SliTaz Contributors" />
35 <link rel="shortcut icon" href="static/favicon.ico" />
36 <link rel="stylesheet" type="text/css" href="static/slitaz.css" />
37 <link rel="stylesheet" type="text/css" href="menu.css" />
38 <style type="text/css">
39 table {
40 background-color: inherit;
41 margin: 10px 0px 0px 0px;
42 }
43 #copy {
44 text-align: center;
45 }
47 #bottom {
48 text-align: center;
49 }
51 </style>
52 </head>
53 <body bgcolor="#ffffff">
54 <!-- Header -->
55 <div id="header">
56 <a name="top"></a>
57 <div id="logo"></div>
58 <div id="network">
59 <ul id="menu">
60 <li>
61 <a href="http://www.slitaz.org/">
62 <img src="static/home.png" alt="[ home ]" /></a>
63 </li>
64 <li>
65 <a href="floppy-grub4dos" title="Boot tools">Generic boot floppy</a>
66 </li>
67 <li>
68 <a href="http://tiny.slitaz.org/" title="SliTaz in one floppy and 8Mb RAM">Tiny SliTaz</a>
69 <ul>
70 $( list_version | while read dir; do
71 case "$dir" in
72 *-*) echo " <li>"
73 text="${dir/-/ }";;
74 *) echo " $ul<li>"
75 text="SliTaz ${dir/-/ }";;
76 esac
77 echo " <a href=\"index-$dir.html\" title=\"$(cat $dir/title)\">$text</a>"
78 case "$dir" in
79 *-*) echo " </li>";;
80 *) echo " <ul>"
81 ul=" </ul></li>";;
82 esac
83 done )
84 </ul>
85 </li>
86 </ul>
87 </li>
88 <li>
89 <a href="builder/index.php" title="Build floppies with your own kernel and initramfs">Floppy set builder</a>
90 <ul>
91 <li>
92 <a href="builder/bootloader" title="Build your floppy sets without Internet">Standalone shell</a>
93 </li>
94 </ul>
95 </li>
96 </ul>
97 </div>
98 <h1><a href="http://www.slitaz.org/">Boot&nbsp;floppies$TYPE&nbsp;$VERSION</a></h1>
99 </div>
101 <!-- Block -->
102 <div id="block">
103 <!-- Navigation -->
104 <div id="block_nav" style="height: 126px;">
105 <h4><img src="pics/floppy.png" alt="@" />1.44Mb SliTaz$TYPE $VERSION floppy images</h4>
106 <table width="100%">
107 $(
108 n=0
109 for f in $DIR/fd*img ; do
110 [ $n -eq 0 ] && echo "<tr>"
111 echo " <td> <a href=\"$f\">$(basename $f .img)</a> </td>"
112 n=$(( ($n+1)%6 ))
113 [ $n -eq 0 ] && echo "</tr>"
114 done
115 [ $n -eq 0 ] && echo "<tr>"
116 while [ $n -ne 5 ]; do
117 echo " <td> </td>"
118 n=$(($n+1))
119 done
120 )
121 <td> <a href="$DIR/md5sum">md5</a> </td>
122 </tr>
123 </table>
124 </div>
125 <!-- Information/image -->
126 <div id="block_info">
127 <h4>Available boot floppies</h4>
128 <ul>
129 $(
130 tail=""
131 list_version | while read dir; do
132 case "$dir" in
133 bios*) echo -en "\n - <a href=\"index-$dir.html\">bios</a>" ;;
134 mini*) echo -en "\n - <a href=\"index-$dir.html\">mini</a>" ;;
135 loram*) echo -en "\n - <a href=\"index-$dir.html\">loram</a>" ;;
136 *) echo -en "$tail <li><a href=\"index-$dir.html\">SliTaz $dir</a>" ;;
137 esac
138 tail="</li>\n"
139 done
140 )</li>
141 </ul>
142 </div>
143 </div>
145 <!-- Content top. -->
146 <div id="content_top">
147 <div class="top_left"></div>
148 <div class="top_right"></div>
149 </div>
151 <!-- Content -->
152 <div id="content">
154 <h2>$TITLE</h2>
156 <p>
157 This floppy set will boot a Slitaz stable$TYPE version. You can write floppies
158 with SliTaz <i>bootfloppybox</i>,
159 <a href="http://en.wikipedia.org/wiki/RaWrite">Windows rawrite</a> or simply dd:
160 </p><pre># dd if=fd001.img of=/dev/fd0
161 </pre>
163 <p>
164 If you have a CD-ROM, an USB port and an USB key or a network card, but you
165 can't boot these devices directly, then try
166 <a href="http://mirror.slitaz.org/boot/floppy-grub4dos">floppy-grub4dos</a>
167 first. This 1.44Mb floppy provides tiny programs to boot these devices without BIOS
168 support and some other tools.
169 </p>
170 $(cat $DIR/description.html)
171 <p>
172 Each floppy set detects disk swaps and can be used without a keyboard.
173 </p>
174 EOT
175 [ -s $DIR/fd100.img ] && cat <<EOT
176 <p>
177 If you have an ext3 partition on your hard disk, the bootstrap can create the
178 installation script <u>slitaz/install.sh</u>. You will be able to install SliTaz
179 on your hard disk without extra media.
180 </p>
181 EOT
182 cat <<EOT
183 <p>
184 Good luck.
185 </p>
187 <a name="fdiso"></a>
188 <h2>ISO image floppy set</h2>
190 <form method="get" action="http://mirror.slitaz.org/floppies/download.php">
191 <p>
192 The floppy image set above includes an embedded installer and can install
193 SliTaz on your hard disk.
194 </p>
195 <p>
196 Anyway you may want these ISO images to
197 <a href="http://doc.slitaz.org/en:guides:uncommoninst#floppy-install">
198 install SliTaz</a>
199 <select name="iso">
200 $(
201 for file in $(ls ../iso/*/flavors/slitaz-*.iso ../iso/*/slitaz-*.iso | sort); do
202 set -- $(echo $(basename $file .iso) | sed 's/-/ /g')
203 echo " <option value=\"${file#../}\">${3:-core} $4 $2</option>"
204 done
205 )
206 </select>
207 <input name="build" value="Build floppy set" type="submit" />
208 </p>
209 </form>
210 <p>
211 You can restore the ISO image on your hard disk using :
212 </p>
213 <pre>
214 # dd if=/dev/fd0 of=fdiso01.img
215 # dd if=/dev/fd0 of=fdiso02.img
216 # ...
217 # cat fdiso*.img | cpio -i
218 </pre>
220 <h2>Images generation</h2>
221 <p>
222 All these floppy images are built with <b>bootfloppybox</b> from
223 a <i>core</i> or a <i>4in1</i> iso. The <i>loram</i> is preprocessed by
224 <b>tazlitobox</b> (Low RAM tab). These tools are available since 3.0.
225 You can extract the <u>kernel</u>, <u>cmdline</u> and <u>rootfs</u> files with
226 <a href="floppies">this tool</a>
227 </p>
229 <!-- End of content with round corner -->
230 </div>
231 <div id="content_bottom">
232 <div class="bottom_left"></div>
233 <div class="bottom_right"></div>
234 </div>
236 <!-- Start of footer and copy notice -->
237 <div id="copy">
238 <p>
239 Copyright &copy; <span class="year"></span> <a href="http://www.slitaz.org/">SliTaz</a> -
240 <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>
241 </p>
242 <!-- End of copy -->
243 </div>
245 <!-- Bottom and logo's -->
246 <div id="bottom">
247 <p>
248 <a href="http://validator.w3.org/check?uri=referer"><img src="static/xhtml10.png" alt="Valid XHTML 1.0" title="Code validé XHTML 1.0" style="width: 80px; height: 15px;" /></a>
249 </p>
250 <p>
251 <script type="text/javascript">
252 function QRCodePNG(str, obj) {
253 try {
254 obj.height = obj.width += 300;
255 return QRCode.generatePNG(str, {ecclevel: 'H'});
256 }
257 catch (any) {
258 var element = document.createElement("script");
259 element.src = "static/qrcode.js";
260 element.type ="text/javascript";
261 element.onload = function() {
262 obj.src = QRCode.generatePNG(str, {ecclevel: 'H'});
263 };
264 document.body.appendChild(element);
265 }
266 }
267 </script>
268 <img src="static/qr.png" alt="#"
269 onmouseover= "this.title = location.href"
270 onclick="this.src = QRCodePNG(location.href, this)" />
271 </p>
272 </div>
274 </body>
275 </html>
276 EOT
277 }
279 if [ -n "$1" ]; then
280 build_page $1
281 else
282 list_version | while read dir ; do
283 [ -s $dir/description.html ] || continue
284 [ -s $dir/md5sum ] || continue
285 build_page $dir > index-$dir.html
286 done
287 fi