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
=== modified file 'debian/changelog'
--- debian/changelog 2009-07-02 11:09:51 +0000
+++ debian/changelog 2009-12-10 21:09:14 +0000
@@ -1,3 +1,10 @@
1system-config-lvm (1.1.4-4ubuntu2) lucid; urgency=low
2
3 * Add support for ext4 and xfs via patch in upstream tracker
4 (thanks, Andres Mujica; LP: #390423)
5
6 -- Barry A. Warsaw <barry@canonical.com> Thu, 10 Dec 2009 10:56:03 -0500
7
1system-config-lvm (1.1.4-4ubuntu1) karmic; urgency=low8system-config-lvm (1.1.4-4ubuntu1) karmic; urgency=low
29
3 * In Ubuntu, we use udev rather than an init script to activate lvm2, so10 * In Ubuntu, we use udev rather than an init script to activate lvm2, so
411
=== modified file 'src/Filesystem.py'
--- src/Filesystem.py 2008-05-27 13:11:19 +0000
+++ src/Filesystem.py 2009-12-10 21:09:14 +0000
@@ -42,8 +42,6 @@
42 return Unknown('vfat32')42 return Unknown('vfat32')
43 elif re.search('minix', result, re.I):43 elif re.search('minix', result, re.I):
44 return Unknown('minix')44 return Unknown('minix')
45 elif re.search('xfs', result, re.I):
46 return Unknown('xfs')
47 elif re.search('jfs', result, re.I):45 elif re.search('jfs', result, re.I):
48 return Unknown('jfs')46 return Unknown('jfs')
49 elif re.search('reiserfs', result, re.I):47 elif re.search('reiserfs', result, re.I):
@@ -56,7 +54,7 @@
5654
57def get_filesystems():55def get_filesystems():
58 # NoFS has to be first56 # NoFS has to be first
59 return [NoFS(), ext3(), ext2(), gfs2(), gfs2_clustered(), gfs(), gfs_clustered()]57 return [NoFS(), ext4(), ext3(), ext2(), gfs2(), gfs2_clustered(), gfs(), gfs_clustered(), xfs()]
6058
6159
62class Filesystem:60class Filesystem:
@@ -146,6 +144,112 @@
146 'unknown')144 'unknown')
147 145
148 146
147class ext4(Filesystem):
148 def __init__(self):
149 creatable = self.check_path('/sbin/mkfs.ext4')
150 mountable = self.check_mountable('ext4', 'ext4')
151 resize_offline = self.check_paths(['/sbin/e2fsck', '/sbin/resize2fs'])
152 extend_online = self.check_path('/sbin/resize2fs')
153
154 Filesystem.__init__(self, 'Ext4', creatable, True, mountable,
155 extend_online, resize_offline, False, resize_offline,
156 'ext4')
157
158
159 def probe(self, path):
160 result = execWithCapture("/usr/bin/file", ['/usr/bin/file', '-s', '-L', path])
161 if re.search('ext4', result, re.I):
162 return True
163
164 # Note, you may need a test for new-enough e2fsprogs for ext4
165 def create(self, path):
166 args = list()
167 args.append("/sbin/mkfs")
168 args.append("-t")
169 args.append('ext4')
170 args.append(path)
171 cmdstr = ' '.join(args)
172 msg = CREATING_FS % (self.name)
173 o,e,r = execWithCaptureErrorStatusProgress("/sbin/mkfs", args, msg)
174 if r != 0:
175 raise CommandError('FATAL', FSCREATE_FAILURE % (cmdstr,e))
176
177 def extend_online(self, dev_path):
178 cmd = '/sbin/resize2fs'
179 args = [cmd, dev_path]
180 cmdstr = ' '.join(args)
181 msg = RESIZING_FS % (self.name)
182 o, e, s = execWithCaptureErrorStatusProgress(cmd, args, msg)
183 if s != 0:
184 raise CommandError('FATAL', FSRESIZE_FAILURE % (cmdstr, e))
185
186 def reduce_online(self, dev_path, new_size_bytes):
187 # not supported
188 raise 'NOT supported'
189
190 def extend_offline(self, dev_path):
191 # first check fs (resize2fs requirement)
192 args = list()
193 args.append('/sbin/e2fsck')
194 args.append('-f')
195 args.append('-p') # repair fs
196 args.append(dev_path)
197 cmdstr = ' '.join(args)
198 msg = CHECKING_FS % self.name
199 o,e,r = execWithCaptureErrorStatusProgress('/sbin/e2fsck', args, msg)
200 if not (r==0 or r==1):
201 raise CommandError('FATAL', FSCHECK_FAILURE % (cmdstr,e))
202
203 args = list()
204 args.append('/sbin/resize2fs')
205 args.append(dev_path)
206 cmdstr = ' '.join(args)
207 msg = RESIZING_FS % self.name
208 o,e,r = execWithCaptureErrorStatusProgress('/sbin/resize2fs', args, msg)
209 if r != 0:
210 raise CommandError('FATAL', FSRESIZE_FAILURE % (cmdstr,e))
211
212 def reduce_offline(self, dev_path, new_size_bytes):
213 # first check fs (resize2fs requirement)
214 args = list()
215 args.append('/sbin/e2fsck')
216 args.append('-f')
217 args.append('-p') # repair fs
218 args.append(dev_path)
219 cmdstr = ' '.join(args)
220 msg = CHECKING_FS % self.name
221 o,e,r = execWithCaptureErrorStatusProgress('/sbin/e2fsck', args, msg)
222 if not (r==0 or r==1):
223 raise CommandError('FATAL', FSCHECK_FAILURE % (cmdstr,e))
224
225 new_size_kb = new_size_bytes / 1024
226 args = list()
227 args.append('/sbin/resize2fs')
228 args.append(dev_path)
229 args.append(str(new_size_kb) + 'K')
230 cmdstr = ' '.join(args)
231 msg = RESIZING_FS % (self.name)
232 o,e,r = execWithCaptureErrorStatusProgress('/sbin/resize2fs', args, msg)
233 if r != 0:
234 raise CommandError('FATAL', FSRESIZE_FAILURE % (cmdstr,e))
235
236 def get_label(self, devpath):
237 args = ['/sbin/tune2fs']
238 args.append('-l')
239 args.append(devpath)
240 o, r = execWithCaptureStatus('/sbin/tune2fs', args)
241 if r == 0:
242 lines = o.splitlines()
243 for line in lines:
244 if re.search('volume name', line, re.I):
245 words = line.split()
246 label = words[len(words) - 1]
247 if re.match('<none>', label, re.I):
248 return None
249 else:
250 return label
251 return None
252
149class ext3(Filesystem):253class ext3(Filesystem):
150 def __init__(self):254 def __init__(self):
151 creatable = self.check_path('/sbin/mkfs.ext3')255 creatable = self.check_path('/sbin/mkfs.ext3')
@@ -652,6 +756,66 @@
652 return v756 return v
653 return None757 return None
654758
759class xfs(Filesystem):
760 def __init__(self):
761 creatable = self.check_path('/sbin/mkfs.xfs')
762 mountable = self.check_mountable('xfs', 'xfs')
763 extend_online = self.check_path('/usr/sbin/xfs_growfs')
764
765 Filesystem.__init__(self, 'XFS', creatable, True, mountable,
766 extend_online, False, False, False,
767 'xfs')
768
769 def probe(self, path):
770 result = execWithCapture("/usr/bin/file", ['/usr/bin/file', '-s', '-L', path])
771 if re.search('SGI XFS', result, re.I):
772 return True
773
774 def create(self, path):
775 args = list()
776 args.append("/sbin/mkfs")
777 args.append("-t")
778 args.append('xfs')
779 args.append(path)
780 cmdstr = ' '.join(args)
781 msg = CREATING_FS % (self.name)
782 o,e,r = execWithCaptureErrorStatusProgress("/sbin/mkfs", args, msg)
783 if r != 0:
784 raise CommandError('FATAL', FSCREATE_FAILURE % (cmdstr,e))
785
786 def extend_online(self, dev_path):
787 cmd = '/usr/sbin/xfs_growfs'
788 args = [cmd, dev_path]
789 cmdstr = ' '.join(args)
790 msg = RESIZING_FS % (self.name)
791 o, e, s = execWithCaptureErrorStatusProgress(cmd, args, msg)
792 if s != 0:
793 raise CommandError('FATAL', FSRESIZE_FAILURE % (cmdstr, e))
794
795 def reduce_online(self, dev_path, new_size_bytes):
796 # not supported
797 raise 'NOT supported'
798
799 def extend_offline(self, dev_path):
800 # not supported
801 raise 'NOT supported'
802
803 def reduce_offline(self, dev_path, new_size_bytes):
804 # not supported
805 raise 'NOT supported'
806
807 def get_label(self, devpath):
808 args = ['/usr/sbin/xfs_admin']
809 args.append('-l')
810 args.append(devpath)
811 o, r = execWithCaptureStatus('/usr/sbin/xfs_admin', args)
812 if r == 0:
813 words = o.split()
814 label = re.sub('\"', '', words[len(words) - 1])
815 if label:
816 return label
817 return None
818 return None
655 819
656820
657821

Subscribers

People subscribed via source and target branches

to all changes: