show error messages when hdd-init fails
[enigma2.git] / lib / python / Components / Harddisk.py
index b51d7a6736a6899524aa34e7af8961173f0be0b0..133e063fee322c413cd3bbdb86d1394f31a20104 100644 (file)
@@ -103,7 +103,8 @@ class Harddisk:
 
        def unmount(self):
                cmd = "/bin/umount " + self.devidex + "part*"
-               os.system(cmd)
+               res = os.system(cmd)
+               return (res >> 8)
 
        def createPartition(self):
                cmd = "/sbin/sfdisk -f " + self.devidex + "disc"
@@ -123,11 +124,14 @@ class Harddisk:
                return (res >> 8)
 
        def createMovieFolder(self):
-               res = os.system("mkdir /hdd/movie")
+               res = os.system("mkdir /hdd/movies")
                return (res >> 8)
                
+       errorList = [ _("Everything is fine"), _("Creating partition failed"), _("Mkfs failed"), _("Mount failed"), _("Create movie folder failed"), _("Unmount failed")]
+
        def initialize(self):
-               self.unmount()
+               if self.unmount() != 0:
+                       return -5
 
                if self.createPartition() != 0:
                        return -1