blob: 55f84646a5f6937d428a65bb8622ff6a58d1e493 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
use fmt;
use io;
use volume;
use gpt;
export fn mkbackup(vol: str, args: []str) void = {
const vol = volume::openvol(vol);
const vol = match(gpt::from(vol)) {
case let g: *gpt::gpt =>
yield g;
case gpt::nogpt =>
fmt::fatalf("{}: disk does not have valid gpt", args[0]);
case =>
fmt::fatalf("{}: could not access volume", args[0]);
};
defer {
gpt::commit(vol)!;
gpt::finish(vol);
};
gpt::mkbackup(vol);
};
|