tiny-slitaz annotate step5.php @ rev 0

Initial move from slitaz-pizza
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Mar 23 19:37:38 2012 +0100 (2012-03-23)
parents
children 577e6e91216d
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@0 8 }
pascal@0 9
pascal@0 10 if (isset($_POST['toconfigure']) && $_POST['toconfigure'] == ""
pascal@0 11 && $output == "") {
pascal@0 12 shell_exec("sudo ./helper --mkrootfs ".$_POST['tmp_dir']);
pascal@0 13 ?>
pascal@0 14
pascal@0 15 <a name="get"></a>
pascal@0 16 <h2>Get Tiny SliTaz files</h2>
pascal@0 17
pascal@0 18 <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post" name="config">
pascal@0 19
pascal@0 20 <?php post_hidden(); ?>
pascal@0 21 <h3>Bootable images</h3>
pascal@0 22 <p>
pascal@0 23 <div align="center">
pascal@0 24 <input name="download" value="Floppy image" type="submit" />
pascal@0 25 <?php if (file_exists("/boot/isolinux/isolinux.bin")) { ?>
pascal@0 26 &nbsp;
pascal@0 27 <input name="download" value="ISO image" type="submit" />
pascal@0 28 <?php } ?>
pascal@0 29 </div>
pascal@0 30 </p>
pascal@0 31
pascal@0 32 <h3>Files for bootloaders</h3>
pascal@0 33 <p>
pascal@0 34 <div align="center">
pascal@0 35 <input name="download" value="Kernel (<?php echo show_size("fs/boot/bzImage");
pascal@0 36 ?>)" type="submit" />
pascal@0 37 &nbsp;
pascal@0 38 <input name="download" value="Rootfs (<?php echo show_size("rootfs.gz");
pascal@0 39 ?>)" type="submit" />
pascal@0 40 </div>
pascal@0 41 </p>
pascal@0 42
pascal@0 43 <h3>Configuration info</h3>
pascal@0 44 <p>
pascal@0 45 <div align="center">
pascal@0 46 <input name="download" value="Configuration files" type="submit" />
pascal@0 47 &nbsp;
pascal@0 48 <input name="download" value="packages.conf (<?php
pascal@0 49 echo show_size("fs/etc/packages.conf"); ?>)" type="submit" />
pascal@0 50 </div>
pascal@0 51 </p>
pascal@0 52
pascal@0 53 <?php if (show_size("fs/boot/System.map") != "") { ?>
pascal@0 54 <h3>Debug info</h3>
pascal@0 55 <p>
pascal@0 56 <div align="center">
pascal@0 57 <input name="download" value="System.map (<?php echo show_size("fs/boot/System.map");
pascal@0 58 ?>)" type="submit" />
pascal@0 59 &nbsp;
pascal@0 60 <input name="download" value="linux.config (<?php echo show_size("fs/boot/config");
pascal@0 61 ?>)" type="submit" />
pascal@0 62 </div>
pascal@0 63 </p>
pascal@0 64 <p>
pascal@0 65 <div align="center">
pascal@0 66 <input name="download" value="busybox.config (<?php echo show_size("fs/boot/config-busybox");
pascal@0 67 ?>)" type="submit" />
pascal@0 68 &nbsp;
pascal@0 69 <input name="download" value="post_install.log (<?php echo show_size("post_install.log");
pascal@0 70 ?>)" type="submit" />
pascal@0 71 </div>
pascal@0 72 </p>
pascal@0 73 <?php } ?>
pascal@0 74
pascal@0 75 </form>
pascal@0 76
pascal@0 77 <h2>Going further</h2>
pascal@0 78 <p>
pascal@0 79 Tiny SliTaz should be smaller to have more functionality
pascal@0 80 and/or needs less RAM.<br />
pascal@0 81 The kernel can be <a href="http://elinux.org/Linux_Tiny">tuned/patched</a>
pascal@0 82 or you can use an earlier version.
pascal@0 83 </p>
pascal@0 84 <p>
pascal@0 85 You can test Tiny SliTaz without pre-historic hardware using qemu:
pascal@0 86 </p>
pascal@0 87 <pre>
pascal@0 88 qemu -cpu 486 -m 8 -net nic,model=ne2k_isa -net tap -fda slitaz.img
pascal@0 89 </pre>
pascal@0 90 <p>
pascal@0 91 Or
pascal@0 92 </p>
pascal@0 93 <pre>
pascal@0 94 qemu -cpu 486 -m 8 -net nic,model=ne2k_isa -net tap -snapshot \
pascal@0 95 -kernel kernel -initrd rootfs.gz /dev/zero
pascal@0 96 </pre>
pascal@0 97 <p>
pascal@0 98 And the executable file /etc/qemu-ifup:
pascal@0 99 </p>
pascal@0 100 <pre>
pascal@0 101 #!/bin/sh
pascal@0 102
pascal@0 103 if [ -x /usr/sbin/openvpn ]; then
pascal@0 104 openvpn --mktun --dev $1 --user `id -un`
pascal@0 105 else
pascal@0 106 tunctl -u `id -un` -t $1
pascal@0 107 fi
pascal@0 108 ifconfig $1 192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0
pascal@0 109 </pre>
pascal@0 110 <p>
pascal@0 111 You can also update the file /etc/resolv.conf on the Tiny SliTaz guest with your
pascal@0 112 nameserver(s) and enable the ip routing on your desktop:
pascal@0 113 </p>
pascal@0 114 <pre>
pascal@0 115 # echo 1 > /proc/sys/net/ipv4/ip_forward
pascal@0 116 # yes y | tazpkg get-install iptables
pascal@0 117 # iptables -t nat -A POSTROUTING -j MASQUERADE
pascal@0 118 </pre>
pascal@0 119
pascal@0 120 <?php
pascal@0 121 }
pascal@0 122 ?>