Commit afc987a4 authored by Leigh Stoller's avatar Leigh Stoller

Merge remote-tracking branch 'central/imageversion'

parents 2d43ff3f 06591f8a
......@@ -34,15 +34,16 @@ use Cwd qw(realpath);
#
sub usage()
{
print("Usage: newimageid [-v] [-a] [-s] <xmlfile>\n");
print("Usage: newimageid [-v] [-a] [-s] [-t target] <xmlfile>\n");
exit(-1);
}
my $optlist = "dvfas";
my $optlist = "dvfast:";
my $debug = 0;
my $force = 0;
my $verify = 0; # Check data and return status only.
my $allpc = 0; # insert mappings for all pc types.
my $skipadmin = 0; # Skip SLOT_ADMINONLY checks.
my $target;
#
# Configure variables
......@@ -52,6 +53,8 @@ my $TBOPS = "@TBOPSEMAIL@";
my $TBAUDIT = "@TBAUDITEMAIL@";
my $TBGROUP_DIR = "@GROUPSROOT_DIR@";
my $TBPROJ_DIR = "@PROJROOT_DIR@";
my $CREATEIMAGE = "$TB/bin/create_image";
my $CLONEIMAGE = "$TB/sbin/clone_image";
#
# Untaint the path
......@@ -107,6 +110,20 @@ if (defined($options{"s"})) {
if (defined($options{"a"})) {
$allpc = 1;
}
if (defined($options{"t"})) {
$target = $options{"t"};
# Might be an EC2 target. Also need to untaint for below.
if ($target =~ /^([-\w\@\.\+]+@[-\w\@\.\+]+)$/) {
$target = $1;
}
else {
my $node = Node->Lookup($target);
if (!defined($node)) {
fatal("No such node!");
}
$target = $node->node_id();
}
}
if (@ARGV != 1) {
usage();
}
......@@ -727,7 +744,8 @@ UserError($usrerr)
fatal("Could not create new Image!")
if (!defined($new_image));
my $imageid = $new_image->imageid();
my $imageid = $new_image->imageid();
my $imagepid = $new_image->pid();
#
# Insert a submap entry.
......@@ -748,6 +766,27 @@ if (defined($parentos)) {
}
}
#
# If a target was specified, fire off image creation. It will return
# quickly enough (going into the background) that we can wait here for
# it.
#
if (defined($target)) {
#
# Use clone_image for a node, create_image for an EC2 target. We use
# clone cause it will do the provenance, so we do not have to duplicate
# that stuff here. Then it just calls create_image.
#
if ($target =~ /^.*@.*$/) {
system("$CREATEIMAGE -p $imagepid $imageid '$target'"); }
else {
# Must be an imagename, not and imageid.
system("$CLONEIMAGE $imagename '$target'");
}
if ($?) {
fatal("Could not image capture from $target");
}
}
# The web interface requires this line to be printed.
print "IMAGE $imagename/$imageid has been created\n";
......
......@@ -46,4 +46,4 @@
* it in clientside/tmcc/common/libsetup.pm!
*/
#define DEFAULT_VERSION 2
#define CURRENT_VERSION 38
#define CURRENT_VERSION 39
#
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -75,7 +75,10 @@ endif
$(MAKE) -C genhostsfile client-install
ifeq ($(SYSTEM),FreeBSD)
$(MAKE) -C growdisk client-install
$(INSTALL_PROGRAM) $(SRCDIR)/create-image $(LBINDIR)/
$(INSTALL_PROGRAM) $(SRCDIR)/create-swapimage $(LBINDIR)/
endif
$(INSTALL_PROGRAM) $(SRCDIR)/create-versioned-image $(LBINDIR)/
mfs:
$(MAKE) -C growdisk client
......@@ -83,6 +86,9 @@ mfs:
$(MAKE) -C growdisk client
$(MAKE) -C imagezip client
$(MAKE) -C frisbee.redux client
$(INSTALL_PROGRAM) $(SRCDIR)/create-image $(LBINDIR)/
$(INSTALL_PROGRAM) $(SRCDIR)/create-versioned-image $(LBINDIR)/
$(INSTALL_PROGRAM) $(SRCDIR)/create-swapimage $(LBINDIR)/
subboss: subboss-subdirs
......
#!/usr/bin/perl -wT
#!/usr/bin/perl -w
#
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
......@@ -53,6 +53,7 @@ delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
my $sudo = "";
my $zipper = "/usr/local/bin/imagezip";
my $uploader = "/usr/local/bin/frisupload";
my $xenscript = "/usr/local/bin/create-xen-image";
my $slice = "";
my $device;
my $filename;
......@@ -69,6 +70,19 @@ if ($EUID != 0) {
}
}
#
# A newer server side is going to invoke this script for XEN nodes, to be
# backwards compatible with older XEN client sides that had its own version
# of create-image. It is now called create-xen-image, so call that script,
# which conveniently is argument compatible with this script. This test for
# the file is kinda bogus, but this script does not include libsetup, which
# hides that. Not sure why we do not include libsetup (ask Mike).
#
if ($^O eq 'linux' && -e "/etc/emulab/genvmtype") {
exec $xenscript, @ARGV;
die("Could not exec $xenscript");
}
# Frisbee master server params
my $iserver = "boss"; # XXX
my $imageid;
......
#!/usr/bin/perl -wT
#!/usr/bin/perl -w
#
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
......@@ -88,17 +88,23 @@ use Getopt::Std;
# Partition on DISK from which to load image. Used for imagezip -s option.
# If not set or set to zero, then it is a whole-disk image.
#
# IZOPTS=<string>
# Additional options for imagezip.
#
# PROXY=<vnodeid>
# The proxy argument for use on XEN, when acting on behalf of a container.
#
sub usage()
{
print STDERR
"Usage:\n".
"create-versioned-image [-nv] -f param-file\n".
"create-versioned-image [-nvx] -f param-file\n".
" or\n".
"create-versioned-image [-nv] KEY=VALUE ...\n";
"create-versioned-image [-nv] [-x vnode_id] KEY=VALUE ...\n";
exit(-1);
}
my $optlist = "f:nv";
my $optlist = "f:nvx:";
#
# Turn off line buffering on output
......@@ -114,25 +120,14 @@ delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
#
# No configure vars.
#
my $sudo;
my $sudo = "";
my $zipper = "/usr/local/bin/imagezip";
my $uploader = "/usr/local/bin/frisupload";
my $frisbee = "/usr/local/bin/frisbee";
my $localdir = "/local";
my $impotent = 0;
my $verbose = 0;
#
# We do not create relocations (-N) in the resulting image right now for a
# couple of reasons. One is that we never did relocation support for GRUB
# partition boot code, so modern Linux images would not have relocations
# anyway. For FreeBSD this does mean that we cannot relocate them (we use
# a relocation for correct disklabel construction), but we never really
# took advantage of this anyway. The second reason is that ranges with
# relocations are always considered different for hash comparisons, so an
# otherwise empty FreeBSD delta image would have 64K of data in it.
#
my $zipperopts = "-N";
my $isxen = 0;
sub process_image($);
sub mysystem($);
......@@ -148,6 +143,13 @@ sub map_diskname($)
my ($dev) = @_;
my ($dtype, $dunit);
#
# When called on XEN, the diskname is correct, and in fact we will
# just mess it up.
#
return $dev
if ($isxen);
# strip off /dev/ if it is there
$dev =~ s/^\/dev\///;
......@@ -182,13 +184,7 @@ sub map_diskname($)
}
}
$dev = "/dev/$dtype$dunit";
if (-r "$dev") {
print STDERR "Could not read $dev\n";
return undef;
}
return $dev;
return "/dev/$dtype$dunit";
}
sub parse_params(@)
......@@ -246,6 +242,25 @@ sub parse_params(@)
$iinfo{$iid}{'nsigfile'} = $val;
next;
}
if ($key eq "izopts") {
#
# No spaces in string, so options are encoded; e.g.:
# -N -z 9 -d -a SHA1
# would be encoded as:
# N,z=9,d,a=SHA1
# We unencode them here.
#
my $optstr = "";
foreach my $opt (split(',', $val)) {
$optstr .= " -" . join(' ', split('=', $opt));
}
$iinfo{$iid}{'izopts'} = $optstr;
next;
}
if ($key eq "proxy") {
$iinfo{$iid}{'proxy'} = $val;
next;
}
} else {
print STDERR "Bogus parameter: '$kv'\n";
$errors++;
......@@ -259,11 +274,16 @@ sub parse_params(@)
}
}
for my $path (qw#/usr/local/bin /usr/bin#) {
#
# If we are running as a user, then we will need sudo
#
if ($EUID != 0) {
for my $path (qw#/usr/local/bin /usr/bin#) {
if (-e "$path/sudo") {
$sudo = "$path/sudo";
last;
$sudo = "$path/sudo";
last;
}
}
}
#
......@@ -280,6 +300,10 @@ if (defined($options{"n"})) {
if (defined($options{"v"})) {
$verbose = 1;
}
if (defined($options{"x"})) {
$isxen = 1;
$localdir = "/capture/" . $options{"x"} . "/frisbee";
}
if (defined($options{"f"})) {
my $pfile = $options{"f"};
if ($pfile =~ /^(\/tmp\/[-\w\.]+)$/) {
......@@ -335,7 +359,7 @@ foreach my $iid (sort keys %iinfo) {
# For method=frisbee, the actual files will be here.
# For method=file, a symlink to the actual file will be here.
#
if (mysystem("$sudo mkdir -p $localdir")) {
if (! -e $localdir && mysystem("$sudo mkdir -p $localdir")) {
print STDERR "Could not create $localdir\n";
exit(1);
}
......@@ -351,12 +375,18 @@ if (mysystem("$sudo mkdir -p $localdir")) {
# memory filesystem is too much for our older machines--let's go
# with 64MB for now.
#
my $MEMFS_SIZE = (64 * 1024 * 1024);
my $MEMFS_SIZE = "64m";
if ($dofrisbee) {
if ($^O eq 'linux') {
die "No can do Linux right now!\n";
if (!$isxen &&
mysystem("$sudo mount -t tmpfs -o size=$MEMFS_SIZE tmpfs $localdir")) {
print STDERR "Could not create $MEMFS_SIZE byte local MFS\n";
# XXX try NFS instead
exit(1);
}
} else {
if (mysystem("$sudo mdconfig -a -t swap -s 64m -u 4") ||
if (mysystem("$sudo mdconfig -a -t swap -s $MEMFS_SIZE -u 4") ||
mysystem("$sudo newfs -b 8192 -i 25000 -o space /dev/md4") ||
mysystem("$sudo mount /dev/md4 $localdir")) {
print STDERR "Could not create $MEMFS_SIZE byte local MFS\n";
......@@ -384,7 +414,9 @@ foreach my $iid (sort keys %iinfo) {
#
if ($dofrisbee) {
if ($^O eq 'linux') {
print STDERR "No can do Linux right now!\n";
if (!$isxen && mysystem("$sudo umount $localdir")) {
print STDERR "WARNING: could not destroy local MFS\n";
}
} else {
if (mysystem("$sudo umount $localdir") ||
mysystem("$sudo mdconfig -d -u 4")) {
......@@ -527,25 +559,28 @@ sub process_image($)
# Fire off the command:
#
# file:
# imagezip [-s $part] [-H $sigfile] [-U $nsigfile] $disk $ifile
# imagezip $izopts [-s $part] [-H $sigfile] [-U $nsigfile] $disk $ifile
#
# frisbee:
# imagezip [-s $part] [-H $sigfile] [-U $localdir/$nsigfile] $disk - | \
# imagezip $izopts [-s $part] [-H $sigfile] [-U $localdir/$nsigfile] $disk - | \
# frisupload -S $server -F $ifile -
# [ cat $localdir/$nsigfile | frisupload -S $server -F $nsigfile ]
#
my $cmd = "$zipper $zipperopts";
my $cmd = "$sudo $zipper";
if ($verbose) {
$cmd .= " -o";
}
if (exists($iinfo{$iid}{'izopts'})) {
$cmd .= $iinfo{$iid}{'izopts'};
}
if ($iinfo{$iid}{'part'} != 0) {
$cmd .= " -s " . $iinfo{$iid}{'part'};
}
if (exists($iinfo{$iid}{'sigfile'})) {
$cmd .= " -H /local/sigfile";
$cmd .= " -H $localdir/sigfile";
}
if (exists($iinfo{$iid}{'nsigfile'})) {
$cmd .= " -U /local/nsigfile";
$cmd .= " -U $localdir/nsigfile";
}
$cmd .= " " . $iinfo{$iid}{'disk'};
......@@ -554,14 +589,32 @@ sub process_image($)
$cmd .= " $image";
} elsif ($iinfo{$iid}{'method'} eq "frisbee") {
my $srv = $iinfo{$iid}{'server'};
$cmd .= " - | $uploader -S $srv -F $image -";
# use basic shell sleezy trick to capture exit status from imagezip
$cmd = "( $cmd - || echo \$? > $localdir/imagezip.stat )";
$cmd .= " | $uploader -S $srv -F $image";
if (exists($iinfo{$iid}{'proxy'})) {
$cmd .= " -P " . $iinfo{$iid}{'proxy'};
}
$cmd .= " - ";
}
if (mysystem("$sudo $cmd")) {
if (mysystem("$cmd") || -e "$localdir/imagezip.stat") {
my $stat = sprintf("0x%04x", $?);
my $izstat = 0;
if (-e "$localdir/imagezip.stat") {
$izstat = `cat $localdir/imagezip.stat`;
chomp($izstat);
}
$izstat = sprintf("0x%04x", $izstat);
print STDERR "*** Failed to create image!\n";
print STDERR " command: '$sudo $cmd'\n";
print STDERR " status: $stat\n";
print STDERR " command: '$cmd'\n";
print STDERR " status: $stat\n";
print STDERR " izstatus: $izstat\n"
if ($izstat);
exit(3);
}
......@@ -576,7 +629,7 @@ sub process_image($)
}
}
mysystem("$sudo rm /local/*");
mysystem("$sudo rm $localdir/*");
}
sub mysystem($)
......
#
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -280,8 +280,8 @@ subboss-install: subboss
client: frisbee frisupload
client-install: client
$(INSTALL_PROGRAM) frisbee $(DESTDIR)$(CLIENT_BINDIR)
$(INSTALL_PROGRAM) frisupload $(DESTDIR)$(CLIENT_BINDIR)
$(INSTALL_PROGRAM) frisbee $(DESTDIR)/usr/local/bin
$(INSTALL_PROGRAM) frisupload $(DESTDIR)/usr/local/bin
clean:
/bin/rm -f *.o *.a *.debug
......
This diff is collapsed.
......@@ -42,8 +42,9 @@ struct config_imageinfo {
#define CONFIG_PATH_ISDIR 0x2 /* path is a directory */
#define CONFIG_PATH_ISGLOB 0x4 /* path is a file glob */
#define CONFIG_PATH_ISRE 0x8 /* path is a perl RE */
#define CONFIG_PATH_RESOLVE 0x10 /* path needs resolution at use */
#define CONFIG_PATH_EXISTS 0x20 /* imaged named by path arg exists */
#define CONFIG_PATH_ISSIGFILE 0x10 /* path is an image sigfile */
#define CONFIG_PATH_RESOLVE 0x20 /* path needs resolution at use */
#define CONFIG_PATH_EXISTS 0x40 /* imaged named by path arg exists */
#define CONFIG_SIG_ISMTIME 0x1000 /* sig is path mtime */
#define CONFIG_SIG_ISMD5 0x2000 /* sig is MD5 hash of path */
#define CONFIG_SIG_ISSHA1 0x4000 /* sig is SHA1 hash of path */
......
......@@ -732,7 +732,7 @@ handle_get(int sock, struct sockaddr_in *sip, struct sockaddr_in *cip,
}
ii = copy_imageinfo(&ai->imageinfo[0]);
config_free_host_authinfo(ai);
assert((ii->flags & CONFIG_PATH_ISFILE) != 0);
assert((ii->flags & (CONFIG_PATH_ISFILE|CONFIG_PATH_ISSIGFILE)) != 0);
/*
* If the image is currently being uploaded, return TRYAGAIN.
......@@ -1086,7 +1086,7 @@ handle_put(int sock, struct sockaddr_in *sip, struct sockaddr_in *cip,
{
struct in_addr host, in;
in_addr_t myaddr;
char imageid[MS_MAXIDLEN+1];
char imageid[MS_MAXIDLEN+1], *cimageid;
char clientip[sizeof("XXX.XXX.XXX.XXX")+1];
int len;
struct config_host_authinfo *ai;
......@@ -1112,6 +1112,11 @@ handle_put(int sock, struct sockaddr_in *sip, struct sockaddr_in *cip,
len = ntohs(msg->body.putrequest.idlen);
memcpy(imageid, msg->body.putrequest.imageid, len);
imageid[len] = '\0';
cimageid = config_canonicalize_imageid(imageid);
if (cimageid != NULL && strcmp(cimageid, imageid) == 0) {
free(cimageid);
cimageid = NULL;
}
wantstatus = msg->body.putrequest.status;
op = wantstatus ? "PUTSTATUS" : "PUT";
isize = ((uint64_t)ntohl(msg->body.putrequest.hisize) << 32) |
......@@ -1120,18 +1125,38 @@ handle_put(int sock, struct sockaddr_in *sip, struct sockaddr_in *cip,
timo = ntohl(msg->body.putrequest.timeout);
strncpy(clientip, inet_ntoa(cip->sin_addr), sizeof clientip);
if (host.s_addr != cip->sin_addr.s_addr)
FrisLog("%s: %s from %s (for %s), size=%llu",
imageid, op, clientip, inet_ntoa(host), isize);
else
FrisLog("%s: %s from %s, size=%llu",
imageid, op, clientip, isize);
if (cimageid == NULL) {
if (host.s_addr != cip->sin_addr.s_addr)
FrisLog("%s: %s from %s (for %s), size=%llu",
imageid, op, clientip, inet_ntoa(host), isize);
else
FrisLog("%s: %s from %s, size=%llu",
imageid, op, clientip, isize);
} else {
if (host.s_addr != cip->sin_addr.s_addr)
FrisLog("%s (%s): %s from %s (for %s), size=%llu",
imageid, cimageid, op, clientip,
inet_ntoa(host), isize);
else
FrisLog("%s (%s): %s from %s, size=%llu",
imageid, cimageid, op, clientip,
isize);
}
memset(msg, 0, sizeof *msg);
msg->hdr.type = htonl(MS_MSGTYPE_PUTREPLY);
strncpy((char *)msg->hdr.version, MS_MSGVERS_1,
sizeof(msg->hdr.version));
/*
* Use the canonical name from here on out.
*/
if (cimageid != NULL) {
strcpy(imageid, cimageid);
free(cimageid);
cimageid = NULL;
}
/*
* XXX we don't handle mirror mode right now.
*/
......@@ -1167,7 +1192,7 @@ handle_put(int sock, struct sockaddr_in *sip, struct sockaddr_in *cip,
}
ii = copy_imageinfo(&ai->imageinfo[0]);
config_free_host_authinfo(ai);
assert((ii->flags & CONFIG_PATH_ISFILE) != 0);
assert((ii->flags & (CONFIG_PATH_ISFILE|CONFIG_PATH_ISSIGFILE)) != 0);
/*
* If they gave us a size and it exceeds the maxsize, return an error.
......
......@@ -29,6 +29,7 @@ BINDIR= /usr/local/bin
# Set to 1 for "secure frisbee" support. Requires openssl libraries.
WITH_CRYPTO = 1
WITH_SIGNING = 1
#
# Which filesystems to support
......@@ -36,8 +37,8 @@ WITH_CRYPTO = 1
WITH_EXTFS = 1
WITH_FFS = 1
WITH_FAT = 1
WITH_NTFS = 0
WITH_HASH = 0
WITH_NTFS = 1
WITH_HASH = 1
WITH_V3COMPAT = 1
......@@ -82,16 +83,14 @@ endif
ifeq ($(WITH_NTFS),1)
FSOBJS += ntfs/ntfs_glue.o
FSLIBS += ntfs/libntfs/libntfs.a
CFLAGS += -DWITH_NTFS -DOLD_LIBNTFS -Intfs/libntfs/ntfsprogs-1.7.1.linux/include
CFLAGS += -DWITH_NTFS -DHAVE_CONFIG_H -Intfs/libntfs/ntfsprogs-2.0.0/include -Intfs/libntfs/ntfsprogs-2.0.0/include/ntfs
endif
# with HASH
ifeq ($(WITH_HASH),1)
CFLAGS += -DWITH_HASH -DHASHSTATS
SUBDIRCFLAGS += -DHASHSTATS
SUBDIRS += hashmap
ZIPLIBS += hashmap/libhashmap.a
LIBS += -lcrypto $(PTHREADLIBS)
FSOBJS += hashmap/hashmap.o
CFLAGS += -DWITH_HASH -DHASHSTATS -Ihashmap
LIBS += -lcrypto
endif
all: imagezip imageunzip imagedump
......@@ -111,6 +110,8 @@ imagedump: imagedump.o checksum.o version.o
version.c: imagezip.c imageunzip.c imagedump.c
echo >$@ "char build_info[] = \"Built `date +%d-%b-%Y` by `id -nu`@`hostname | sed 's/\..*//'`:`pwd`\";"
hashmap/hashmap.o: hashmap/hashmap.h imagehdr.h imagehash.h
ntfs/libntfs/libntfs.a:
(cd ntfs/libntfs; make -f Makefile-linux.sa)
......
......@@ -820,13 +820,15 @@ main(int argc, char *argv[])
if (hashfile && deltapct >= 0) {
uint32_t oldsect = sectinranges(ranges);
uint32_t newsect = sectinranges(nranges);
if (oldsect == 0 ||
((double)newsect / oldsect) * 100 > deltapct) {
fprintf(stderr,
"Delta size (%u sect) more than %d%% "
"the size of a full image (%u sect),\n"
"creating a full image instead.\n",
newsect, deltapct, oldsect);
int dofull =
(oldsect == 0 ||
((double)newsect / oldsect) * 100 > deltapct);
fprintf(stderr,
"Full image size %u sect, "
"delta image size %u sect\n"
"Auto image selection creating %s image.\n",
oldsect, newsect, dofull ? "full" : "delta");
if (dofull) {
freeranges(nranges);
goto done;
}
......
......@@ -23,41 +23,26 @@
all: libntfs.a
NTFSDIR = ntfsprogs-1.7.1.linux
NTFSDIR = ntfsprogs-2.0.0
LIBSRCDIR = $(NTFSDIR)/libntfs
INCLUDES = -I${NTFSDIR}/include
CFLAGS = -O2 -g -static -Wall $(INCLUDES)
OBJS= attrib.o \
bitmap.o \
bootsect.o \
compat.o \
debug.o \
dir.o \
disk_io.o \
inode.o \
lcnalloc.o \
mft.o \
mst.o \
runlist.o \
unistr.o \
volume.o
%.o: $(NTFSDIR)/libntfs/%.c
%.o: $(LIBSRCDIR)/%.c
$(CC) $(CFLAGS) -c -o $@ $<
libntfs.a: configureit $(OBJS)
ar crv $@ $(OBJS)
ranlib $@
libntfs.a: configureit
$(MAKE) -C $(LIBSRCDIR) all
cp -p $(LIBSRCDIR)/.libs/libntfs.a $@
configureit:
wget -q -N http://www.emulab.net/ntfsprogs-1.7.1.tar.gz
tar zxf ntfsprogs-1.7.1.tar.gz
mv ntfsprogs-1.7.1 $(NTFSDIR)
patch -sN -d $(NTFSDIR) -p1 < ntfs.linuxpatch
patch -sN -d $(NTFSDIR) -p1 < ntfs_lvalue.patch
$(NTFSDIR)/configure
mv config.h $(NTFSDIR)/include
wget -q -N http://www.emulab.net/distributions/ntfsprogs-2.0.0.tar.gz
tar zxf ntfsprogs-2.0.0.tar.gz
patch -sN -d $(NTFSDIR) -p1 < ntfsprogs-2.0.0.patch
(cd $(NTFSDIR); ./configure)
cp $(NTFSDIR)/config.h $(NTFSDIR)/include
touch configureit
clean:
rm -f $(OBJS) libntfs.a
$(MAKE) -C $(LIBSRCDIR) clean
rm -f libntfs.a
......@@ -81,7 +81,7 @@ use librc;
# IMPORTANT NOTE: if you change the version here, you must also change it
# in clientside/lib/tmcd/tmcd.h!
#
sub TMCD_VERSION() { 38; };
sub TMCD_VERSION() { 39; };
libtmcc::configtmcc("version", TMCD_VERSION());
# Control tmcc timeout.
......
......@@ -374,11 +374,6 @@ $vnconfig{"fwconfig"} = {"fwinfo" => $fwinfo,
"fwrules" => \@fwrules,
"fwhosts" => \@fwhosts};
if ($debug) {
print "VN Config:\n";
print Dumper(\%vnconfig);
}
#
# see if we 1) are supposed to be "booting" into the reload mfs, and 2) if
# we have loadinfo. Need both to reload!
......@@ -397,15 +392,39 @@ if (scalar(@tmp) && exists($tmp[0]->{"WHAT"})) {
if (!scalar(@tmp)) {
fatal("vnode $vnodeid in reloading, but got no loadinfo!");
}
#
# Loadinfo can now be a list, when loading deltas. Actually, I suppose
# we could support loading multiple partitions, but other stuff would
# have to change for that to work, so not going there right now.
#
$vnconfig{"reloadinfo"} = \@tmp;
#
# But the image we eventually boot is in jailconfig.
# Sheesh, LVM names cannot include comma or colon.
#
if (VNCONFIG('IMAGENAME') =~ /^([-\w]+),([-\w]+),([-\w]+)$/) {
$vnconfig{"image"} = "$1-$2-$3";
}
elsif (VNCONFIG('IMAGENAME') =~ /^([-\w]+),([-\w]+),([^:]+):(\d+)$/) {
$vnconfig{"image"} = "$1-$2-$3-$4";
}
else {
if ($tmp[0]->{"IMAGEID"} =~
/^([-\d\w]+),([-\d\w]+),([-\d\w\.]+)$/) {
$vnconfig{"reloadinfo"} = $tmp[0];
$vnconfig{"image"} = "$1-$2-$3";
fatal("vnode $vnodeid in reloading, but got bogus IMAGENAME " .
VNCONFIG('IMAGENAME') . " from jailconf!");
}
#
# Apply the same transform to each loadinfo so that we do not have
# duplicate it in the library,
#