From: root Date: Fri, 20 Aug 2010 13:09:28 +0000 (+0200) Subject: Merge commit 'local_master/master' X-Git-Tag: bootstrapfs-2.0-7~4 X-Git-Url: http://git.onelab.eu/?p=bootstrapfs.git;a=commitdiff_plain;h=bf875be66195318943b34cd86845f9d83c0bdeb4;hp=39553505e4ab024b95a905755883b3d997ec4fd7 Merge commit 'local_master/master' --- diff --git a/bootstrapfs.spec b/bootstrapfs.spec index 4fb6090..8662536 100644 --- a/bootstrapfs.spec +++ b/bootstrapfs.spec @@ -3,11 +3,12 @@ # %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}} @@ -31,6 +32,10 @@ BuildArch: noarch 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} @@ -45,60 +50,128 @@ Group: System Environment/Base %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 - BootstrapFS-2.0-6 +- add sha1sum +- module name changes + +* Tue Apr 27 2010 Talip Baris Metin - BootstrapFS-2.0-5 +- support different flavours of vservers on nodes + +* Mon Apr 12 2010 Thierry Parmentelat - BootstrapFS-2.0-4 +- fix unmatched $ in URL svn keywords + +* Fri Apr 02 2010 Thierry Parmentelat - 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 - BootstrapFS-2.0-2 +- new slicerepo package for exposing stuff to slivers + +* Fri Jan 29 2010 Thierry Parmentelat - 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 - BootstrapFS-1.0-11 - for building on fedora12 @@ -144,3 +217,5 @@ fi * Fri Sep 2 2005 Mark Huang - - Initial build. + +%define module_current_branch 1.0 diff --git a/build.sh b/build.sh index 0067611..4fb0ae2 100755 --- a/build.sh +++ b/build.sh @@ -7,7 +7,7 @@ # Copyright (C) 2005-2007 The Trustees of Princeton University # # $Id$ -# +# $URL$ # # This will build the bootstrafs-*.tar.bz2 images, which comprises @@ -15,6 +15,7 @@ # 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 @@ -39,6 +40,9 @@ shift $shiftcount # 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 @@ -73,8 +77,8 @@ pkgs_count=$(ls ../build/config.${pldistro}/bootstrapfs-*.pkgs 2> /dev/null | wc [ -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)" @@ -149,8 +153,8 @@ done # 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) " diff --git a/db-config.d/030-conf_files_node_update b/db-config.d/030-conf_files_node_update new file mode 100644 index 0000000..69ebcf4 --- /dev/null +++ b/db-config.d/030-conf_files_node_update @@ -0,0 +1,62 @@ +# -*-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) diff --git a/nodeconfig/yum/centos5/yum.conf b/nodeconfig/yum/centos5/yum.conf new file mode 100644 index 0000000..3dc1b2a --- /dev/null +++ b/nodeconfig/yum/centos5/yum.conf @@ -0,0 +1,23 @@ +# 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 + diff --git a/nodeconfig/yum/centos5/yum.myplc.d/CentOS-Base.repo.in b/nodeconfig/yum/centos5/yum.myplc.d/CentOS-Base.repo.in new file mode 100644 index 0000000..c45b976 --- /dev/null +++ b/nodeconfig/yum/centos5/yum.myplc.d/CentOS-Base.repo.in @@ -0,0 +1,63 @@ +# $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 + diff --git a/nodeconfig/yum/centos5/yum.myplc.d/epel.repo.in b/nodeconfig/yum/centos5/yum.myplc.d/epel.repo.in new file mode 100644 index 0000000..7c8159f --- /dev/null +++ b/nodeconfig/yum/centos5/yum.myplc.d/epel.repo.in @@ -0,0 +1,30 @@ +# $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 diff --git a/nodeconfig/yum/f10/yum.conf b/nodeconfig/yum/f10/yum.conf new file mode 100644 index 0000000..ab30e9f --- /dev/null +++ b/nodeconfig/yum/f10/yum.conf @@ -0,0 +1,13 @@ +# 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 diff --git a/nodeconfig/yum/f10/yum.myplc.d/fedora-updates.repo.in b/nodeconfig/yum/f10/yum.myplc.d/fedora-updates.repo.in new file mode 100644 index 0000000..04de1a3 --- /dev/null +++ b/nodeconfig/yum/f10/yum.myplc.d/fedora-updates.repo.in @@ -0,0 +1,30 @@ +# $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 diff --git a/nodeconfig/yum/f10/yum.myplc.d/fedora.repo.in b/nodeconfig/yum/f10/yum.myplc.d/fedora.repo.in new file mode 100644 index 0000000..e7db63d --- /dev/null +++ b/nodeconfig/yum/f10/yum.myplc.d/fedora.repo.in @@ -0,0 +1,30 @@ +# $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 diff --git a/nodeconfig/yum/f12/yum.conf b/nodeconfig/yum/f12/yum.conf new file mode 100644 index 0000000..5b6d3a6 --- /dev/null +++ b/nodeconfig/yum/f12/yum.conf @@ -0,0 +1,13 @@ +# 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 diff --git a/nodeconfig/yum/f12/yum.myplc.d/fedora-updates.repo.in b/nodeconfig/yum/f12/yum.myplc.d/fedora-updates.repo.in new file mode 100644 index 0000000..04de1a3 --- /dev/null +++ b/nodeconfig/yum/f12/yum.myplc.d/fedora-updates.repo.in @@ -0,0 +1,30 @@ +# $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 diff --git a/nodeconfig/yum/f12/yum.myplc.d/fedora.repo.in b/nodeconfig/yum/f12/yum.myplc.d/fedora.repo.in new file mode 100644 index 0000000..e7db63d --- /dev/null +++ b/nodeconfig/yum/f12/yum.myplc.d/fedora.repo.in @@ -0,0 +1,30 @@ +# $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 diff --git a/nodeconfig/yum/f8/yum.conf b/nodeconfig/yum/f8/yum.conf new file mode 100644 index 0000000..8e8e63f --- /dev/null +++ b/nodeconfig/yum/f8/yum.conf @@ -0,0 +1,13 @@ +# 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 diff --git a/nodeconfig/yum/f8/yum.myplc.d/fedora-updates.repo.in b/nodeconfig/yum/f8/yum.myplc.d/fedora-updates.repo.in new file mode 100644 index 0000000..28f612a --- /dev/null +++ b/nodeconfig/yum/f8/yum.myplc.d/fedora-updates.repo.in @@ -0,0 +1,60 @@ +# $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 diff --git a/nodeconfig/yum/f8/yum.myplc.d/fedora.repo.in b/nodeconfig/yum/f8/yum.myplc.d/fedora.repo.in new file mode 100644 index 0000000..e7db63d --- /dev/null +++ b/nodeconfig/yum/f8/yum.myplc.d/fedora.repo.in @@ -0,0 +1,30 @@ +# $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 diff --git a/nodeconfig/yum/myplc.repo.php b/nodeconfig/yum/myplc.repo.php new file mode 100644 index 0000000..d06da92 --- /dev/null +++ b/nodeconfig/yum/myplc.repo.php @@ -0,0 +1,66 @@ +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__; + +?> diff --git a/nodeconfig/yum/yum.php b/nodeconfig/yum/yum.php new file mode 100644 index 0000000..81dd1b6 --- /dev/null +++ b/nodeconfig/yum/yum.php @@ -0,0 +1,67 @@ +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// +$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"; + + + + diff --git a/noderepo.spec b/noderepo.spec index e11c901..ab4f6b9 100644 --- a/noderepo.spec +++ b/noderepo.spec @@ -8,22 +8,23 @@ # %{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 +Vendor: OneLab +Packager: PlanetLab Europe 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} @@ -37,6 +38,10 @@ BuildArch: noarch 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 @@ -65,6 +70,10 @@ install -D -m 644 %{_topdir}/RPMS/yumgroups.xml $RPM_BUILD_ROOT/var/www/html/ins 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 @@ -74,6 +83,31 @@ service plc start packages %config(noreplace) /var/www/html/install-rpms/%{nodefamily}/yumgroups.xml %changelog +* Mon Jul 05 2010 Baris Metin - BootstrapFS-2.0-6 +- add sha1sum +- module name changes + +* Tue Apr 27 2010 Talip Baris Metin - BootstrapFS-2.0-5 +- support different flavours of vservers on nodes + +* Mon Apr 12 2010 Thierry Parmentelat - BootstrapFS-2.0-4 +- fix unmatched $ in URL svn keywords + +* Fri Apr 02 2010 Thierry Parmentelat - 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 - BootstrapFS-2.0-2 +- new slicerepo package for exposing stuff to slivers + +* Fri Jan 29 2010 Thierry Parmentelat - 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 - BootstrapFS-1.0-11 - for building on fedora12 @@ -114,3 +148,5 @@ service plc start packages * Tue Mar 4 2008 Thierry Parmentelat - - Initial build. + +%define module_current_branch 1.0 diff --git a/plc.d/packages b/plc.d/packages new file mode 100755 index 0000000..8218560 --- /dev/null +++ b/plc.d/packages @@ -0,0 +1,149 @@ +#!/bin/bash +# $Id$ +# $URL$ +# +# priority: 1200 +# +# Update node package repository metadata and sign packages +# +# Mark Huang +# 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 diff --git a/slicerepo.spec b/slicerepo.spec new file mode 100644 index 0000000..7e8d4b4 --- /dev/null +++ b/slicerepo.spec @@ -0,0 +1,96 @@ +# +# $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 +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 - BootstrapFS-2.0-6 +- add sha1sum +- module name changes + +* Tue Apr 27 2010 Talip Baris Metin - BootstrapFS-2.0-5 +- support different flavours of vservers on nodes + +* Mon Apr 12 2010 Thierry Parmentelat - BootstrapFS-2.0-4 +- fix unmatched $ in URL svn keywords + +* Fri Apr 02 2010 Thierry Parmentelat - 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 - BootstrapFS-2.0-2 +- new slicerepo package for exposing stuff to slivers +