enigma2: add missing patch
[opendreambox.git] / meta-opendreambox / recipes-dreambox / enigma2 / enigma2-3.999git20140314 / 0001-Hardisk.py-fixed-possible-crash-on-harddisk-re-init-.patch
1 From 3bc160c3807c344ba300a74e217733a974b7d67b Mon Sep 17 00:00:00 2001
2 From: ghost <andreas.monzner@dream-property.net>
3 Date: Mon, 26 May 2014 14:39:36 +0200
4 Subject: [PATCH] Hardisk.py: fixed possible crash on harddisk re-init, allow
5  fsck for ext4 (thx to jophi)
6
7 ---
8  usr/lib/enigma2/python/Components/Harddisk.py |    4 ++--
9  1 files changed, 2 insertions(+), 2 deletions(-)
10
11 diff --git a/usr/lib/enigma2/python/Components/Harddisk.py b/usr/lib/enigma2/python/Components/Harddisk.py
12 index 6501800..cbe0f7f 100644
13 --- a/usr/lib/enigma2/python/Components/Harddisk.py
14 +++ b/usr/lib/enigma2/python/Components/Harddisk.py
15 @@ -388,7 +388,7 @@ class Harddisk:
16                                 sectors = self.diskSize(sectors = True)
17                         cmd = 'parted --script --align=min ' + self.disk_path + ' -- mklabel msdos mkpart primary ext3 40s 100%'
18                         if sectors and not self.isRemovable:
19 -                               part1end = int(sectors-swapPartSize) #leaving 1GB for swap
20 +                               part1end = int(sectors)-swapPartSize #leaving 1GB for swap
21                                 cmd = 'parted --script --align=min ' + self.disk_path + ' -- mklabel msdos mkpart primary ext3 40s ' + str(part1end) + 's'
22                                 cmd+=  ' mkpart primary linux-swap ' + str(int(part1end+1)) + 's -1s'
23                                 if sectors > maxSectorsMBR:
24 @@ -474,7 +474,7 @@ class Harddisk:
25  
26                 res = -1
27                 if access(partitionPath, 0):
28 -                       if partitionType in ("ext2", "ext3"):
29 +                       if partitionType in ("ext2", "ext3", "ext4"):
30                                 cmd = "fsck." + partitionType + " -f -p -C 0 " + partitionPath
31                                 res = system(cmd)
32  
33 -- 
34 1.7.7
35