Skip to contentSkip to conversation

uml_utilities_20030903

uml-devel Jeff Dike 3 participants 4 messages Sep 3, 2003 – Sep 4, 2003 User-mode Linux (UML)

lore
Share & tools
lore

Jeff Dike

author
#0 lore raw

The main addition in this update is COW V3 support in uml_moo. uml_mkcow is also here, although I wouldn't get too attached to it since I'm thinking about moving it into uml_moo and making that the Swiss Army knife of COW file manipulation.

There are a bunch of smaller changes in uml_switch, uml_mconsole, and the honeypot utilities.

Jeff

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#1 lore raw
Quoted 7 lines · Jeff Dike

The main addition in this update is COW V3 support in uml_moo. uml_mkcow is also here, although I wouldn't get too attached to it since I'm thinking about moving it into uml_moo and making that the Swiss Army knife of COW file manipulation.

There are a bunch of smaller changes in uml_switch, uml_mconsole, and the honeypot utilities.

Is there a changelog available somewhere for inspection?

Signature · 16 lines
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
L. Friedman                       	       [email protected]
Linux Step-by-step & TyGeMo: 		    http://netllama.ipfox.com

  5:05pm  up 4 days,  2:32,  1 user,  load average: 0.61, 1.49, 1.75



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#3 lore raw
In reply to Jeff Dike
Quoted 4 lines · Jeff Dike

The main addition in this update is COW V3 support in uml_moo. uml_mkcow is also here, although I wouldn't get too attached to it since I'm thinking about moving it into uml_moo and making that the Swiss Army knife of COW file manipulation.

Here's the uml_moo.c patch which allows the user to provide the path to the backing store, overriding the path listed in the COW file. Useful when manipulating a COW file created in a chrooted jail.

Updated for uml_utilities_20030903.

Anything you'd like done to it to would make it merge in easier?

-James

uml_moo.c renamed from uml_moo.c.orig +23 -5
@@ -38,7 +38,7 @@ static inline void ubd_set_bit(int bit, 
 	data[n] |= (1 << off);
 }
 
-int create_backing_file(char *in, char *out)
+int create_backing_file(char *in, char *out, char *old)
 {
 	int cow_fd, back_fd, in_fd, out_fd;
 	struct stat buf;
@@ -65,10 +65,15 @@ int create_backing_file(char *in, char *
 		exit(1);
 	}
 
+	if(old != NULL) {
+		backing_file = old;
+	}
+
 	if(stat(backing_file, &buf) < 0) {
 		perror("Stating backing file");
 		exit(1);
 	}
+
 	if(buf.st_size != size){
 		fprintf(stderr,"Size mismatch (%ld vs %ld) of COW header "
 			"vs backing file \"%s\"\n", (long int) size, 
@@ -192,13 +197,15 @@ int create_backing_file(char *in, char *
 
 int Usage(char *prog) {
 	fprintf(stderr, "%s usage:\n", prog);
-	fprintf(stderr, "\t%s <COW file> <new backing file>\n", prog);
-	fprintf(stderr, "\t%s -d <COW file>\n", prog);
+	fprintf(stderr, "\t%s [ -O <old backing file> ] <COW file> <new backing file>\n", prog);
+	fprintf(stderr, "\t%s [ -O <old backing file> ] -d <COW file>\n", prog);
 	fprintf(stderr, "Creates a new filesystem image from the COW file "
 		"and its backing file.\n");
 	fprintf(stderr, "Specifying -d will cause a destructive, in-place "
 		"merge of the COW file into\n");
 	fprintf(stderr, "its current backing file\n");
+	fprintf(stderr, "Specifying -O <old backing file> overrides the backing_file\n");
+	fprintf(stderr, "field specified in the COW file.\n");
 	fprintf(stderr, "%s supports version 1 and 2 COW files.\n", prog);
 	exit(1);
 }
@@ -206,6 +213,7 @@ int Usage(char *prog) {
 int main(int argc, char **argv)
 {
 	char *prog = argv[0];
+	char *real_backing_file = NULL;
 	int in_place = 0;
 
 	argv++;
@@ -220,13 +228,23 @@ int main(int argc, char **argv)
 		argc--;
 	}
 
+	if(!strcmp(argv[0], "-O")){
+		real_backing_file = argv[1];
+		argv++;
+		argc--;
+
+		argv++;
+		argc--;
+
+	}
+
 	if(in_place){
 		if(argc != 1) Usage(prog);
-		create_backing_file(argv[0], NULL);
+		create_backing_file(argv[0], NULL, real_backing_file);
 	}
 	else {
 		if(argc != 2) Usage(prog);
-		create_backing_file(argv[0], argv[1]);
+		create_backing_file(argv[0], argv[1], real_backing_file);
 	}
 	return 0;
 }
author
#2 lore raw
In reply to Net Llama!
Quoted 1 line · [email protected] said:

Is there a changelog available somewhere for inspection?

From my download page, as usual.

Jeff

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel