Revision: 6892
          http://ipcop.svn.sourceforge.net/ipcop/?rev=6892&view=rev
Author:   owes
Date:     2013-01-04 11:37:22 +0000 (Fri, 04 Jan 2013)
Log Message:
-----------
Some partitions make partprobe exit with error. Erasing the partition before 
using partprobe fixes that.

Modified Paths:
--------------
    ipcop/trunk/src/scripts/disk-partition.sh

Modified: ipcop/trunk/src/scripts/disk-partition.sh
===================================================================
--- ipcop/trunk/src/scripts/disk-partition.sh   2013-01-04 09:41:52 UTC (rev 
6891)
+++ ipcop/trunk/src/scripts/disk-partition.sh   2013-01-04 11:37:22 UTC (rev 
6892)
@@ -91,6 +91,9 @@
         ;;
 esac
 
+# erase before checking, some partitions may fool partprobe
+erase_partition
+
 # check for device
 if ( ! /usr/sbin/partprobe $dev 2>&1 1>/dev/null ); then
     echo "device:$dev not found"
@@ -101,7 +104,6 @@
 # generally sector 0 contain the partition table, so first partition start 
after
 case "$arch" in
     x86)
-        erase_partition
         parted_call "$dev mklabel msdos"
         parted_call "$dev mkpart primary 1MiB ${root_size}MiB"
         parted_call "$dev mkpart primary $((${root_size}+1))MiB 
${disk_size}MiB"
@@ -112,7 +114,6 @@
         fi
         ;;
     alpha)
-        erase_partition
         parted_call "$dev mklabel bsd"
         # aboot need 70k or 150sectors * 512B at disk start
         parted_call "$dev mkpart primary 150s ${root_size}MiB"
@@ -124,7 +125,6 @@
         fi
         ;;
     powerpc)
-        erase_partition
         # mac label create a first partition from sector 1 to 63
         parted_call "$dev mklabel mac"
         # so second partition start at sector 64 and contain boot code
@@ -142,7 +142,6 @@
         fi
         ;;
     sparc)
-        erase_partition
         parted_call "$dev mklabel sun"
         # 'Whole disk' partition3 is not displayed by parted print but fdisk 
show that
         # boot flag is not needed on sun label

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn

Reply via email to