tiny-slitaz rev 5

refresh
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Oct 07 23:37:02 2015 +0200 (2015-10-07)
parents 1d33b2a53785
children ac214416e736
files bootloader download.php helper index.php step1.php step2.php step3.php step4.php step5.php
line diff
     1.1 --- a/bootloader	Mon Sep 03 10:21:46 2012 +0200
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,213 +0,0 @@
     1.4 -#!/bin/sh
     1.5 -#
     1.6 -# This script creates a floppy image set from a linux bzImage and can merge
     1.7 -# a cmdline and/or one or more initramfs.
     1.8 -# The total size can not exceed 15M because INT 15H function 87H limitations.
     1.9 -#
    1.10 -# (C) 2009 Pascal Bellard - GNU General Public License v3.
    1.11 -
    1.12 -usage()
    1.13 -{
    1.14 -cat <<EOT
    1.15 -Usage: $0 bzImage [--prefix image_prefix] [--cmdline 'args']
    1.16 -       [--rdev device] [--video mode] [--flags rootflags] [--tracks cnt]
    1.17 -       [--format 1440|1680|1920|2880 ] [--initrd initrdfile]...
    1.18 -
    1.19 -Default values: --format 1440 --tracks 80 --prefix floppy.
    1.20 -
    1.21 -Example:
    1.22 -$0 /boot/vmlinuz-2.6.30.6 --rdev /dev/ram0 --video -3 --cmdline 'rw lang=fr_FR kmap=fr-latin1 laptop autologin' --initrd /boot/rootfs.gz --initrd ./myconfig.gz
    1.23 -EOT
    1.24 -exit 1
    1.25 -}
    1.26 -
    1.27 -KERNEL=""
    1.28 -INITRD=""
    1.29 -CMDLINE=""
    1.30 -PREFIX="floppy."
    1.31 -FORMAT="1440"
    1.32 -RDEV=""
    1.33 -VIDEO=""
    1.34 -FLAGS=""
    1.35 -TRACKS=""
    1.36 -DEBUG=""
    1.37 -while [ -n "$1" ]; do
    1.38 -	case "$1" in
    1.39 -	--c*|-c*)  CMDLINE="$2"; shift;;
    1.40 -	--i*|-i*)  INITRD="$INITRD $2"; shift;;
    1.41 -	--p*|-p*)  PREFIX="$2"; shift;;
    1.42 -	--fo*|-f*) FORMAT="$2"; shift;;
    1.43 -	--fl*)     FLAGS="$2"; shift;;	# 1 read-only, 0 read-write
    1.44 -	--r*|-r*)  RDEV="$2"; shift;;	# /dev/???
    1.45 -	--v*|-v*)  VIDEO="$2"; shift;;	# -3 .. n
    1.46 -	--t*|-t*)  TRACKS="$2"; shift;; # likely 81 .. 84
    1.47 -	--debug)   DEBUG="1";;
    1.48 -	*) KERNEL="$1";;
    1.49 -	esac
    1.50 -	shift
    1.51 -done
    1.52 -[ -n "$KERNEL" -a -f "$KERNEL" ] || usage
    1.53 -if [ -n "$TRACKS" ]; then
    1.54 -	if [ $(( $FORMAT % $TRACKS )) -ne 0 ]; then
    1.55 -		echo "Invalid track count for format $FORMAT."
    1.56 -		usage
    1.57 -	fi
    1.58 -fi
    1.59 -
    1.60 -# write a 16 bits data
    1.61 -# usage: store16 offset data16 file
    1.62 -store16()
    1.63 -{
    1.64 -	echo $(( $2 + 0x10000 )) | \
    1.65 -		awk '{ printf "\\\\x%02X\\\\x%02X",$1%256,($1/256)%256 }' | \
    1.66 -		xargs echo -en | \
    1.67 -	dd bs=2 conv=notrunc of=$3 seek=$(( $1 / 2 )) 2> /dev/null
    1.68 -	[ -n "$DEBUG" ] && printf "store16(%04X) = %04X\n" $1 $2 1>&2
    1.69 -}
    1.70 -
    1.71 -# write a 32 bits data
    1.72 -# usage: storelong offset data32 file
    1.73 -storelong()
    1.74 -{
    1.75 -	echo $2 | awk '{ printf "\\\\x%02X\\\\x%02X\\\\x%02X\\\\x%02X",
    1.76 -		 $1%256,($1/256)%256,($1/256/256)%256,($1/256/256/256)%256 }' | \
    1.77 -		xargs echo -en | \
    1.78 -		dd bs=4 conv=notrunc of=$3 seek=$(( $1 / 4 )) 2> /dev/null
    1.79 -	[ -n "$DEBUG" ] && printf "storelong(%04X) = %08X\n" $1 $2 1>&2
    1.80 -}
    1.81 -
    1.82 -# read a 32 bits data
    1.83 -# usage: getlong offset file
    1.84 -getlong()
    1.85 -{
    1.86 -	dd if=$2 bs=1 skip=$(( $1 )) count=4 2> /dev/null | \
    1.87 -		hexdump -e '"" 1/4 "%d" "\n"'
    1.88 -}
    1.89 -
    1.90 -floppyset()
    1.91 -{
    1.92 -	# bzImage offsets
    1.93 -	CylinderCount=496
    1.94 -	SetupSzOfs=497
    1.95 -	FlagsOfs=498
    1.96 -	SyssizeOfs=500
    1.97 -	VideoModeOfs=506
    1.98 -	RootDevOfs=508
    1.99 -	CodeAdrOfs=0x214
   1.100 -	RamfsAdrOfs=0x218
   1.101 -	RamfsLenOfs=0x21C
   1.102 -	ArgPtrOfs=0x228
   1.103 -
   1.104 -	# boot+setup address
   1.105 -	SetupBase=0x90000
   1.106 -
   1.107 -	stacktop=0x9E00
   1.108 -
   1.109 -	bs=/tmp/bs$$
   1.110 -
   1.111 -	# Get and patch boot sector
   1.112 -	# See  http://hg.slitaz.org/wok/raw-file/711d076b277c/linux/stuff/linux-header-2.6.34.u
   1.113 -	dd if=$KERNEL bs=512 count=1 of=$bs 2> /dev/null
   1.114 -	uudecode <<EOT | dd of=$bs conv=notrunc 2> /dev/null
   1.115 -begin-base64 644 -
   1.116 -/L+6nWgAkAcGF4n8McC5HQDzq1sfD6mg8X1ABlfFd3ixBvOlZWaPR3gGH8ZF
   1.117 -+D/6l1hB6DQBvgACA3QO6HYBWwseKAJ0LFNH6AoBXuhmAbAgzRCwCM0QTuhl
   1.118 -ATwIdAOIBK05NigCdPDoPgE8CnXgiHz+ieb/TBD/TBi/9AGBTRz/gMdFMACc
   1.119 -sBCxBUi0k4lEHLABiUQUmGaY0+BIZgMFZtPoaAAQB7+AACn4nHMCAccx21BW
   1.120 -6J4AXrkAgLSH/kQczRVYnXfcoRoCvxwCsQk4RBxyuJPNE+oAACCQsEYoyL7b
   1.121 -AejSAF3rI4D5E3IEOMF3a4D+AnIEOOZ3bGCB/QAGdCoGUlFTlrQCULEGtQTB
   1.122 -xQSwDyHoBJAnFEAn6IwA/s117LAgzRDitOiWAJjNE2FSUCjIdwKwAZg5+HIC
   1.123 -ifhQtALNE5VeWFpyoJVBjuGAxwJPdFFOdfSM4ZU4wXVFiMj+xrEBOOZ1O4j0
   1.124 -/sW2AID9UHIwOi7wAXIqtQBgvt4B/kQMU+gxAFvoOAB1FlKYzRO4AQLNE1rQ
   1.125 -1Dpk/nXqRgjkdeVh64sWB7AxLAO0DrsHAM0QPA1088OwDejv/6wIwHX4w79s
   1.126 -BLFbZQINuA0BZToNdArNFnT0mM0Wju9Hw1g6AEluc2VydCBkaXNrIDEuBw0A
   1.127 -AA==
   1.128 -====
   1.129 -EOT
   1.130 -
   1.131 -	# Get setup
   1.132 -	setupsz=$(getlong $SetupSzOfs $bs)
   1.133 -	setupszb=$(( $setupsz & 255 ))
   1.134 -	dd if=$KERNEL bs=512 skip=1 count=$setupszb 2> /dev/null >> $bs
   1.135 -
   1.136 -	if [ -n "$TRACKS" ]; then
   1.137 -		[ -n "$DEBUG" ] && echo -n "--tracks " 1>&2
   1.138 -		n=$(getlong $CylinderCount $bs)
   1.139 -		store16 $CylinderCount $(( ($n & -256) + $TRACKS )) $bs
   1.140 -	fi
   1.141 -	if [ -n "$FLAGS" ]; then
   1.142 -		[ -n "$DEBUG" ] && echo -n "--flags " 1>&2
   1.143 -		store16 $FlagsOfs $FLAGS $bs
   1.144 -	fi
   1.145 -	if [ -n "$VIDEO" ]; then
   1.146 -		[ -n "$DEBUG" ] && echo -n "--video " 1>&2
   1.147 -		store16 $VideoModeOfs $VIDEO $bs
   1.148 -	fi
   1.149 -	if [ -n "$RDEV" ]; then
   1.150 -		if [ "$(dirname $RDEV)" == "/dev" -a -b $RDEV ]; then
   1.151 -			[ -n "$DEBUG" ] && echo -n "--rdev " 1>&2
   1.152 -			RDEV=$(stat -c '0x%02t%02T' $RDEV 2> /dev/null)
   1.153 -			store16 $RootDevOfs $RDEV $bs
   1.154 -		fi
   1.155 -	fi
   1.156 -
   1.157 -	# Store cmdline after setup
   1.158 -	if [ -n "$CMDLINE" ]; then
   1.159 -		[ -n "$DEBUG" ] && echo -n "--cmdline '$CMDLINE' " 1>&2
   1.160 -		echo -n "$CMDLINE" | dd bs=512 count=1 conv=sync 2> /dev/null >> $bs
   1.161 -		storelong $ArgPtrOfs $(( $SetupBase + $stacktop )) $bs
   1.162 -	fi
   1.163 -
   1.164 -	# Compute initramfs size
   1.165 -	initrdlen=0
   1.166 -	for i in $( echo $INITRD | sed 's/,/ /' ); do
   1.167 -		[ -s "$i" ] || continue
   1.168 -		[ -n "$DEBUG" ] && echo "--initrd $i " 1>&2
   1.169 -		initrdlen=$(( ($initrdlen + $(stat -c %s $i) + 3) & -4 ))
   1.170 -	done
   1.171 -	if [ $initrdlen -ne 0 ]; then
   1.172 -		[ -n "$DEBUG" ] && echo "initrdlen = $initrdlen " 1>&2
   1.173 -		storelong $RamfsAdrOfs \
   1.174 -			$(( (0x1000000 - $initrdlen) & 0xFFFF0000 )) $bs
   1.175 -		storelong $RamfsLenOfs $initrdlen $bs
   1.176 -	fi
   1.177 -
   1.178 -	# Output boot sector + setup + cmdline
   1.179 -	dd if=$bs 2> /dev/null
   1.180 -
   1.181 -	# Output kernel code
   1.182 -	dd if=$KERNEL bs=512 skip=$(( $setupszb + 1 )) 2> /dev/null
   1.183 -
   1.184 -	# Pad to next sector
   1.185 -	Kpad=$(( 512 - ($(stat -c %s $KERNEL) & 511) ))
   1.186 -	[ $Kpad -eq 512 ] || dd if=/dev/zero bs=1 count=$Kpad 2> /dev/null
   1.187 -
   1.188 -	# Output initramfs
   1.189 -	padding=0
   1.190 -	for i in $( echo $INITRD | sed 's/,/ /' ); do
   1.191 -		[ -s "$i" ] || continue
   1.192 -		[ $padding -ne 0 ] && dd if=/dev/zero bs=1 count=$padding 2> /dev/null
   1.193 -		dd if=$i 2> /dev/null
   1.194 -		padding=$(( 4 - ($(stat -c %s $i) & 3) ))
   1.195 -		[ $padding -eq 4 ] && padding=0
   1.196 -	done
   1.197 -
   1.198 -	# Cleanup
   1.199 -	rm -f $bs
   1.200 -}
   1.201 -
   1.202 -if [ "$FORMAT" == "0" ]; then # unsplitted
   1.203 -	floppyset > $PREFIX
   1.204 -	PAD=$(( 512 - ($(stat -c %s $PREFIX) % 512) ))
   1.205 -	[ $PAD -ne 512 ] && dd if=/dev/zero bs=1 count=$PAD >> $PREFIX 2> /dev/null
   1.206 -	exit
   1.207 -fi
   1.208 -floppyset | split -b ${FORMAT}k /dev/stdin floppy$$
   1.209 -i=1
   1.210 -ls floppy$$* | while read file ; do
   1.211 -	output=$PREFIX$(printf "%03d" $i)
   1.212 -	cat $file /dev/zero | dd bs=1k count=$FORMAT conv=sync of=$output 2> /dev/null
   1.213 -	echo $output
   1.214 -	rm -f $file
   1.215 -	i=$(( $i + 1 ))
   1.216 -done
     2.1 --- a/download.php	Mon Sep 03 10:21:46 2012 +0200
     2.2 +++ b/download.php	Wed Oct 07 23:37:02 2015 +0200
     2.3 @@ -24,6 +24,8 @@
     2.4  			download("config_files.cpio.gz");
     2.5  	case "Floppy" : shell_exec("./helper --mkimg ".$_POST['tmp_dir']); 
     2.6  			download("slitaz.img");
     2.7 +	case "DOS/EX" : shell_exec("./helper --mkexe ".$_POST['tmp_dir']); 
     2.8 +			download("slitaz.exe");
     2.9  	case "ISO im" : shell_exec("sudo ./helper --mkiso ".$_POST['tmp_dir']); 
    2.10  			download("slitaz.iso");
    2.11  	case "System" : download("fs/boot/System.map");
     3.1 --- a/helper	Mon Sep 03 10:21:46 2012 +0200
     3.2 +++ b/helper	Wed Oct 07 23:37:02 2015 +0200
     3.3 @@ -43,12 +43,15 @@
     3.4  		esac
     3.5  		grep -qs "^$PACKAGE " $TMPDIR/uploadconf &&
     3.6  			checked='checked="checked"'
     3.7 -		if [ -n "$AUTO_SELECTION" ]; then
     3.8 +		case "$AUTO_SELECTION" in
     3.9 +		never)
    3.10 +			checked='disabled' ;;
    3.11 +		always)
    3.12  			checked='checked="checked" disabled'
    3.13  			cat <<EOT
    3.14  <input type="hidden" name="selected[]" value="$PACKAGE" />
    3.15  EOT
    3.16 -		fi
    3.17 +		esac
    3.18  		cat <<EOT
    3.19  <tr>
    3.20  <td><input type="checkbox" name="selected[]" value="$PACKAGE" $checked /></td>
    3.21 @@ -225,7 +228,7 @@
    3.22  	. $pkg
    3.23  	echo "$1 $VERSION $(md5sum $(dirname $pkg)/fs.cpio.lzma | awk '{ print $1 }')" >> $2/fs/etc/packages.conf
    3.24  	if grep -qs ^post_install $pkg; then
    3.25 -		. $2/vars
    3.26 +		[ -s $2/vars ] && . $2/vars
    3.27  		echo "=== $pkg: $(date) ===" >> $2/post_install.log 2>&1
    3.28  		post_install $2/fs >> $2/post_install.log 2>&1
    3.29  		sed -e 's/^export/ /' -e 's/^/  /' < $2/vars >> $2/fs/etc/packages.conf
    3.30 @@ -321,8 +324,9 @@
    3.31  		cp ../kernel boot/bzImage
    3.32  	fi
    3.33  	find -user bellard -exec chown root.root {} \;
    3.34 -	find | grep -v ^./boot | cpio -o -H newc | lzma e ../rootfs.gz -si
    3.35 -	lzma_set_size ../rootfs.gz
    3.36 +	find | grep -v ^./boot | cpio -o -H newc | gzip -9 > ../rootfs.gz
    3.37 +	which advdef 2> /dev/null && advdef -z4 ../rootfs.gz
    3.38 +  find .. -exec ls -ld {} \; > /tmp/X
    3.39  fi
    3.40  if [ "x$1" == "x--mkiso" ]; then
    3.41  	tmp=$2
    3.42 @@ -330,6 +334,7 @@
    3.43  	cat $tmp/fs/boot/System.map | gzip -9 > $tmp/iso/data/sysmap.gz
    3.44  	cat $tmp/fs/boot/config | gzip -9 > $tmp/iso/data/linconf.gz
    3.45  	cat $tmp/fs/boot/config-busybox | gzip -9 > $tmp/iso/data/bbconf.gz
    3.46 +	cp $tmp/fs/boot/bundle $tmp/iso/data/bundle.sh
    3.47  	cat $tmp/post_install.log | gzip -9 > $tmp/iso/data/log.gz
    3.48  	cp $tmp/config_files $tmp/iso/data/files.cnf
    3.49  	cp $tmp/fs/etc/packages.conf $tmp/iso/data/packages.cnf
    3.50 @@ -352,14 +357,18 @@
    3.51          [ -x /usr/bin/isohybrid ] &&
    3.52          /usr/bin/isohybrid $tmp/slitaz.iso 2> /dev/null
    3.53  fi
    3.54 +if [ "x$1" == "x--mkexe" ]; then
    3.55 +	tmp=$2
    3.56 +	cd $tmp
    3.57 +	cp fs/boot/bzImage slitaz.exe
    3.58 +	sh fs/boot/bundle slitaz.exe rootfs.gz exe
    3.59 +fi
    3.60  if [ "x$1" == "x--mkimg" ]; then
    3.61  	tmp=$2
    3.62 -	exe=$PWD
    3.63  	cd $tmp
    3.64 -	$exe/bootloader fs/boot/bzImage --initrd rootfs.gz --format 0
    3.65 -	mv floppy. slitaz.img
    3.66 -#	$exe/bootloader fs/boot/bzImage --initrd rootfs.gz
    3.67 -#	cat floppy.* > slitaz.img && rm -f floppy.*
    3.68 +	cp fs/boot/bzImage slitaz.img
    3.69 +	sh fs/boot/bundle slitaz.img rootfs.gz floppy
    3.70 +	dd of=slitaz.img bs=18k seek=80 count=0 conv=notrunc 2> /dev/null
    3.71  fi
    3.72  if [ "x$1" == "x--mkcfg" ]; then
    3.73  	tmp=$2
    3.74 @@ -367,3 +376,11 @@
    3.75  	for i in $(sed 's#^/##' < ../config_files); do find $i; done | \
    3.76  		sort | uniq | cpio -o -H newc | gzip -9 > ../config_files.cpio.gz
    3.77  fi
    3.78 +if [ "x$1" == "x--chkdist" ]; then
    3.79 +	if [ pkgs/busybox-*/fs.cpio.lzma -nt dist/rootfs.cpio ]; then
    3.80 +		cat pkgs/busybox-*/fs.cpio.lzma | unlzma | ( cd dist ; cpio -idmu )
    3.81 +		mv -f dist/fs/* dist/
    3.82 +		rmdir dist/fs
    3.83 +		touch dist/*
    3.84 +	fi
    3.85 +fi
     4.1 --- a/index.php	Mon Sep 03 10:21:46 2012 +0200
     4.2 +++ b/index.php	Wed Oct 07 23:37:02 2015 +0200
     4.3 @@ -46,7 +46,7 @@
     4.4  <!-- Content -->
     4.5  <div id="content">
     4.6  
     4.7 -<?php if (isset($error) && $error != "") echo "
     4.8 +<?php if (!empty($error)) echo "
     4.9  <div class=\"nav_box\">
    4.10  	<h4>Error :</h4>
    4.11  	<p>$error</p>
    4.12 @@ -71,7 +71,7 @@
    4.13  	Useful software, expansible, easy to configure, runs fully in RAM, 
    4.14  	simple, light and fast for minimum hardware resources: ie fits on
    4.15  	one floppy disk (IDE disk optional), runs on a 386sx processor and
    4.16 -	needs as little memory as possible (currently 8 MB with a 2.6.34 
    4.17 +	needs as little memory as possible (currently 4 MB with a 2.6.14 
    4.18  	kernel).
    4.19  	<a href="http://doc.slitaz.org/en:guides:pxe#why-use-pxe-the-vnc-example">
    4.20  	Example</a>
    4.21 @@ -98,11 +98,9 @@
    4.22  	The initramfs is based on <a href="http://uclibc.org/"
    4.23  	title="Instead of glibc">uClibc</a> and 
    4.24  	busybox with its <a href="dist/busybox.config.txt">config</a>
    4.25 -	files and the packages 
    4.26 -	<a href="http://pkgs.slitaz.org/search.cgi?filelist=slitaz-base-files">
    4.27 -	slitaz-base-files</a> and 
    4.28 -	<a href="http://pkgs.slitaz.org/search.cgi?filelist=slitaz-boot-scripts">
    4.29 -	slitaz-boot-scripts</a>.
    4.30 +	files and this
    4.31 +	<a href="http://hg.slitaz.org/wok-tiny/file/tip/base-tiny/stuff">
    4.32 +	filesystem tree</a>.
    4.33  </p>
    4.34  </div>
    4.35  
    4.36 @@ -127,6 +125,27 @@
    4.37  		<a href="http://en.wikipedia.org/wiki/SliTaz">Wikipedia</a>
    4.38  		<a href="http://flattr.com/profile/slitaz">Flattr</a>
    4.39  	</p>
    4.40 +<p>
    4.41 +	<script type="text/javascript">
    4.42 +	function QRCodePNG(str, obj) {
    4.43 +		try {
    4.44 +			obj.height = obj.width += 200;
    4.45 +			return QRCode.generatePNG(str, {ecclevel: 'H'});
    4.46 +		}
    4.47 +		catch (any) {
    4.48 +			var element = document.createElement("script");
    4.49 +			element.src = "/static/qrcode.js";
    4.50 +			element.type ="text/javascript"; 
    4.51 +			element.onload = function() {
    4.52 +				obj.src = QRCode.generatePNG(str, {ecclevel: 'H'});
    4.53 +			};
    4.54 +			document.body.appendChild(element);
    4.55 +		}
    4.56 +	}
    4.57 +	</script>
    4.58 +	<img src="/static/qr.png" alt="#" onmouseover="this.title = location.href"
    4.59 +	 onclick="this.src = QRCodePNG(location.href, this)" />
    4.60 +</p>
    4.61  </div>
    4.62  
    4.63  </body>
     5.1 --- a/step1.php	Mon Sep 03 10:21:46 2012 +0200
     5.2 +++ b/step1.php	Wed Oct 07 23:37:02 2015 +0200
     5.3 @@ -1,5 +1,6 @@
     5.4  <?php 
     5.5  
     5.6 +shell_exec("sudo ./helper --chkdist"); 
     5.7  $usedvars = array( "kernel", "modules", "packages", "toconfigure",
     5.8  	"continue", "configuring", "tmp_dir" );
     5.9  
    5.10 @@ -119,10 +120,7 @@
    5.11  
    5.12  <div>
    5.13  <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post" name="kernels">
    5.14 -<?php
    5.15 -	echo shell_exec("./helper --list-kernels ".$_POST["tmp_dir"]);
    5.16 -	post_hidden();
    5.17 -?>
    5.18 +<input type="hidden" name="kernel" value="linux" />
    5.19  <p>
    5.20  </p>
    5.21  
     6.1 --- a/step2.php	Mon Sep 03 10:21:46 2012 +0200
     6.2 +++ b/step2.php	Wed Oct 07 23:37:02 2015 +0200
     6.3 @@ -1,15 +1,13 @@
     6.4  <?php
     6.5  
     6.6 -if (isset($_POST['kernel']) && $_POST['kernel'] == "kernel-modular" &&
     6.7 -   !isset($_POST['modules'])) {
     6.8 +if (isset($_POST['kernel']) && !isset($_POST['modules'])) {
     6.9  	if (isset($_POST['selected'])) {
    6.10  		$_POST['modules'] = implode(" ",$_POST['selected']);
    6.11  		unset($_POST['selected']);
    6.12  	}
    6.13  }
    6.14  
    6.15 -if (isset($_POST['kernel']) && $_POST['kernel'] == "kernel-modular" &&
    6.16 -   !isset($_POST['modules'])) {
    6.17 +if (isset($_POST['kernel']) && !isset($_POST['modules'])) {
    6.18  
    6.19  ?>
    6.20  
     7.1 --- a/step3.php	Mon Sep 03 10:21:46 2012 +0200
     7.2 +++ b/step3.php	Wed Oct 07 23:37:02 2015 +0200
     7.3 @@ -1,7 +1,7 @@
     7.4  <?php
     7.5  
     7.6  if (isset($_POST['kernel']) && 
     7.7 -   ($_POST['kernel'] != "kernel-modular" || isset($_POST['modules'])) &&
     7.8 +   (isset($_POST['modules'])) &&
     7.9     !isset($_POST['packages'])) {
    7.10  	if (isset($_POST['selected'])) {
    7.11  		upload("mypackages");
    7.12 @@ -9,13 +9,13 @@
    7.13  		if ($_POST['selected'][$last] == "uploaded") {
    7.14  			unset($_POST['selected'][$last]);
    7.15  		}
    7.16 -		$_POST['packages'] = implode(" ",$_POST['selected']);
    7.17 +		$_POST['packages'] = $_POST['modules'].' '.implode(" ",$_POST['selected']);
    7.18  		unset($_POST['selected']);
    7.19  	}
    7.20  }
    7.21  
    7.22  if (isset($_POST['kernel']) && 
    7.23 -   ($_POST['kernel'] != "kernel-modular" || isset($_POST['modules'])) &&
    7.24 +   (isset($_POST['modules'])) &&
    7.25     !isset($_POST['packages'])) {
    7.26  
    7.27  	mkdir($_POST["tmp_dir"]."/fs");
     8.1 --- a/step4.php	Mon Sep 03 10:21:46 2012 +0200
     8.2 +++ b/step4.php	Wed Oct 07 23:37:02 2015 +0200
     8.3 @@ -17,7 +17,7 @@
     8.4  }
     8.5  
     8.6  $output = '';
     8.7 -if (isset($_POST['toconfigure']) && $_POST['toconfigure'] != "") {
     8.8 +if (!empty($_POST['toconfigure'])) {
     8.9  	$pkgs = explode(" ",$_POST['toconfigure']);
    8.10  	foreach ($pkgs as $key => $pkg) {
    8.11  		shell_exec("sudo ./helper --pre-install $pkg ".$_POST['tmp_dir']); 
     9.1 --- a/step5.php	Mon Sep 03 10:21:46 2012 +0200
     9.2 +++ b/step5.php	Wed Oct 07 23:37:02 2015 +0200
     9.3 @@ -22,6 +22,8 @@
     9.4  <p>
     9.5  <div align="center">
     9.6  <input name="download" value="Floppy image" type="submit" />
     9.7 +&nbsp;
     9.8 +<input name="download" value="DOS/EXE" type="submit" />
     9.9  <?php if (file_exists("/boot/isolinux/isolinux.bin")) { ?>
    9.10  &nbsp;
    9.11  <input name="download" value="ISO image" type="submit" />
    9.12 @@ -82,17 +84,16 @@
    9.13  or you can use an earlier version.
    9.14  </p>
    9.15  <p>
    9.16 -You can test Tiny SliTaz without pre-historic hardware using qemu:
    9.17 +You can test Tiny SliTaz without pre-historic hardware using qemu (need the ne module) :
    9.18  </p>
    9.19  <pre>
    9.20 -qemu -cpu 486 -m 8 -net nic,model=ne2k_isa -net tap -fda slitaz.img
    9.21 +qemu -cpu 486 -m 4 -net nic,model=ne2k_isa -net tap -fda slitaz.img
    9.22  </pre>
    9.23  <p>
    9.24  Or
    9.25  </p>
    9.26  <pre>
    9.27 -qemu -cpu 486 -m 8 -net nic,model=ne2k_isa -net tap -snapshot \
    9.28 -     -kernel kernel -initrd rootfs.gz /dev/zero
    9.29 +qemu -cpu 486 -m 4 -net nic,model=ne2k_isa -net tap -kernel kernel -initrd rootfs.gz /dev/null
    9.30  </pre>
    9.31  <p>
    9.32  And the executable file /etc/qemu-ifup:
    9.33 @@ -100,22 +101,9 @@
    9.34  <pre>
    9.35  #!/bin/sh
    9.36  
    9.37 -if [ -x /usr/sbin/openvpn ]; then
    9.38 -	openvpn --mktun --dev $1 --user `id -un`
    9.39 -else
    9.40 -	tunctl -u `id -un` -t $1                           
    9.41 -fi                              
    9.42 +tunctl -u $(id -un) -t $1                           
    9.43  ifconfig $1 192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0
    9.44  </pre>
    9.45 -<p>
    9.46 -You can also update the file /etc/resolv.conf on the Tiny SliTaz guest with your
    9.47 -nameserver(s) and enable the ip routing on your desktop:
    9.48 -</p>
    9.49 -<pre>
    9.50 -# echo 1 > /proc/sys/net/ipv4/ip_forward
    9.51 -# yes y | tazpkg get-install iptables
    9.52 -# iptables -t nat -A POSTROUTING -j MASQUERADE
    9.53 -</pre>
    9.54  
    9.55  <?php
    9.56  }