tiny-slitaz view step5.php @ rev 35

helper: fix /etc/packages.conf
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Jul 13 15:37:38 2021 +0000 (2021-07-13)
parents b79cb203da62
children 49e3141e5899
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 $use_optgroup=0;
32 foreach(array("360K 5¼-inch" => "", "368640" => "360K", "409600" => "400K",
33 "720K 3½-inch" => "", "737280" => "720K", "819200" => "800K",
34 "1.2M 5¼-inch" => "", "1228800" => "1.2M",
35 "1.44M 3½-inch" => "", "1474560" => "1.44M", "1720320" => "1.68M",
36 "1966080" => "1.92M",
37 "2.88M 3½-inch" => "", "2949120" => "2.88M", "5898240" => "3.36M") as $sz => $nm) {
38 if ($nm == "") {
39 if ($use_optgroup != 0) echo " </optgroup>\n";
40 echo " <optgroup label=\"$sz\">\n";
41 $use_optgroup=1;
42 }
43 else {
44 echo " <option value=\"$sz\"";
45 if ($sz == $_POST['fdsize']) echo " selected";
46 echo ">$nm</option>\n";
47 }
48 }
49 if ($use_optgroup != 0) echo " </optgroup>\n";
50 ?>
51 </select>
52 </div>
53 <input name="download" value="DOS/EXE" type="submit"
54 title="<?php echo $title; ?>" />
55 <?php if (file_exists("/boot/isolinux/isolinux.bin")) {
56 $title="Can be burnt on to a CD-ROM or written on to a USB Key / memory card";
57 if (file_exists("/usr/bin/iso2exe"))
58 $title .= ", or renamed with the .exe suffix and run with DOS or Windows";
59 ?>
60 <input name="download" value="ISO image" type="submit"
61 title="<?php echo $title; ?>" />
62 <?php } ?>
63 </td></tr>
66 <tr><td class="first">Files for bootloaders:</td><td>
68 <input name="download" value="Kernel (<?php echo show_size("fs/boot/bzImage");
69 ?>)" title="A bzImage with a basic embbeded initramfs.
70 Can boot from floppy or DOS in real mode." type="submit" />
71 <input name="download" value="Rootfs (<?php echo show_size("rootfs.gz");
72 ?>)" title="Extra initramfs for the initrd= parameter" type="submit" />
73 <?php echo shell_exec("sudo ./helper --boot-files ".$_POST['tmp_dir']); ?>
74 </td></tr>
77 <tr><td class="first">Configuration info:</td><td>
79 <input name="download" value="Configuration files" type="submit" />
80 <input name="download" value="packages.conf (<?php
81 echo show_size("fs/etc/packages.conf"); ?>)" type="submit" />
82 </td></tr>
85 <?php if (show_size("fs/boot/System.map") != "") { ?>
86 <tr><td class="first">Debug info:</td><td>
88 <input name="download" value="System.map (<?php echo show_size("fs/boot/System.map");
89 ?>)" type="submit" />
90 <input name="download" value="linux.config (<?php echo show_size("fs/boot/config");
91 ?>)" type="submit" />
92 <br>
93 <input name="download" value="busybox.config (<?php echo show_size("fs/boot/config-busybox");
94 ?>)" type="submit" />
95 <input name="download" value="post_install.log (<?php echo show_size("post_install.log");
96 ?>)" type="submit" />
97 </td></tr>
99 <?php } ?>
101 </table>
102 </form>
103 </div>
105 <script>
106 function floppy_form()
107 {
108 var element;
109 var fds=document.getElementById("fdsize");
110 for (i=1;;i++) {
111 element=document.getElementById("Floppy"+i);
112 if (element) document.getElementById("floppyset").removeChild(element);
113 else break;
114 }
115 for (i=<?php echo filesize($_POST['tmp_dir']."out"); ?>, j=1; i > 0; j++, i -= fds.value) {
116 element = document.createElement("input");
117 element.name = "download";
118 element.type = "submit";
119 element.value = element.id = "Floppy"+j;
120 element.title = "You can use dd or rawrite to create the floppy disk";
121 document.getElementById("floppyset").appendChild(element);
122 }
123 if (j == 2) element.value = "Floppy image";
124 }
126 floppy_form();
127 </script>
129 <h2>Going further</h2>
131 <p>Tiny SliTaz should be smaller to have more functionality and/or needs less
132 RAM.<br>
133 The kernel can be <a href="http://elinux.org/Linux_Tiny">tuned/patched</a> or
134 you can use an earlier version.</p>
136 <p>You can test Tiny SliTaz without pre-historic hardware using qemu (needs the
137 <tt>ne.ko</tt> module, i.e select ne - Kernel module for the ne2000 driver in
138 Step 2/5):</p>
140 <pre>
141 qemu -cpu 486 -m 4 -net nic,model=ne2k_isa -net tap -fda slitaz.img
142 </pre>
144 <p>Or</p>
146 <pre>
147 qemu -cpu 486 -m 4 -net nic,model=ne2k_isa -net tap -kernel kernel -initrd rootfs.gz /dev/null
148 </pre>
150 <p>And the executable file <code>/etc/qemu-ifup</code>:</p>
152 <pre>
153 #!/bin/sh
155 tunctl -u $(id -un) -t $1
156 ifconfig $1 192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0
157 </pre>
159 <?php
160 }
161 ?>