diff options
-rwxr-xr-x | debootstrap.sh | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/debootstrap.sh b/debootstrap.sh index 2ce7e2c..1b88a86 100755 --- a/debootstrap.sh +++ b/debootstrap.sh | |||
@@ -234,6 +234,18 @@ new() | |||
234 | cp --reflink=always "$source" "$dest" | 234 | cp --reflink=always "$source" "$dest" |
235 | } | 235 | } |
236 | 236 | ||
237 | rm_image() | ||
238 | { | ||
239 | suite=$1 | ||
240 | name=$2 | ||
241 | [ "$suite" -a "$name" ] || usage | ||
242 | image_basename=$imgdir/$(suite_to_basename "$suite") || die 'suite_to_basename' | ||
243 | source=$image_basename | ||
244 | dest=${source%.btrfs}.$name.btrfs | ||
245 | |||
246 | rm -i "$dest" | ||
247 | } | ||
248 | |||
237 | init() | 249 | init() |
238 | { | 250 | { |
239 | suite=$1 | 251 | suite=$1 |
@@ -296,6 +308,6 @@ show() | |||
296 | 308 | ||
297 | case "$1" in | 309 | case "$1" in |
298 | init|new|clone|list|show) cmd=$1; shift; $cmd "$@" ;; | 310 | init|new|clone|list|show) cmd=$1; shift; $cmd "$@" ;; |
299 | chroot|sh) cmd=${1}_image; shift; $cmd "$@" ;; | 311 | chroot|sh|rm) cmd=${1}_image; shift; $cmd "$@" ;; |
300 | *) usage ;; | 312 | *) usage ;; |
301 | esac | 313 | esac |