tiny-slitaz view step5.php @ rev 33

step5.php: be more verbose about ne2000 driver
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Feb 22 16:57:19 2020 +0100 (2020-02-22)
parents f03cb925353c
children 798a84e27cc9
line source
1 <?php
3 function show_size($file)
4 {
5 return shell_exec("du -h ".$_POST['tmp_dir'].
6 "$file | awk '{ printf \"%s\",$1 }'");
7 }
9 if (isset($_POST['toconfigure']) && $_POST['toconfigure'] == ""
10 && $output == "") {
11 shell_exec("sudo ./helper --mkrootfs ".$_POST['tmp_dir']);
12 ?>
14 <div class="box">
15 <h3 id="get">[Step 5/5] Get Tiny SliTaz files</h3>
17 <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post" name="config">
19 <?php post_hidden(); ?>
21 <table>
22 <tr><td class="first">Bootable images:</td><td>
23 <div id="floppyset">
24 <select name="fdsize" id="fdsize" onchange="floppy_form()"
25 title="Select the size of the floppies">
26 <?php
27 $title="Neither Windows nor emm386 supported. Needs a real mode DOS";
28 if (!file_exists($_POST['tmp_dir']."out"))
29 shell_exec("sudo ./helper --mkimg ".$_POST['tmp_dir']);
30 if (!isset($_POST['fdsize'])) $_POST['fdsize']="1474560";
31 foreach(array("737280" => "720K", "1228800" => "1.2M",
32 "1474560" => "1.44M", "1720320" => "1.68M",
33 "1966080" => "1.92M", "2949120" => "2.88M") as $sz => $nm) {
34 echo " <option value=\"$sz\"";
35 if ($sz == $_POST['fdsize']) echo " selected";
36 echo ">$nm</option>\n";
37 } ?>
38 </select>
39 </div>
40 <input name="download" value="DOS/EXE" type="submit"
41 title="<?php echo $title; ?>" />
42 <?php if (file_exists("/boot/isolinux/isolinux.bin")) {
43 $title="Can be burnt on to a CD-ROM or written on to a USB Key / memory card";
44 if (file_exists("/usr/bin/iso2exe"))
45 $title .= ", or renamed with the .exe suffix and run with DOS or Windows";
46 ?>
47 <input name="download" value="ISO image" type="submit"
48 title="<?php echo $title; ?>" />
49 <?php } ?>
50 </td></tr>
53 <tr><td class="first">Files for bootloaders:</td><td>
55 <input name="download" value="Kernel (<?php echo show_size("fs/boot/bzImage");
56 ?>)" title="A bzImage with a basic embbeded initramfs.
57 Can boot from floppy or DOS in real mode." type="submit" />
58 <input name="download" value="Rootfs (<?php echo show_size("rootfs.gz");
59 ?>)" title="Extra initramfs for the initrd= parameter" type="submit" />
60 <?php echo shell_exec("sudo ./helper --boot-files ".$_POST['tmp_dir']); ?>
61 </td></tr>
64 <tr><td class="first">Configuration info:</td><td>
66 <input name="download" value="Configuration files" type="submit" />
67 <input name="download" value="packages.conf (<?php
68 echo show_size("fs/etc/packages.conf"); ?>)" type="submit" />
69 </td></tr>
72 <?php if (show_size("fs/boot/System.map") != "") { ?>
73 <tr><td class="first">Debug info:</td><td>
75 <input name="download" value="System.map (<?php echo show_size("fs/boot/System.map");
76 ?>)" type="submit" />
77 <input name="download" value="linux.config (<?php echo show_size("fs/boot/config");
78 ?>)" type="submit" />
79 <br>
80 <input name="download" value="busybox.config (<?php echo show_size("fs/boot/config-busybox");
81 ?>)" type="submit" />
82 <input name="download" value="post_install.log (<?php echo show_size("post_install.log");
83 ?>)" type="submit" />
84 </td></tr>
86 <?php } ?>
88 </table>
89 </form>
90 </div>
92 <script>
93 function floppy_form()
94 {
95 var element;
96 var fds=document.getElementById("fdsize");
97 for (i=1;;i++) {
98 element=document.getElementById("Floppy"+i);
99 if (element) document.getElementById("floppyset").removeChild(element);
100 else break;
101 }
102 for (i=<?php echo filesize($_POST['tmp_dir']."out"); ?>, j=1; i > 0; j++, i -= fds.value) {
103 element = document.createElement("input");
104 element.name = "download";
105 element.type = "submit";
106 element.value = element.id = "Floppy"+j;
107 element.title = "You can use dd or rawrite to create the floppy disk";
108 document.getElementById("floppyset").appendChild(element);
109 }
110 if (j == 2) element.value = "Floppy image";
111 }
113 floppy_form();
114 </script>
116 <h2>Going further</h2>
118 <p>Tiny SliTaz should be smaller to have more functionality and/or needs less
119 RAM.<br>
120 The kernel can be <a href="http://elinux.org/Linux_Tiny">tuned/patched</a> or
121 you can use an earlier version.</p>
123 <p>You can test Tiny SliTaz without pre-historic hardware using qemu (needs the
124 <tt>ne.ko</tt> module, i.e select ne - Kernel module for the ne2000 driver in
125 Step 2/5):</p>
127 <pre>
128 qemu -cpu 486 -m 4 -net nic,model=ne2k_isa -net tap -fda slitaz.img
129 </pre>
131 <p>Or</p>
133 <pre>
134 qemu -cpu 486 -m 4 -net nic,model=ne2k_isa -net tap -kernel kernel -initrd rootfs.gz /dev/null
135 </pre>
137 <p>And the executable file <code>/etc/qemu-ifup</code>:</p>
139 <pre>
140 #!/bin/sh
142 tunctl -u $(id -un) -t $1
143 ifconfig $1 192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0
144 </pre>
146 <?php
147 }
148 ?>