summaryrefslogtreecommitdiffstats
path: root/abs/core-testing
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2009-06-26 03:23:23 (GMT)
committerJames Meyer <james.meyer@operamail.com>2009-06-26 03:23:23 (GMT)
commit60d1f118c9218973c099ea1baf4c0aa2f21f6c30 (patch)
tree93e40e5520b420816e939fae91303740bb6b9aa4 /abs/core-testing
parent7146d00d725637e34c6295130853e4138093ed0c (diff)
downloadlinhes_pkgbuild-60d1f118c9218973c099ea1baf4c0aa2f21f6c30.zip
linhes_pkgbuild-60d1f118c9218973c099ea1baf4c0aa2f21f6c30.tar.gz
linhes_pkgbuild-60d1f118c9218973c099ea1baf4c0aa2f21f6c30.tar.bz2
linhes-config: try to write a valid partition table if one doesn't exist.
Works for new disks.
Diffstat (limited to 'abs/core-testing')
-rwxr-xr-xabs/core-testing/LinHES-config/PKGBUILD2
-rwxr-xr-xabs/core-testing/LinHES-config/mv_install.py31
2 files changed, 25 insertions, 8 deletions
diff --git a/abs/core-testing/LinHES-config/PKGBUILD b/abs/core-testing/LinHES-config/PKGBUILD
index 676c13f..cc67e21 100755
--- a/abs/core-testing/LinHES-config/PKGBUILD
+++ b/abs/core-testing/LinHES-config/PKGBUILD
@@ -1,6 +1,6 @@
pkgname=LinHES-config
pkgver=2.0
-pkgrel=25
+pkgrel=26
conflicts=(MythVantage-config MythVantage-config-dev LinHES-config-dev )
pkgdesc="Install and configure your system"
depends=(bc libstatgrab mysql-python expect curl dnsutils parted sg3_utils nmbscan system-templates rsync python-parted ddcxinfo)
diff --git a/abs/core-testing/LinHES-config/mv_install.py b/abs/core-testing/LinHES-config/mv_install.py
index 87fbaae..9d70a55 100755
--- a/abs/core-testing/LinHES-config/mv_install.py
+++ b/abs/core-testing/LinHES-config/mv_install.py
@@ -219,16 +219,33 @@ def umount_bind_chroot():
runcmd(cmd)
+def blank_table(diskdevice):
+ logging.debug(" writing new parition table for %s", diskdevice)
+ logging.debug("parition table before:")
+ cmd = "fdisk -l %s" %diskdevice
+ runcmd(cmd)
+
+ cmd = "echo w |fdisk %s" %diskdevice
+ runcmd(cmd)
+
+ logging.debug("parition table after:")
+ cmd = "fdisk -l %s" %diskdevice
+ runcmd(cmd)
+
def partitions_removeall(diskdevice, label):
logging.info("Removing all partitions for %s %s", label, diskdevice)
- device = parted.getDevice(diskdevice)
- partdisk = parted.Disk(device)
- partdisk.deleteAllPartitions()
- if data_config.NOOPDEBUG == "FALSE":
- partdisk.commit()
+ try:
+ device = parted.getDevice(diskdevice)
+ partdisk = parted.Disk(device)
+ partdisk.deleteAllPartitions()
+ if data_config.NOOPDEBUG == "FALSE":
+ partdisk.commit()
+ for partition in partdisk.partitions:
+ print "type: %s" %partition.type
+ except:
+ logging.debug(" Error reading parition table, attempting to write a blank one")
+ blank_table(diskdevice)
- for partition in partdisk.partitions:
- print "type: %s" %partition.type
def create_partitions(diskdevice, size, ptype, startsector):
logging.debug("_____Create partitions______")