-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.php
138 lines (120 loc) · 4.99 KB
/
index.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<html>
<head>
<title>Narcissus - Online image builder for the angstrom distribution</title>
<script language="javascript" type="text/javascript" src="scripts/js/MochiKit.js"></script>
<script language="javascript" type="text/javascript" src="scripts/js/internal_request.js"></script>
<link rel="stylesheet" type="text/css" title="dominion" href="css/dominion.css" media="screen" />
</head>
<body>
<?
/* Narcissus - Online image builder for the angstrom distribution
* Koen Kooi (c) 2008 - all rights reserved
*/
function machine_dropdown() {
$machine = array();
if ($handle = opendir ('./conf/'))
{
/* This is the correct way to loop over the directory. */
while (false !== ($file = readdir ($handle)))
{
if ($file != "." && $file != ".." && file_exists("./conf/$file/arch.conf"))
{
$machine[] = $file;
}
}
closedir ($handle);
}
sort($machine);
foreach($machine as $value) {
print ("\t<option value=\"$value\">$value</option>\n");
}
}
?>
This is a proof of concept online image builder for the Angstrom distribution. <div id="intro">The basic operation is simple:
<ol>
<li>select machine from dropdown list</li>
<li>check packages you want to have included</li>
<li>Change the random name for the image into the name you want it to be called</li>
<li>Click the "build me!" button</li>
</ol></div>
<div id="form" class="kader"><form name="entry_form" onsubmit="javascript:configureImage();return false">
Machine:
<select name="machine">
<? machine_dropdown(); ?>
</select >
<hr width="80%"/>
Package selections:<br/><br/>
<?
$base_array = array("task-boot" => "task-boot",
"task-base" => "task-base",
"task-base-extended" => "task-base-extended");
$wm_array = array("Matchbox" => "angstrom-x11-base-depends angstrom-gpe-task-base",
"Illume" => "e-wm e-wm-config-illume angstrom-x11-base-depends angstrom-gpe-task-base",
"Enlightenment" => "e-wm e-wm-config-standard e-wm-config-default angstrom-x11-base-depends angstrom-gpe-task-base",
"Metacity" => "metacity angstrom-x11-base-depends angstrom-gpe-task-base");
$devel_array = array("Python" => "python-core python-modules",
"Perl" => "perl perl-modules",
"Toolchain" => "task-native-sdk",
"Busybox replacements" => "task-proper-tools");
$packages_array = array("Abiword" => "abiword",
"Aircrack-ng" => "aircrack-ng",
"Apache" => "apache2",
"Bluez" => "bluez-utils",
"Boa" => "boa",
"Cherokee" => "cherokee",
"Duke Nukem 3D" => "duke3d",
"E-uae" => "e-uae",
"Epiphany" => "epiphany",
"Evince" => "evince",
"Fennec" => "fennec",
"Firefox" => "firefox",
"Gdbserver" => "gdbserver",
"Gimp" => "gimp",
"Gnome Games" => "gnome-games",
"Gnumeric" => "gnumeric",
"Gnuradio" => "gnuradio",
"Git" => "git",
"GSM0710muxd" => "gsm0710muxd",
"I2C-tools" => "i2c-tools",
"JamVM" => "jamvm",
"Kismet" => "kismet",
"Mediatomb" => "mediatomb",
"MPlayer" => "mplayer",
"MythTV" => "mythtv mythtv-theme-blue mythtv-theme-default",
"Nmap" => "nmap",
"Numptyphysics" => "numptyphysics",
"Octave" => "octave",
"OpenCV" => "opencv-samples",
"Pidgin IM" => "pidgin",
"Samba" => "samba",
"Screen" => "screen",
"ScummVM" => "scummvm");
foreach ($base_array as $pkg => $pkgdepends) {
print("<input type=\"checkbox\" name=\"pkg\" value=\"$pkgdepends\">$pkg<br/>\n");
}
print "<hr width='80%'/>\n\n";
foreach ($wm_array as $pkg => $pkgdepends) {
print("<input type=\"checkbox\" name=\"wm\" value=\"$pkgdepends\">$pkg<br/>\n");
}
print "<hr width='80%'/>\n\n";
foreach ($devel_array as $pkg => $pkgdepends) {
print("<input type=\"checkbox\" name=\"devel\" value=\"$pkgdepends\">$pkg<br/>\n");
}
print "<hr width='80%'/>\n\n";
foreach ($packages_array as $pkg => $pkgdepends) {
print("<input type=\"checkbox\" name=\"packages\" value=\"$pkgdepends\">$pkg<br/>\n");
}
print "<hr width='80%'/>\n\n";
?>
Image name:
<input type="text" name="name" id="name" value="random-<?print(substr(md5(time()),0,8));?>"/>
<hr width="80%"/>
<center><input type="submit" value="Build me!"/></center></form></div>
<br clear='all'/>
<div id="pkg_progress"></div>
<div id="image_link"></div>
<div id="configure_progress"></div>
<div id="image_progress"></div>
<div id="imgstatus"></div>
</body>
</html>