Merge lp:~barry/ubuntu/lucid/system-config-lvm/390423-ext4-support into lp:ubuntu/lucid/system-config-lvm

Proposed by Barry Warsaw
Status: Superseded
Proposed branch: lp:~barry/ubuntu/lucid/system-config-lvm/390423-ext4-support
Merge into: lp:ubuntu/lucid/system-config-lvm
Diff against target: 213 lines (+174/-3)
2 files modified
debian/changelog (+7/-0)
src/Filesystem.py (+167/-3)
To merge this branch: bzr merge lp:~barry/ubuntu/lucid/system-config-lvm/390423-ext4-support
Reviewer Review Type Date Requested Status
Colin Watson Needs Fixing
Review via email: mp+15988@code.launchpad.net

This proposal has been superseded by a proposal from 2009-12-11.

To post a comment you must log in.
Revision history for this message
Barry Warsaw (barry) wrote :

Resolves bug 390423 providing ext4 support to system-config-lvm for Lucid by applying upstream patch.

Tested by creating a virtual disk in my Lucid VM, using system-config-lvm to put an ext4 file system on it, and checking the results with the normal file system tools.

Revision history for this message
Colin Watson (cjwatson) wrote :

All looks fine to me. Thanks! Sponsoring.

review: Approve
Revision history for this message
Colin Watson (cjwatson) wrote :

As explained on IRC, this package uses a patch system, so the upstream part of this change needs to be reformatted to match that.

review: Needs Fixing
11. By Barry Warsaw

Move the patch into a dpatch file.

12. By Barry Warsaw

Back out the patch from the source branch, in favor of the dpatch.

13. By Barry Warsaw

Rename file for proper dpatch convention.

14. By Barry Warsaw

Give the directory prefix expected by dpatch.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2009-07-02 11:09:51 +0000
3+++ debian/changelog 2009-12-10 21:09:14 +0000
4@@ -1,3 +1,10 @@
5+system-config-lvm (1.1.4-4ubuntu2) lucid; urgency=low
6+
7+ * Add support for ext4 and xfs via patch in upstream tracker
8+ (thanks, Andres Mujica; LP: #390423)
9+
10+ -- Barry A. Warsaw <barry@canonical.com> Thu, 10 Dec 2009 10:56:03 -0500
11+
12 system-config-lvm (1.1.4-4ubuntu1) karmic; urgency=low
13
14 * In Ubuntu, we use udev rather than an init script to activate lvm2, so
15
16=== modified file 'src/Filesystem.py'
17--- src/Filesystem.py 2008-05-27 13:11:19 +0000
18+++ src/Filesystem.py 2009-12-10 21:09:14 +0000
19@@ -42,8 +42,6 @@
20 return Unknown('vfat32')
21 elif re.search('minix', result, re.I):
22 return Unknown('minix')
23- elif re.search('xfs', result, re.I):
24- return Unknown('xfs')
25 elif re.search('jfs', result, re.I):
26 return Unknown('jfs')
27 elif re.search('reiserfs', result, re.I):
28@@ -56,7 +54,7 @@
29
30 def get_filesystems():
31 # NoFS has to be first
32- return [NoFS(), ext3(), ext2(), gfs2(), gfs2_clustered(), gfs(), gfs_clustered()]
33+ return [NoFS(), ext4(), ext3(), ext2(), gfs2(), gfs2_clustered(), gfs(), gfs_clustered(), xfs()]
34
35
36 class Filesystem:
37@@ -146,6 +144,112 @@
38 'unknown')
39
40
41+class ext4(Filesystem):
42+ def __init__(self):
43+ creatable = self.check_path('/sbin/mkfs.ext4')
44+ mountable = self.check_mountable('ext4', 'ext4')
45+ resize_offline = self.check_paths(['/sbin/e2fsck', '/sbin/resize2fs'])
46+ extend_online = self.check_path('/sbin/resize2fs')
47+
48+ Filesystem.__init__(self, 'Ext4', creatable, True, mountable,
49+ extend_online, resize_offline, False, resize_offline,
50+ 'ext4')
51+
52+
53+ def probe(self, path):
54+ result = execWithCapture("/usr/bin/file", ['/usr/bin/file', '-s', '-L', path])
55+ if re.search('ext4', result, re.I):
56+ return True
57+
58+ # Note, you may need a test for new-enough e2fsprogs for ext4
59+ def create(self, path):
60+ args = list()
61+ args.append("/sbin/mkfs")
62+ args.append("-t")
63+ args.append('ext4')
64+ args.append(path)
65+ cmdstr = ' '.join(args)
66+ msg = CREATING_FS % (self.name)
67+ o,e,r = execWithCaptureErrorStatusProgress("/sbin/mkfs", args, msg)
68+ if r != 0:
69+ raise CommandError('FATAL', FSCREATE_FAILURE % (cmdstr,e))
70+
71+ def extend_online(self, dev_path):
72+ cmd = '/sbin/resize2fs'
73+ args = [cmd, dev_path]
74+ cmdstr = ' '.join(args)
75+ msg = RESIZING_FS % (self.name)
76+ o, e, s = execWithCaptureErrorStatusProgress(cmd, args, msg)
77+ if s != 0:
78+ raise CommandError('FATAL', FSRESIZE_FAILURE % (cmdstr, e))
79+
80+ def reduce_online(self, dev_path, new_size_bytes):
81+ # not supported
82+ raise 'NOT supported'
83+
84+ def extend_offline(self, dev_path):
85+ # first check fs (resize2fs requirement)
86+ args = list()
87+ args.append('/sbin/e2fsck')
88+ args.append('-f')
89+ args.append('-p') # repair fs
90+ args.append(dev_path)
91+ cmdstr = ' '.join(args)
92+ msg = CHECKING_FS % self.name
93+ o,e,r = execWithCaptureErrorStatusProgress('/sbin/e2fsck', args, msg)
94+ if not (r==0 or r==1):
95+ raise CommandError('FATAL', FSCHECK_FAILURE % (cmdstr,e))
96+
97+ args = list()
98+ args.append('/sbin/resize2fs')
99+ args.append(dev_path)
100+ cmdstr = ' '.join(args)
101+ msg = RESIZING_FS % self.name
102+ o,e,r = execWithCaptureErrorStatusProgress('/sbin/resize2fs', args, msg)
103+ if r != 0:
104+ raise CommandError('FATAL', FSRESIZE_FAILURE % (cmdstr,e))
105+
106+ def reduce_offline(self, dev_path, new_size_bytes):
107+ # first check fs (resize2fs requirement)
108+ args = list()
109+ args.append('/sbin/e2fsck')
110+ args.append('-f')
111+ args.append('-p') # repair fs
112+ args.append(dev_path)
113+ cmdstr = ' '.join(args)
114+ msg = CHECKING_FS % self.name
115+ o,e,r = execWithCaptureErrorStatusProgress('/sbin/e2fsck', args, msg)
116+ if not (r==0 or r==1):
117+ raise CommandError('FATAL', FSCHECK_FAILURE % (cmdstr,e))
118+
119+ new_size_kb = new_size_bytes / 1024
120+ args = list()
121+ args.append('/sbin/resize2fs')
122+ args.append(dev_path)
123+ args.append(str(new_size_kb) + 'K')
124+ cmdstr = ' '.join(args)
125+ msg = RESIZING_FS % (self.name)
126+ o,e,r = execWithCaptureErrorStatusProgress('/sbin/resize2fs', args, msg)
127+ if r != 0:
128+ raise CommandError('FATAL', FSRESIZE_FAILURE % (cmdstr,e))
129+
130+ def get_label(self, devpath):
131+ args = ['/sbin/tune2fs']
132+ args.append('-l')
133+ args.append(devpath)
134+ o, r = execWithCaptureStatus('/sbin/tune2fs', args)
135+ if r == 0:
136+ lines = o.splitlines()
137+ for line in lines:
138+ if re.search('volume name', line, re.I):
139+ words = line.split()
140+ label = words[len(words) - 1]
141+ if re.match('<none>', label, re.I):
142+ return None
143+ else:
144+ return label
145+ return None
146+
147 class ext3(Filesystem):
148 def __init__(self):
149 creatable = self.check_path('/sbin/mkfs.ext3')
150@@ -652,6 +756,66 @@
151 return v
152 return None
153
154+class xfs(Filesystem):
155+ def __init__(self):
156+ creatable = self.check_path('/sbin/mkfs.xfs')
157+ mountable = self.check_mountable('xfs', 'xfs')
158+ extend_online = self.check_path('/usr/sbin/xfs_growfs')
159+
160+ Filesystem.__init__(self, 'XFS', creatable, True, mountable,
161+ extend_online, False, False, False,
162+ 'xfs')
163+
164+ def probe(self, path):
165+ result = execWithCapture("/usr/bin/file", ['/usr/bin/file', '-s', '-L', path])
166+ if re.search('SGI XFS', result, re.I):
167+ return True
168+
169+ def create(self, path):
170+ args = list()
171+ args.append("/sbin/mkfs")
172+ args.append("-t")
173+ args.append('xfs')
174+ args.append(path)
175+ cmdstr = ' '.join(args)
176+ msg = CREATING_FS % (self.name)
177+ o,e,r = execWithCaptureErrorStatusProgress("/sbin/mkfs", args, msg)
178+ if r != 0:
179+ raise CommandError('FATAL', FSCREATE_FAILURE % (cmdstr,e))
180+
181+ def extend_online(self, dev_path):
182+ cmd = '/usr/sbin/xfs_growfs'
183+ args = [cmd, dev_path]
184+ cmdstr = ' '.join(args)
185+ msg = RESIZING_FS % (self.name)
186+ o, e, s = execWithCaptureErrorStatusProgress(cmd, args, msg)
187+ if s != 0:
188+ raise CommandError('FATAL', FSRESIZE_FAILURE % (cmdstr, e))
189+
190+ def reduce_online(self, dev_path, new_size_bytes):
191+ # not supported
192+ raise 'NOT supported'
193+
194+ def extend_offline(self, dev_path):
195+ # not supported
196+ raise 'NOT supported'
197+
198+ def reduce_offline(self, dev_path, new_size_bytes):
199+ # not supported
200+ raise 'NOT supported'
201+
202+ def get_label(self, devpath):
203+ args = ['/usr/sbin/xfs_admin']
204+ args.append('-l')
205+ args.append(devpath)
206+ o, r = execWithCaptureStatus('/usr/sbin/xfs_admin', args)
207+ if r == 0:
208+ words = o.split()
209+ label = re.sub('\"', '', words[len(words) - 1])
210+ if label:
211+ return label
212+ return None
213+ return None
214
215
216

Subscribers

People subscribed via source and target branches

to all changes: