All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit a2a19bcb authored by Weibin Sun's avatar Weibin Sun

Merge commit 'central/master'

parents 6690420d 09dcc801
......@@ -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);
include ../../variables.mk
BUSYBOX_CONFIG = $(SOURCE_PATH)/busybox/busybox.config
BUSYBOX_VERSION = 1.13.1
BUSYBOX_VERSION = 1.16.0
BUSYBOX_PATH = $(TARGET_BUILD_PATH)/busybox-$(BUSYBOX_VERSION)
.PHONY: extract patch config busybox
......
This diff is collapsed.
--- busybox-1.13.1/miscutils/crond.c Sun Nov 9 18:28:17 2008
+++ busybox-1.13.1-crond/miscutils/crond.c Thu Dec 4 14:56:10 2008
@@ -779,6 +779,8 @@
xmove_fd(mailFd, mail_filename ? 1 : 0);
dup2(1, 2);
}
+ /* crond 3.0pl1-100 puts tasks in separate process groups */
+ bb_setpgrp();
execlp(prog, prog, cmd, arg, NULL);
crondlog(ERR20 "can't exec, user %s cmd %s %s %s", user, prog, cmd, arg);
if (mail_filename) {
@@ -914,6 +916,8 @@
if (DebugOpt) {
crondlog(LVL5 "child running %s", DEFAULT_SHELL);
}
+ /* crond 3.0pl1-100 puts tasks in separate process groups */
+ bb_setpgrp();
execl(DEFAULT_SHELL, DEFAULT_SHELL, "-c", line->cl_Shell, NULL);
crondlog(ERR20 "can't exec, user %s cmd %s %s %s", user,
DEFAULT_SHELL, "-c", line->cl_Shell);
--- busybox-1.13.1/init/init.c Sat Nov 29 07:48:56 2008
+++ busybox-1.13.1-init/init/init.c Tue Dec 9 22:17:43 2008
@@ -118,18 +118,18 @@
msg[0] = '\r';
va_start(arguments, fmt);
- l = vsnprintf(msg + 1, sizeof(msg) - 2, fmt, arguments);
- if (l > sizeof(msg) - 2)
- l = sizeof(msg) - 2;
+ l = 1 + vsnprintf(msg + 1, sizeof(msg) - 2, fmt, arguments);
+ if (l > sizeof(msg) - 1)
+ l = sizeof(msg) - 1;
msg[l] = '\0';
va_end(arguments);
if (ENABLE_FEATURE_INIT_SYSLOG) {
- /* Log the message to syslogd */
if (where & L_LOG) {
- /* don't print out "\r" */
- openlog(applet_name, 0, LOG_DAEMON);
- syslog(LOG_INFO, "init: %s", msg + 1);
+ /* Log the message to syslogd */
+ openlog("init", 0, LOG_DAEMON);
+ /* don't print "\r" */
+ syslog(LOG_INFO, "%s", msg + 1);
closelog();
}
msg[l++] = '\n';
--- busybox-1.13.1/networking/ip.c Sun Nov 9 18:27:59 2008
+++ busybox-1.13.1-ip/networking/ip.c Thu Dec 4 13:16:29 2008
@@ -31,7 +31,7 @@
static int ip_do(int (*ip_func)(char **argv), char **argv)
{
- argv = ip_parse_common_args(argv);
+ argv = ip_parse_common_args(argv + 1);
return ip_func(argv);
}
--- busybox-1.13.1/coreutils/printf.c Sun Nov 9 18:28:07 2008
+++ busybox-1.13.1-printf/coreutils/printf.c Wed Dec 10 12:50:55 2008
@@ -359,8 +359,15 @@
* We will mimic coreutils. */
if (argv[1] && argv[1][0] == '-' && argv[1][1] == '-' && !argv[1][2])
argv++;
- if (!argv[1])
+ if (!argv[1]) {
+ if (ENABLE_ASH_BUILTIN_PRINTF
+ && applet_name[0] != 'p'
+ ) {
+ bb_error_msg("usage: printf FORMAT [ARGUMENT...]");
+ return 2; /* bash compat */
+ }
bb_show_usage();
+ }
format = argv[1];
argv2 = argv + 2;
diff -urpN busybox-1.16.0/shell/ash.c busybox-1.16.0-ash/shell/ash.c
--- busybox-1.16.0/shell/ash.c 2010-01-25 01:59:38.000000000 +0100
+++ busybox-1.16.0-ash/shell/ash.c 2010-02-21 01:52:22.000000000 +0100
@@ -4539,7 +4539,7 @@ forkchild(struct job *jp, union node *n,
if (mode == FORK_NOJOB /* is it `xxx` ? */
&& n && n->type == NCMD /* is it single cmd? */
/* && n->ncmd.args->type == NARG - always true? */
- && strcmp(n->ncmd.args->narg.text, "trap") == 0
+ && n->ncmd.args && strcmp(n->ncmd.args->narg.text, "trap") == 0
&& n->ncmd.args->narg.next == NULL /* "trap" with no arguments */
/* && n->ncmd.args->narg.backquote == NULL - do we need to check this? */
) {
@@ -4627,7 +4627,7 @@ forkchild(struct job *jp, union node *n,
}
#if JOBS
if (n && n->type == NCMD
- && strcmp(n->ncmd.args->narg.text, "jobs") == 0
+ && n->ncmd.args && strcmp(n->ncmd.args->narg.text, "jobs") == 0
) {
TRACE(("Job hack\n"));
/* "jobs": we do not want to clear job list for it,
diff -urpN busybox-1.16.0/shell/ash_test/ash-misc/nulltick1.right busybox-1.16.0-ash/shell/ash_test/ash-misc/nulltick1.right
--- busybox-1.16.0/shell/ash_test/ash-misc/nulltick1.right 1970-01-01 01:00:00.000000000 +0100
+++ busybox-1.16.0-ash/shell/ash_test/ash-misc/nulltick1.right 2010-02-21 01:52:22.000000000 +0100
@@ -0,0 +1,3 @@
+Test 1
+Test 2
+Done
diff -urpN busybox-1.16.0/shell/ash_test/ash-misc/nulltick1.tests busybox-1.16.0-ash/shell/ash_test/ash-misc/nulltick1.tests
--- busybox-1.16.0/shell/ash_test/ash-misc/nulltick1.tests 1970-01-01 01:00:00.000000000 +0100
+++ busybox-1.16.0-ash/shell/ash_test/ash-misc/nulltick1.tests 2010-02-21 01:52:22.000000000 +0100
@@ -0,0 +1,3 @@
+echo Test ` ` 1
+echo Test `</dev/null` 2
+echo Done
This diff is collapsed.
This diff is collapsed.
diff -urpN busybox-1.16.0/util-linux/volume_id/linux_swap.c busybox-1.16.0-linux_swap/util-linux/volume_id/linux_swap.c
--- busybox-1.16.0/util-linux/volume_id/linux_swap.c 2010-01-25 01:59:39.000000000 +0100
+++ busybox-1.16.0-linux_swap/util-linux/volume_id/linux_swap.c 2010-02-21 01:53:21.000000000 +0100
@@ -52,7 +52,11 @@ int FAST_FUNC volume_id_probe_linux_swap
goto found;
}
- if (memcmp(buf, "SWAPSPACE2", 10) == 0) {
+ if (memcmp(buf, "SWAPSPACE2", 10) == 0
+ || memcmp(buf, "S1SUSPEND", 9) == 0
+ || memcmp(buf, "S2SUSPEND", 9) == 0
+ || memcmp(buf, "ULSUSPEND", 9) == 0
+ ) {
sw = volume_id_get_buffer(id, off, sizeof(struct swap_header_v1_2));
if (sw == NULL)
return -1;
diff -urpN busybox-1.16.0/coreutils/md5_sha1_sum.c busybox-1.16.0-md5_sha_compat/coreutils/md5_sha1_sum.c
--- busybox-1.16.0/coreutils/md5_sha1_sum.c 2010-01-25 01:59:38.000000000 +0100
+++ busybox-1.16.0-md5_sha_compat/coreutils/md5_sha1_sum.c 2010-02-21 01:53:28.000000000 +0100
@@ -101,8 +101,10 @@ int md5_sha1_sum_main(int argc UNUSED_PA
unsigned flags;
/*hash_algo_t hash_algo = applet_name[3];*/
- if (ENABLE_FEATURE_MD5_SHA1_SUM_CHECK)
- flags = getopt32(argv, "scw");
+ if (ENABLE_FEATURE_MD5_SHA1_SUM_CHECK) {
+ /* -b "binary", -t "text" are ignored (shaNNNsum compat) */
+ flags = getopt32(argv, "scwbt");
+ }
else optind = 1;
argv += optind;
//argc -= optind;
diff -urpN busybox-1.16.0/sysklogd/syslogd.c busybox-1.16.0-syslogd/sysklogd/syslogd.c
--- busybox-1.16.0/sysklogd/syslogd.c 2010-01-25 01:59:38.000000000 +0100
+++ busybox-1.16.0-syslogd/sysklogd/syslogd.c 2010-02-21 01:53:33.000000000 +0100
@@ -698,7 +698,7 @@ int syslogd_main(int argc UNUSED_PARAM,
if (!(opts & OPT_nofork)) {
bb_daemonize_or_rexec(DAEMON_CHDIR_ROOT, argv);
}
- umask(0);
+ //umask(0); - why??
write_pidfile("/var/run/syslogd.pid");
do_syslogd();
/* return EXIT_SUCCESS; */
diff -urpN busybox-1.16.0/networking/tftp.c busybox-1.16.0-tftp/networking/tftp.c
--- busybox-1.16.0/networking/tftp.c 2010-01-25 01:59:38.000000000 +0100
+++ busybox-1.16.0-tftp/networking/tftp.c 2010-02-21 01:53:41.000000000 +0100
@@ -308,7 +308,7 @@ static int tftp_protocol(
if (!ENABLE_TFTP || our_lsa) { /* tftpd */
/* Open file (must be after changing user) */
- local_fd = open(local_file, open_mode);
+ local_fd = open(local_file, open_mode, 0666);
if (local_fd < 0) {
error_pkt_reason = ERR_NOFILE;
strcpy((char*)error_pkt_str, "can't open file");
This diff is collapsed.
diff -urpN busybox-1.16.0/networking/wget.c busybox-1.16.0-wget/networking/wget.c
--- busybox-1.16.0/networking/wget.c 2010-01-25 01:59:38.000000000 +0100
+++ busybox-1.16.0-wget/networking/wget.c 2010-02-21 01:53:53.000000000 +0100
@@ -546,6 +546,8 @@ int wget_main(int argc UNUSED_PARAM, cha
"passive-ftp\0" No_argument "\xff"
"header\0" Required_argument "\xfe"
"post-data\0" Required_argument "\xfd"
+ /* Ignored (we don't do ssl) */
+ "no-check-certificate\0" No_argument "\xfc"
;
#endif
@@ -590,6 +592,7 @@ int wget_main(int argc UNUSED_PARAM, cha
if (use_proxy) {
proxy = getenv(target.is_ftp ? "ftp_proxy" : "http_proxy");
if (proxy && proxy[0]) {
+ server.user = NULL;
parse_url(proxy, &server);
} else {
use_proxy = 0;
This diff is collapsed.
......@@ -71,6 +71,7 @@ $(ETHTOOL_PATH)/ethtool: $(ETHTOOL_PATH)/.config-stamp
$(TARGET_PATH)/usr/sbin/ethtool: $(ETHTOOL_PATH)/ethtool
install -d -m 755 $(TARGET_PATH)/usr
install -d -m 755 $(TARGET_PATH)/usr/bin
mkdir -p $(TARGET_PATH)/usr/sbin
install -m 755 $(ETHTOOL_PATH)/ethtool \
$(TARGET_PATH)/usr/sbin/ethtool
$(STRIPCMD) --strip-unneeded $(TARGET_PATH)/usr/sbin/ethtool
......
include ../../variables.mk
LINUX_VERSION = 2.6.27.8
LINUX_VERSION = 2.6.32.9
LINUX_PATH = $(TARGET_BUILD_PATH)/linux-$(LINUX_VERSION)
KERNEL_CONFIG = $(SOURCE_PATH)/linux/linux.config.$(MFS_ARCH)
......
--- linux-2.6.23.i686/arch/x86/kernel/reboot.c~ 2008-02-29 10:06:46.000000000 -0700