From dce5399653cbf0e5e6fd63b4a5e97d729dfaaf86 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Tue, 26 Jan 2010 16:51:02 +0000 Subject: [PATCH 01/16] Branch 2.0 for module BootstrapFS created (as new trunk) from tag BootstrapFS-1.0-11 --- bootstrapfs.spec | 6 ++++-- noderepo.spec | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bootstrapfs.spec b/bootstrapfs.spec index d6cdca3..d2e0ef5 100644 --- a/bootstrapfs.spec +++ b/bootstrapfs.spec @@ -6,8 +6,8 @@ %define nodefamily %{pldistro}-%{distroname}-%{_arch} %define name bootstrapfs-%{nodefamily} -%define version 1.0 -%define taglevel 11 +%define version 2.0 +%define taglevel 0 # pldistro already in the rpm name #%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}} @@ -144,3 +144,5 @@ fi * Fri Sep 2 2005 Mark Huang - - Initial build. + +%define module_current_branch 1.0 diff --git a/noderepo.spec b/noderepo.spec index fdda544..dcf9ab6 100644 --- a/noderepo.spec +++ b/noderepo.spec @@ -11,8 +11,8 @@ %define nodefamily %{pldistro}-%{distroname}-%{_arch} %define name noderepo-%{nodefamily} -%define version 1.0 -%define taglevel 11 +%define version 2.0 +%define taglevel 0 # pldistro already in the rpm name #%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}} @@ -114,3 +114,5 @@ service plc start packages * Tue Mar 4 2008 Thierry Parmentelat - - Initial build. + +%define module_current_branch 1.0 -- 2.43.0 From 0d7865eefc03fd84df21664bd52198faecc8a2d2 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Tue, 26 Jan 2010 17:20:29 +0000 Subject: [PATCH 02/16] fix bootstrapfs names, and add fcdistro to extension tarballs --- build.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index 0067611..106d66e 100755 --- a/build.sh +++ b/build.sh @@ -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) " -- 2.43.0 From c0e4c7b4683247608b7861b871a7ecc0217579e4 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Tue, 26 Jan 2010 17:40:52 +0000 Subject: [PATCH 03/16] kwd --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 106d66e..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 -- 2.43.0 From 3d27c3a2baa7740915560a5bff45e41e401d2774 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Tue, 26 Jan 2010 19:50:48 +0000 Subject: [PATCH 04/16] more fixes --- bootstrapfs.spec | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/bootstrapfs.spec b/bootstrapfs.spec index d2e0ef5..fb9515a 100644 --- a/bootstrapfs.spec +++ b/bootstrapfs.spec @@ -4,6 +4,7 @@ %define url $URL$ %define nodefamily %{pldistro}-%{distroname}-%{_arch} +%define extensionfamily %{distroname}-%{_arch} %define name bootstrapfs-%{nodefamily} %define version 2.0 @@ -57,19 +58,19 @@ popd BootstrapFS rm -rf $RPM_BUILD_ROOT pushd BootstrapFS -arch=$(uname -i) +#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 +install -D -m 644 bootstrapfs-%{nodefamily}.tar.bz2 \ + $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-%{nodefamily}.tar.bz2 +install -D -m 644 bootstrapfs-%{nodefamily}.tar \ + $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-%{nodefamily}.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 + install -D -m 644 %{pldistro}-filesystems/bootstrapfs-${NAME}-%{extensionfamily}.tar.bz2 \ + $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-${NAME}-%{extensionfamily}.tar.bz2 + install -D -m 644 %{pldistro}-filesystems/bootstrapfs-${NAME}-%{extensionfamily}.tar \ + $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-${NAME}-%{extensionfamily}.tar done popd @@ -77,19 +78,6 @@ 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 -- 2.43.0 From 296b3d4af2f78b2f8c401748685b6cdf1b8dfcd7 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 27 Jan 2010 18:44:46 +0000 Subject: [PATCH 05/16] fixed and moved the server-side yum scripts, from nodeconfig/yum to BootstrapFS/nodeconfig/yum now known as the nodeyum package (might need some moer work for properly handling kexcludes in multi-fc plcs) cleaned up all uses of /etc/planetlab/{node,slice}family nodeconfig now does not need the build/ module anymore at build time --- bootstrapfs.spec | 58 +++++++++++++++++ nodeconfig/yum/centos5/yum.conf | 22 +++++++ .../centos5/yum.myplc.d/CentOS-Base.repo.in | 62 +++++++++++++++++++ .../yum/centos5/yum.myplc.d/epel.repo.in | 29 +++++++++ nodeconfig/yum/f10/yum.conf | 10 +++ .../f10/yum.myplc.d/fedora-updates.repo.in | 29 +++++++++ nodeconfig/yum/f10/yum.myplc.d/fedora.repo.in | 29 +++++++++ nodeconfig/yum/f12/yum.conf | 10 +++ .../f12/yum.myplc.d/fedora-updates.repo.in | 29 +++++++++ nodeconfig/yum/f12/yum.myplc.d/fedora.repo.in | 29 +++++++++ nodeconfig/yum/f8/yum.conf | 10 +++ .../yum/f8/yum.myplc.d/fedora-updates.repo.in | 59 ++++++++++++++++++ nodeconfig/yum/f8/yum.myplc.d/fedora.repo.in | 29 +++++++++ nodeconfig/yum/myplc.repo.php | 55 ++++++++++++++++ noderepo.spec | 5 ++ 15 files changed, 465 insertions(+) create mode 100644 nodeconfig/yum/centos5/yum.conf create mode 100644 nodeconfig/yum/centos5/yum.myplc.d/CentOS-Base.repo.in create mode 100644 nodeconfig/yum/centos5/yum.myplc.d/epel.repo.in create mode 100644 nodeconfig/yum/f10/yum.conf create mode 100644 nodeconfig/yum/f10/yum.myplc.d/fedora-updates.repo.in create mode 100644 nodeconfig/yum/f10/yum.myplc.d/fedora.repo.in create mode 100644 nodeconfig/yum/f12/yum.conf create mode 100644 nodeconfig/yum/f12/yum.myplc.d/fedora-updates.repo.in create mode 100644 nodeconfig/yum/f12/yum.myplc.d/fedora.repo.in create mode 100644 nodeconfig/yum/f8/yum.conf create mode 100644 nodeconfig/yum/f8/yum.myplc.d/fedora-updates.repo.in create mode 100644 nodeconfig/yum/f8/yum.myplc.d/fedora.repo.in create mode 100644 nodeconfig/yum/myplc.repo.php diff --git a/bootstrapfs.spec b/bootstrapfs.spec index fb9515a..90d07d3 100644 --- a/bootstrapfs.spec +++ b/bootstrapfs.spec @@ -32,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} @@ -46,6 +50,15 @@ 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. +# need the apache user at install-time +Requires: httpd + %prep %setup -q @@ -54,6 +67,31 @@ pushd BootstrapFS ./build.sh %{pldistro} popd BootstrapFS +# xxx in a multi-flavour myplc, we should ship for all fcdistros +# and let the php scripts do the right thing + +pushd BootstrapFS/nodeconfig/yum + +# expand list of kexcludes + +# scan fcdistros and catenate all repos in 'stock.repo' so db-config can be distro-independant + +for fcdistro in $(ls); do + [ -d $fcdistro ] || continue + 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 @@ -72,12 +110,28 @@ for pkgs in $(ls ../build/config.%{pldistro}/bootstrapfs-*.pkgs) ; do install -D -m 644 %{pldistro}-filesystems/bootstrapfs-${NAME}-%{extensionfamily}.tar \ $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-${NAME}-%{extensionfamily}.tar done +popd +pushd BootstrapFS/nodeconfig/yum +echo "* Installing MyPLC-side yum stuff" +# expose (fixed) myplc.repo.php as https:///yum/myplc.repo.php +install -D -m 644 ./yum/myplc.repo.php $RPM_BUILD_ROOT/var/www/html/yum/myplc.repo.php +# expose the fcdistro-dependant yum.conf as https:///yum/yum.conf +install -D -m 644 ./yum/%{distroname}/yum.conf $RPM_BUILD_ROOT/var/www/html/yum/yum.conf +# expose the (fcdistro-dependant) stock.repo as https:///yum/stock.repo +install -D -m 644 ./yum/%{distroname}/yum.myplc.d/stock.repo $RPM_BUILD_ROOT/var/www/html/yum/stock.repo popd %clean rm -rf $RPM_BUILD_ROOT +%post -n nodeyum +# the boot manager upload area +mkdir -p /var/log/bm +chown apache:apache /var/log/bm +chmod 700 /var/log/bm + + %files %defattr(-,root,root,-) /var/www/html/boot/bootstrapfs*.tar.bz2 @@ -86,6 +140,10 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root,-) /var/www/html/boot/bootstrapfs*.tar +%files -n nodeyum +%defattr(-,root,root,-) +/var/www/html/yum + %changelog * Mon Jan 04 2010 Thierry Parmentelat - BootstrapFS-1.0-11 - for building on fedora12 diff --git a/nodeconfig/yum/centos5/yum.conf b/nodeconfig/yum/centos5/yum.conf new file mode 100644 index 0000000..bfff95d --- /dev/null +++ b/nodeconfig/yum/centos5/yum.conf @@ -0,0 +1,22 @@ +[main] +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 + +# PUT YOUR REPOS HERE OR IN separate files named file.repo +# in /etc/yum.repos.d 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..be1e9c2 --- /dev/null +++ b/nodeconfig/yum/centos5/yum.myplc.d/CentOS-Base.repo.in @@ -0,0 +1,62 @@ +# 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..1a844c1 --- /dev/null +++ b/nodeconfig/yum/centos5/yum.myplc.d/epel.repo.in @@ -0,0 +1,29 @@ +[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..13046c8 --- /dev/null +++ b/nodeconfig/yum/f10/yum.conf @@ -0,0 +1,10 @@ +[main] +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..2323288 --- /dev/null +++ b/nodeconfig/yum/f10/yum.myplc.d/fedora-updates.repo.in @@ -0,0 +1,29 @@ +[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..b7cea58 --- /dev/null +++ b/nodeconfig/yum/f10/yum.myplc.d/fedora.repo.in @@ -0,0 +1,29 @@ +[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..13046c8 --- /dev/null +++ b/nodeconfig/yum/f12/yum.conf @@ -0,0 +1,10 @@ +[main] +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..2323288 --- /dev/null +++ b/nodeconfig/yum/f12/yum.myplc.d/fedora-updates.repo.in @@ -0,0 +1,29 @@ +[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..b7cea58 --- /dev/null +++ b/nodeconfig/yum/f12/yum.myplc.d/fedora.repo.in @@ -0,0 +1,29 @@ +[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..13046c8 --- /dev/null +++ b/nodeconfig/yum/f8/yum.conf @@ -0,0 +1,10 @@ +[main] +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..9f9b7f6 --- /dev/null +++ b/nodeconfig/yum/f8/yum.myplc.d/fedora-updates.repo.in @@ -0,0 +1,59 @@ +[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..b7cea58 --- /dev/null +++ b/nodeconfig/yum/f8/yum.myplc.d/fedora.repo.in @@ -0,0 +1,29 @@ +[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..a0e8d28 --- /dev/null +++ b/nodeconfig/yum/myplc.repo.php @@ -0,0 +1,55 @@ +GetNodeFlavour($node_id); +$nodefamily=$nodeflavour['nodefamily']; + +$topdir=$_SERVER['DOCUMENT_ROOT'] . "/install-rpms/" . $nodefamily; +$topurl="https://$PLC_BOOT_HOST" . "/install-rpms/" . $nodefamily; + +if (! is_dir (realpath($topdir))) { + echo "# WARNING: plc-side yum repo $topdir NOT FOUND !!"; + } + +echo <<< __PLC_REPO__ +[$id] +name=$name +baseurl=$topurl +gpgcheck=$gpgcheck + +__PLC_REPO__; + +?> diff --git a/noderepo.spec b/noderepo.spec index dcf9ab6..f213061 100644 --- a/noderepo.spec +++ b/noderepo.spec @@ -9,6 +9,7 @@ # %{node_rpms_plus} : as a +++ separated list of rpms from the build dir %define nodefamily %{pldistro}-%{distroname}-%{_arch} +%define obsolete_nodefamily %{pldistro}-%{_arch} %define name noderepo-%{nodefamily} %define version 2.0 @@ -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 -- 2.43.0 From ce0e0297a617d28fdee5b5518f2b4f850558a94c Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 27 Jan 2010 20:37:13 +0000 Subject: [PATCH 06/16] fix --- bootstrapfs.spec | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/bootstrapfs.spec b/bootstrapfs.spec index 90d07d3..d721ee4 100644 --- a/bootstrapfs.spec +++ b/bootstrapfs.spec @@ -65,19 +65,16 @@ Requires: httpd %build pushd BootstrapFS ./build.sh %{pldistro} -popd BootstrapFS +popd # xxx in a multi-flavour myplc, we should ship for all fcdistros # and let the php scripts do the right thing pushd BootstrapFS/nodeconfig/yum - -# expand list of kexcludes - # 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)" @@ -89,7 +86,6 @@ for fcdistro in $(ls); do cat *.repo > stock.repo popd done - popd %install -- 2.43.0 From 4f2e7f51183f46bc6dee374d0e0d735d94f351df Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 27 Jan 2010 20:44:22 +0000 Subject: [PATCH 07/16] conf_files belong to the same module --- bootstrapfs.spec | 8 ++++ db-config.d/030-conf_files_node_update | 62 ++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 db-config.d/030-conf_files_node_update diff --git a/bootstrapfs.spec b/bootstrapfs.spec index d721ee4..e64fb7a 100644 --- a/bootstrapfs.spec +++ b/bootstrapfs.spec @@ -118,6 +118,13 @@ install -D -m 644 ./yum/%{distroname}/yum.conf $RPM_BUILD_ROOT/var/www/htm install -D -m 644 ./yum/%{distroname}/yum.myplc.d/stock.repo $RPM_BUILD_ROOT/var/www/html/yum/stock.repo popd +pushd BootstrapFS +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 @@ -139,6 +146,7 @@ chmod 700 /var/log/bm %files -n nodeyum %defattr(-,root,root,-) /var/www/html/yum +/etc/planetlab/db-config.d %changelog * Mon Jan 04 2010 Thierry Parmentelat - BootstrapFS-1.0-11 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..d3d9434 --- /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.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/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) -- 2.43.0 From 334db0292b5faca2e77a3e2aa4bf5f763c6a7b03 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 27 Jan 2010 20:54:58 +0000 Subject: [PATCH 08/16] fix --- bootstrapfs.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrapfs.spec b/bootstrapfs.spec index e64fb7a..bdd61ae 100644 --- a/bootstrapfs.spec +++ b/bootstrapfs.spec @@ -108,7 +108,7 @@ for pkgs in $(ls ../build/config.%{pldistro}/bootstrapfs-*.pkgs) ; do done popd -pushd BootstrapFS/nodeconfig/yum +pushd BootstrapFS/nodeconfig echo "* Installing MyPLC-side yum stuff" # expose (fixed) myplc.repo.php as https:///yum/myplc.repo.php install -D -m 644 ./yum/myplc.repo.php $RPM_BUILD_ROOT/var/www/html/yum/myplc.repo.php -- 2.43.0 From 7e95a12202773aa9bcd081b12363dfdffc2ba412 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 27 Jan 2010 21:41:40 +0000 Subject: [PATCH 09/16] plc.d/packages part of nodeyum --- bootstrapfs.spec | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/bootstrapfs.spec b/bootstrapfs.spec index bdd61ae..4861868 100644 --- a/bootstrapfs.spec +++ b/bootstrapfs.spec @@ -56,8 +56,6 @@ Group: System Environment/Base %description -n nodeyum Utility scripts for configuring node updates. This package is designed for the MyPLC side. -# need the apache user at install-time -Requires: httpd %prep %setup -q @@ -108,14 +106,20 @@ for pkgs in $(ls ../build/config.%{pldistro}/bootstrapfs-*.pkgs) ; do done popd -pushd BootstrapFS/nodeconfig -echo "* Installing MyPLC-side yum stuff" +pushd BootstrapFS +echo "* Installing MyPLC-side nodes yum config utilities" # expose (fixed) myplc.repo.php as https:///yum/myplc.repo.php -install -D -m 644 ./yum/myplc.repo.php $RPM_BUILD_ROOT/var/www/html/yum/myplc.repo.php +install -D -m 644 ./nodeconfig/yum/myplc.repo.php $RPM_BUILD_ROOT/var/www/html/yum/myplc.repo.php # expose the fcdistro-dependant yum.conf as https:///yum/yum.conf -install -D -m 644 ./yum/%{distroname}/yum.conf $RPM_BUILD_ROOT/var/www/html/yum/yum.conf +install -D -m 644 ./nodeconfig/yum/%{distroname}/yum.conf $RPM_BUILD_ROOT/var/www/html/yum/yum.conf # expose the (fcdistro-dependant) stock.repo as https:///yum/stock.repo -install -D -m 644 ./yum/%{distroname}/yum.myplc.d/stock.repo $RPM_BUILD_ROOT/var/www/html/yum/stock.repo +install -D -m 644 ./nodeconfig/yum/%{distroname}/yum.myplc.d/stock.repo $RPM_BUILD_ROOT/var/www/html/yum/stock.repo + +# 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/* + popd pushd BootstrapFS @@ -128,12 +132,6 @@ popd %clean rm -rf $RPM_BUILD_ROOT -%post -n nodeyum -# the boot manager upload area -mkdir -p /var/log/bm -chown apache:apache /var/log/bm -chmod 700 /var/log/bm - %files %defattr(-,root,root,-) @@ -147,6 +145,7 @@ chmod 700 /var/log/bm %defattr(-,root,root,-) /var/www/html/yum /etc/planetlab/db-config.d +/etc/plc.d %changelog * Mon Jan 04 2010 Thierry Parmentelat - BootstrapFS-1.0-11 -- 2.43.0 From a695ad38ada5f697817069b15fc7e342d61500f1 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 27 Jan 2010 22:12:09 +0000 Subject: [PATCH 10/16] oops, had been moved to the wrong place --- plc.d/packages | 131 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100755 plc.d/packages diff --git a/plc.d/packages b/plc.d/packages new file mode 100755 index 0000000..e932eb0 --- /dev/null +++ b/plc.d/packages @@ -0,0 +1,131 @@ +#!/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" + + 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 -- 2.43.0 From ce1031681efc56b805c837453a549772df64d074 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Thu, 28 Jan 2010 14:13:00 +0000 Subject: [PATCH 11/16] fix broken yum repo generation --- nodeconfig/yum/myplc.repo.php | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/nodeconfig/yum/myplc.repo.php b/nodeconfig/yum/myplc.repo.php index a0e8d28..e26287d 100644 --- a/nodeconfig/yum/myplc.repo.php +++ b/nodeconfig/yum/myplc.repo.php @@ -5,7 +5,8 @@ // Thierry Parmentelat // Copyright (C) 2008 INRIA // -// $Id: myplc.repo.php 9818 2008-07-04 07:54:06Z thierry $ +// $Id$ +// $URL$ // // For PLC_NAME and PLC_BOOT_HOST @@ -24,12 +25,15 @@ if (isset($_REQUEST['gpgcheck'])) { $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 "# myplc.repo.php: node_id is needed"; - echo "# looks like you're running a very old NodeManager..."; - echo "# bailing out.."; + echo "# node_id is needed\n"; + echo "# looks like you're running a very old NodeManager...\n"; + echo "# bailing out..\n"; exit; } @@ -40,13 +44,17 @@ $nodefamily=$nodeflavour['nodefamily']; $topdir=$_SERVER['DOCUMENT_ROOT'] . "/install-rpms/" . $nodefamily; $topurl="https://$PLC_BOOT_HOST" . "/install-rpms/" . $nodefamily; -if (! is_dir (realpath($topdir))) { - echo "# WARNING: plc-side yum repo $topdir NOT FOUND !!"; - } +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__ -[$id] -name=$name +[$repo_id] +name=$repo_name baseurl=$topurl gpgcheck=$gpgcheck -- 2.43.0 From 02317daf49cdd2e0abef5e83c05525daf9a4243b Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Fri, 29 Jan 2010 14:02:45 +0000 Subject: [PATCH 12/16] Setting tag 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 nodefamily is 3-fold with pldistro-fcdistro-arch new module nodeyum; first draft has the php scripts and conf_files for tweaking nodes yum config --- bootstrapfs.spec | 8 +++++++- noderepo.spec | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/bootstrapfs.spec b/bootstrapfs.spec index 4861868..6c46f79 100644 --- a/bootstrapfs.spec +++ b/bootstrapfs.spec @@ -8,7 +8,7 @@ %define name bootstrapfs-%{nodefamily} %define version 2.0 -%define taglevel 0 +%define taglevel 1 # pldistro already in the rpm name #%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}} @@ -148,6 +148,12 @@ rm -rf $RPM_BUILD_ROOT /etc/plc.d %changelog +* 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 diff --git a/noderepo.spec b/noderepo.spec index f213061..4993759 100644 --- a/noderepo.spec +++ b/noderepo.spec @@ -13,7 +13,7 @@ %define name noderepo-%{nodefamily} %define version 2.0 -%define taglevel 0 +%define taglevel 1 # pldistro already in the rpm name #%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}} @@ -79,6 +79,12 @@ service plc start packages %config(noreplace) /var/www/html/install-rpms/%{nodefamily}/yumgroups.xml %changelog +* 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 -- 2.43.0 From ee50ab5ee36234b25f63068c7911772dd7a70a97 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Fri, 12 Mar 2010 13:59:47 +0000 Subject: [PATCH 13/16] first draft of the slicerepo --- bootstrapfs.spec | 14 +++++---- slicerepo.spec | 81 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+), 6 deletions(-) create mode 100644 slicerepo.spec diff --git a/bootstrapfs.spec b/bootstrapfs.spec index 6c46f79..da84c10 100644 --- a/bootstrapfs.spec +++ b/bootstrapfs.spec @@ -61,13 +61,13 @@ for the MyPLC side. %setup -q %build + +############################## node-side pushd BootstrapFS ./build.sh %{pldistro} popd -# xxx in a multi-flavour myplc, we should ship for all fcdistros -# and let the php scripts do the right thing - +############################## server-side 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 @@ -89,6 +89,7 @@ popd %install rm -rf $RPM_BUILD_ROOT +############################## node-side pushd BootstrapFS #arch=$(uname -i) @@ -106,6 +107,10 @@ for pkgs in $(ls ../build/config.%{pldistro}/bootstrapfs-*.pkgs) ; do done popd +############################## server-side +# xxx unfinished business here +# xxx in a multi-flavour myplc, we should ship for all fcdistros +# and let the php scripts do the right thing pushd BootstrapFS echo "* Installing MyPLC-side nodes yum config utilities" # expose (fixed) myplc.repo.php as https:///yum/myplc.repo.php @@ -120,9 +125,6 @@ echo "* Installing plc.d initscripts" find plc.d | cpio -p -d -u ${RPM_BUILD_ROOT}/etc/ chmod 755 ${RPM_BUILD_ROOT}/etc/plc.d/* -popd - -pushd BootstrapFS 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 diff --git a/slicerepo.spec b/slicerepo.spec new file mode 100644 index 0000000..4e405e1 --- /dev/null +++ b/slicerepo.spec @@ -0,0 +1,81 @@ +# +# $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 0 + +# pldistro already in the rpm name +#%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}} +%define release %{taglevel}%{?date:.%{date}} + +Vendor: PlanetLab +Packager: PlanetLab Central +Distribution: PlanetLab %{plrelease} +URL: %(echo %{url} | cut -d ' ' -f 2) + +Summary: The initial content of the yum repository for nodes +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 + +# 5.0 now has 3-fold nodefamily +%define obsolete_nodefamily %{pldistro}-%{_arch} +Obsoletes: slicerepo-%{obsolete_nodefamily} + +%define debug_package %{nil} + +%description +This rpm contains all the rpms designed for running on a PlanetLab node +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/%{nodefamily} +# don't overwrite yumgroups.xml if exists +%config(noreplace) /var/www/html/install-rpms/%{nodefamily}/yumgroups.xml + +%changelog -- 2.43.0 From 3a1ac984e3fe1a5521a9da19e830bea02d80717b Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Fri, 12 Mar 2010 16:56:58 +0000 Subject: [PATCH 14/16] oops --- slicerepo.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/slicerepo.spec b/slicerepo.spec index 4e405e1..080e297 100644 --- a/slicerepo.spec +++ b/slicerepo.spec @@ -74,8 +74,8 @@ service plc start packages %files %defattr(-,root,root,-) -/var/www/html/install-rpms/%{nodefamily} +/var/www/html/install-rpms/slice-%{nodefamily} # don't overwrite yumgroups.xml if exists -%config(noreplace) /var/www/html/install-rpms/%{nodefamily}/yumgroups.xml +%config(noreplace) /var/www/html/install-rpms/slice-%{nodefamily}/yumgroups.xml %changelog -- 2.43.0 From daf80ab6786dcb7a3b7617372375fc75593673e7 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Fri, 12 Mar 2010 17:04:00 +0000 Subject: [PATCH 15/16] cosmetic --- noderepo.spec | 6 +++--- slicerepo.spec | 12 ++++-------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/noderepo.spec b/noderepo.spec index 4993759..d8acabb 100644 --- a/noderepo.spec +++ b/noderepo.spec @@ -19,12 +19,12 @@ #%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} diff --git a/slicerepo.spec b/slicerepo.spec index 080e297..021e4a4 100644 --- a/slicerepo.spec +++ b/slicerepo.spec @@ -19,12 +19,12 @@ #%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 slices, to be installed on the myplc-side Name: %{name} Version: %{version} Release: %{release} @@ -38,14 +38,10 @@ BuildArch: noarch BuildRequires: rsync Requires: myplc -# 5.0 now has 3-fold nodefamily -%define obsolete_nodefamily %{pldistro}-%{_arch} -Obsoletes: slicerepo-%{obsolete_nodefamily} - %define debug_package %{nil} %description -This rpm contains all the rpms designed for running on a PlanetLab node +This rpm contains all the rpms that might ship on a sliver image they come organized into a yum repository %prep -- 2.43.0 From 3d0fccd9b1ba2bc65bbe47be6ab890fd8646001b Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Fri, 12 Mar 2010 17:55:02 +0000 Subject: [PATCH 16/16] Setting tag BootstrapFS-2.0-2 new slicerepo package for exposing stuff to slivers --- bootstrapfs.spec | 5 ++++- noderepo.spec | 5 ++++- slicerepo.spec | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/bootstrapfs.spec b/bootstrapfs.spec index da84c10..b7f4611 100644 --- a/bootstrapfs.spec +++ b/bootstrapfs.spec @@ -8,7 +8,7 @@ %define name bootstrapfs-%{nodefamily} %define version 2.0 -%define taglevel 1 +%define taglevel 2 # pldistro already in the rpm name #%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}} @@ -150,6 +150,9 @@ rm -rf $RPM_BUILD_ROOT /etc/plc.d %changelog +* 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 diff --git a/noderepo.spec b/noderepo.spec index d8acabb..00b4450 100644 --- a/noderepo.spec +++ b/noderepo.spec @@ -13,7 +13,7 @@ %define name noderepo-%{nodefamily} %define version 2.0 -%define taglevel 1 +%define taglevel 2 # pldistro already in the rpm name #%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}} @@ -79,6 +79,9 @@ service plc start packages %config(noreplace) /var/www/html/install-rpms/%{nodefamily}/yumgroups.xml %changelog +* 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 diff --git a/slicerepo.spec b/slicerepo.spec index 021e4a4..60783a8 100644 --- a/slicerepo.spec +++ b/slicerepo.spec @@ -13,7 +13,7 @@ %define name slicerepo-%{nodefamily} %define version 2.0 -%define taglevel 0 +%define taglevel 2 # pldistro already in the rpm name #%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}} @@ -75,3 +75,6 @@ service plc start packages %config(noreplace) /var/www/html/install-rpms/slice-%{nodefamily}/yumgroups.xml %changelog +* Fri Mar 12 2010 Thierry Parmentelat - BootstrapFS-2.0-2 +- new slicerepo package for exposing stuff to slivers + -- 2.43.0