tiny-slitaz diff 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
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/step5.php	Fri Mar 23 19:37:38 2012 +0100
     1.3 @@ -0,0 +1,122 @@
     1.4 +<?php
     1.5 +
     1.6 +function show_size($file)
     1.7 +{
     1.8 +	return shell_exec("du -h ".$_POST['tmp_dir'].
     1.9 +		"$file | awk '{ printf \"%s\",$1 }'");
    1.10 +	
    1.11 +}
    1.12 + 
    1.13 +if (isset($_POST['toconfigure']) && $_POST['toconfigure'] == ""
    1.14 +    && $output == "") {
    1.15 +	shell_exec("sudo ./helper --mkrootfs ".$_POST['tmp_dir']); 
    1.16 +?>
    1.17 +
    1.18 +<a name="get"></a>
    1.19 +<h2>Get Tiny SliTaz files</h2>
    1.20 +
    1.21 +<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post" name="config">
    1.22 +
    1.23 +<?php	post_hidden(); ?>
    1.24 +<h3>Bootable images</h3>
    1.25 +<p>
    1.26 +<div align="center">
    1.27 +<input name="download" value="Floppy image" type="submit" />
    1.28 +<?php if (file_exists("/boot/isolinux/isolinux.bin")) { ?>
    1.29 +&nbsp;
    1.30 +<input name="download" value="ISO image" type="submit" />
    1.31 +<?php } ?>
    1.32 +</div>
    1.33 +</p>
    1.34 +
    1.35 +<h3>Files for bootloaders</h3>
    1.36 +<p>
    1.37 +<div align="center">
    1.38 +<input name="download" value="Kernel (<?php echo show_size("fs/boot/bzImage");
    1.39 + ?>)" type="submit" />
    1.40 +&nbsp;
    1.41 +<input name="download" value="Rootfs (<?php echo show_size("rootfs.gz");
    1.42 + ?>)" type="submit" />
    1.43 +</div>
    1.44 +</p>
    1.45 +
    1.46 +<h3>Configuration info</h3>
    1.47 +<p>
    1.48 +<div align="center">
    1.49 +<input name="download" value="Configuration files" type="submit" />
    1.50 +&nbsp;
    1.51 +<input name="download" value="packages.conf (<?php 
    1.52 +echo show_size("fs/etc/packages.conf"); ?>)" type="submit" />
    1.53 +</div>
    1.54 +</p>
    1.55 +
    1.56 +<?php if (show_size("fs/boot/System.map") != "") { ?>
    1.57 +<h3>Debug info</h3>
    1.58 +<p>
    1.59 +<div align="center">
    1.60 +<input name="download" value="System.map (<?php echo show_size("fs/boot/System.map");
    1.61 + ?>)" type="submit" />
    1.62 +&nbsp;
    1.63 +<input name="download" value="linux.config (<?php echo show_size("fs/boot/config");
    1.64 + ?>)" type="submit" />
    1.65 +</div>
    1.66 +</p>
    1.67 +<p>
    1.68 +<div align="center">
    1.69 +<input name="download" value="busybox.config (<?php echo show_size("fs/boot/config-busybox");
    1.70 + ?>)" type="submit" />
    1.71 +&nbsp;
    1.72 +<input name="download" value="post_install.log (<?php echo show_size("post_install.log");
    1.73 + ?>)" type="submit" />
    1.74 +</div>
    1.75 +</p>
    1.76 +<?php } ?>
    1.77 +
    1.78 +</form>
    1.79 +
    1.80 +<h2>Going further</h2>
    1.81 +<p>
    1.82 +Tiny SliTaz should be smaller to have more functionality
    1.83 +and/or needs less RAM.<br />
    1.84 +The kernel can be <a href="http://elinux.org/Linux_Tiny">tuned/patched</a>
    1.85 +or you can use an earlier version.
    1.86 +</p>
    1.87 +<p>
    1.88 +You can test Tiny SliTaz without pre-historic hardware using qemu:
    1.89 +</p>
    1.90 +<pre>
    1.91 +qemu -cpu 486 -m 8 -net nic,model=ne2k_isa -net tap -fda slitaz.img
    1.92 +</pre>
    1.93 +<p>
    1.94 +Or
    1.95 +</p>
    1.96 +<pre>
    1.97 +qemu -cpu 486 -m 8 -net nic,model=ne2k_isa -net tap -snapshot \
    1.98 +     -kernel kernel -initrd rootfs.gz /dev/zero
    1.99 +</pre>
   1.100 +<p>
   1.101 +And the executable file /etc/qemu-ifup:
   1.102 +</p>
   1.103 +<pre>
   1.104 +#!/bin/sh
   1.105 +
   1.106 +if [ -x /usr/sbin/openvpn ]; then
   1.107 +	openvpn --mktun --dev $1 --user `id -un`
   1.108 +else
   1.109 +	tunctl -u `id -un` -t $1                           
   1.110 +fi                              
   1.111 +ifconfig $1 192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0
   1.112 +</pre>
   1.113 +<p>
   1.114 +You can also update the file /etc/resolv.conf on the Tiny SliTaz guest with your
   1.115 +nameserver(s) and enable the ip routing on your desktop:
   1.116 +</p>
   1.117 +<pre>
   1.118 +# echo 1 > /proc/sys/net/ipv4/ip_forward
   1.119 +# yes y | tazpkg get-install iptables
   1.120 +# iptables -t nat -A POSTROUTING -j MASQUERADE
   1.121 +</pre>
   1.122 +
   1.123 +<?php
   1.124 +}
   1.125 +?>