1 |
slords |
1.1 |
? tmp |
2 |
|
|
Index: anaconda.spec |
3 |
|
|
=================================================================== |
4 |
|
|
RCS file: /usr/local/CVS/anaconda/anaconda.spec,v |
5 |
|
|
retrieving revision 1.26.2.75 |
6 |
|
|
diff -u -p -r1.26.2.75 anaconda.spec |
7 |
|
|
--- anaconda.spec 4 Apr 2007 21:45:13 -0000 1.26.2.75 |
8 |
|
|
+++ anaconda.spec 10 Apr 2007 20:10:59 -0000 |
9 |
|
|
@@ -6,12 +6,12 @@ License: GPL |
10 |
|
|
Summary: Graphical system installer |
11 |
|
|
Group: Applications/System |
12 |
|
|
Source: anaconda-%{PACKAGE_VERSION}.tar.bz2 |
13 |
|
|
-BuildPreReq: pump-devel >= 0.8.20, kudzu-devel >= 1.1.95.16, pciutils-devel, bzip2-devel, e2fsprogs-devel, python-devel gtk2-devel rpm-python >= 4.2-0.61, newt-devel, rpm-devel, gettext >= 0.11, rhpl, booty, libxml2-python, zlib-devel, bogl-devel >= 0:0.1.9-17, bogl-bterm >= 0:0.1.9-17, elfutils-devel, beecrypt-devel, libselinux-devel >= 1.6, xorg-x11-devel |
14 |
|
|
+BuildPreReq: pump-devel >= 0.8.20, kudzu-devel >= 1.1.95.16, pciutils-devel, bzip2-devel, e2fsprogs-devel >= 1.35-12.6.el4, python-devel gtk2-devel rpm-python >= 4.2-0.61, newt-devel, rpm-devel, gettext >= 0.11, rhpl, booty, libxml2-python, zlib-devel, bogl-devel >= 0:0.1.9-17, bogl-bterm >= 0:0.1.9-17, elfutils-devel, beecrypt-devel, libselinux-devel >= 1.6, xorg-x11-devel |
15 |
|
|
%ifarch i386 |
16 |
|
|
BuildRequires: dietlibc |
17 |
|
|
%endif |
18 |
|
|
Requires: rpm-python >= 4.2-0.61, rhpl > 0.63, parted >= 1.6.3-7, booty, kudzu |
19 |
|
|
-Requires: pyparted, libxml2-python |
20 |
|
|
+Requires: pyparted, libxml2-python, dosfstools >= 2.8-17 |
21 |
|
|
Requires: anaconda-help, system-logos |
22 |
|
|
Obsoletes: anaconda-images <= 10 |
23 |
|
|
Url: http://fedora.redhat.com/projects/anaconda-installer/ |
24 |
|
|
Index: fsset.py |
25 |
|
|
=================================================================== |
26 |
|
|
RCS file: /usr/local/CVS/anaconda/fsset.py,v |
27 |
|
|
retrieving revision 1.237.4.6 |
28 |
|
|
diff -u -p -r1.237.4.6 fsset.py |
29 |
|
|
--- fsset.py 12 Feb 2007 22:11:03 -0000 1.237.4.6 |
30 |
|
|
+++ fsset.py 10 Apr 2007 20:10:59 -0000 |
31 |
|
|
@@ -101,7 +101,7 @@ class LabelFactory: |
32 |
|
|
def __init__(self): |
33 |
|
|
self.labels = None |
34 |
|
|
|
35 |
|
|
- def createLabel(self, mountpoint, maxLabelChars): |
36 |
|
|
+ def createLabel(self, mountpoint, maxLabelChars, kslabel = None): |
37 |
|
|
if self.labels == None: |
38 |
|
|
|
39 |
|
|
self.labels = {} |
40 |
|
|
@@ -112,6 +112,13 @@ class LabelFactory: |
41 |
|
|
labels = diskset.getLabels() |
42 |
|
|
del diskset |
43 |
|
|
self.reserveLabels(labels) |
44 |
|
|
+ |
45 |
|
|
+ # If a label was specified in the kickstart file, return that as |
46 |
|
|
+ # the label - unless it's already in the reserved list. If that's |
47 |
|
|
+ # the case, make a new one. |
48 |
|
|
+ if kslabel and kslabel not in self.labels: |
49 |
|
|
+ self.labels[kslabel] = 1 |
50 |
|
|
+ return kslabel |
51 |
|
|
|
52 |
|
|
if len(mountpoint) > maxLabelChars: |
53 |
|
|
mountpoint = mountpoint[0:maxLabelChars] |
54 |
|
|
@@ -433,7 +440,8 @@ class xfsFileSystem(FileSystemType): |
55 |
|
|
|
56 |
|
|
def labelDevice(self, entry, chroot): |
57 |
|
|
devicePath = entry.device.setupDevice(chroot) |
58 |
|
|
- label = labelFactory.createLabel(entry.mountpoint, self.maxLabelChars) |
59 |
|
|
+ label = labelFactory.createLabel(entry.mountpoint, self.maxLabelChars, |
60 |
|
|
+ kslabel = entry.label) |
61 |
|
|
db_cmd = "label " + label |
62 |
|
|
rc = iutil.execWithRedirect("/usr/sbin/xfs_db", |
63 |
|
|
["xfs_db", "-x", "-c", db_cmd, |
64 |
|
|
@@ -479,7 +487,8 @@ class jfsFileSystem(FileSystemType): |
65 |
|
|
|
66 |
|
|
def labelDevice(self, entry, chroot): |
67 |
|
|
devicePath = entry.device.setupDevice(chroot) |
68 |
|
|
- label = labelFactory.createLabel(entry.mountpoint, self.maxLabelChars) |
69 |
|
|
+ label = labelFactory.createLabel(entry.mountpoint, self.maxLabelChars, |
70 |
|
|
+ kslabel = entry.label) |
71 |
|
|
rc = iutil.execWithRedirect("/usr/sbin/jfs_tune", |
72 |
|
|
["jfs_tune", "-L", label, devicePath], |
73 |
|
|
stdout = "/dev/tty5", |
74 |
|
|
@@ -514,7 +523,8 @@ class extFileSystem(FileSystemType): |
75 |
|
|
|
76 |
|
|
def labelDevice(self, entry, chroot): |
77 |
|
|
devicePath = entry.device.setupDevice(chroot) |
78 |
|
|
- label = labelFactory.createLabel(entry.mountpoint, self.maxLabelChars) |
79 |
|
|
+ label = labelFactory.createLabel(entry.mountpoint, self.maxLabelChars, |
80 |
|
|
+ kslabel = entry.label) |
81 |
|
|
rc = iutil.execWithRedirect("/usr/sbin/e2label", |
82 |
|
|
["e2label", devicePath, label], |
83 |
|
|
stdout = "/dev/tty5", |
84 |
|
|
@@ -759,10 +769,13 @@ class FATFileSystem(FileSystemType): |
85 |
|
|
FileSystemType.__init__(self) |
86 |
|
|
self.partedFileSystemType = parted.file_system_type_get("fat32") |
87 |
|
|
self.formattable = 1 |
88 |
|
|
+ self.supported = 1 |
89 |
|
|
self.checked = 0 |
90 |
|
|
self.maxSizeMB = 1024 * 1024 |
91 |
|
|
self.name = "vfat" |
92 |
|
|
self.packages = [ "dosfstools" ] |
93 |
|
|
+ self.maxLabelChars = 11 |
94 |
|
|
+ self.migratetofs = ['vfat'] |
95 |
|
|
|
96 |
|
|
def formatDevice(self, entry, progress, chroot='/'): |
97 |
|
|
devicePath = entry.device.setupDevice(chroot) |
98 |
|
|
@@ -775,6 +788,101 @@ class FATFileSystem(FileSystemType): |
99 |
|
|
stderr = "/dev/tty5") |
100 |
|
|
if rc: |
101 |
|
|
raise SystemError |
102 |
|
|
+ |
103 |
|
|
+ def labelDevice(self, entry, chroot): |
104 |
|
|
+ if not iutil.getArch() == 'ia64': |
105 |
|
|
+ return |
106 |
|
|
+ devicePath = entry.device.setupDevice(chroot) |
107 |
|
|
+ label = labelFactory.createLabel(entry.mountpoint, self.maxLabelChars, |
108 |
|
|
+ kslabel = entry.label) |
109 |
|
|
+ |
110 |
|
|
+ rc = iutil.execWithRedirect("/usr/sbin/dosfslabel", |
111 |
|
|
+ ["dosfslabel", devicePath, label], |
112 |
|
|
+ stdout = "/dev/tty5", |
113 |
|
|
+ stderr = "/dev/tty5", |
114 |
|
|
+ searchPath = 1) |
115 |
|
|
+ newLabel = iutil.execWithCapture("/usr/sbin/dosfslabel", |
116 |
|
|
+ ["dosfslabel", devicePath], |
117 |
|
|
+ stderr = "/dev/tty5") |
118 |
|
|
+ newLabel = newLabel.strip() |
119 |
|
|
+ if label != newLabel: |
120 |
|
|
+ raise SystemError, "dosfslabel failed on device %s" % (devicePath,) |
121 |
|
|
+ entry.setLabel(label) |
122 |
|
|
+ |
123 |
|
|
+ def _readFstab(self, path): |
124 |
|
|
+ f = open (path, "r") |
125 |
|
|
+ lines = f.readlines () |
126 |
|
|
+ f.close() |
127 |
|
|
+ |
128 |
|
|
+ fstab = [] |
129 |
|
|
+ for line in lines: |
130 |
|
|
+ fields = string.split(line) |
131 |
|
|
+ |
132 |
|
|
+ if not fields: |
133 |
|
|
+ fstab.append(line) |
134 |
|
|
+ continue |
135 |
|
|
+ |
136 |
|
|
+ if line[0] == "#": |
137 |
|
|
+ fstab.append(line) |
138 |
|
|
+ # skip all comments |
139 |
|
|
+ continue |
140 |
|
|
+ |
141 |
|
|
+ # all valid fstab entries have 6 fields; if the last two are |
142 |
|
|
+ # missing they are assumed to be zero per fstab(5) |
143 |
|
|
+ if len(fields) < 4: |
144 |
|
|
+ fstab.append(line) |
145 |
|
|
+ continue |
146 |
|
|
+ elif len(fields) == 4: |
147 |
|
|
+ fields.append(0) |
148 |
|
|
+ fields.append(0) |
149 |
|
|
+ elif len(fields) == 5: |
150 |
|
|
+ fields.append(0) |
151 |
|
|
+ elif len(fields) > 6: |
152 |
|
|
+ fstab.append(line) |
153 |
|
|
+ continue |
154 |
|
|
+ fstab.append(fields) |
155 |
|
|
+ |
156 |
|
|
+ return fstab |
157 |
|
|
+ |
158 |
|
|
+ def migrateFileSystem(self, entry, message, chroot='/'): |
159 |
|
|
+ devicePath = entry.device.setupDevice(chroot) |
160 |
|
|
+ |
161 |
|
|
+ if not entry.fsystem or not entry.origfsystem: |
162 |
|
|
+ raise RuntimeError, ("Trying to migrate fs w/o fsystem or " |
163 |
|
|
+ "origfsystem set") |
164 |
|
|
+ if entry.fsystem.getName() != "vfat": |
165 |
|
|
+ raise RuntimeError, ("Trying to migrate vfat to something other " |
166 |
|
|
+ "than vfat") |
167 |
|
|
+ |
168 |
|
|
+ self.labelDevice(entry, chroot) |
169 |
|
|
+ |
170 |
|
|
+ if not entry.label: |
171 |
|
|
+ return |
172 |
|
|
+ |
173 |
|
|
+ try: |
174 |
|
|
+ os.stat(chroot + "/etc/fstab") |
175 |
|
|
+ except: |
176 |
|
|
+ return |
177 |
|
|
+ mounts = self._readFstab(chroot + "/etc/fstab") |
178 |
|
|
+ |
179 |
|
|
+ changed = False |
180 |
|
|
+ for mount in mounts: |
181 |
|
|
+ if type(mount) == types.ListType: |
182 |
|
|
+ if mount[0] == "/dev/%s" % (entry.device.getDevice(),): |
183 |
|
|
+ mount[0] = "LABEL=%s" % (entry.label,) |
184 |
|
|
+ changed = True |
185 |
|
|
+ |
186 |
|
|
+ if changed: |
187 |
|
|
+ os.rename(chroot + "/etc/fstab", chroot + "/etc/fstab.anaconda") |
188 |
|
|
+ f = open (chroot + "/etc/fstab", "w") |
189 |
|
|
+ for mount in mounts: |
190 |
|
|
+ if type(mount) == types.ListType: |
191 |
|
|
+ mount = string.join(mount, "\t") |
192 |
|
|
+ if mount[:-1] != "\n": |
193 |
|
|
+ mount += "\n" |
194 |
|
|
+ f.write(mount) |
195 |
|
|
+ f.close() |
196 |
|
|
+ |
197 |
|
|
|
198 |
|
|
fileSystemTypeRegister(FATFileSystem()) |
199 |
|
|
|
200 |
|
|
Index: partRequests.py |
201 |
|
|
=================================================================== |
202 |
|
|
RCS file: /usr/local/CVS/anaconda/partRequests.py,v |
203 |
|
|
retrieving revision 1.45.4.4 |
204 |
|
|
diff -u -p -r1.45.4.4 partRequests.py |
205 |
|
|
--- partRequests.py 6 Apr 2006 18:27:22 -0000 1.45.4.4 |
206 |
|
|
+++ partRequests.py 10 Apr 2007 20:10:59 -0000 |
207 |
|
|
@@ -194,6 +194,11 @@ class RequestSpec: |
208 |
|
|
|
209 |
|
|
if self.migrate: |
210 |
|
|
entry.setMigrate(self.migrate) |
211 |
|
|
+ elif iutil.getArch() == 'ia64' \ |
212 |
|
|
+ and entry.getMountPoint() == "/boot/efi" \ |
213 |
|
|
+ and isinstance(self.origfstype, fsset.FATFileSystem) \ |
214 |
|
|
+ and not entry.getFormat(): |
215 |
|
|
+ entry.setMigrate(1) |
216 |
|
|
|
217 |
|
|
if self.badblocks: |
218 |
|
|
entry.setBadblocks(self.badblocks) |
219 |
|
|
Index: isys/isys.py |
220 |
|
|
=================================================================== |
221 |
|
|
RCS file: /usr/local/CVS/anaconda/isys/isys.py,v |
222 |
|
|
retrieving revision 1.136.2.14 |
223 |
|
|
diff -u -p -r1.136.2.14 isys.py |
224 |
|
|
--- isys/isys.py 4 Apr 2007 20:43:23 -0000 1.136.2.14 |
225 |
|
|
+++ isys/isys.py 10 Apr 2007 20:11:00 -0000 |
226 |
|
|
@@ -685,12 +685,31 @@ def readSwapLabel(device, makeDevNode = |
227 |
|
|
def readExt2Label(device, makeDevNode = 1): |
228 |
|
|
if makeDevNode: |
229 |
|
|
makeDevInode(device, "/tmp/disk") |
230 |
|
|
- label = _isys.e2fslabel("/tmp/disk"); |
231 |
|
|
+ label = _isys.e2fslabel("/tmp/disk") |
232 |
|
|
os.unlink("/tmp/disk") |
233 |
|
|
else: |
234 |
|
|
label = _isys.e2fslabel(device) |
235 |
|
|
return label |
236 |
|
|
|
237 |
|
|
+def _readFATLabel(device): |
238 |
|
|
+ label = iutil.execWithCapture("/usr/sbin/dosfslabel", |
239 |
|
|
+ ["dosfslabel", device], stderr="/dev/tty5") |
240 |
|
|
+ label = label.strip() |
241 |
|
|
+ if len(label) == 0: |
242 |
|
|
+ return None |
243 |
|
|
+ return label |
244 |
|
|
+ |
245 |
|
|
+def readFATLabel(device, makeDevNode = 1): |
246 |
|
|
+ if not iutil.getArch() == "ia64": |
247 |
|
|
+ return None |
248 |
|
|
+ if makeDevNode: |
249 |
|
|
+ makeDevInode(device, "/tmp/disk") |
250 |
|
|
+ label = _readFATLabel("/tmp/disk") |
251 |
|
|
+ os.unlink("/tmp/disk") |
252 |
|
|
+ else: |
253 |
|
|
+ label = _readFATLabel(device) |
254 |
|
|
+ return label |
255 |
|
|
+ |
256 |
|
|
def readFSLabel(device, makeDevNode = 1): |
257 |
|
|
label = readExt2Label(device, makeDevNode) |
258 |
|
|
if label is None: |
259 |
|
|
@@ -699,6 +718,8 @@ def readFSLabel(device, makeDevNode = 1) |
260 |
|
|
label = readXFSLabel(device, makeDevNode) |
261 |
|
|
if label is None: |
262 |
|
|
label = readJFSLabel(device, makeDevNode) |
263 |
|
|
+ if label is None: |
264 |
|
|
+ label = readFATLabel(device, makeDevNode) |
265 |
|
|
return label |
266 |
|
|
|
267 |
|
|
def ext2IsDirty(device): |
268 |
|
|
Index: scripts/upd-instroot |
269 |
|
|
=================================================================== |
270 |
|
|
RCS file: /usr/local/CVS/anaconda/scripts/upd-instroot,v |
271 |
|
|
retrieving revision 1.368.2.4 |
272 |
|
|
diff -u -p -r1.368.2.4 upd-instroot |
273 |
|
|
--- scripts/upd-instroot 30 Jan 2007 19:37:47 -0000 1.368.2.4 |
274 |
|
|
+++ scripts/upd-instroot 10 Apr 2007 20:11:00 -0000 |
275 |
|
|
@@ -278,6 +278,7 @@ sbin/badblocks |
276 |
|
|
sbin/busybox.anaconda |
277 |
|
|
sbin/clock |
278 |
|
|
sbin/debugfs |
279 |
|
|
+sbin/dosfslabel |
280 |
|
|
sbin/e2fsck |
281 |
|
|
sbin/e2fsadm |
282 |
|
|
sbin/e2label |