3 // /etc/yum.conf for production nodes
5 // Mark Huang <mlhuang@cs.princeton.edu>
6 // Copyright (C) 2004-2006 The Trustees of Princeton University
11 // For PLC_NAME and PLC_BOOT_HOST
12 include('plc_config.php');
15 $PLC_BOOT_HOST = PLC_BOOT_HOST;
17 ////////////////////////////// mirror list
19 // Requesting a mirror list. Yum bombs out completely if a repository
20 // is (even temporarily) unavailable, so if CoBlitz is down, provide a
21 // few more options. Make sure that gpgcheck remains enabled. Last
22 // chance option is ourselves so that yum never fails.
23 if (isset($_REQUEST['mirrorlist']) &&
24 isset($_REQUEST['repo']) &&
25 isset($_REQUEST['releasever'])) {
26 $mirrors = array("http://coblitz.codeen.org/coblitz.planet-lab.org/pub/fedora/linux",
27 "http://fedora.gtlib.cc.gatech.edu/pub/fedora.redhat/linux",
28 "http://download.fedoraproject.org/pub/fedora/linux",
29 "http://mirrors.kernel.org/fedora");
30 #"ftp://rpmfind.net/linux/fedora", still uses the old style of directory hierarchy
31 $releasever = $_REQUEST['releasever'];
32 switch ($_REQUEST['repo']) {
34 if ( intval($releasever) >= 7 )
36 foreach ($mirrors as $mirror) {
37 echo "$mirror/releases/$releasever/Everything/\$ARCH/os/\n";
41 foreach ($mirrors as $mirror) {
42 echo "$mirror/core/$releasever/\$ARCH/os/\n";
47 if ( intval($releasever) >= 7 )
49 foreach ($mirrors as $mirror) {
50 echo "$mirror/updates/$releasever/\$ARCH/\n";
54 foreach ($mirrors as $mirror) {
55 echo "$mirror/core/updates/$releasever/\$ARCH/\n";
61 // Always list ourselves last
62 echo "https://$PLC_BOOT_HOST/install-rpms/planetlab/\n";
66 ////////////////////////////// plain yum.conf
68 // Get admin API handle
69 require_once 'plc_api.php';
72 // Requesting yum.conf. See above for the mirrorlist definition.
74 #$oldrepos = array(array('FedoraCore2Base', 'Fedora Core 2 Base', 'stock-fc2'),
75 # array('FedoraCore2Updates', 'Fedora Core 2 Updates', 'updates-fc2'),
76 # array('ThirdParty', 'Third Party RPMS', '3rdparty'));
78 $repos = array(array('ThirdParty', 'Third Party RPMS', '3rdparty'));
81 if (isset($_REQUEST['alpha'])) {
82 $repos[] = array('PlanetLabAlpha', 'PlanetLab Alpha RPMS', 'planetlab-alpha');
83 } elseif (isset($_REQUEST['beta'])) {
84 $repos[] = array('PlanetLabBeta', 'PlanetLab Beta RPMS', 'planetlab-beta');
85 } elseif (isset($_REQUEST['rollout'])) {
86 $repos[] = array('PlanetLab', 'PlanetLab RPMS', 'planetlab-rollout');
88 $repos[] = array('PlanetLab', 'PlanetLab RPMS', 'planetlab');
91 if (isset($_REQUEST['gpgcheck'])) {
92 $gpgcheck = $_REQUEST['gpgcheck'];
100 # Do not scan /etc/yum.repos.d/
102 cachedir=/var/cache/yum
104 logfile=/var/log/yum.log
109 name=Fedora Core \$releasever - \$basearch - Base
110 mirrorlist=https://$PLC_BOOT_HOST/PlanetLabConf/yum.conf.php?mirrorlist&repo=base&releasever=\$releasever
112 # PlanetLab builds its own versions of these tools
113 exclude=iptables kernel kernel kernel-devel kernel-smp kernel-smp-devel kernel-xen0 kernel-xen0-devel kernel-xenU kernel-xenU-devel mysql ulogd
116 name=Fedora Core \$releasever - \$basearch - Released Updates
117 mirrorlist=https://$PLC_BOOT_HOST/PlanetLabConf/yum.conf.php?mirrorlist&repo=updates&releasever=\$releasever
119 # PlanetLab builds its own versions of these tools
120 exclude=iptables kernel kernel kernel-devel kernel-smp kernel-smp-devel kernel-xen0 kernel-xen0-devel kernel-xenU kernel-xenU-devel mysql ulogd
124 // Figure out which repositories we actually have on this
125 // machine. MyPLC installations, for instance, generally only have
126 // PlanetLab RPMS installed.
127 foreach ($repos as $repo) {
129 $name = $repo[1] . " -- " . "$PLC_NAME Central";
130 $dir = "/install-rpms/" . $repo[2];
131 $baseurl = "https://$PLC_BOOT_HOST" . $dir . "/";
133 if (is_dir(realpath($_SERVER['DOCUMENT_ROOT'] . $dir))) {
145 if (isset($_REQUEST['node_id'])) {
146 $node_id=intval($_REQUEST['node_id']);
147 echo "# node_id = " . $node_id . "\n";
149 $nodes = $adm->GetNodes(array('node_id'=>$node_id));
150 $nodegroup_ids = $nodes[0]['nodegroup_ids'];
151 $nodegroups = $adm->GetNodeGroups($nodegroup_ids);
152 foreach ($nodegroups as $nodegroup) {
153 echo "# in nodegroup " . $nodegroup['name'] . "\n" ;