X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=vserver-reference.spec;h=9a4298cfa2ce51d33608641ca9fd7cf47a9c7c31;hb=208e5be30349820ab251c3e9ba0d806f63543c83;hp=6988e7d450ca2b6995fb996a8b4fb5142aa8893b;hpb=a571dd4f8da90ebfcb88255d99f90c07e0cdfb49;p=vserver-reference.git diff --git a/vserver-reference.spec b/vserver-reference.spec index 6988e7d..9a4298c 100644 --- a/vserver-reference.spec +++ b/vserver-reference.spec @@ -1,11 +1,11 @@ %define name vserver-reference -%define version 3.0 +%define version 3.1 %define release 1.planetlab%{?date:.%{date}} Vendor: PlanetLab Packager: PlanetLab Central Distribution: PlanetLab 3.0 -URL: http://www.planet-lab.org +URL: http://cvs.planet-lab.org/cvs/vserver-reference Summary: VServer reference image Name: %{name} @@ -15,152 +15,96 @@ Source0: %{name}-%{version}.tar.bz2 License: GPL Group: Applications/System BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot -BuildArchitectures: noarch -Requires: util-vserver +Requires: util-vserver, e2fsprogs, yum + AutoReqProv: no -BuildRequires: e2fsprogs, yum +%define debug_package %{nil} %description This package creates the virtual server (VServer) reference image used as the installation base for new PlanetLab slivers. -%define vrootdir /vservers -%define vrefdir %{vrootdir}/%{name} -%define installroot $RPM_BUILD_ROOT%{vrefdir} - %prep %setup -q -# chattr, mknod, mount, yum all require root privileges. Yech. -if [ $UID -ne 0 ] ; then - echo You must be root to build the %{name} package. - false -fi - %build +RPM_BUILD_DIR=$RPM_BUILD_DIR ./%{name}.init %install -# Running as root -export PATH="$PATH:/sbin:/usr/sbin" +rm -rf $RPM_BUILD_ROOT +find vservers/vserver-reference | cpio -p -d -u $RPM_BUILD_ROOT/ -# Clean up -if grep -q %{installroot}/proc /proc/mounts ; then - umount %{installroot}/proc +# If run under sudo, allow user to delete the build directory +if [ -n "$SUDO_USER" ] ; then + chown -R $SUDO_USER . fi -if grep -q %{installroot}/dev/pts /proc/mounts ; then - umount %{installroot}/dev/pts -fi -chattr -R -i $RPM_BUILD_ROOT + +%clean rm -rf $RPM_BUILD_ROOT -# Make /vservers -mkdir -p $RPM_BUILD_ROOT%{vrootdir} -chmod 000 $RPM_BUILD_ROOT%{vrootdir} -chattr +t $RPM_BUILD_ROOT%{vrootdir} +%files +%defattr(-,root,root) +/vservers/vserver-reference -# Make /vservers/vserver-reference -mkdir -p %{installroot} -chattr -t %{installroot} -chmod 755 %{installroot} +%post +VROOT=/vservers/vserver-reference + +# Make sure the barrier bit is set +setattr --barrier /vservers -MAKEDEV () -{ - if grep -q %{installroot}/dev/pts /proc/mounts ; then - umount %{installroot}/dev/pts +# Copy configuration files from host to reference image +for file in /etc/hosts /etc/resolv.conf /etc/yum.conf ; do + if [ -f $file ] ; then + echo $file | cpio -p -d -u $VROOT fi - rm -rf %{installroot}/dev - mkdir -p %{installroot}/dev - mknod -m 666 %{installroot}/dev/null c 1 3 - mknod -m 666 %{installroot}/dev/zero c 1 5 - mknod -m 666 %{installroot}/dev/full c 1 7 - mknod -m 644 %{installroot}/dev/random c 1 8 - mknod -m 644 %{installroot}/dev/urandom c 1 9 - mknod -m 666 %{installroot}/dev/tty c 5 0 - mknod -m 666 %{installroot}/dev/ptmx c 5 2 - touch %{installroot}/dev/hdv1 -} - -# Initialize /dev in reference image -MAKEDEV - -# Mount /dev/pts in reference image -mkdir -p %{installroot}/dev/pts -mount -t devpts none %{installroot}/dev/pts - -# Mount /proc in reference image -mkdir -p %{installroot}/proc -mount -t proc none %{installroot}/proc - -# Create a dummy /etc/fstab in reference image -mkdir -p %{installroot}/etc -cat > %{installroot}/etc/fstab < %{installroot}/etc/rpm/macros < $VROOT/etc/planetlab/primary_ma < $VROOT/mnt/cdrom/bootme/BOOTSERVER -# Configure authentication in reference image -chroot %{installroot} authconfig --nostart --kickstart --enablemd5 --enableshadow || : +%changelog +* Tue Sep 1 2005 Mark Huang 3.1-1.planetlab +- Pre-package vserver-reference instead of building it on nodes -# Disable all services in reference image -chroot %{installroot} /bin/sh -c "chkconfig --list | awk '{ print \$1 }' | xargs -i chkconfig {} off" +* Tue Nov 30 2004 Mark Huang 3.0-5.planetlab +- PL3118 and PL3131 fix: set barrier bit on /vservers instead of old + immulink bit. Do not reset the immutable bit on the new + vserver-reference directory when deleting it after an error. -# Clean up -if grep -q %{installroot}/proc /proc/mounts ; then - umount %{installroot}/proc -fi -if grep -q %{installroot}/dev/pts /proc/mounts ; then - umount %{installroot}/dev/pts -fi +* Mon Nov 15 2004 Mark Huang 3.0-4.planetlab +- bump release to install Fedora Core 2 updates as of Tue Nov 9 2004 +- PL3017 fix: rebuild vserver-reference image in case it was built + with i386 glibc -%clean -# Running as root -export PATH="$PATH:/sbin:/usr/sbin" +* Mon Nov 15 2004 Mark Huang 3.0-4.planetlab +- bump release to install Fedora Core 2 updates as of Tue Nov 9 2004 +- PL3017 fix: rebuild vserver-reference image in case it was built + with i386 glibc -# Clean up -if grep -q %{installroot}/proc /proc/mounts ; then - umount %{installroot}/proc -fi -if grep -q %{installroot}/dev/pts /proc/mounts ; then - umount %{installroot}/dev/pts -fi -chattr -R -i $RPM_BUILD_ROOT -rm -rf $RPM_BUILD_ROOT +* Sun Oct 10 2004 Mark Huang 3.0-3.planetlab +- dynamically install reference image at init time -%post -# Copy configuration files from host to reference image -for file in /etc/hosts /etc/resolv.conf /etc/yum.conf ; do - if [ -f $file ] ; then - echo $file | cpio -p -d -u %{vrefdir} - fi -done - -%preun +* Sun Oct 10 2004 Mark Huang 3.0-2.planetlab +- dynamically install reference image -%files -%defattr(-,root,root) -%{vrefdir} - -%changelog * Tue Sep 14 2004 Mark Huang 3.0-1.planetlab - initial build