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