#
%define url $URL$
-%define nodefamily %{pldistro}-%{_arch}
+%define nodefamily %{pldistro}-%{distroname}-%{_arch}
+%define extensionfamily %{distroname}-%{_arch}
%define name bootstrapfs-%{nodefamily}
-%define version 1.0
-%define taglevel 11
+%define version 2.0
+%define taglevel 6
# pldistro already in the rpm name
#%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
Requires: tar, gnupg, sharutils, bzip2
+# 5.0 now has 3-fold nodefamily
+%define obsolete_nodefamily %{pldistro}-%{_arch}
+Obsoletes: bootstrapfs-%{obsolete_nodefamily}
+
AutoReqProv: no
%define debug_package %{nil}
%description plain
This package provides the same functions as %{name} but with uncompressed tarball for faster tests.
+%package -n nodeyum
+Summary: the MyPLC-side utilities for tweaking nodes yum configs
+Group: System Environment/Base
+%description -n nodeyum
+Utility scripts for configuring node updates. This package is designed
+for the MyPLC side.
+
%prep
%setup -q
%build
-pushd BootstrapFS
+
+############################## node-side
+[ -d bootstrapfs ] || ln -s BootstrapFS bootstrapfs
+pushd bootstrapfs
./build.sh %{pldistro}
-popd BootstrapFS
+for tar in *.tar *.tar.bz2; do
+ echo "* Computing SHA1 checksum for $tar"
+ sha1sum $tar > $tar.sha1sum
+ chmod 444 $tar.sha1sum
+done
+popd
+
+############################## server-side
+# ship all fcdistros for multi-fcdistros myplc, and let the php scripts do the right thing
+pushd bootstrapfs/nodeconfig/yum
+# scan fcdistros and catenate all repos in 'stock.repo' so db-config can be distro-independant
+for fcdistro in $(ls); do
+ [ -d $fcdistro ] || continue
+ # get kexcludes for that distro
+ KEXCLUDE="exclude=$(../../../build/getkexcludes.sh -f $fcdistro)"
+ pushd $fcdistro/yum.myplc.d
+ echo "* Handling KEXCLUDE in yum repo for $fcdistro ($KEXCLUDE)"
+ for filein in $(find . -name '*.in') ; do
+ file=$(echo $filein | sed -e "s,\.in$,,")
+ sed -e "s,@KEXCLUDE@,$KEXCLUDE,g" $filein > $file
+ done
+ rm -f stock.repo
+ cat *.repo > stock.repo
+ popd
+done
+popd
%install
rm -rf $RPM_BUILD_ROOT
-pushd BootstrapFS
-arch=$(uname -i)
-
-install -D -m 644 bootstrapfs-%{pldistro}-${arch}.tar.bz2 \
- $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-%{pldistro}-${arch}.tar.bz2
-install -D -m 644 bootstrapfs-%{pldistro}-${arch}.tar \
- $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-%{pldistro}-${arch}.tar
-
-for pkgs in $(ls ../build/config.%{pldistro}/bootstrapfs-*.pkgs) ; do
- NAME=$(basename $pkgs .pkgs | sed -e s,bootstrapfs-,,)
- install -D -m 644 %{pldistro}-filesystems/bootstrapfs-${NAME}-${arch}.tar.bz2 \
- $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-${NAME}-${arch}.tar.bz2
- install -D -m 644 %{pldistro}-filesystems/bootstrapfs-${NAME}-${arch}.tar \
- $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-${NAME}-${arch}.tar
+############################## node-side
+pushd bootstrapfs
+for out in *.tar *.tar.bz2 ; do
+ echo "* Installing $out"
+ install -D -m 644 $out $RPM_BUILD_ROOT/var/www/html/boot/$out
+done
+for out in *.sha1sum; do
+ echo "* Installing $out"
+ install -D -m 444 $out $RPM_BUILD_ROOT/var/www/html/boot/$out
done
+popd
+############################## server-side
+# ship all fcdistros for multi-fcdistros myplc, and let the php scripts do the right thing
+pushd bootstrapfs
+echo "* Installing MyPLC-side nodes yum config utilities (support for multi-fcdistro)"
+mkdir -p $RPM_BUILD_ROOT/var/www/html/yum/
+rsync -av ./nodeconfig/yum/ $RPM_BUILD_ROOT/var/www/html/yum/
+
+# Install initscripts
+echo "* Installing plc.d initscripts"
+find plc.d | cpio -p -d -u ${RPM_BUILD_ROOT}/etc/
+chmod 755 ${RPM_BUILD_ROOT}/etc/plc.d/*
+
+echo "* Installing db-config.d files"
+mkdir -p ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d
+cp db-config.d/* ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d
+chmod 444 ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d/*
popd
%clean
rm -rf $RPM_BUILD_ROOT
-# If run under sudo
-if [ -n "$SUDO_USER" ] ; then
- # Allow user to delete the build directory
- chown -h -R $SUDO_USER .
- # Some temporary cdroot files like /var/empty/sshd and
- # /usr/bin/sudo get created with non-readable permissions.
- find . -not -perm +0600 -exec chmod u+rw {} \;
- # Allow user to delete the built RPM(s)
- chown -h -R $SUDO_USER %{_rpmdir}/*
-fi
-
-%post
%files
%defattr(-,root,root,-)
/var/www/html/boot/bootstrapfs*.tar.bz2
+/var/www/html/boot/bootstrapfs*.tar.bz2.sha1sum
%files plain
%defattr(-,root,root,-)
/var/www/html/boot/bootstrapfs*.tar
+/var/www/html/boot/bootstrapfs*.tar.sha1sum
+
+%files -n nodeyum
+%defattr(-,root,root,-)
+/var/www/html/yum
+/etc/planetlab/db-config.d
+/etc/plc.d
%changelog
+* Mon Jul 05 2010 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - BootstrapFS-2.0-6
+- add sha1sum
+- module name changes
+
+* Tue Apr 27 2010 Talip Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - BootstrapFS-2.0-5
+- support different flavours of vservers on nodes
+
+* Mon Apr 12 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-2.0-4
+- fix unmatched $ in URL svn keywords
+
+* Fri Apr 02 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-2.0-3
+- choice between various pldistros is not made at build time, but at run time
+- relies on GetNodeFlavour to expose the node's fcdistro - requires PLCAPI-5.0-5
+- in addition, the baseurl for the myplc repo is http:// and not https:// anymore
+- the https method does not work on fedora 12, and GPG is used below anyway
+
+* Fri Mar 12 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-2.0-2
+- new slicerepo package for exposing stuff to slivers
+
+* Fri Jan 29 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-2.0-1
+- first working version of 5.0:
+- pld.c/, db-config.d/ and nodeconfig/ scripts should now sit in the module they belong to
+- nodefailiy is 3-fold with pldistro-fcdistro-arch
+- new module nodeyum; first draft has the php scripts and conf_files for tweaking nodes yum config
+
* Mon Jan 04 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-11
- for building on fedora12
* Fri Sep 2 2005 Mark Huang <mlhuang@cotton.CS.Princeton.EDU> -
- Initial build.
+
+%define module_current_branch 1.0
# Copyright (C) 2005-2007 The Trustees of Princeton University
#
# $Id$
-#
+# $URL$
#
# This will build the bootstrafs-*.tar.bz2 images, which comprises
# which is made up of just the additional files needed for a ${NAME} nodegroup
# node.
#
+# It is expected to be in sync with the getNodeFlavour PLCAPI method
PATH=/sbin:/bin:/usr/sbin:/usr/bin
# expecting fcdistro and pldistro on the command line
pldistro=$1; shift
fcdistro=${pl_DISTRO_NAME}
+arch=${pl_DISTRO_ARCH}
+nodefamily=${pldistro}-${fcdistro}-${arch}
+extensionfamily=${fcdistro}-${arch}
# Do not tolerate errors
set -e
[ -z "$displayed" ] && echo "* Handling ${pldistro} bootstrapfs extensions"
displayed=true
- extension_plain=bootstrapfs-${NAME}-${pl_DISTRO_ARCH}.tar
- extension_name=bootstrapfs-${NAME}-${pl_DISTRO_ARCH}.tar.bz2
+ extension_plain=bootstrapfs-${NAME}-${extensionfamily}.tar
+ extension_name=bootstrapfs-${NAME}-${extensionfamily}.tar.bz2
echo "* Start Building $extension_name: $(date)"
# clean out yum cache to reduce space requirements
yum -c ${vref}/etc/mkfedora-yum.conf --installroot=${vref} -y clean all
-bootstrapfs_plain=bootstrapfs-${pldistro}-${pl_DISTRO_ARCH}.tar
-bootstrapfs_name=bootstrapfs-${pldistro}-${pl_DISTRO_ARCH}.tar.bz2
+bootstrapfs_plain=bootstrapfs-${nodefamily}.tar
+bootstrapfs_name=bootstrapfs-${nodefamily}.tar.bz2
echo -n "* tar $bootstrapfs_name s=$(date +%H-%M-%S)"
tar -cpf $bootstrapfs_plain -C ${vref} .
echo -n " m=$(date +%H-%M-%S) "
--- /dev/null
+# -*-python-*-
+# $Id: 030-conf_files 16642 2010-01-18 17:14:40Z thierry $
+# $URL: svn+ssh://thierry@svn.planet-lab.org/svn/MyPLC/trunk/db-config.d/030-conf_files $
+#################### conf files
+
+conf_files = [
+
+# myplc/noderepo
+ # YUM configuration
+ {'enabled': True,
+ 'source': 'yum/myplc.repo.php?gpgcheck=1',
+ 'dest': '/etc/yum.myplc.d/myplc.repo',
+ 'file_permissions': '644', 'file_owner': 'root', 'file_group': 'root',
+ 'preinstall_cmd': '', 'postinstall_cmd': '', 'error_cmd': '',
+ 'ignore_cmd_errors': False,
+ 'always_update': False},
+ {'enabled': True,
+ 'source': 'yum/yum.php?path=yum.conf',
+ 'dest': '/etc/yum.conf',
+ 'file_permissions': '644', 'file_owner': 'root', 'file_group': 'root',
+ 'preinstall_cmd': '', 'postinstall_cmd': '', 'error_cmd': '',
+ 'ignore_cmd_errors': False,
+ 'always_update': False},
+ {'enabled': True,
+ 'source': 'yum/yum.php?path=yum.myplc.d/stock.repo',
+ 'dest': '/etc/yum.myplc.d/stock.repo',
+ 'file_permissions': '644', 'file_owner': 'root', 'file_group': 'root',
+ 'preinstall_cmd': '', 'postinstall_cmd': '', 'error_cmd': '',
+ 'ignore_cmd_errors': False,
+ 'always_update': False},
+
+# NodeUpdate
+ {'enabled': True,
+ 'source': 'PlanetLabConf/delete-rpm-list-production',
+ 'dest': '/etc/planetlab/delete-rpm-list',
+ 'file_permissions': '644',
+ 'file_owner': 'root',
+ 'file_group': 'root',
+ 'preinstall_cmd': '',
+ 'postinstall_cmd': '',
+ 'error_cmd': '',
+ 'ignore_cmd_errors': False,
+ 'always_update': False},
+
+# NodeUpdate
+ # /etc/planetlab/extensions
+ {'enabled': True,
+ 'source': 'PlanetLabConf/extensions.php',
+ 'dest': '/etc/planetlab/extensions',
+ 'file_permissions': '644',
+ 'file_owner': 'root',
+ 'file_group': 'root',
+ 'preinstall_cmd': '',
+ 'postinstall_cmd': '',
+ 'error_cmd': '',
+ 'ignore_cmd_errors': False,
+ 'always_update': False},
+
+ ]
+
+for conf_file in conf_files:
+ SetConfFile(conf_file)
--- /dev/null
+# CentOS 5
+# $URL$
+[main]
+# Overwriting the default yum repos dir
+reposdir=/etc/yum.myplc.d
+pkgpolicy=newest
+exactarch=0
+keepcache=0
+cachedir=/var/cache/yum
+debuglevel=1
+logfile=/var/log/yum.log
+distroverpkg=redhat-release
+tolerant=1
+obsoletes=1
+gpgcheck=1
+plugins=0
+
+# Note: yum-RHN-plugin doesn't honor this.
+metadata_expire=1h
+
+# Default.
+# installonly_limit = 3
+
--- /dev/null
+# $URL$
+# CentOS-Base.repo
+#
+# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
+# The mirror system uses the connecting IP address of the client and the
+# update status of each mirror to pick mirrors that are updated to and
+# geographically close to the client. You should use this for CentOS updates
+# unless you are manually picking other mirrors.
+#
+# If the mirrorlist= does not work for you, as a fall back you can try the
+# remarked out baseurl= line instead.
+#
+#
+
+[base]
+name=CentOS-$releasever - Base
+mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
+#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
+@KEXCLUDE@
+gpgcheck=1
+enabled=1
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
+
+#released updates
+[updates]
+name=CentOS-$releasever - Updates
+mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
+#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
+@KEXCLUDE@
+gpgcheck=1
+enabled=1
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
+
+#packages used/produced in the build but not released
+[addons]
+name=CentOS-$releasever - Addons
+mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
+#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
+@KEXCLUDE@
+gpgcheck=1
+enabled=0
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
+
+#additional packages that may be useful
+[extras]
+name=CentOS-$releasever - Extras
+mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
+#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
+@KEXCLUDE@
+gpgcheck=1
+enabled=0
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
+
+#additional packages that extend functionality of existing packages
+[centosplus]
+name=CentOS-$releasever - Plus
+mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
+#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
+@KEXCLUDE@
+gpgcheck=1
+enabled=0
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
+
--- /dev/null
+# $URL$
+[epel]
+name=Extra Packages for Enterprise Linux 5 - $basearch
+#baseurl=http://download.fedoraproject.org/pub/epel/5/$basearch
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch
+failovermethod=priority
+@KEXCLUDE@
+enabled=1
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
+
+[epel-debuginfo]
+name=Extra Packages for Enterprise Linux 5 - $basearch - Debug
+#baseurl=http://download.fedoraproject.org/pub/epel/5/$basearch/debug
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-debug-5&arch=$basearch
+failovermethod=priority
+@KEXCLUDE@
+enabled=0
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
+gpgcheck=1
+
+[epel-source]
+name=Extra Packages for Enterprise Linux 5 - $basearch - Source
+#baseurl=http://download.fedoraproject.org/pub/epel/5/SRPMS
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-source-5&arch=$basearch
+failovermethod=priority
+@KEXCLUDE@
+enabled=0
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
+gpgcheck=1
--- /dev/null
+# Fedora 10
+# $URL$
+[main]
+# Overwriting the default yum repos dir
+reposdir=/etc/yum.myplc.d
+cachedir=/var/cache/yum
+debuglevel=1
+logfile=/var/log/yum.log
+lockfile=/var/lock/yum.pid
+pkgpolicy=newest
+distroverpkg=fedora-release
+installonlypkgs=
+exactarch=0
--- /dev/null
+# $URL$
+[updates]
+name=Fedora $releasever - $basearch - Updates
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=1
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
+
+[updates-debuginfo]
+name=Fedora $releasever - $basearch - Updates - Debug
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch/debug/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-debug-f$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=0
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
+
+[updates-source]
+name=Fedora $releasever - Updates Source
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/SRPMS/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-source-f$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=0
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
--- /dev/null
+# $URL$
+[fedora]
+name=Fedora $releasever - $basearch
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=1
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
+
+[fedora-debuginfo]
+name=Fedora $releasever - $basearch - Debug
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/debug/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-debug-$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=0
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
+
+[fedora-source]
+name=Fedora $releasever - Source
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/source/SRPMS/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-source-$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=0
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
--- /dev/null
+# Fedora 12
+# $URL$
+[main]
+# Overwriting the default yum repos dir
+reposdir=/etc/yum.myplc.d
+cachedir=/var/cache/yum
+debuglevel=1
+logfile=/var/log/yum.log
+lockfile=/var/lock/yum.pid
+pkgpolicy=newest
+distroverpkg=fedora-release
+installonlypkgs=
+exactarch=0
--- /dev/null
+# $URL$
+[updates]
+name=Fedora $releasever - $basearch - Updates
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=1
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
+
+[updates-debuginfo]
+name=Fedora $releasever - $basearch - Updates - Debug
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch/debug/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-debug-f$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=0
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
+
+[updates-source]
+name=Fedora $releasever - Updates Source
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/SRPMS/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-source-f$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=0
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
--- /dev/null
+# $URL$
+[fedora]
+name=Fedora $releasever - $basearch
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=1
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
+
+[fedora-debuginfo]
+name=Fedora $releasever - $basearch - Debug
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/debug/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-debug-$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=0
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
+
+[fedora-source]
+name=Fedora $releasever - Source
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/source/SRPMS/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-source-$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=0
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
--- /dev/null
+# Fedora 8
+# $URL$
+[main]
+# Overwriting the default yum repos dir
+reposdir=/etc/yum.myplc.d
+cachedir=/var/cache/yum
+debuglevel=1
+logfile=/var/log/yum.log
+lockfile=/var/lock/yum.pid
+pkgpolicy=newest
+distroverpkg=fedora-release
+installonlypkgs=
+exactarch=0
--- /dev/null
+# $URL$
+[updates]
+name=Fedora $releasever - $basearch - Updates
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=1
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
+
+[updates-debuginfo]
+name=Fedora $releasever - $basearch - Updates - Debug
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch/debug/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-debug-f$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=0
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
+
+[updates-source]
+name=Fedora $releasever - Updates Source
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/SRPMS/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-source-f$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=0
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
+
+[updates-newkey]
+name=Fedora $releasever - $basearch - Updates Newkey
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch.newkey/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever.newkey&arch=$basearch
+@KEXCLUDE@
+enabled=1
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-8-and-9
+
+[updates-newkey-debuginfo]
+name=Fedora $releasever - $basearch - Updates - Debug Newkey
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch.newkey/debug/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-debug-f$releasever.newkey&arch=$basearch
+@KEXCLUDE@
+enabled=0
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-8-and-9
+
+[updates-newkey-source]
+name=Fedora $releasever - Updates Source Newkey
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/SRPMS.newkey/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-source-f$releasever.newkey&arch=$basearch
+@KEXCLUDE@
+enabled=0
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-8-and-9
--- /dev/null
+# $URL$
+[fedora]
+name=Fedora $releasever - $basearch
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=1
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
+
+[fedora-debuginfo]
+name=Fedora $releasever - $basearch - Debug
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/debug/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-debug-$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=0
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
+
+[fedora-source]
+name=Fedora $releasever - Source
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/source/SRPMS/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-source-$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=0
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
--- /dev/null
+<?php
+//
+// part of yum config on nodes
+//
+// Thierry Parmentelat
+// Copyright (C) 2008 INRIA
+//
+// $Id$
+// $URL$
+//
+
+// For PLC_NAME and PLC_BOOT_HOST
+include('plc_config.php');
+
+$PLC_NAME = PLC_NAME;
+$PLC_BOOT_HOST = PLC_BOOT_HOST;
+
+// Get admin API handle
+require_once 'plc_api.php';
+global $adm;
+
+if (isset($_REQUEST['gpgcheck'])) {
+ $gpgcheck = $_REQUEST['gpgcheck'];
+} else {
+ $gpgcheck = 0;
+}
+
+echo "# Generated by myplc.repo.php\n";
+echo '# $Id$' . "\n";
+echo '# $URL$' . "\n";
+# we assume the node is not so old that it would not send node_id
+# get node family
+if ( ! isset($_REQUEST['node_id'])) {
+ echo "# node_id is needed\n";
+ echo "# looks like you're running a very old NodeManager...\n";
+ echo "# bailing out..\n";
+ exit;
+ }
+
+$node_id = intval($_REQUEST['node_id']);
+$nodeflavour=$adm->GetNodeFlavour($node_id);
+$nodefamily=$nodeflavour['nodefamily'];
+
+$topdir=$_SERVER['DOCUMENT_ROOT'] . "/install-rpms/" . $nodefamily;
+# Thierry : starting with fedora 12, yum complains about not being able to
+# verify the certificates; as we're using gpgcheck on top of the rest,
+# it's safe to use http only
+$topurl="http://$PLC_BOOT_HOST" . "/install-rpms/" . $nodefamily;
+
+if ( is_dir (realpath($topdir))) {
+ echo "# This directory was checked to exist on the server-side\n";
+} else{
+ echo "# WARNING: plc-side yum repo $topdir NOT FOUND !!\n";
+}
+
+$repo_id=$nodefamily;
+$repo_name="$PLC_NAME $nodefamily";
+echo <<< __PLC_REPO__
+[$repo_id]
+name=$repo_name
+baseurl=$topurl
+gpgcheck=$gpgcheck
+
+__PLC_REPO__;
+
+?>
--- /dev/null
+<?php
+//
+// part of yum config on nodes
+//
+// Thierry Parmentelat
+// Copyright (C) 2008 INRIA
+//
+// $Id$
+// $URL$
+//
+
+// For PLC_NAME and PLC_BOOT_HOST
+include('plc_config.php');
+
+$PLC_NAME = PLC_NAME;
+$PLC_BOOT_HOST = PLC_BOOT_HOST;
+
+// Get admin API handle
+require_once 'plc_api.php';
+global $adm;
+
+if (isset($_REQUEST['gpgcheck'])) {
+ $gpgcheck = $_REQUEST['gpgcheck'];
+} else {
+ $gpgcheck = 0;
+}
+
+echo "# Generated by yum.php\n";
+echo '# $Id$' . "\n";
+echo '# $URL$' . "\n";
+# we assume the node is not so old that it would not send node_id
+# get node family
+if ( ! isset($_REQUEST['node_id'])) {
+ echo "# yum.php expects node_id to be set\n";
+ echo "# looks like you're running a very old NodeManager...\n";
+ echo "# bailing out..\n";
+ exit;
+ }
+$node_id = intval($_REQUEST['node_id']);
+$nodeflavour=$adm->GetNodeFlavour($node_id);
+$fcdistro=$nodeflavour['fcdistro'];
+
+if ( ! isset($_REQUEST['path'])) {
+ echo "# yum.php expect path to be set - bailing out\n";
+ exit;
+ }
+$path = $_REQUEST['path'];
+
+# try to open /var/www/html/yum/<fcdistro>/<path>
+$fc_name="/var/www/html/yum/" . $fcdistro . "/" . $path;
+
+$fc_contents=file_get_contents($fc_name);
+if ($fc_contents) {
+ echo "#\n";
+ echo "# yum.php has retrieved " . $fc_name . "\n";
+ echo "#\n";
+ print $fc_contents;
+ exit;
+ }
+echo "#\n";
+echo "# yum.php could not find the following path\n";
+echo "# " . $fc_name . "\n";
+echo "# bailing out\n";
+
+
+
+
# %{distrorelease} : e.g. 8
# %{node_rpms_plus} : as a +++ separated list of rpms from the build dir
-%define nodefamily %{pldistro}-%{_arch}
+%define nodefamily %{pldistro}-%{distroname}-%{_arch}
+%define obsolete_nodefamily %{pldistro}-%{_arch}
%define name noderepo-%{nodefamily}
-%define version 1.0
-%define taglevel 11
+%define version 2.0
+%define taglevel 6
# pldistro already in the rpm name
#%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
%define release %{taglevel}%{?date:.%{date}}
-Vendor: PlanetLab
-Packager: PlanetLab Central <support@planet-lab.org>
+Vendor: OneLab
+Packager: PlanetLab Europe <build@onelab.eu>
Distribution: PlanetLab %{plrelease}
URL: %(echo %{url} | cut -d ' ' -f 2)
-Summary: The initial content of the yum repository for nodes
+Summary: The yum repository for nodes, to be installed on the myplc-side
Name: %{name}
Version: %{version}
Release: %{release}
BuildRequires: rsync
Requires: myplc
+# 5.0 now has 3-fold nodefamily
+%define obsolete_nodefamily %{pldistro}-%{_arch}
+Obsoletes: noderepo-%{obsolete_nodefamily}
+
%define debug_package %{nil}
%description
rm -rf $RPM_BUILD_ROOT
%post
+# it would at first glance seem to make sense to invoke service plc start gpg here as well,
+# as noderepo might get installed before myplc gets even started
+# this however exhibit a deadlock, as rpm --almatches -e gpg-pubkey waits for transaction lock
+# that is help by the calling yum/rpm
service plc start packages
%files
%config(noreplace) /var/www/html/install-rpms/%{nodefamily}/yumgroups.xml
%changelog
+* Mon Jul 05 2010 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - BootstrapFS-2.0-6
+- add sha1sum
+- module name changes
+
+* Tue Apr 27 2010 Talip Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - BootstrapFS-2.0-5
+- support different flavours of vservers on nodes
+
+* Mon Apr 12 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-2.0-4
+- fix unmatched $ in URL svn keywords
+
+* Fri Apr 02 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-2.0-3
+- choice between various pldistros is not made at build time, but at run time
+- relies on GetNodeFlavour to expose the node's fcdistro - requires PLCAPI-5.0-5
+- in addition, the baseurl for the myplc repo is http:// and not https:// anymore
+- the https method does not work on fedora 12, and GPG is used below anyway
+
+* Fri Mar 12 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-2.0-2
+- new slicerepo package for exposing stuff to slivers
+
+* Fri Jan 29 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-2.0-1
+- first working version of 5.0:
+- pld.c/, db-config.d/ and nodeconfig/ scripts should now sit in the module they belong to
+- nodefailiy is 3-fold with pldistro-fcdistro-arch
+- new module nodeyum; first draft has the php scripts and conf_files for tweaking nodes yum config
+
* Mon Jan 04 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-11
- for building on fedora12
* Tue Mar 4 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> -
- Initial build.
+
+%define module_current_branch 1.0
--- /dev/null
+#!/bin/bash
+# $Id$
+# $URL$
+#
+# priority: 1200
+#
+# Update node package repository metadata and sign packages
+#
+# Mark Huang <mlhuang@cs.princeton.edu>
+# Copyright (C) 2006 The Trustees of Princeton University
+#
+
+# Source function library and configuration
+. /etc/plc.d/functions
+. /etc/planetlab/plc_config
+
+# Be verbose
+set -x
+
+case "$1" in
+ start)
+ if [ "$PLC_BOOT_ENABLED" != "1" ] ; then
+ exit 0
+ fi
+
+ MESSAGE=$"Signing and indexing node packages"
+ dialog "$MESSAGE"
+
+ shopt -s nullglob
+
+ shift
+ if [[ -z "$@" ]] ; then
+ # use all subdirs in install-rpms by default
+ repositories=/var/www/html/install-rpms/*
+ else
+ # else use argv
+ repositories="$@"
+ fi
+
+ ### availability of repo indexing tools
+ # old one - might be needed for old-style nodes
+ type -p yum-arch > /dev/null && have_yum_arch="true"
+ # new one
+ type -p createrepo > /dev/null && have_createrepo="true"
+
+
+ ### symlink vserver-PLDISTRO* and vserver-systemslices-PLDISTRO*
+ ### packages to each repository to be able to create different
+ ### flavours of vservers on nodes
+ for repository1 in $repositories; do
+ DISTRO=${PLC_FLAVOUR_SLICE_PLDISTRO}
+ VSERVER_PKG=vserver-$(basename $repository1)
+ VSERVER_SYS_SLICES_PKG=vserver-systemslices-$(basename $repository1)
+ for repository2 in $repositories; do
+ if [[ $(basename $repository1) == ${DISTRO}* ]] \
+ && [[ $(basename $repository2) == ${DISTRO}* ]] \
+ && [[ $repository1 != $repository2 ]] ; then
+ ln -s $repository1/${VSERVER_PKG}* $repository2
+ ln -s $repository1/${VSERVER_SYS_SLICES_PKG}* $repository2
+ fi
+ done
+ done
+
+ for repository in $repositories ; do
+ # the rpms that need signing
+ new_rpms=
+ # and the corresponding stamps
+ new_stamps=
+ # is there a need to refresh yum metadata
+ need_yum_arch=
+ need_createrepo=
+
+ # right after installation, no package is present
+ # but we still need to create index
+ [ -n "$have_yum_arch" -a ! -f $repository/headers/header.info ] && need_yum_arch=true
+ [ -n "$have_createrepo" -a ! -f $repository/repodata/repomd.xml ] && need_createrepo=true
+
+ for package in $(find $repository/ -name '*.rpm') ; do
+ stamp=$repository/signed-stamps/$(basename $package).signed
+ # If package is newer than signature stamp
+ if [ $package -nt $stamp ] ; then
+ new_rpms="$new_rpms $package"
+ new_stamps="$new_stamps $stamp"
+ fi
+ # Or than yum-arch headers
+ [ -n "$have_yum_arch" ] && [ $package -nt $repository/headers/header.info ] && need_yum_arch=true
+ # Or than createrepo database
+ [ -n "$have_createrepo" ] && [ $package -nt $repository/repodata/repomd.xml ] && need_createrepo=true
+ done
+
+ if [ -n "$new_rpms" ] ; then
+ # Create a stamp once the package gets signed
+ mkdir $repository/signed-stamps 2> /dev/null
+
+ # Sign RPMS. setsid detaches rpm from the terminal,
+ # allowing the (hopefully blank) GPG password to be
+ # entered from stdin instead of /dev/tty.
+ echo | setsid rpm \
+ --define "_signature gpg" \
+ --define "_gpg_path /etc/planetlab" \
+ --define "_gpg_name $PLC_MAIL_SUPPORT_ADDRESS" \
+ --resign $new_rpms && touch $new_stamps
+ check
+ fi
+
+ # Update repository index / yum metadata.
+
+ if [ -n "$need_yum_arch" ] ; then
+ # yum-arch sometimes leaves behind
+ # .oldheaders and .olddata directories accidentally.
+ rm -rf $repository/{.oldheaders,.olddata}
+ yum-arch $repository
+ check
+ fi
+
+ if [ -n "$need_createrepo" ] ; then
+ if [ -f $repository/yumgroups.xml ] ; then
+ createrepo --quiet -g yumgroups.xml $repository
+ else
+ createrepo --quiet $repository
+ fi
+ check
+ fi
+ done
+
+ result "$MESSAGE"
+ ;;
+ clean)
+ shift
+ if [[ -z "$@" ]] ; then
+ # use all subdirs in install-rpms by default
+ repositories=/var/www/html/install-rpms/*
+ else
+ # else use argv
+ repositories=$@
+ fi
+
+ for repository in $repositories ; do
+ rm -rf $repository/signed-stamps
+ rm -rf $repository/repodata
+ rm -rf $repository/headers
+ done
+ ;;
+ *)
+ echo "Usage: $0 start|clean [repo ..]"
+ ;;
+esac
+
+exit $ERRORS
--- /dev/null
+#
+# $Id$
+#
+%define url $URL$
+
+# build is expected to export the following rpm variables
+# %{distroname} : e.g. Fedora
+# %{distrorelease} : e.g. 8
+# %{slice_rpms_plus} : as a +++ separated list of rpms from the build dir
+
+%define nodefamily %{pldistro}-%{distroname}-%{_arch}
+%define obsolete_nodefamily %{pldistro}-%{_arch}
+
+%define name slicerepo-%{nodefamily}
+%define version 2.0
+%define taglevel 6
+
+# pldistro already in the rpm name
+#%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
+%define release %{taglevel}%{?date:.%{date}}
+
+Vendor: OneLab
+Packager: PlanetLab Europe <build@onelab.eu>
+Distribution: PlanetLab %{plrelease}
+URL: %(echo %{url} | cut -d ' ' -f 2)
+
+Summary: The yum repository for slices, to be installed on the myplc-side
+Name: %{name}
+Version: %{version}
+Release: %{release}
+License: BSD
+Group: System Environment/Base
+Source0: %{name}-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+# other archs must be able to install this
+BuildArch: noarch
+
+BuildRequires: rsync
+Requires: myplc
+
+%define debug_package %{nil}
+
+%description
+This rpm contains all the rpms that might ship on a sliver image
+they come organized into a yum repository
+
+%prep
+%setup -q
+
+%build
+echo nothing to do at build time for slicerepo
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+repo=slice-%{nodefamily}
+install -d -m 755 $RPM_BUILD_ROOT/var/www/html/install-rpms/$repo
+rpms=$(echo %{slice_rpms_plus} | sed -e 's,+++, ,g')
+for rpm in $rpms; do rsync %{_topdir}/$rpm $RPM_BUILD_ROOT/var/www/html/install-rpms/$repo/ ; done
+### yumgroups
+install -D -m 644 %{_topdir}/RPMS/yumgroups.xml $RPM_BUILD_ROOT/var/www/html/install-rpms/$repo/yumgroups.xml
+# do not do this yet, as plc.d/packages will do it anyway
+#createrepo -g yumgroups.xml $RPM_BUILD_ROOT/var/www/html/install-rpms/$repo
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+service plc start packages
+
+%files
+%defattr(-,root,root,-)
+/var/www/html/install-rpms/slice-%{nodefamily}
+# don't overwrite yumgroups.xml if exists
+%config(noreplace) /var/www/html/install-rpms/slice-%{nodefamily}/yumgroups.xml
+
+%changelog
+* Mon Jul 05 2010 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - BootstrapFS-2.0-6
+- add sha1sum
+- module name changes
+
+* Tue Apr 27 2010 Talip Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - BootstrapFS-2.0-5
+- support different flavours of vservers on nodes
+
+* Mon Apr 12 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-2.0-4
+- fix unmatched $ in URL svn keywords
+
+* Fri Apr 02 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-2.0-3
+- choice between various pldistros is not made at build time, but at run time
+- relies on GetNodeFlavour to expose the node's fcdistro - requires PLCAPI-5.0-5
+- in addition, the baseurl for the myplc repo is http:// and not https:// anymore
+- the https method does not work on fedora 12, and GPG is used below anyway
+
+* Fri Mar 12 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-2.0-2
+- new slicerepo package for exposing stuff to slivers
+