summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xanaconda4
-rw-r--r--loader2/loader.c16
-rw-r--r--packages.py38
3 files changed, 33 insertions, 25 deletions
diff --git a/anaconda b/anaconda
index 81d3badae..1ac466f01 100755
--- a/anaconda
+++ b/anaconda
@@ -490,8 +490,8 @@ for n in args:
method = method[:len(method) - 1]
os.unlink(filename)
elif (str == '--module'):
- (path, subdir, name) = string.split(arg, ":")
- extraModules.append((path, subdir, name))
+ (path, name) = string.split(arg, ":")
+ extraModules.append((path, name))
elif (str == '--nofallback'):
nofallback = 1
elif (str == "--nomount"):
diff --git a/loader2/loader.c b/loader2/loader.c
index 0f880a218..7e11f0cb8 100644
--- a/loader2/loader.c
+++ b/loader2/loader.c
@@ -1366,23 +1366,15 @@ int main(int argc, char ** argv) {
}
for (i = 0; i < modLoaded->numModules; i++) {
- struct moduleInfo * mi;
- char * where;
-
if (!modLoaded->mods[i].path) continue;
-
- mi = findModuleInfo(modInfo, modLoaded->mods[i].name);
- if (!mi) continue;
- if (mi->major == DRIVER_NET)
- where = "net";
- else if (mi->major == DRIVER_SCSI)
- where = "scsi";
- else
+ if (!strcmp(modLoaded->mods[i].path,
+ "/mnt/runtime/modules/modules.cgz")) {
continue;
+ }
*argptr++ = "--module";
*argptr = alloca(80);
- sprintf(*argptr, "%s:%s:%s", modLoaded->mods[i].path, where,
+ sprintf(*argptr, "%s:%s", modLoaded->mods[i].path,
modLoaded->mods[i].name);
argptr++;
diff --git a/packages.py b/packages.py
index d4b6b1d2d..ea858c0f3 100644
--- a/packages.py
+++ b/packages.py
@@ -1227,6 +1227,7 @@ def migrateXinetd(instPath, instLog):
def copyExtraModules(instPath, grpset, extraModules):
kernelVersions = grpset.kernelVersionList()
+ foundModule = 0
try:
f = open("/etc/arch")
@@ -1235,7 +1236,7 @@ def copyExtraModules(instPath, grpset, extraModules):
except IOError:
arch = os.uname()[2]
- for (path, subdir, name) in extraModules:
+ for (path, name) in extraModules:
if not path:
path = "/modules.cgz"
pattern = ""
@@ -1258,22 +1259,37 @@ def copyExtraModules(instPath, grpset, extraModules):
os.system(command)
for (n, tag) in kernelVersions:
- fromFile = "%s/lib/modules/%s/%s.o" % (instPath, n, name)
+ if tag == "up":
+ pkg = "kernel"
+ else:
+ pkg = "kernel-%s" %(tag,)
+
toDir = "%s/lib/modules/%s/updates" % \
(instPath, n)
to = "%s/%s.o" % (toDir, name)
- if (os.access(fromFile, os.R_OK) and
- os.access(toDir, os.X_OK)):
- log("moving %s to %s" % (fromFile, to))
- os.rename(fromFile, to)
+ if (os.path.isdir("%s/lib/modules/%s" %(instPath, n)) and not
+ os.path.isdir("%s/lib/modules/%s/updates" %(instPath, n))):
+ os.mkdir("%s/lib/modules/%s/updates" %(instPath, n))
+ if not os.path.isdir(toDir):
+ continue
- # the file might not have been owned by root in the cgz
- os.chown(to, 0, 0)
- else:
- log("missing DD module %s (this may be okay)" %
- fromFile)
+ arch = grpset.hdrlist[pkg][rpm.RPMTAG_ARCH]
+ for p in ("%s/%s.o" %(arch, name), "%s.o" %(name,)):
+ fromFile = "%s/lib/modules/%s/%s" % (instPath, n, p)
+
+ if (os.access(fromFile, os.R_OK)):
+ log("moving %s to %s" % (fromFile, to))
+ os.rename(fromFile, to)
+ # the file might not have been owned by root in the cgz
+ os.chown(to, 0, 0)
+ foundModule = 1
+ else:
+ log("missing DD module %s (this may be okay)" %
+ fromFile)
+ if foundModule == 1:
+ for (n, tag) in kernelVersions:
recreateInitrd(n, instPath)