Revision 3f4f15f3 snf-image-host/create
b/snf-image-host/create | ||
---|---|---|
36 | 36 |
|
37 | 37 |
ganeti_os_main |
38 | 38 |
|
39 |
case "$IMAGE_TYPE" in |
|
40 |
extdump) |
|
41 |
image_file="$IMAGE_DIR/$IMAGE_NAME-$ARCH.extdump";; |
|
42 |
ntfsdump) |
|
43 |
image_file="$IMAGE_DIR/$IMAGE_NAME-$ARCH.ntfsdump";; |
|
44 |
diskdump) |
|
45 |
image_file="$IMAGE_DIR/$IMAGE_NAME-$ARCH.diskdump";; |
|
46 |
*) |
|
47 |
log_error "Unknown image type: \`$IMAGE_TYPE'."; |
|
48 |
exit 1 |
|
49 |
esac |
|
39 |
image_file="$IMAGE_DIR/$IMAGE_NAME-$ARCH.$IMAGE_TYPE" |
|
50 | 40 |
|
51 | 41 |
if [ ! -e "$image_file" ]; then |
52 | 42 |
log_error "Image file \`$image_file' does not exit." |
... | ... | |
70 | 60 |
|
71 | 61 |
case "$IMAGE_TYPE" in |
72 | 62 |
ntfsdump, extdump) |
63 |
# Create partitions |
|
73 | 64 |
format_disk0 "$blockdev" "$IMAGE_TYPE" |
74 | 65 |
|
66 |
# Install a new MBR |
|
67 |
"$INSTALL_MBR" -p 1 -i n "$blockdev" |
|
68 |
|
|
75 | 69 |
target="$(map_disk0 "$blockdev")-1" #the root device |
76 | 70 |
add_cleanup unmap_disk0 "$blockdev" |
77 | 71 |
;; |
... | ... | |
135 | 129 |
exit 1 |
136 | 130 |
fi |
137 | 131 |
|
138 |
# Install a new MBR |
|
139 |
"$INSTALL_MBR" -p 1 -i n "$blockdev" |
|
140 |
|
|
141 | 132 |
# Execute cleanups |
142 | 133 |
cleanup |
143 | 134 |
trap - EXIT |
Also available in: Unified diff