summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Gilligan <gilligan@vyatta.com>2010-02-18 18:02:56 -0800
committerBob Gilligan <gilligan@vyatta.com>2010-02-18 18:02:56 -0800
commite1864411c77e688b1b67de40441550b1f1eba055 (patch)
tree091d9b96dfb41aaeea35c04e76f63e71d34eca6b
parent0c04bdcc9add92232f58799d9ea26690897a6204 (diff)
downloadvyatta-cfg-system-e1864411c77e688b1b67de40441550b1f1eba055.tar.gz
vyatta-cfg-system-e1864411c77e688b1b67de40441550b1f1eba055.zip
Bugfix 5360: Get name of image from correct source.
The name of a system image is supposed to match the Vyatta version string. Previously, the install-image script determined the name of the image being installed by parsing a field in the Vyatta version file on the image being installed. But the format of that file has changed, and may change again the future, so it is not a good source of the Vyatta version string. The most accurate way to determine the Vyatta version string is to look up the debian package version string associated with the vyatta-version package on the image being installed. This changes the install-image script to get the system image name that way.
-rwxr-xr-xscripts/install/install-functions7
-rwxr-xr-xscripts/install/install-image-existing4
2 files changed, 6 insertions, 5 deletions
diff --git a/scripts/install/install-functions b/scripts/install/install-functions
index 7f1269bb..a50b0f56 100755
--- a/scripts/install/install-functions
+++ b/scripts/install/install-functions
@@ -292,19 +292,20 @@ get_cur_version ()
# being installed. this can be from live CD boot or from a ISO image file.
get_new_version ()
{
- ver_path=/opt/vyatta/etc/version
+ ver_path=/var/lib/dpkg/status
ver_file=${CD_SQUASH_ROOT}${ver_path}
if [ -f "$ver_file" ]; then
# CD_SQUASH_ROOT is set up => we are installing with a specified ISO
# image file. use the version string from there.
- grep '^Version' $ver_file | awk '{ print $3 }'
+ dpkg -l --root=${CD_SQUASH_ROOT} | \
+ grep "^ii vyatta-version" | awk '{print $3}'
return
fi
ver_file=${ver_path}
if is_live_cd_boot && [ -f "$ver_file" ]; then
# we are installing from a live CD boot
- grep '^Version' $ver_file | awk '{ print $3 }'
+ dpkg -l | grep "^ii vyatta-version" | awk '{print $3}'
return
fi
diff --git a/scripts/install/install-image-existing b/scripts/install/install-image-existing
index b566c1e9..1514d0a1 100755
--- a/scripts/install/install-image-existing
+++ b/scripts/install/install-image-existing
@@ -32,8 +32,8 @@ if [ -z "$CURVER" ]; then
fi
# get new version string. this is from the squashfs image.
-NEWVER=$(grep '^Version ' ${CD_SQUASH_ROOT}${vyatta_sysconfdir}/version \
- | tr -s ' ' | cut -d ' ' -f 3)
+NEWVER=`dpkg -l --root=${CD_SQUASH_ROOT} | grep "^ii vyatta-version" | awk '{print $3}'`
+
if [ -z "$NEWVER" ]; then
failure_exit 'Cannot find new release version.'
fi