aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2019-01-01 10:07:39 +0800
committerAaron LI <aly@aaronly.me>2019-01-01 10:07:39 +0800
commit45d244bfe1b75bf57dd2dd68c6e665dc0c4443e9 (patch)
treee918cdcdf40940461ae96b6fb971e08828e93b35
parentb33533c3fabcffbec00fc1a3d4ad415d57c7ba2a (diff)
downloaddfly-update-45d244bfe1b75bf57dd2dd68c6e665dc0c4443e9.tar.bz2
Simplify cmd_mount() and cmd_cleanup()
-rwxr-xr-xdfly-update24
1 files changed, 1 insertions, 23 deletions
diff --git a/dfly-update b/dfly-update
index 5ff1d14..5f872dd 100755
--- a/dfly-update
+++ b/dfly-update
@@ -123,15 +123,6 @@ get_vn_devname() {
echo ${dev%s??}
}
-# Get the filename configured for the vn device
-get_vn_filename() {
- [ $# -eq 1 ] ||
- error ${EC_ARGS} "get_vn_filename: invalid arguments: $@"
-
- local vn="$1"
- echo $(vnconfig -l ${vn} | awk '{ print $3 }')
-}
-
# Umount the image
#
# umount_image(mntpnt)
@@ -426,16 +417,7 @@ cmd_mount() {
local file="$1"
[ -f "${file}" ] ||
- error ${EC_NOFILE} "checksum_image: file not exists: ${file}"
-
- case "${file}" in
- *.bz2)
- echo -n "Decompressing file: ${file} ... "
- bunzip2 "${file}"
- echo "DONE"
- file="${file%.bz2}"
- ;;
- esac
+ error ${EC_NOFILE} "cmd_mount: file not exists: ${file}"
mount_image "${file}" "${MNT_DIR}"
}
@@ -464,11 +446,7 @@ cmd_cleanup() {
error ${EC_ARGS} "cmd_cleanup: invalid arguments: $@"
cleanup
- local vn=$(get_vn_devname ${MNT_DIR})
- local filepath=$(get_vn_filename ${vn})
umount_image ${MNT_DIR}
- rm -f ${filepath}
- echo "Removed image file: ${filepath}"
postupgrade
}