3 // /etc/yum.conf for production nodes
5 // Mark Huang <mlhuang@cs.princeton.edu>
6 // Copyright (C) 2004-2006 The Trustees of Princeton University
8 // $Id: yum.conf.php,v 1.1 2006/11/06 22:02:17 mlhuang Exp $
11 // For PLC_NAME and PLC_BOOT_HOST
12 include('plc_config.php');
15 $PLC_BOOT_HOST = PLC_BOOT_HOST;
17 $repos = array(array('ThirdParty', 'Third Party RPMS', '3rdparty'));
19 if (isset($_REQUEST['alpha'])) {
20 $repos[] = array('PlanetLabAlpha', 'PlanetLab Alpha RPMS', 'planetlab-alpha');
21 } elseif (isset($_REQUEST['beta'])) {
22 $repos[] = array('PlanetLabBeta', 'PlanetLab Beta RPMS', 'planetlab-beta');
23 } elseif (isset($_REQUEST['rollout'])) {
24 $repos[] = array('PlanetLab', 'PlanetLab RPMS', 'planetlab-rollout');
26 $repos[] = array('PlanetLab', 'PlanetLab RPMS', 'planetlab');
29 if (isset($_REQUEST['gpgcheck'])) {
30 $gpgcheck = $_REQUEST['gpgcheck'];
35 // Requesting a mirror list. Yum bombs out completely if a repository
36 // is (even temporarily) unavailable, so if CoBlitz is down, provide a
37 // few more options. Make sure that gpgcheck remains enabled. Last
38 // chance option is ourselves so that yum never fails.
39 if (isset($_REQUEST['mirrorlist']) &&
40 isset($_REQUEST['repo']) &&
41 isset($_REQUEST['releasever'])) {
42 $mirrors = array("http://coblitz.planet-lab.org/pub/fedora/linux",
43 "http://fedora.gtlib.cc.gatech.edu/pub/fedora.redhat/linux",
44 "http://download.fedoraproject.org/pub/fedora/linux",
45 "ftp://rpmfind.net/linux/fedora",
46 "http://mirrors.kernel.org/fedora");
47 $releasever = $_REQUEST['releasever'];
48 switch ($_REQUEST['repo']) {
50 foreach ($mirrors as $mirror) {
51 echo "$mirror/core/$releasever/\$ARCH/os/\n";
55 foreach ($mirrors as $mirror) {
56 echo "$mirror/core/updates/$releasever/\$ARCH/\n";
60 foreach ($mirrors as $mirror) {
61 echo "$mirror/extras/$releasever/\$ARCH/\n";
66 // Always list ourselves last
67 echo "http://$PLC_BOOT_HOST/install-rpms/planetlab/\n";
71 // Requesting yum.conf. See above for the mirrorlist definition.
74 # Do not scan /etc/yum.repos.d/
76 cachedir=/var/cache/yum
78 logfile=/var/log/yum.log
83 name=Fedora Core \$releasever - \$basearch - Base
84 mirrorlist=http://$PLC_BOOT_HOST/PlanetLabConf/yum.conf.php?mirrorlist&repo=base&releasever=\$releasever
88 name=Fedora Core \$releasever - \$basearch - Released Updates
89 mirrorlist=http://$PLC_BOOT_HOST/PlanetLabConf/yum.conf.php?mirrorlist&repo=updates&releasever=\$releasever
93 name=Fedora Extras \$releasever - \$basearch
94 mirrorlist=http://$PLC_BOOT_HOST/PlanetLabConf/yum.conf.php?mirrorlist&repo=extras&releasever=\$releasever
100 // Figure out which repositories we actually have on this
101 // machine. MyPLC installations, for instance, generally only have
102 // PlanetLab RPMS installed.
103 foreach ($repos as $repo) {
105 $name = $repo[1] . " -- " . "$PLC_NAME Central";
106 $dir = "/install-rpms/" . $repo[2];
107 $baseurl = "http://$PLC_BOOT_HOST" . $dir . "/";
109 if (is_dir(realpath($_SERVER['DOCUMENT_ROOT'] . $dir))) {