-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcreate.php
64 lines (61 loc) · 1.74 KB
/
create.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
$sizes = array(
"1474560" => "1.44 MB", "1720320" => "1.68 MB",
"1966080" => "1.92 MB", "2949120" => "2.88 MB"
);
?>
<form method="post" enctype="multipart/form-data" action="<?php echo $_SERVER["PHP_SELF"]; ?>">
<table>
<tr>
<td>Initramfs :</td>
<td><select name="initrd">
<option value="">No configuration</option>
<option value="upload">Use my configuration ----></option>
<?php
// <option value="builder">Use online rootfs builder</option>
function blocksize($file)
{
global $use_sectors;
if ($use_sectors)
return floor((filesize($file) + 511) / 512)." sectors";
else
return "use ".((filesize($file) + 511) & -512)." bytes";
}
foreach ($demos as $name)
echo "<option value=\"demos/$name\">Demo $name (".blocksize("demos/".$name).
")</option>\n";
closedir($dir);
?>
</select></td>
<td><input type="file" name="uploadinitrd" /></td>
</tr>
<tr>
<td>Kernel :</td>
<td><select name="kernel">
<option value="dist/bzImage.lzma">LZMA (<?php echo blocksize("dist/bzImage.lzma") ?>)</option>
<option value="dist/bzImage.gz">GZIP (<?php echo blocksize("dist/bzImage.gz") ?>)</option>
<option value="upload">Use my kernel ----></option>
</select></td>
<td><input type="file" name="uploadkernel" /></td>
</tr>
<tr>
<td>Floppy :</td>
<td><select name="size">
<?php
foreach ($sizes as $key => $value) {
if ($use_sectors)
echo " <option value=\"$key\">$value (".($key/512)." sectors)</option>\n";
else
echo " <option value=\"$key\">$value ($key bytes)</option>\n";
}
?>
</select></td>
<td align="center">
<input name="build" value="Build floppy" type="submit" />
<?php if (file_exists("/boot/isolinux/isolinux.bin")) { ?>
<input name="buildiso" value="Build ISO image" type="submit" />
<?php } ?>
</td>
</tr>
</table>
</form>