From: Marc Fiuczynski Date: Tue, 6 Nov 2007 23:08:34 +0000 (+0000) Subject: * Removed building PlanetLab-Bootstrap.tar.bz2 from the package. It X-Git-Tag: bootmanager-3.2-2~24 X-Git-Url: http://git.onelab.eu/?p=bootmanager.git;a=commitdiff_plain;h=a09daa186d351e53ced3c79c832ece4d17e3a51a * Removed building PlanetLab-Bootstrap.tar.bz2 from the package. It now lives in the BootstrapFS package. * Modified the InstallBootstrapRPM.py to download the following: - base bootstrapfs tar ball -> PlanetLab-Bootstrap.tar.bz2 - node group specific tar ball -> PlanetLab-Bootstrap-$nodegroup.tar.bz2 * Removed some of the empty directories under the support-files/ directory. --- diff --git a/bootmanager.spec b/bootmanager.spec index 07dff5f..7bd04b1 100644 --- a/bootmanager.spec +++ b/bootmanager.spec @@ -30,12 +30,7 @@ nodes. %build pushd BootManager - ./build.sh -pushd support-files -./buildnode.sh -r $([ -f "/etc/fedora-release" ] && awk ' { if ($2=="Core") print $4; else print $3 } ' /etc/fedora-release || echo 4) -popd - popd %install @@ -47,11 +42,9 @@ pushd BootManager find build.sh source | cpio -p -d -u $RPM_BUILD_ROOT/%{_datadir}/%{name}/ install -D -m 755 bootmanager.sh $RPM_BUILD_ROOT/var/www/html/boot/bootmanager.sh -for file in \ - uudecode.gz \ - PlanetLab-Bootstrap.tar.bz2 ; do - install -D -m 644 support-files/$file $RPM_BUILD_ROOT/var/www/html/boot/$file -done + +# This is only required for 2.x bootcds. +install -D -m 644 support-files/uudecode.gz $RPM_BUILD_ROOT/var/www/html/boot/uudecode.gz popd @@ -83,4 +76,3 @@ EOF %changelog * Fri Sep 2 2005 Mark Huang - - Initial build. - diff --git a/build.sh b/build.sh index 9fe81cd..87e07c2 100755 --- a/build.sh +++ b/build.sh @@ -1,17 +1,14 @@ #!/bin/bash # -# Builds bootmanager.sh[.sgn], the PlanetLab Boot Manager script, and -# PlanetLab-Bootstrap.tar.bz2, the initial root filesystem of a new -# PlanetLab node. For backward compatibility with old version 2.0 Boot -# CDs, additional utilities are also built and packaged as -# alpina-BootLVM.tar.gz and alpina-PartDisks.tar.gz. +# Builds bootmanager.sh[.sgn], which is the PlanetLab Boot Manager script. # # The bootmanager.sh script contains in it a uuencoded tarball of the # Boot Manager, customized for this PLC installation. # # Aaron Klingaman # Mark Huang -# Copyright (C) 2004-2006 The Trustees of Princeton University +# Marc E. Fiuczynski +# Copyright (C) 2004-2007 The Trustees of Princeton University # # $Id: build.sh,v 1.5 2006/04/03 19:40:55 mlhuang Exp $ # diff --git a/source/steps/InstallBootstrapRPM.py b/source/steps/InstallBootstrapRPM.py index c732119..68b6087 100644 --- a/source/steps/InstallBootstrapRPM.py +++ b/source/steps/InstallBootstrapRPM.py @@ -3,7 +3,7 @@ # Copyright (c) 2003 Intel Corporation # All rights reserved. # -# Copyright (c) 2004-2006 The Trustees of Princeton University +# Copyright (c) 2004-2007 The Trustees of Princeton University # All rights reserved. # expected /proc/partitions format @@ -91,7 +91,7 @@ def Run( vars, log ): vars['ROOT_MOUNTED']= 1 # check which nodegroups we are part of (>=4.0) - tarballs = [] + tarballs = ["PlanetLab-Bootstrap.tar.bz2"] try: nodes = BootAPI.call_api_function(vars, "GetNodes", ([NODE_ID], ['nodegroup_ids'])) node = nodes[0] @@ -100,34 +100,26 @@ def Run( vars, log ): tarballs.append("PlanetLab-Bootstrap-%s.tar.bz2" % nodegroup['name'].lower()) except: pass - tarballs += ["PlanetLab-Bootstrap.tar.bz2", "alpina-BootstrapRPM.tar.bz2"] - # download and extract support tarball for - # this step, which has everything - # we need to successfully run + # download and extract support tarball for this step, which has + # everything we need to successfully run for step_support_file in tarballs: source_file= "%s/%s" % (SUPPORT_FILE_DIR,step_support_file) dest_file= "%s/%s" % (SYSIMG_PATH, step_support_file) - # 30 is the connect timeout, 7200 is the max transfer time - # in seconds (2 hours) + # 30 is the connect timeout, 14400 is the max transfer time in + # seconds (4 hours) log.write( "downloading %s\n" % step_support_file ) result= bs_request.DownloadFile( source_file, None, None, 1, 1, dest_file, - 30, 7200) + 30, 14400) if result: - # New bootstrap tarball contains everything necessary to - # boot, no need to bootstrap further. - vars['SKIP_INSTALL_BASE']= (step_support_file == "PlanetLab-Bootstrap.tar.bz2") - break - - if not result: - raise BootManagerException, "Unable to download %s from server." % \ - source_file - - log.write( "extracting %s in %s\n" % (dest_file,SYSIMG_PATH) ) - result= utils.sysexec( "tar -C %s -xpjf %s" % (SYSIMG_PATH,dest_file), log ) - utils.removefile( dest_file ) + log.write( "extracting %s in %s\n" % (dest_file,SYSIMG_PATH) ) + result= utils.sysexec( "tar -C %s -xpjf %s" % (SYSIMG_PATH,dest_file), log ) + utils.removefile( dest_file ) + else: + raise BootManagerException, "Unable to download %s from server." % \ + source_file # copy resolv.conf from the base system into our temp dir # so DNS lookups work correctly while we are chrooted diff --git a/source/steps/WriteNetworkConfig.py b/source/steps/WriteNetworkConfig.py index dc57ff6..f92985c 100644 --- a/source/steps/WriteNetworkConfig.py +++ b/source/steps/WriteNetworkConfig.py @@ -23,9 +23,6 @@ def Run( vars, log ): /etc/resolv.conf (if applicable) /etc/sysconfig/network - It is assumed the caller mounted the root partition and the vserver partition - starting on SYSIMG_PATH - it is not checked here. - The values to be used for the network settings are to be set in vars in the variable 'NETWORK_SETTINGS', which is a dictionary with keys: diff --git a/support-files/Makefile b/support-files/Makefile deleted file mode 100644 index ea661e1..0000000 --- a/support-files/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# -# Build bootstrap tarballs. The alpina-* files are deprecated and are -# only included for historical purposes. Version 2 BootCDs still -# require them; Version 3 BootCDs come with the tools pre-installed. -# -# Aaron Klingaman -# Mark Huang -# Copyright (C) 2005 The Trustees of Princeton University -# -# $Id: Makefile,v 1.6 2007/08/24 06:13:56 mef Exp $ -# - -all: PlanetLab-Bootstrap.tar.bz2 - -PlanetLab-Bootstrap.tar.bz2: - ./buildnode.sh -r $$([ -f "/etc/fedora-release" ] && awk ' { if ($2=="Core") print $4; else print $3 } ' /etc/fedora-release || echo 4) - -clean: - rm -f PlanetLab-Bootstrap.tar.bz2 diff --git a/support-files/buildnode.sh b/support-files/buildnode.sh deleted file mode 100755 index 2491dc6..0000000 --- a/support-files/buildnode.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/bash -# -# Build PlanetLab-Bootstrap.tar.bz2, the reference image for PlanetLab -# nodes. -# -# Mark Huang -# Copyright (C) 2005-2006 The Trustees of Princeton University -# -# $Id: buildnode.sh,v 1.12.6.1 2007/08/30 20:09:20 mef Exp $ -# - -PATH=/sbin:/bin:/usr/sbin:/usr/bin - -# In both a normal CVS environment and a PlanetLab RPM -# build environment, all of our dependencies are checked out into -# directories at the same level as us. -if [ -d ../../build ] ; then - PATH=$PATH:../../build - srcdir=../.. -else - echo "Error: Could not find $(cd ../.. && pwd -P)/build/" - exit 1 -fi - -export PATH - -. build.common - -pl_process_fedora_options $@ -shiftcount=$? -shift $shiftcount - -# Do not tolerate errors -set -e - -VROOT=$PWD/PlanetLab-Bootstrap -install -d -m 755 $VROOT - -# Some of the PlanetLab RPMs attempt to (re)start themselves in %post, -# unless the installation is running inside the BootCD environment. We -# would like to pretend that we are. -export PL_BOOTCD=1 - -# Install the "PlanetLab" group. This requires that the PlanetLab -# build system install the appropriate yumgroups.xml file (currently -# build/groups/v3_yumgroups.xml) in $RPM_BUILD_DIR/../RPMS/ and that -# mkfedora runs either yum-arch or createrepo on that directory. dev -# is specified explicitly because of a stupid bug in its %post script -# that causes its installation to fail; see the mkfedora script for a -# full explanation. coreutils and python are specified explicitly -# because groupinstall does not honor Requires(pre) dependencies -# properly, most %pre scripts require coreutils to be installed first, -# and some of our %post scripts require python. - -packagelist=( -filesystem -udev -coreutils -python -) -# vserver-reference packages used for reference image -for package in "${packagelist[@]}" ; do - packages="$packages -p $package" -done - -# Populate VROOT with the files for the PlanetLab-Bootstrap content -pl_setup_chroot $VROOT -k $packages -g PlanetLab - -# Disable additional unnecessary services -echo "* Disabling unnecessary services" -for service in netfs rawdevices cpuspeed smartd ; do - if [ -x $VROOT/etc/init.d/$service ] ; then - /usr/sbin/chroot $VROOT /sbin/chkconfig $service off - fi -done - -# Build tarball -echo "* Building bootstrap tarball" -tar -cpjf PlanetLab-Bootstrap.tar.bz2 -C $VROOT . - -exit 0