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

Proposed by Barry Warsaw
Status: Merged
Merged at revision: not available
Proposed branch: lp:~barry/ubuntu/lucid/system-config-lvm/390423-ext4-support
Merge into: lp:ubuntu/lucid/system-config-lvm
Diff against target: 238 lines (+218/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/00list (+1/-0)
debian/patches/ext4xfssupport.dpatch (+210/-0)
To merge this branch: bzr merge lp:~barry/ubuntu/lucid/system-config-lvm/390423-ext4-support
Reviewer Review Type Date Requested Status
Colin Watson Pending
Review via email: mp+16032@code.launchpad.net

This proposal supersedes a proposal from 2009-12-10.

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

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 : Posted in a previous version of this proposal

All looks fine to me. Thanks! Sponsoring.

review: Approve
Revision history for this message
Colin Watson (cjwatson) wrote : Posted in a previous version of this proposal

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

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-11 16:31:13 +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 'debian/patches/00list'
17--- debian/patches/00list 2009-02-19 21:49:39 +0000
18+++ debian/patches/00list 2009-12-11 16:31:13 +0000
19@@ -1,3 +1,4 @@
20 redhat2debian
21 changelog
22 CommandError
23+ext4xfssupport
24
25=== added file 'debian/patches/ext4xfssupport.dpatch'
26--- debian/patches/ext4xfssupport.dpatch 1970-01-01 00:00:00 +0000
27+++ debian/patches/ext4xfssupport.dpatch 2009-12-11 16:31:13 +0000
28@@ -0,0 +1,210 @@
29+#! /bin/sh /usr/share/dpatch/dpatch-run
30+## ext4xfssupport.dpatch by Barry Warsaw <barry@canonical.com>
31+##
32+## All lines beginning with `## DP:' are a description of the patch.
33+## DP: Add support for ext4 and xfs file systems
34+
35+@DPATCH@
36+
37+=== modified file 'src/Filesystem.py'
38+--- system-config-lvm-1.1.4.old/src/Filesystem.py 2008-05-27 13:11:19 +0000
39++++ system-config-lvm-1.1.4/src/Filesystem.py 2009-12-10 15:57:27 +0000
40+@@ -42,8 +42,6 @@
41+ return Unknown('vfat32')
42+ elif re.search('minix', result, re.I):
43+ return Unknown('minix')
44+- elif re.search('xfs', result, re.I):
45+- return Unknown('xfs')
46+ elif re.search('jfs', result, re.I):
47+ return Unknown('jfs')
48+ elif re.search('reiserfs', result, re.I):
49+@@ -56,7 +54,7 @@
50+
51+ def get_filesystems():
52+ # NoFS has to be first
53+- return [NoFS(), ext3(), ext2(), gfs2(), gfs2_clustered(), gfs(), gfs_clustered()]
54++ return [NoFS(), ext4(), ext3(), ext2(), gfs2(), gfs2_clustered(), gfs(), gfs_clustered(), xfs()]
55+
56+
57+ class Filesystem:
58+@@ -146,6 +144,112 @@
59+ 'unknown')
60+
61+
62++class ext4(Filesystem):
63++ def __init__(self):
64++ creatable = self.check_path('/sbin/mkfs.ext4')
65++ mountable = self.check_mountable('ext4', 'ext4')
66++ resize_offline = self.check_paths(['/sbin/e2fsck', '/sbin/resize2fs'])
67++ extend_online = self.check_path('/sbin/resize2fs')
68++
69++ Filesystem.__init__(self, 'Ext4', creatable, True, mountable,
70++ extend_online, resize_offline, False, resize_offline,
71++ 'ext4')
72++
73++
74++ def probe(self, path):
75++ result = execWithCapture("/usr/bin/file", ['/usr/bin/file', '-s', '-L', path])
76++ if re.search('ext4', result, re.I):
77++ return True
78++
79++ # Note, you may need a test for new-enough e2fsprogs for ext4
80++ def create(self, path):
81++ args = list()
82++ args.append("/sbin/mkfs")
83++ args.append("-t")
84++ args.append('ext4')
85++ args.append(path)
86++ cmdstr = ' '.join(args)
87++ msg = CREATING_FS % (self.name)
88++ o,e,r = execWithCaptureErrorStatusProgress("/sbin/mkfs", args, msg)
89++ if r != 0:
90++ raise CommandError('FATAL', FSCREATE_FAILURE % (cmdstr,e))
91++
92++ def extend_online(self, dev_path):
93++ cmd = '/sbin/resize2fs'
94++ args = [cmd, dev_path]
95++ cmdstr = ' '.join(args)
96++ msg = RESIZING_FS % (self.name)
97++ o, e, s = execWithCaptureErrorStatusProgress(cmd, args, msg)
98++ if s != 0:
99++ raise CommandError('FATAL', FSRESIZE_FAILURE % (cmdstr, e))
100++
101++ def reduce_online(self, dev_path, new_size_bytes):
102++ # not supported
103++ raise 'NOT supported'
104++
105++ def extend_offline(self, dev_path):
106++ # first check fs (resize2fs requirement)
107++ args = list()
108++ args.append('/sbin/e2fsck')
109++ args.append('-f')
110++ args.append('-p') # repair fs
111++ args.append(dev_path)
112++ cmdstr = ' '.join(args)
113++ msg = CHECKING_FS % self.name
114++ o,e,r = execWithCaptureErrorStatusProgress('/sbin/e2fsck', args, msg)
115++ if not (r==0 or r==1):
116++ raise CommandError('FATAL', FSCHECK_FAILURE % (cmdstr,e))
117++
118++ args = list()
119++ args.append('/sbin/resize2fs')
120++ args.append(dev_path)
121++ cmdstr = ' '.join(args)
122++ msg = RESIZING_FS % self.name
123++ o,e,r = execWithCaptureErrorStatusProgress('/sbin/resize2fs', args, msg)
124++ if r != 0:
125++ raise CommandError('FATAL', FSRESIZE_FAILURE % (cmdstr,e))
126++
127++ def reduce_offline(self, dev_path, new_size_bytes):
128++ # first check fs (resize2fs requirement)
129++ args = list()
130++ args.append('/sbin/e2fsck')
131++ args.append('-f')
132++ args.append('-p') # repair fs
133++ args.append(dev_path)
134++ cmdstr = ' '.join(args)
135++ msg = CHECKING_FS % self.name
136++ o,e,r = execWithCaptureErrorStatusProgress('/sbin/e2fsck', args, msg)
137++ if not (r==0 or r==1):
138++ raise CommandError('FATAL', FSCHECK_FAILURE % (cmdstr,e))
139++
140++ new_size_kb = new_size_bytes / 1024
141++ args = list()
142++ args.append('/sbin/resize2fs')
143++ args.append(dev_path)
144++ args.append(str(new_size_kb) + 'K')
145++ cmdstr = ' '.join(args)
146++ msg = RESIZING_FS % (self.name)
147++ o,e,r = execWithCaptureErrorStatusProgress('/sbin/resize2fs', args, msg)
148++ if r != 0:
149++ raise CommandError('FATAL', FSRESIZE_FAILURE % (cmdstr,e))
150++
151++ def get_label(self, devpath):
152++ args = ['/sbin/tune2fs']
153++ args.append('-l')
154++ args.append(devpath)
155++ o, r = execWithCaptureStatus('/sbin/tune2fs', args)
156++ if r == 0:
157++ lines = o.splitlines()
158++ for line in lines:
159++ if re.search('volume name', line, re.I):
160++ words = line.split()
161++ label = words[len(words) - 1]
162++ if re.match('<none>', label, re.I):
163++ return None
164++ else:
165++ return label
166++ return None
167++
168+ class ext3(Filesystem):
169+ def __init__(self):
170+ creatable = self.check_path('/sbin/mkfs.ext3')
171+@@ -652,6 +756,66 @@
172+ return v
173+ return None
174+
175++class xfs(Filesystem):
176++ def __init__(self):
177++ creatable = self.check_path('/sbin/mkfs.xfs')
178++ mountable = self.check_mountable('xfs', 'xfs')
179++ extend_online = self.check_path('/usr/sbin/xfs_growfs')
180++
181++ Filesystem.__init__(self, 'XFS', creatable, True, mountable,
182++ extend_online, False, False, False,
183++ 'xfs')
184++
185++ def probe(self, path):
186++ result = execWithCapture("/usr/bin/file", ['/usr/bin/file', '-s', '-L', path])
187++ if re.search('SGI XFS', result, re.I):
188++ return True
189++
190++ def create(self, path):
191++ args = list()
192++ args.append("/sbin/mkfs")
193++ args.append("-t")
194++ args.append('xfs')
195++ args.append(path)
196++ cmdstr = ' '.join(args)
197++ msg = CREATING_FS % (self.name)
198++ o,e,r = execWithCaptureErrorStatusProgress("/sbin/mkfs", args, msg)
199++ if r != 0:
200++ raise CommandError('FATAL', FSCREATE_FAILURE % (cmdstr,e))
201++
202++ def extend_online(self, dev_path):
203++ cmd = '/usr/sbin/xfs_growfs'
204++ args = [cmd, dev_path]
205++ cmdstr = ' '.join(args)
206++ msg = RESIZING_FS % (self.name)
207++ o, e, s = execWithCaptureErrorStatusProgress(cmd, args, msg)
208++ if s != 0:
209++ raise CommandError('FATAL', FSRESIZE_FAILURE % (cmdstr, e))
210++
211++ def reduce_online(self, dev_path, new_size_bytes):
212++ # not supported
213++ raise 'NOT supported'
214++
215++ def extend_offline(self, dev_path):
216++ # not supported
217++ raise 'NOT supported'
218++
219++ def reduce_offline(self, dev_path, new_size_bytes):
220++ # not supported
221++ raise 'NOT supported'
222++
223++ def get_label(self, devpath):
224++ args = ['/usr/sbin/xfs_admin']
225++ args.append('-l')
226++ args.append(devpath)
227++ o, r = execWithCaptureStatus('/usr/sbin/xfs_admin', args)
228++ if r == 0:
229++ words = o.split()
230++ label = re.sub('\"', '', words[len(words) - 1])
231++ if label:
232++ return label
233++ return None
234++ return None
235+
236+
237+
238+

Subscribers

People subscribed via source and target branches

to all changes: