tiny-slitaz diff create.php @ rev 32

Do not suggest packages twice
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Sep 26 13:55:40 2019 +0200 (2019-09-26)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/create.php	Thu Sep 26 13:55:40 2019 +0200
     1.3 @@ -0,0 +1,64 @@
     1.4 +<?php
     1.5 +
     1.6 +$sizes = array(
     1.7 +	"1474560" => "1.44 MB", "1720320" => "1.68 MB",
     1.8 +	"1966080" => "1.92 MB", "2949120" => "2.88 MB"
     1.9 +);
    1.10 +?>
    1.11 +<form method="post" enctype="multipart/form-data" action="<?php echo $_SERVER["PHP_SELF"]; ?>">
    1.12 +<table>
    1.13 +	<tr>
    1.14 +	<td>Initramfs :</td>
    1.15 +	<td><select name="initrd">
    1.16 +		 <option value="">No configuration</option>
    1.17 +		 <option value="upload">Use my configuration ----></option>
    1.18 +<?php
    1.19 +//		 <option value="builder">Use online rootfs builder</option>
    1.20 +
    1.21 +function blocksize($file)
    1.22 +{
    1.23 +	global $use_sectors;
    1.24 +	if ($use_sectors)
    1.25 +		return floor((filesize($file) + 511) / 512)." sectors";
    1.26 +	else
    1.27 +		return "use ".((filesize($file) + 511) & -512)." bytes";
    1.28 +}
    1.29 +
    1.30 +foreach ($demos as $name)
    1.31 +	echo "<option value=\"demos/$name\">Demo $name (".blocksize("demos/".$name).
    1.32 +		")</option>\n";
    1.33 +closedir($dir);
    1.34 +?>
    1.35 +	</select></td>
    1.36 +	<td><input type="file" name="uploadinitrd" /></td>
    1.37 +	</tr>
    1.38 +	<tr>
    1.39 +	<td>Kernel :</td>
    1.40 +	<td><select name="kernel">
    1.41 +		<option value="dist/bzImage.lzma">LZMA (<?php echo blocksize("dist/bzImage.lzma") ?>)</option>
    1.42 +		<option value="dist/bzImage.gz">GZIP (<?php echo blocksize("dist/bzImage.gz") ?>)</option>
    1.43 +		<option value="upload">Use my kernel ----></option>
    1.44 +	</select></td>
    1.45 +	<td><input type="file" name="uploadkernel" /></td>
    1.46 +	</tr>
    1.47 +	<tr>
    1.48 +	<td>Floppy :</td>
    1.49 +	<td><select name="size">
    1.50 +<?php
    1.51 +	foreach ($sizes as $key => $value) {
    1.52 +		if ($use_sectors)
    1.53 +			echo "		<option value=\"$key\">$value (".($key/512)." sectors)</option>\n";
    1.54 +		else
    1.55 +			echo "		<option value=\"$key\">$value ($key bytes)</option>\n";
    1.56 +	}
    1.57 +?>
    1.58 +	</select></td>
    1.59 +	<td align="center">
    1.60 +	<input name="build" value="Build floppy" type="submit" />
    1.61 +<?php if (file_exists("/boot/isolinux/isolinux.bin")) { ?>
    1.62 +	<input name="buildiso" value="Build ISO image" type="submit" />
    1.63 +<?php } ?>
    1.64 +	</td>
    1.65 +	</tr>
    1.66 +</table>
    1.67 +</form>