|
|
@@ -21,21 +21,37 @@ public static int main(string[] args) {
|
|
|
printerr("Expected path after --root\n");
|
|
|
return 255;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ if(command == "manifest") {
|
|
|
+ var wd = File.new_build_filename(root_path, "usm-wd");
|
|
|
+ if(!wd.query_exists()) {
|
|
|
+ wd.make_directory();
|
|
|
+ }
|
|
|
+ Linux.umount(wd.get_path());
|
|
|
+ var res = Linux.mount(Environment.get_current_dir(), wd.get_path(), "", Linux.MountFlags.BIND);
|
|
|
+ if(res != 0) {
|
|
|
+ printerr(@"Unable to bind mount working directory\n");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
var result = Posix.chroot(root_path);
|
|
|
if(result != 0) {
|
|
|
printerr(@"Unable to chroot to \"$root_path\": $(Posix.strerror(result))\n");
|
|
|
return result;
|
|
|
}
|
|
|
+
|
|
|
+ if(command == "manifest") {
|
|
|
+ Environment.set_current_dir("/usm-wd");
|
|
|
+ }
|
|
|
|
|
|
- arguments.remove_at(root_flag_pos);
|
|
|
- arguments.remove_at(root_flag_pos+1);
|
|
|
+ arguments.remove("--root");
|
|
|
+ arguments.remove(root_path);
|
|
|
}
|
|
|
|
|
|
if(command == "manifest") {
|
|
|
- var m_args = new Invercargill.DataStructures.Vector<string>();
|
|
|
- m_args.add_all(Invercargill.Wrap.array(args));
|
|
|
- m_args.remove("manifest");
|
|
|
- return manifest_main(m_args.to_array());
|
|
|
+ arguments.remove("manifest");
|
|
|
+ return manifest_main(arguments.to_array());
|
|
|
}
|
|
|
if(command == "info") {
|
|
|
return info(args);
|