summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--etc/bash_completion.d/vyatta-op12
-rwxr-xr-xscripts/vyatta-image-tools.pl8
-rw-r--r--templates/clone/system/config/node.tag/from/node.tag/node.def3
-rw-r--r--templates/clone/system/config/node.tag/node.def1
4 files changed, 23 insertions, 1 deletions
diff --git a/etc/bash_completion.d/vyatta-op b/etc/bash_completion.d/vyatta-op
index 7a33563..081e8a6 100644
--- a/etc/bash_completion.d/vyatta-op
+++ b/etc/bash_completion.d/vyatta-op
@@ -471,6 +471,9 @@ _vyatta_image_path_complete()
reply[$i]="${reply[$i]}://config/"
done
reply+=( "running://config/" )
+ if [[ -d /live/image/opt/vyatta/etc/config || -d /live/image/config ]]; then
+ reply+=( "disk-install://config/" )
+ fi
else
if ! [[ $cur =~ .*:\/\/ ]]; then
if [[ $cur =~ .*:\/ ]]; then
@@ -480,8 +483,11 @@ _vyatta_image_path_complete()
cur=${cur/:/}
fi
local isrunningimg=$(compgen -W "running" -- ${cur})
+ local isdiskinstall=$(compgen -W "disk-install" -- ${cur})
if [[ $isrunningimg == "running" ]];then
cur="/"
+ elif [[ $isdiskinstall == "disk-install" ]]; then
+ cur="/live/image/"
else
cur="/live/image/boot/${cur}"
fi
@@ -490,6 +496,8 @@ _vyatta_image_path_complete()
file=${reply[$i]}
if [[ $isrunningimg == "running" ]];then
reply[$i]="running://config/"
+ elif [[ $isdiskinstall == "disk-install" ]]; then
+ reply[$i]="disk-install://config/"
else
reply[$i]=${file/#\/live\/image\/boot\//}
if [[ -d /live/image/boot/${reply[$i]} ]]; then
@@ -503,6 +511,8 @@ _vyatta_image_path_complete()
cur=${cur#$topdir//}
if [[ $topdir == "running" ]]; then
cur="/${cur}"
+ elif [[ $topdir == "disk-install" ]]; then
+ cur="/live/image/${cur}"
else
cur="/live/image/boot/${topdir}/live-rw/${cur}"
fi
@@ -524,6 +534,8 @@ _vyatta_image_path_complete()
file=${reply[$i]}
if [[ $topdir == "running" ]]; then
reply[$i]=${file/#\//"$topdir://"}
+ elif [[ $topdir == "disk-install" ]]; then
+ reply[$i]=${file/#\/live\/image\//$"$topdir://"}
else
reply[$i]=${file/#\/live\/image\/boot\/$topdir/"$topdir://"}
reply[$i]=${reply[$i]/\/live-rw\/}
diff --git a/scripts/vyatta-image-tools.pl b/scripts/vyatta-image-tools.pl
index 1fd139c..2edeb10 100755
--- a/scripts/vyatta-image-tools.pl
+++ b/scripts/vyatta-image-tools.pl
@@ -46,6 +46,8 @@ sub conv_file {
}
if ( $topdir eq "running" ) {
$file = "/$file";
+ } elsif ( lc($topdir) eq 'disk-install' ) {
+ $file = "/live/image/$file";
} elsif ( lc($topdir) eq 'tftp') {
$file = $filein;
$topdir = 'url';
@@ -72,6 +74,8 @@ sub conv_file_to_rel {
my ($topdir, $filename) = @_;
if ($topdir eq "running"){
$filename =~ s?/?$topdir://?;
+ } elsif ($topdir eq "disk-install") {
+ $filename =~ s?/live/image/?$topdir://?;
} else {
$filename =~ s?/live/image/boot/$topdir/live-rw/?$topdir://?;
}
@@ -175,6 +179,10 @@ sub update {
print "Cannot clone to running\n";
exit 1;
}
+ if ($t_topdir eq 'disk-install'){
+ print "Cannot clone to running\n";
+ exit 1;
+ }
if ($t_topdir eq 'url'){
print "Cannot clone to a url\n";
exit 1;
diff --git a/templates/clone/system/config/node.tag/from/node.tag/node.def b/templates/clone/system/config/node.tag/from/node.tag/node.def
index 42ef94e..6061efd 100644
--- a/templates/clone/system/config/node.tag/from/node.tag/node.def
+++ b/templates/clone/system/config/node.tag/from/node.tag/node.def
@@ -6,6 +6,9 @@ allowed: reply=( $(compgen -f /live/image/boot/ | grep -v grub) )
reply[$i]="${reply[$i]}://"
done
reply+=( "running://" )
+ if [[ -d /live/image/config ]];then
+ reply+=( "disk-install://" )
+ fi
echo "${reply[*]}"
run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ];
then
diff --git a/templates/clone/system/config/node.tag/node.def b/templates/clone/system/config/node.tag/node.def
index d54a4cf..d4a04c0 100644
--- a/templates/clone/system/config/node.tag/node.def
+++ b/templates/clone/system/config/node.tag/node.def
@@ -5,7 +5,6 @@ allowed: reply=( $(compgen -f /live/image/boot/ | grep -v grub) )
reply[$i]=${file/#\/live\/image\/boot\//}
reply[$i]="${reply[$i]}://"
done
- reply+=( "running://" )
echo "${reply[*]}"
run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ];
then