summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen@networkplumber.org>2013-02-21 16:09:17 -0800
committerStephen Hemminger <stephen@networkplumber.org>2013-02-21 16:09:17 -0800
commit709087a903ffea5d108a1ea80f14c644b46a1449 (patch)
tree155711ec066c1486ed9d2fea057a6963b31a9150
parent90d33710e06a26b0e834cbfbd956139d3e7052a0 (diff)
downloadvyatta-op-709087a903ffea5d108a1ea80f14c644b46a1449.tar.gz
vyatta-op-709087a903ffea5d108a1ea80f14c644b46a1449.zip
Remove format operational mode commands
Bug 8311 Get rid of floppy configuration support
-rw-r--r--templates/format/disk/node.def1
-rw-r--r--templates/format/disk/node.tag/like/node.def1
-rw-r--r--templates/format/disk/node.tag/like/node.tag/node.def61
-rw-r--r--templates/format/disk/node.tag/node.def6
-rw-r--r--templates/format/node.def1
-rw-r--r--templates/format/system-floppy/node.def2
6 files changed, 0 insertions, 72 deletions
diff --git a/templates/format/disk/node.def b/templates/format/disk/node.def
deleted file mode 100644
index 97df9b7..0000000
--- a/templates/format/disk/node.def
+++ /dev/null
@@ -1 +0,0 @@
-help: Format a disk drive
diff --git a/templates/format/disk/node.tag/like/node.def b/templates/format/disk/node.tag/like/node.def
deleted file mode 100644
index c4a5126..0000000
--- a/templates/format/disk/node.tag/like/node.def
+++ /dev/null
@@ -1 +0,0 @@
-help: Format this disk the same as another disk
diff --git a/templates/format/disk/node.tag/like/node.tag/node.def b/templates/format/disk/node.tag/like/node.tag/node.def
deleted file mode 100644
index a98cbcc..0000000
--- a/templates/format/disk/node.tag/like/node.tag/node.def
+++ /dev/null
@@ -1,61 +0,0 @@
-help: Name of disk drive to partition it like
-
-allowed:
- local -a disks ;
- proto_disk=${COMP_WORDS[2]}
- disks=`cat /proc/partitions | awk '{ if ($4!="name") { print $4 } }' | egrep -v "[0-9]"`
- disks=`echo $disks | sed -e s/$proto_disk//g`
- echo -n $disks
-
-run:
- proto_disk=$5
- format_disk=$3
- backup_dir=/var/tmp
- eligible_format_disks=`cat /proc/partitions | awk '{ if ($4!="name") { print $4 } }' | egrep -v "[0-9]"`
- eligible_proto_disks=`echo $eligible_format_disks | sed -e s/$format_disk//g`
- proto_eligible=`echo $eligible_proto_disks | grep $proto_disk`
- format_eligible=`echo $eligible_format_disks | grep $format_disk`
- busy_check=`sudo /sbin/sfdisk -R /dev/$format_disk 2>&1`
-
- if [ $proto_disk = $format_disk ]; then
- echo "The two disk drives must be different."
- elif [ ! -b /dev/$proto_disk ]; then
- echo "Device /dev/$proto_disk does not exist"
- elif [ ! -b /dev/$format_disk ]; then
- echo "Device /dev/$format_disk does not exist"
- elif [ -z "$format_eligible" ]; then
- echo "Device $format_disk can not be formatted"
- elif [ -z "$proto_eligible" ]; then
- echo "Device $proto_disk can not be used as a prototype for $format_disk"
- elif [ -n "$busy_check" ]; then
- echo "Disk device $format_disk is busy. Can't format it now."
- elif [ ! -r /dev/$format_disk ]; then
- echo "Must be admin or root to format disk"
- else
- echo "This will re-format disk $format_disk so that it has the same disk"
- echo "partion sizes and offsets as $proto_disk. This will not copy"
- echo "data from $proto_disk to $format_disk. But this will erase all"
- echo "data on $format_disk."
- echo
- echo -n "Do you wish to proceed (yes, NO)? "
- read response
- if [ "$response" = "yes" ]; then
- echo "OK. Re-formating disk drive $format_disk..."
- echo "Making backup copy of partitions..."
- sudo /sbin/sfdisk -d /dev/$format_disk > $backup_dir/backup_$format_disk.`date +%F-%R`
- sleep 1
- partitions=`cat /proc/partitions | grep $format_disk'[0-9]' | awk '{ print $4 }' | sed 's/[a-z]//g'`
- if [ -n "$partitions" ]; then
- echo -n "Deleting old partitions..."
- for part in $partitions ; do
- sudo /sbin/parted /dev/$format_disk rm $part
- done
- echo ""
- fi
- echo "Creating new partitions on $format_disk based on $proto_disk..."
- sudo /sbin/sfdisk -d /dev/$proto_disk | sudo /sbin/sfdisk --force /dev/$format_disk
- echo "Done."
- else
- echo "OK. Disk drive $format_drive will not be re-formated."
- fi
- fi
diff --git a/templates/format/disk/node.tag/node.def b/templates/format/disk/node.tag/node.def
deleted file mode 100644
index 2b77c5b..0000000
--- a/templates/format/disk/node.tag/node.def
+++ /dev/null
@@ -1,6 +0,0 @@
-help: Disk drive name
-
-allowed:
- local -a array ;
- array=`cat /proc/partitions | awk '{ if ($4!="name") { print $4 } }' | egrep -v "[0-9]"`
- echo -n $array
diff --git a/templates/format/node.def b/templates/format/node.def
deleted file mode 100644
index 5775951..0000000
--- a/templates/format/node.def
+++ /dev/null
@@ -1 +0,0 @@
-help: Format a device
diff --git a/templates/format/system-floppy/node.def b/templates/format/system-floppy/node.def
deleted file mode 100644
index c897913..0000000
--- a/templates/format/system-floppy/node.def
+++ /dev/null
@@ -1,2 +0,0 @@
-help: Format and prepare a floppy to save the config.boot file
-run: sudo /opt/vyatta/sbin/init-floppy