summaryrefslogtreecommitdiff
path: root/scripts/install/install-image-new
diff options
context:
space:
mode:
authorMichael Larson <slioch@slioch.vyatta.com>2010-06-21 11:09:51 -0700
committerMichael Larson <slioch@slioch.vyatta.com>2010-06-21 11:09:51 -0700
commitd801c05f63b0b16f485b176db64e3147ad7d3086 (patch)
tree9829f0bf340a55986aa6d11f1b1d8d5334306abd /scripts/install/install-image-new
parent6d59b5077ef1834379a950437b01d15d687c7a53 (diff)
parent7369bf61abd3eed1fdd17a56908cf2c0ffc9843f (diff)
downloadvyatta-cfg-quagga-d801c05f63b0b16f485b176db64e3147ad7d3086.tar.gz
vyatta-cfg-quagga-d801c05f63b0b16f485b176db64e3147ad7d3086.zip
Merge branch 'larkspur' of http://git.vyatta.com/vyatta-cfg-system into larkspur
Diffstat (limited to 'scripts/install/install-image-new')
-rwxr-xr-xscripts/install/install-image-new31
1 files changed, 26 insertions, 5 deletions
diff --git a/scripts/install/install-image-new b/scripts/install/install-image-new
index 7294fc35..5726fa03 100755
--- a/scripts/install/install-image-new
+++ b/scripts/install/install-image-new
@@ -24,15 +24,36 @@ if ! try_mount "/dev/$ROOT_PARTITION $WRITE_ROOT"; then
fi
version=$(get_new_version)
-if [ -z "$version" ]; then
+image_name=$version
+if [ -z "$image_name" ]; then
echo 'Cannot find new version. Exiting...'
exit 1
fi
+echo -n "What would you like to name this image? [$image_name]: "
+read response
+if [ -n "$response" ]; then
+ image_name=$response
+fi
+
+# Validate image name
+if [ "$image_name" = "grub" -o "${image_name:0:7}" = "vmlinuz" -o \
+ "${image_name:0:6}" = "initrd" -o "${image_name:0:10}" = "System.map" -o \
+ "$image_name" = "Old-non-image-installation" ]; then
+ echo "Can't use $image_name. It is a reserved image name."
+ exit 1;
+fi
+
+if [ -z "$image_name" ]; then
+ failure_exit 'Invalid image name.'
+fi
+
+echo "OK. This image will be named: $image_name"
+
# make the dir for the new version
-mkdir -p $WRITE_ROOT/boot/$version
+mkdir -p $WRITE_ROOT/boot/$image_name
# make dir for backing store
-rw_dir=$WRITE_ROOT/boot/$version/live-rw
+rw_dir=$WRITE_ROOT/boot/$image_name/live-rw
mkdir -p $rw_dir
echo Copying squashfs image...
@@ -53,10 +74,10 @@ if [ ! -f "$squash_img" ] || [ -z "$boot_files" ]; then
fi
fi
-target_squash=$WRITE_ROOT/boot/$version/$version.squashfs
+target_squash=$WRITE_ROOT/boot/$image_name/$version.squashfs
cp -p $squash_img $target_squash
echo Copying kernel and initrd images...
-cp -dp $boot_files $WRITE_ROOT/boot/$version/
+cp -dp $boot_files $WRITE_ROOT/boot/$image_name/
# set up union root for postinst
mkdir -p $INST_ROOT $READ_ROOT