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

Fix floppies/download.php
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Jun 24 21:59:25 2018 +0200 (2018-06-24)
parents 9c5d221507ef
children ade20bc3ae19
line source
1 #!/bin/sh
3 list_version() {
4 ls rolling next ?.0 -dr | \
5 while read dir; do
6 echo $dir
7 [ -d loram-$dir ] && echo loram-$dir
8 [ -d web-$dir ] && echo web-$dir
9 [ -d mini-$dir ] && echo mini-$dir
10 done
11 }
13 build_page() {
14 DIR=$1
15 case "$DIR" in
16 *.*) stable=stable;;
17 *) stable=development;;
18 esac
19 VERSION=${DIR#*-}
20 case "$DIR" in
21 web*) TYPE="&nbsp;web" ;;
22 mini*) TYPE="&nbsp;mini" ;;
23 loram*) TYPE="&nbsp;loram" ;;
24 next*) TYPE="&nbsp;next" ;;
25 *) TYPE=""
26 esac
27 TITLE="Floppy image set"
28 [ -s $DIR/title ] && TITLE="$(cat $DIR/title)"
29 cat <<EOT
30 <!DOCTYPE html>
31 <html lang="en">
32 <head>
33 <title>SliTaz Boot Floppies</title>
34 <meta charset="UTF-8">
35 <meta name="description" content="slitaz$TYPE boot floppies $VERSION">
36 <meta name="robots" content="index, nofollow">
37 <meta name="author" content="SliTaz Contributors">
38 <meta name="viewport" content="width=device-width, initial-scale=1.0">
39 <link rel="shortcut icon" href="static/favicon.ico">
40 <link rel="stylesheet" href="static/slitaz.min.css">
41 <link rel="stylesheet" href="menu.css">
42 <style type="text/css">
43 .block_info { width: inherit; }
44 nav table { margin: 6px 0 0 0; }
45 nav table a { color: #215090; }
46 nav header::before { content: url(pics/floppy.png); vertical-align: middle; padding: 0 6px 0 0; }
47 pre, tt, code { font-size: 0.9rem; }
48 </style>
49 </head>
50 <body>
52 <script>de=document.documentElement;de.className+=(("ontouchstart" in de)?' touch':' no-touch');</script>
54 <header>
55 <h1 id="top"><a href="http://www.slitaz.org/">Boot floppies $DIR</a></h1>
57 <div class="network">
58 <a href="http://www.slitaz.org/" class="home"></a>
59 <ul id="menu">
60 <li>
61 <a href="floppy-grub4dos"
62 title="Boot tools"
63 >Generic boot floppy</a>
64 </li>
65 <li>
66 <a href="http://tiny.slitaz.org/"
67 title="SliTaz in one floppy and 4Mb RAM"
68 >Tiny SliTaz</a>
69 <ul>
70 $(
71 list_version | \
72 while read dir; do
73 case "$dir" in
74 *-*|next)
75 echo -n " <li>"
76 text="${dir/-/ }";;
77 *)
78 echo -n " $ul<li>"
79 text="SliTaz ${dir/-/ }";;
80 esac
82 echo " <a href=\"index-$dir.html\""
83 echo " title=\"$(cat $dir/title)\""
84 echo " >$text</a>"
86 case "$dir" in
87 *-*|next)
88 echo " </li>";;
89 *)
90 echo " <ul>"
91 ul=" </ul>
92 </li>";;
93 esac
94 done )
95 </ul>
96 </li>
97 </ul>
98 </li>
99 <li>
100 <a href="builder/index.php"
101 title="Build floppies with your own kernel and initramfs"
102 >Floppy set builder</a>
103 <ul>
104 <li>
105 <a href="builder/bootloader"
106 title="Build your floppy sets without Internet"
107 >Standalone shell</a>
108 </li>
109 </ul>
110 </li>
111 </ul>
112 </div>
113 </header>
115 <!-- Block -->
116 <div class="block"><div>
118 <!-- Information/image -->
119 <div class="block_info">
120 <header>Available boot floppies</header>
121 <ul>
122 $(
123 tail=""
124 list_version | \
125 while read dir; do
126 case "$dir" in
127 web*) echo -en "\n &middot; <a href=\"index-$dir.html\">web</a>" ;;
128 mini*) echo -en "\n &middot; <a href=\"index-$dir.html\">mini</a>" ;;
129 loram*) echo -en "\n &middot; <a href=\"index-$dir.html\">loram</a>" ;;
130 next*) echo -en "\n &middot; <a href=\"index-$dir.html\">next</a>" ;;
131 *) echo -en "$tail <li><a href=\"index-$dir.html\">SliTaz $dir</a>" ;;
132 esac
133 tail="</li>\n"
134 done
135 )</li>
136 </ul>
137 </div>
139 <!-- Navigation -->
140 <nav>
141 <header>1.44MB SliTaz$TYPE $VERSION floppy images</header>
142 <div class="large"><table>
143 $(
144 n=0
145 for f in $DIR/fd*img ; do
146 [ $n -eq 0 ] && echo " <tr>"
147 echo " <td><a href=\"$f\">$(basename $f .img)</a></td>"
148 n=$(( ($n+1)%6 ))
149 [ $n -eq 0 ] && echo " </tr>"
150 done
151 [ $n -eq 0 ] && echo " <tr>"
152 while [ $n -ne 5 ]; do
153 echo " <td> </td>"
154 n=$(($n+1))
155 done
156 )
157 <td><a href="$DIR/md5sum">md5</a></td>
158 </tr>
159 </table></div>
160 </nav>
161 </div></div>
164 <!-- Content -->
165 <main>
167 <h2>$TITLE</h2>
169 <p>This floppy set will boot a SliTaz $stable$TYPE version. You can write floppies
170 with SliTaz <code>bootfloppybox</code>, <a
171 href="http://en.wikipedia.org/wiki/RaWrite" target="_blank">Windows rawrite</a>
172 or simply <code>dd</code>:</p>
174 <pre># dd if=fd001.img of=/dev/fd0</pre>
176 <p>If you have a CD-ROM, a USB port and a USB key or a network card, but you
177 can't boot these devices directly, then try <a
178 href="http://mirror.slitaz.org/boot/floppy-grub4dos" target="_blank"
179 >floppy-grub4dos</a> first. This 1.44Mb floppy provides tiny programs to boot
180 these devices without BIOS support and some other tools.</p>
182 $(cat $DIR/description.html)
184 <p>Each floppy set detects disk swaps and can be used without a keyboard.</p>
186 <p>Good luck.</p>
189 <h2 id="fdiso">ISO image floppy set</h2>
191 <form method="get" action="http://mirror1.slitaz.org/floppies/download.php">
193 <p>The floppy image set above includes an embedded installer and can install
194 SliTaz on your hard disk.</p>
196 <p>Anyhow you may want these ISO images to <a
197 href="http://doc.slitaz.org/en:guides:uncommoninst#floppy-install">install
198 SliTaz</a>
200 <select name="iso">
201 $(
202 for file in $(ls ../iso/*/flavors/slitaz-*.iso ../iso/*/slitaz-*.iso | sort); do
203 set -- $(echo $(basename $file .iso) | sed 's/-/ /g')
204 echo " <option value=\"${file#../}\">${3:-core} $4 $2</option>"
205 done
206 )
207 </select>
209 <input name="build" value="Build floppy set" type="submit"/>
210 </p>
211 </form>
213 <p>You can restore the ISO image on your hard disk using:</p>
215 <pre>
216 # dd if=/dev/fd0 of=fdiso01.img
217 # dd if=/dev/fd0 of=fdiso02.img
218 # ...
219 # cat fdiso*.img | cpio -i
220 </pre>
223 <h2>Images generation</h2>
225 <ul>
226 <li>All these floppy images are built from a <i>core</i> or a <i>Nin1</i>
227 ISO.</li>
228 <li>The <i>loram</i> is preprocessed by <code>tazlitobox</code> (Low RAM
229 tab) or <code>tazlito build-loram</code>.</li>
230 <li>The versions 1.0 and 2.0 are built with <code>bootfloppybox</code>
231 available since 3.0.</li>
232 <li>The newer versions are built with <code>taziso floppyset</code>
233 available since 5.0.</li>
234 <li>You can extract the <u>kernel</u>, <u>cmdline</u> and <u>rootfs*</u>
235 files with <a href="floppies">this tool</a>.</li>
236 <li>You can change the floppy format (to 2.88M, 1.2M ...)
237 with <a href="resizefdset.sh">this tool</a>.</li>
238 </ul>
240 <!-- End of content -->
241 </main>
244 <script>
245 function QRCodePNG(str, obj) {
246 try {
247 obj.height = obj.width += 300;
248 return QRCode.generatePNG(str, {ecclevel: 'H'});
249 }
250 catch (any) {
251 var element = document.createElement("script");
252 element.src = "/static/qrcode.min.js";
253 element.type = "text/javascript";
254 element.onload = function() {
255 obj.src = QRCode.generatePNG(str, {ecclevel: 'H'});
256 };
257 document.body.appendChild(element);
258 }
259 }
260 </script>
262 <footer>
263 <div>
264 Copyright &copy; <span class="year"></span>
265 <a href="http://www.slitaz.org/">SliTaz</a>
266 </div>
267 <div>
268 Network:
269 <a href="http://scn.slitaz.org/">Community</a> &middot;
270 <a href="http://doc.slitaz.org/">Doc</a> &middot;
271 <a href="http://forum.slitaz.org/">Forum</a> &middot;
272 <a href="http://pkgs.slitaz.org/">Packages</a> &middot;
273 <a href="http://bugs.slitaz.org">Bugs</a> &middot;
274 <a href="http://hg.slitaz.org/?sort=lastchange">Hg</a>
275 </div>
276 <div>
277 SliTaz @
278 <a href="http://twitter.com/slitaz">Twitter</a> &middot;
279 <a href="http://www.facebook.com/slitaz">Facebook</a> &middot;
280 <a href="http://distrowatch.com/slitaz">Distrowatch</a> &middot;
281 <a href="http://en.wikipedia.org/wiki/SliTaz">Wikipedia</a> &middot;
282 <a href="http://flattr.com/profile/slitaz">Flattr</a>
283 </div>
284 <img src="/static/qr.png" alt="#" onmouseover="this.title = location.href"
285 onclick="this.src = QRCodePNG(location.href, this)"/>
286 </footer>
288 </body>
289 </html>
290 EOT
291 }
293 if [ -n "$1" ]; then
294 build_page $1
295 else
296 list_version | while read dir ; do
297 [ -s $dir/description.html ] || continue
298 [ -s $dir/md5sum ] || continue
299 build_page $dir > index-$dir.html
300 done
301 fi