From 07d72417590ae2ad4641fb7f58f093bf68dca87e Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Mon, 16 Jan 2012 10:25:34 -0800
Subject: Fix check for pseudo-ethernet overlap

Bug 7726
Incorrect variable name (from cut-paste)
---
 scripts/vyatta-bridge.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'scripts')

diff --git a/scripts/vyatta-bridge.pl b/scripts/vyatta-bridge.pl
index 68d3e107..b1a3afaa 100755
--- a/scripts/vyatta-bridge.pl
+++ b/scripts/vyatta-bridge.pl
@@ -72,8 +72,8 @@ if ( $action eq 'SET' ) {
     foreach my $peth ($cfg->listNodes()) {
 	my $link = $cfg->returnValue("$peth link");
 
-	die "Error: can not add interface $slave to bridge already used by pseudo-ethernet $peth\n"
-	    if ($link eq $slave);
+	die "Error: can not add interface $ifname to bridge already used by pseudo-ethernet $peth\n"
+	    if ($link eq $ifname);
     }
 
     print "Adding interface $ifname to bridge $newbridge\n";
-- 
cgit v1.2.3


From 177fa685159523d2ef8bd9ad6447d28c3338e7e9 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Fri, 20 Jan 2012 15:36:25 -0800
Subject: Make disk label if necessary

Bug 7732
Restore installation section that makes disk label.
---
 scripts/install-system                | 16 ++++++++++++++++
 scripts/install/install-get-partition | 16 ++++++++++++++++
 2 files changed, 32 insertions(+)

(limited to 'scripts')

diff --git a/scripts/install-system b/scripts/install-system
index 536233d7..fcd2dff0 100755
--- a/scripts/install-system
+++ b/scripts/install-system
@@ -840,6 +840,22 @@ create_partitions() {
     exit 1
   fi
 
+  # Make sure you can print disk info using parted
+  parted --script /dev/$ldrive p >/dev/null 2>&1
+
+  # If unable to read disk, it's likely it needs a disklabel
+  if [ "$?" != "0" ]; then
+    lecho "Creating a new disklabel on $ldrive"
+    lecho "parted /dev/$ldrive mklabel msdos"
+    output=$(parted -s /dev/$ldrive mklabel msdos)
+
+    parted --script /dev/$ldrive p >/dev/null 2>&1
+    if [ "$?" != "0" ]; then
+      echo "Unable to read disk label.  Exiting."
+      exit 1
+    fi
+  fi
+
   echo "Creating root partition on /dev/$ldrive" >> $INSTALL_LOG
   
   # make the root partition
diff --git a/scripts/install/install-get-partition b/scripts/install/install-get-partition
index 86197708..594fa929 100755
--- a/scripts/install/install-get-partition
+++ b/scripts/install/install-get-partition
@@ -682,6 +682,22 @@ create_partitions() {
     exit 1
   fi
 
+  # Make sure you can print disk info using parted
+  parted --script /dev/$ldrive p >/dev/null 2>&1
+
+  # If unable to read disk, it's likely it needs a disklabel
+  if [ "$?" != "0" ]; then
+    lecho "Creating a new disklabel on $ldrive"
+    lecho "parted /dev/$ldrive mklabel msdos"
+    output=$(parted -s /dev/$ldrive mklabel msdos)
+
+    parted --script /dev/$ldrive p >/dev/null 2>&1
+    if [ "$?" != "0" ]; then
+      echo "Unable to read disk label.  Exiting."
+      exit 1
+    fi
+  fi
+
   lecho "Creating root partition on /dev/$ldrive"
   
   # make the root partition
-- 
cgit v1.2.3


From 07119bd476b7963fee55e1b5eb649edf25603910 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Tue, 24 Jan 2012 16:50:50 -0800
Subject: Fix missing error (missing lecho) in install-system

Some statements were copy/pasted over from install-image.
install-system does not use lecho, that is only used in install-image
---
 scripts/install-system | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'scripts')

diff --git a/scripts/install-system b/scripts/install-system
index fcd2dff0..fbff5e1f 100755
--- a/scripts/install-system
+++ b/scripts/install-system
@@ -647,7 +647,7 @@ save_image_config() {
 
     if [ -n "$output" ]; then
         echo -e "Warning: error in copying the old config partition.\nSee $INSTALL_LOG for more details."
-        lecho "Warning: error in copying the old config partition.\ncp -pR /mnt/tmp/* /mnt/config\n$output\n"
+        echo "Warning: error in copying the old config partition.\ncp -pR /mnt/tmp/* /mnt/config\n$output\n"
     fi
     rename_old_config
 }
@@ -845,8 +845,8 @@ create_partitions() {
 
   # If unable to read disk, it's likely it needs a disklabel
   if [ "$?" != "0" ]; then
-    lecho "Creating a new disklabel on $ldrive"
-    lecho "parted /dev/$ldrive mklabel msdos"
+    echo "Creating a new disklabel on $ldrive"
+    echo "parted /dev/$ldrive mklabel msdos"
     output=$(parted -s /dev/$ldrive mklabel msdos)
 
     parted --script /dev/$ldrive p >/dev/null 2>&1
-- 
cgit v1.2.3