tiny-slitaz annotate step5.php @ rev 21
May upload memtest & ipxe
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Aug 18 11:32:08 2017 +0200 (2017-08-18) |
parents | b58beb683c22 |
children | cb1743f12df8 |
rev | line source |
---|---|
pascal@0 | 1 <?php |
pascal@0 | 2 |
pascal@0 | 3 function show_size($file) |
pascal@0 | 4 { |
pascal@0 | 5 return shell_exec("du -h ".$_POST['tmp_dir']. |
pascal@0 | 6 "$file | awk '{ printf \"%s\",$1 }'"); |
pascal@0 | 7 } |
pascal@6 | 8 |
pascal@0 | 9 if (isset($_POST['toconfigure']) && $_POST['toconfigure'] == "" |
pascal@0 | 10 && $output == "") { |
pascal@0 | 11 shell_exec("sudo ./helper --mkrootfs ".$_POST['tmp_dir']); |
pascal@0 | 12 ?> |
pascal@0 | 13 |
pascal@6 | 14 <div class="box"> |
pascal@6 | 15 <h3 id="get">[Step 5/5] Get Tiny SliTaz files</h3> |
pascal@0 | 16 |
pascal@0 | 17 <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post" name="config"> |
pascal@0 | 18 |
pascal@6 | 19 <?php post_hidden(); ?> |
pascal@6 | 20 |
pascal@6 | 21 <table> |
pascal@6 | 22 <tr><td class="first">Bootable images:</td><td> |
pascal@6 | 23 |
pascal@6 | 24 <?php |
paul@17 | 25 $title="Neither Windows nor emm386 supported. Needs a real mode DOS"; |
pascal@6 | 26 if ((filesize($_POST['tmp_dir']."rootfs.gz") + |
pascal@6 | 27 filesize($_POST['tmp_dir']."fs/boot/bzImage")) <= 18*80*1024) { |
paul@17 | 28 $title .= ". Tip: can be split in several boot floppies too"; |
pascal@6 | 29 ?> |
pascal@6 | 30 <input name="download" value="Floppy image" type="submit" |
pascal@6 | 31 title="You can use dd or rawrite to create the 1.44M floppy disk" /> |
pascal@0 | 32 <?php } ?> |
pascal@6 | 33 <input name="download" value="DOS/EXE" type="submit" |
pascal@6 | 34 title="<?php echo $title; ?>" /> |
pascal@6 | 35 <?php if (file_exists("/boot/isolinux/isolinux.bin")) { |
paul@17 | 36 $title="Can be burnt on to a CD-ROM or written on to a USB Key / memory card"; |
pascal@6 | 37 if (file_exists("/usr/bin/iso2exe")) |
pascal@6 | 38 $title .= ", or renamed with the .exe suffix and run with DOS or Windows"; |
pascal@6 | 39 ?> |
pascal@6 | 40 <input name="download" value="ISO image" type="submit" |
pascal@6 | 41 title="<?php echo $title; ?>" /> |
pascal@6 | 42 <?php } ?> |
pascal@6 | 43 </td></tr> |
pascal@0 | 44 |
pascal@0 | 45 |
pascal@6 | 46 <tr><td class="first">Files for bootloaders:</td><td> |
pascal@6 | 47 |
pascal@6 | 48 <input name="download" value="Kernel (<?php echo show_size("fs/boot/bzImage"); |
pascal@6 | 49 ?>)" type="submit" /> |
pascal@6 | 50 <input name="download" value="Rootfs (<?php echo show_size("rootfs.gz"); |
pascal@6 | 51 ?>)" title="For the initrd= parameter" type="submit" /> |
pascal@21 | 52 <?php if (show_size("fs/boot/memtest") != "") { ?> |
pascal@21 | 53 <input name="download" value="Memtest (<?php echo show_size("fs/boot/memtest"); |
pascal@21 | 54 ?>)" type="submit" /> |
pascal@21 | 55 <?php } ?> |
pascal@21 | 56 <?php if (show_size("fs/boot/gpxe") != "") { ?> |
pascal@21 | 57 <input name="download" value="GPXE (<?php echo show_size("fs/boot/gpxe"); |
pascal@21 | 58 ?>)" type="submit" /> |
pascal@21 | 59 <?php } ?> |
pascal@21 | 60 <?php if (show_size("fs/boot/ipxe") != "") { ?> |
pascal@21 | 61 <input name="download" value="IPXE (<?php echo show_size("fs/boot/ipxe"); |
pascal@21 | 62 ?>)" type="submit" /> |
pascal@21 | 63 <?php } ?> |
pascal@6 | 64 </td></tr> |
pascal@6 | 65 |
pascal@6 | 66 |
pascal@6 | 67 <tr><td class="first">Configuration info:</td><td> |
pascal@6 | 68 |
pascal@6 | 69 <input name="download" value="Configuration files" type="submit" /> |
pascal@6 | 70 <input name="download" value="packages.conf (<?php |
pascal@6 | 71 echo show_size("fs/etc/packages.conf"); ?>)" type="submit" /> |
pascal@6 | 72 </td></tr> |
pascal@6 | 73 |
pascal@0 | 74 |
pascal@0 | 75 <?php if (show_size("fs/boot/System.map") != "") { ?> |
pascal@6 | 76 <tr><td class="first">Debug info:</td><td> |
pascal@6 | 77 |
pascal@6 | 78 <input name="download" value="System.map (<?php echo show_size("fs/boot/System.map"); |
pascal@6 | 79 ?>)" type="submit" /> |
pascal@6 | 80 <input name="download" value="linux.config (<?php echo show_size("fs/boot/config"); |
pascal@6 | 81 ?>)" type="submit" /> |
pascal@6 | 82 <br> |
pascal@6 | 83 <input name="download" value="busybox.config (<?php echo show_size("fs/boot/config-busybox"); |
pascal@6 | 84 ?>)" type="submit" /> |
pascal@6 | 85 <input name="download" value="post_install.log (<?php echo show_size("post_install.log"); |
pascal@6 | 86 ?>)" type="submit" /> |
pascal@6 | 87 </td></tr> |
pascal@6 | 88 |
pascal@0 | 89 <?php } ?> |
pascal@0 | 90 |
pascal@6 | 91 </table> |
pascal@0 | 92 </form> |
pascal@6 | 93 </div> |
pascal@0 | 94 |
pascal@0 | 95 <h2>Going further</h2> |
pascal@6 | 96 |
pascal@6 | 97 <p>Tiny SliTaz should be smaller to have more functionality and/or needs less |
pascal@6 | 98 RAM.<br> |
pascal@6 | 99 The kernel can be <a href="http://elinux.org/Linux_Tiny">tuned/patched</a> or |
pascal@6 | 100 you can use an earlier version.</p> |
pascal@6 | 101 |
paul@17 | 102 <p>You can test Tiny SliTaz without pre-historic hardware using qemu (needs the |
pascal@18 | 103 <tt>ne.ko</tt> module):</p> |
pascal@6 | 104 |
pascal@0 | 105 <pre> |
pascal@5 | 106 qemu -cpu 486 -m 4 -net nic,model=ne2k_isa -net tap -fda slitaz.img |
pascal@0 | 107 </pre> |
pascal@6 | 108 |
pascal@6 | 109 <p>Or</p> |
pascal@6 | 110 |
pascal@0 | 111 <pre> |
pascal@5 | 112 qemu -cpu 486 -m 4 -net nic,model=ne2k_isa -net tap -kernel kernel -initrd rootfs.gz /dev/null |
pascal@0 | 113 </pre> |
pascal@6 | 114 |
pascal@6 | 115 <p>And the executable file <code>/etc/qemu-ifup</code>:</p> |
pascal@6 | 116 |
pascal@0 | 117 <pre> |
pascal@0 | 118 #!/bin/sh |
pascal@0 | 119 |
pascal@6 | 120 tunctl -u $(id -un) -t $1 |
pascal@0 | 121 ifconfig $1 192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0 |
pascal@0 | 122 </pre> |
pascal@0 | 123 |
pascal@0 | 124 <?php |
pascal@0 | 125 } |
pascal@0 | 126 ?> |