Commit 0d2d88d9 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Merge branch 'master' of git-public.flux.utah.edu:/flux/git/emulab-devel

parents dc1aae77 a9785a12
......@@ -286,7 +286,7 @@ foreach $key (keys(%{ $xmlparse->{'attribute'} })) {
}
}
$newosid_args{$key} = $value;
$newosid_args{$dbslot} = $value;
}
UserError()
if (keys(%errors));
......
......@@ -291,8 +291,12 @@ sub Create($$$$)
print STDERR "*** No virtnode_capacity for $type! Using zero.\n";
$virtnode_capacity = 0;
}
if ($isremote) {
$osid = 0;
if ($typeinfo->isswitch()) {
$osid = "NULL";
$opmode = "ALWAYSUP";
}
elsif ($isremote) {
$osid = "NULL";
$opmode = "";
if (defined($typeinfo->default_osid())) {
......@@ -330,7 +334,7 @@ sub Create($$$$)
}
}
else {
$osid = 0;
$osid = "NULL";
$opmode = "";
}
$state = $STATE_INITIAL;
......@@ -370,7 +374,7 @@ sub Create($$$$)
" phys_nodeid='$node_id', role='$role', ".
" priority=$priority, " .
" eventstate='$state', op_mode='$opmode', " .
" def_boot_osid='$osid', " .
" def_boot_osid=$osid, " .
" inception=now(), uuid=$uuid, ".
" state_timestamp=unix_timestamp(NOW()), " .
" op_mode_timestamp=unix_timestamp(NOW())")) {
......
<descriptors>
<osid>
<attribute name="magic">
<value></value>
</attribute>
<attribute name="features">
<value>ping,ssh,isup,linktest</value>
</attribute>
<attribute name="version">
<value>8</value>
</attribute>
<attribute name="reboot_waittime">
<value>120</value>
</attribute>
<attribute name="description">
<value>Generic osid for openvz virtual nodes.</value>
</attribute>
<attribute name="mustclean">
<value>0</value>
</attribute>
<attribute name="shared">
<value>1</value>
</attribute>
<attribute name="op_mode">
<value>PCVM</value>
</attribute>
<attribute name="pid">
<value>emulab-ops</value>
</attribute>
<attribute name="osname">
<value>OPENVZ-STD</value>
</attribute>
<attribute name="OS">
<value>Fedora</value>
</attribute>
<attribute name="nextosid">
<value>emulab-ops,FEDORA8-OVZ-STD</value>
</attribute>
</osid>
<image>
<attribute name="global">
<value>1</value>
</attribute>
<attribute name="version">
<value>8</value>
</attribute>
<attribute name="osfeatures">
<value>ping,ssh,ipod,isup,veths,veth-ne,mlinks,linktest,linkdelays,vlans,suboses</value>
</attribute>
<attribute name="path">
<value>/usr/testbed/images/FEDORA8-OVZ-STD.ndz</value>
</attribute>
<attribute name="mbr_version">
<value>1</value>
</attribute>
<attribute name="loadpart">
<value>2</value>
</attribute>
<attribute name="description">
<value>Standard Fedora8 image with support for OpenVZ vnodes.</value>
</attribute>
<attribute name="op_mode">
<value>NORMALv2</value>
</attribute>
<attribute name="shared">
<value>0</value>
</attribute>
<attribute name="imagename">
<value>FEDORA8-OVZ-STD</value>
</attribute>
<attribute name="pid">
<value>emulab-ops</value>
</attribute>
<attribute name="OS">
<value>Fedora</value>
</attribute>
<attribute name="gid">
<value>emulab-ops</value>
</attribute>
</image>
</descriptors>
MFS_ARCH = i386
MFS_ARCH = x86_64
SOURCE_PATH = $(PWD)/source
TARGET_PATH = $(PWD)/target
TARGET_BUILD_PATH = $(PWD)/build
SCRIPTS_PATH = $(PWD)/scripts
INITRAMFS_PATH = $(PWD)/initramfs.tmp
BUILDROOT_PATH = $(PWD)/buildroot
BUILDROOT_VERSION = 2010.02
BUILDROOT_PATH = $(PWD)/buildroot-$(BUILDROOT_VERSION)
FAKEROOT_ENVIRONMENT = $(PWD)/fs_fakeroot.env
STAGING_DIR = $(PWD)/buildroot/build_$(MFS_ARCH)/staging_dir
BOOT_PATH = $(PWD)/boot
INITRAMFS = $(BOOT_PATH)/initramfs.gz
INITRAMFS_COMPRESSION = lzma
INITRAMFS = $(BOOT_PATH)/initramfs
#FAKEROOT_BIN = $(STAGING_DIR)/usr/bin/fakeroot
FAKEROOT_BIN = fakeroot
......@@ -68,7 +70,7 @@ $(INSTALL_MODULES):
$(TARGET_PATH)/lib/libc.so.0:
mkdir -p $(TARGET_PATH)/lib
cp -dpR $(BUILDROOT_PATH)/project_build_$(MFS_ARCH)/uclibc/root/lib/* $(TARGET_PATH)/lib
cp -dpR $(BUILDROOT_PATH)/output/target/lib/* $(TARGET_PATH)/lib
uclibc-install: $(TARGET_PATH)/lib/libc.so.0
......@@ -91,6 +93,6 @@ initramfs: install
-i $(FAKEROOT_ENVIRONMENT) \
$(SCRIPTS_PATH)/misc_fixup.sh $(TARGET_PATH)
$(FAKEROOT_BIN) -i $(FAKEROOT_ENVIRONMENT) \
$(SCRIPTS_PATH)/gen_initramfs.sh $(INITRAMFS_PATH) $(INITRAMFS)
$(SCRIPTS_PATH)/gen_initramfs.sh -c $(INITRAMFS_COMPRESSION) $(INITRAMFS_PATH) $(INITRAMFS)
rm -f $(FAKEROOT_ENVIRONMENT)
rm -rf $(INITRAMFS_PATH)
#! /bin/sh
compression=gzip
usage() {
echo "USAGE: ${0##*/} [-c gzip|bzip2|lzma|none] root_dir image"
}
if [ "$1" = "-c" ]; then
case $2 in
gzip|bzip2|lzma|none)
compression=$2
;;
*) echo \
"${0##*/}: invalid compresion method \"$2\"" 1>&2
usage 1>&2
exit 1
;;
esac
shift
shift
fi
if [ $# -lt 2 ]; then
usage 1>&2
exit 1
fi
TARGET="$1"
INITRAMFS="$2"
(
cd "$TARGET"
find . -print | cpio --quiet -H newc -o | gzip -c -9 > "$INITRAMFS"
if [ $compression = none ]; then
find . -print | cpio --quiet -H newc -o
else
find . -print | cpio --quiet -H newc -o | $compression -c -9
fi
) > "$INITRAMFS"
......@@ -25,26 +25,28 @@ my %aliases;
my %symbols;
my @order;
my @firmware;
sub parse_deps
{
my ($module_dir) = @_;
my $depfile = "$module_dir/modules.dep";
open DEPS, $depfile ||
die "Couldn't open modules.dep: $!\n";
while (<DEPS>) {
chomp;
my ($filename, $deplist) = /^(\S+):\s*(.*)$/;
my $module = $filename;
$module =~ s/.*\/([^\/]+)\.ko$/$1/;
#my @d = map { s/.*\/([^\/]+)\.ko$/$1/; y/_/-/; $_ }
my @d = map { s/.*\/([^\/]+)\.ko$/$1/; $_ }
split(/\s+/, $deplist);
# Normalize underscores to dashes
#$module =~ y/_/-/;
$deps{$module} = \@d if (@d);
$files{$module} = $filename;
}
......@@ -57,7 +59,7 @@ sub parse_symbols
my $symfile = "$module_dir/modules.symbols";
open SYMS, $symfile ||
die "Couldn't open modules.symbols: $!\n";
while (<SYMS>) {
chomp;
next if (/^#/ || /^\s*$/);
......@@ -79,7 +81,7 @@ sub parse_aliases
my $aliasfile = "$module_dir/modules.alias";
open SYMS, $aliasfile ||
die "Couldn't open modules.alias: $!\n";
while (<SYMS>) {
chomp;
next if (/^#/ || /^\s*$/);
......@@ -100,7 +102,7 @@ sub parse_order
my $orderfile = "$module_dir/modules.order";
open ORDER, $orderfile ||
die "Couldn't open modules.order: $!\n";
while (<ORDER>) {
chomp;
/.*\/([^\/]+)\.ko$/;
......@@ -111,6 +113,21 @@ sub parse_order
close ORDER;
}
sub parse_firmware
{
my ($module_file) = @_;
my @files;
open STRINGS, "strings \"$module_file\"|" or
die "Couldn't read $module_file: $!\n";
while (<STRINGS>) {
chomp;
next unless (/^firmware=(.*)$/);
push @files, $1;
}
return @files;
}
#my @modules = @ARGV;
my @modules = qw/unix sunrpc af_packet ext3 ext2 ufs/;
if (@ARGV != 3) {
......@@ -138,7 +155,9 @@ if ($? != 0) {
$version = glob "$tmpdir/lib/modules/*";
$version = (split /\/+/, $version)[-1];
$basedir = "$tmpdir/lib/modules";
$basedir = "$tmpdir/lib";
my $module_basedir = "$basedir/modules";
my $firmware_basedir = "$basedir/firmware";
open MODLIST, $modlist || die "Couldn't read $modlist: $!\n";
while (<MODLIST>) {
......@@ -150,30 +169,33 @@ close MODLIST;
my @list = @modules;
parse_deps("$basedir/$version");
parse_symbols("$basedir/$version");
parse_aliases("$basedir/$version");
parse_deps("$module_basedir/$version");
parse_symbols("$module_basedir/$version");
parse_aliases("$module_basedir/$version");
while (@list) {
my $module = shift @list;
#$module =~ y/_/-/;
next if (exists $seen{$module});
next if (not exists $files{$module});
if (exists $deps{$module}) {
push @list, @{$deps{$module}};
}
$seen{$module} = 1;
}
parse_order("$basedir/$version");
parse_order("$module_basedir/$version");
$outdir .= '/lib/modules/' . $version;
rmtree($outdir);
mkpath($outdir);
my $module_outdir = $outdir . '/lib/modules/' . $version;
my $firmware_outdir = $outdir . '/lib/firmware';
rmtree($module_outdir);
rmtree($firmware_outdir);
mkpath($module_outdir);
mkpath($firmware_outdir);
open DEPS, ">$outdir/modules.dep" || die "Can't write to modules.dep: $!\n";
open DEPS, ">$module_outdir/modules.dep" || die "Can't write to modules.dep: $!\n";
#print "#modules.dep\n\n";
for my $module (keys %seen) {
my @tmp = map { $files{$_} } @{$deps{$module}};
......@@ -181,7 +203,7 @@ for my $module (keys %seen) {
}
close DEPS;
open SYMS, ">$outdir/modules.symbols" || die "Can't write to modules.symbols: $!\n";
open SYMS, ">$module_outdir/modules.symbols" || die "Can't write to modules.symbols: $!\n";
#print "#modules.symbols\n\n";
for my $module (keys %seen) {
for my $sym (@{$symbols{$module}}) {
......@@ -190,7 +212,7 @@ for my $module (keys %seen) {
}
close SYMS;
open ALIAS, ">$outdir/modules.alias" || die "Can't write to modules.alias: $!\n";
open ALIAS, ">$module_outdir/modules.alias" || die "Can't write to modules.alias: $!\n";
#print "#modules.aliases\n\n";
for my $module (keys %seen) {
for my $alias (@{$aliases{$module}}) {
......@@ -199,7 +221,7 @@ for my $module (keys %seen) {
}
close ALIAS;
open ORDER, ">$outdir/modules.order" || die "Can't write to modules.order: $!\n";
open ORDER, ">$module_outdir/modules.order" || die "Can't write to modules.order: $!\n";
print ORDER "$_\n" for (@order);
close ORDER;
......@@ -207,7 +229,19 @@ for my $module (keys %seen) {
my $file = $files{$module};
my $path = $file;
$path =~ s/\/[^\/]+$//;
mkpath($outdir . '/' . $path);
copy("$basedir/$version/$file", "$outdir/$file");
mkpath($module_outdir . '/' . $path);
copy("$module_basedir/$version/$file", "$module_outdir/$file");
push @firmware, parse_firmware("$module_basedir/$version/$file");
}
for my $fw (@firmware) {
my $path = $fw;
$path =~ s/\/[^\/]+$//;
mkpath($firmware_outdir . '/' . $path);
if (! -f "$firmware_basedir/$fw") {
print STDERR "WARNING: $firmware_basedir/$fw does not exist\n";
next;
}
copy("$firmware_basedir/$fw", "$firmware_outdir/$fw");
}
rmtree($tmpdir);
#
# Automatically generated make config: don't edit
# Wed Dec 17 14:13:46 2008
# Mon Mar 1 16:10:18 2010
#
BR2_HAVE_DOT_CONFIG=y
BR2_VERSION="0.10.0-svn"
BR2_VERSION="2010.02"
# BR2_alpha is not set
# BR2_arm is not set
# BR2_armeb is not set
......@@ -16,12 +16,12 @@ BR2_i386=y
# BR2_mipsel is not set
# BR2_nios2 is not set
# BR2_powerpc is not set
# BR2_s390 is not set
# BR2_sh is not set
# BR2_sh64 is not set
# BR2_sparc is not set
# BR2_sparc64 is not set
# BR2_x86_64 is not set
# BR2_xtensa is not set
BR2_x86_i386=y
# BR2_x86_i486 is not set
# BR2_x86_i586 is not set
......@@ -55,66 +55,39 @@ BR2_GCC_TARGET_ARCH="i386"
# Target options
#
#
# Project Options
#
BR2_PROJECT="uclibc"
BR2_HOSTNAME="uclibc"
BR2_BANNER="Welcome to the Erik's uClibc development environment."
#
# Preset Devices
#
# BR2_TARGET_SOEKRIS is not set
# BR2_TARGET_VIA_EPIA_MII is not set
#
# Generic Architecture support
#
#
# Generic x86 Device Support
#
#
# Generic System Support
#
# BR2_TARGET_GENERIC_ACCESS_POINT is not set
# BR2_TARGET_GENERIC_FIREWALL is not set
# BR2_TARGET_GENERIC_DEV_SYSTEM is not set
# BR2_TARGET_X86 is not set
BR2_TARGET_GENERIC_HOSTNAME="buildroot"
BR2_TARGET_GENERIC_ISSUE="Welcome to Buildroot"
# BR2_TARGET_GENERIC_GETTY is not set
#
# Build options
#
BR2_PRIMARY_SITE=""
BR2_WGET="wget --passive-ftp -nd"
BR2_SVN_CO="svn co"
BR2_SVN_UP="svn up"
BR2_BZR_CO="bzr co"
BR2_BZR_UP="bzr up"
BR2_GIT="git clone"
BR2_ZCAT="gzip -d -c"
BR2_BZCAT="bzcat"
BR2_TAR_OPTIONS=""
BR2_DL_DIR="$(BASE_DIR)/dl"
BR2_COPYTO=""
#
# Mirrors and Download locations
#
BR2_PRIMARY_SITE=""
BR2_BACKUP_SITE="http://buildroot.net/downloads/sources/"
BR2_SOURCEFORGE_MIRROR="easynews"
BR2_KERNEL_MIRROR="http://www.kernel.org/pub/"
BR2_GNU_MIRROR="http://ftp.gnu.org/pub/gnu"
BR2_DEBIAN_MIRROR="http://ftp.debian.org"
#
# Atmel Mirrors
#
BR2_ATMEL_MIRROR="ftp://www.at91.com/pub/buildroot/"
BR2_AT91_PATCH_MIRROR="http://maxim.org.za/AT91RM9200/2.6/"
BR2_STAGING_DIR="$(BUILD_DIR)/staging_dir"
# BR2_FPU_SUFFIX is not set
BR2_TOPDIR_PREFIX=""
BR2_TOPDIR_SUFFIX=""
BR2_ROOTFS_PREFIX="rootfs"
BR2_ROOTFS_SUFFIX=""
BR2_GNU_BUILD_SUFFIX="pc-linux-gnu"
BR2_GNU_TARGET_SUFFIX="linux-uclibc"
BR2_JLEVEL=1
......@@ -143,91 +116,72 @@ BR2_UPDATE_CONFIG=y
#
BR2_TOOLCHAIN_BUILDROOT=y
# BR2_TOOLCHAIN_EXTERNAL is not set
# BR2_TOOLCHAIN_EXTERNAL_SOURCE is not set
BR2_TOOLCHAIN_SOURCE=y
BR2_EXT_GCC_VERSION_4_1_2=y
BR2_EXT_GCC_VERSION_4_2_1=y
BR2_EXT_GCC_VERSION_4_2_2=y
BR2_EXT_GCC_VERSION_4_2_3=y
BR2_EXT_BINUTILS_VERSION_2_17=y
BR2_EXT_UCLIBC_VERSION_0_9_28_3=y
BR2_EXT_UCLIBC_VERSION_0_9_29=y
BR2_EXT_UCLIBC_VERSION_0_9_30=y
#
# Kernel Header Options
#
# BR2_KERNEL_HEADERS_2_4_31 is not set
# BR2_KERNEL_HEADERS_2_6_20_4 is not set
# BR2_KERNEL_HEADERS_2_6_20 is not set
# BR2_KERNEL_HEADERS_2_6_21_5 is not set
# BR2_KERNEL_HEADERS_2_6_21 is not set
# BR2_KERNEL_HEADERS_2_6_22_1 is not set
# BR2_KERNEL_HEADERS_2_6_22_10 is not set
# BR2_KERNEL_HEADERS_2_6_22 is not set
# BR2_KERNEL_HEADERS_2_6_23 is not set
# BR2_KERNEL_HEADERS_2_6_24 is not set
# BR2_KERNEL_HEADERS_2_6_25 is not set
# BR2_KERNEL_HEADERS_2_6_26 is not set
BR2_KERNEL_HEADERS_2_6_27=y
# BR2_KERNEL_HEADERS_2_6_27 is not set
# BR2_KERNEL_HEADERS_2_6_28 is not set
# BR2_KERNEL_HEADERS_2_6_29 is not set
# BR2_KERNEL_HEADERS_2_6_30 is not set
# BR2_KERNEL_HEADERS_2_6_31 is not set
BR2_KERNEL_HEADERS_2_6_32=y
# BR2_KERNEL_HEADERS_VERSION is not set
# BR2_KERNEL_HEADERS_SNAP is not set
BR2_DEFAULT_KERNEL_HEADERS="2.6.27.8"
BR2_DEFAULT_KERNEL_HEADERS="2.6.32.9"
#
# uClibc Options
#
# BR2_UCLIBC_VERSION_0_9_28_3 is not set
# BR2_UCLIBC_VERSION_0_9_29 is not set
BR2_UCLIBC_VERSION_0_9_30=y
# BR2_UCLIBC_VERSION_0_9_30 is not set
# BR2_UCLIBC_VERSION_0_9_30_1 is not set
BR2_UCLIBC_VERSION_0_9_30_2=y
# BR2_UCLIBC_VERSION_SNAPSHOT is not set
BR2_UCLIBC_VERSION_STRING="0.9.30.2"
BR2_UCLIBC_CONFIG="toolchain/uClibc/uClibc-0.9.30.config"
# BR2_ENABLE_LOCALE is not set
# BR2_PTHREADS_NONE is not set
# BR2_PTHREADS is not set
BR2_PTHREADS_OLD=y
# BR2_PTHREADS_NATIVE is not set
# BR2_PTHREAD_DEBUG is not set
# BR2_UCLIBC_PROGRAM_INVOCATION is not set
# BR2_UCLIBC_INSTALL_TEST_SUITE is not set
#
# Binutils Options
#
# BR2_BINUTILS_VERSION_2_17 is not set
# BR2_BINUTILS_VERSION_2_17_50_0_17 is not set
# BR2_BINUTILS_VERSION_2_18 is not set
# BR2_BINUTILS_VERSION_2_18_50_0_1 is not set
# BR2_BINUTILS_VERSION_2_18_50_0_3 is not set
# BR2_BINUTILS_VERSION_2_18_50_0_6 is not set
# BR2_BINUTILS_VERSION_2_18_50_0_8 is not set
# BR2_BINUTILS_VERSION_2_18_50_0_9 is not set
BR2_BINUTILS_VERSION_2_19=y
BR2_BINUTILS_VERSION="2.19"
# BR2_BINUTILS_VERSION_2_18_AVR32_1_0_1 is not set
# BR2_BINUTILS_VERSION_2_19 is not set
# BR2_BINUTILS_VERSION_2_19_1 is not set
BR2_BINUTILS_VERSION_2_20=y
BR2_BINUTILS_VERSION="2.20"
BR2_EXTRA_BINUTILS_CONFIG_OPTIONS=""
#
# GCC Options
#
# BR2_GCC_VERSION_3_4_6 is not set
# BR2_GCC_VERSION_4_0_4 is not set
# BR2_GCC_VERSION_4_1_2 is not set
# BR2_GCC_VERSION_4_2_1 is not set
# BR2_GCC_VERSION_4_2_2 is not set
# BR2_GCC_VERSION_4_2_2_AVR32_2_1_5 is not set
# BR2_GCC_VERSION_4_2_3 is not set
BR2_GCC_VERSION_4_2_4=y
# BR2_GCC_VERSION_4_3_1 is not set
# BR2_GCC_VERSION_4_3_2 is not set
# BR2_GCC_VERSION_4_3_3 is not set
# BR2_GCC_VERSION_4_3_4 is not set
# BR2_GCC_VERSION_4_4_X is not set
# BR2_GCC_VERSION_SNAP is not set
BR2_GCC_SUPPORTS_SYSROOT=y
# BR2_GCC_SUPPORTS_FINEGRAINEDMTUNE is not set
BR2_GCC_VERSION="4.2.4"
BR2_TOOLCHAIN_SYSROOT=y
# BR2_GCC_USE_SJLJ_EXCEPTIONS is not set
BR2_EXTRA_GCC_CONFIG_OPTIONS=""
# BR2_GCC_CROSS_CXX is not set
# BR2_GCC_CROSS_FORTRAN is not set
# BR2_INSTALL_LIBSTDCPP is not set
# BR2_INSTALL_OBJC is not set
# BR2_INSTALL_FORTRAN is not set
BR2_GCC_SHARED_LIBGCC=y
BR2_GCC_ENABLE_TLS=y
#
# Ccache Options
......@@ -244,38 +198,57 @@ BR2_GCC_SHARED_LIBGCC=y
#
# Common Toolchain Options
#
# BR2_MKLIBS is not set
# BR2_PACKAGE_SSTRIP_TARGET is not set
# BR2_PACKAGE_SSTRIP_HOST is not set
# BR2_ENABLE_MULTILIB is not set
BR2_LARGEFILE=y
# BR2_INET_IPV6 is not set
BR2_INET_RPC=y
# BR2_ENABLE_LOCALE is not set
# BR2_ENABLE_LOCALE_PURGE is not set
BR2_USE_WCHAR=y
# BR2_USE_SSP is not set
# BR2_PTHREADS_NONE is not set
# BR2_PTHREADS is not set
BR2_PTHREADS_OLD=y
# BR2_PTHREADS_NATIVE is not set
# BR2_PROGRAM_INVOCATION is not set
# BR2_INSTALL_LIBSTDCPP is not set
BR2_TARGET_OPTIMIZATION="-Os -pipe"
# BR2_MKLIBS is not set
# BR2_PACKAGE_SSTRIP_TARGET is not set