aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-04-02 18:47:31 +0000
committerOlivier Blin <oblin@mandriva.com>2008-04-02 18:47:31 +0000
commitea39262aa589a279506a636eebdea8e4f09fd32c (patch)
tree8aa051bddf1a52b94de6694a18715c821237927f /lib
parente596bd5d8503711ad2f12f674a5a588825255ae3 (diff)
downloadiurt-ea39262aa589a279506a636eebdea8e4f09fd32c.tar
iurt-ea39262aa589a279506a636eebdea8e4f09fd32c.tar.gz
iurt-ea39262aa589a279506a636eebdea8e4f09fd32c.tar.bz2
iurt-ea39262aa589a279506a636eebdea8e4f09fd32c.tar.xz
iurt-ea39262aa589a279506a636eebdea8e4f09fd32c.zip
do not uses hacks if the dkms module is built for the wrong kernel, a warning mail is sent to maintainers instead
Diffstat (limited to 'lib')
-rw-r--r--lib/Iurt/DKMS.pm28
1 files changed, 5 insertions, 23 deletions
diff --git a/lib/Iurt/DKMS.pm b/lib/Iurt/DKMS.pm
index 9af638f..088ad06 100644
--- a/lib/Iurt/DKMS.pm
+++ b/lib/Iurt/DKMS.pm
@@ -206,20 +206,6 @@ sub dkms_compile {
# install kernel and dkms if not already installed
my $ok = 1;
- # some of the dkms modules does not handle correclty the -k option and use uname -r to
- # find kernel modules dir.
- # FIXME must send a mail to the maintainer for that problem
- # try to workarround with a symlink
- if ($kerver ne $modulesdir) {
- if (-e "$chroot_tmp/lib/modules/$kerver") {
- system("sudo mv $chroot_tmp/lib/modules/$kerver $chroot_tmp/lib/modules/$kerver.tmp");
- }
- if (system("sudo ln -sf $modulesdir $chroot_tmp/lib/modules/$kerver")) {
- plog('ERR', "ERROR: creating a link from $chroot_tmp/lib/modules/$modulesdir to $kerver failed ($!)");
- next;
- }
- }
-
# make sure dkms commands are not run in rpm post scripts
my $dkms_conf = $chroot_tmp . "/etc/dkms/framework.conf";
system("sudo sh -c 'mkdir -p `dirname $dkms_conf`; echo exit 0 > $dkms_conf'");
@@ -261,9 +247,11 @@ sub dkms_compile {
system($command);
}
- # now need to move dkms build if it wrongly assume a build for the running kernel
- plog("search module in /var/lib/dkms/$realname/$realversion/$kerver/");
if ($kerver ne $modulesdir && -d "$chroot_tmp/var/lib/dkms/$realname/$realversion/$kerver/") {
+ # some of the dkms modules do not handle correclty the -k option
+ # and use uname -r to find kernel modules dir
+ plog('ERR', "ERROR: modules have been built for current kernel ($kerver) instead of $modulesdir");
+ system("sudo rm -rf $chroot_tmp/var/lib/dkms/$realname/$realversion/$kerver");
require Text::Wrap;
sendmail("Iurt admins <$config->{admin}>", '' , "Iurt failure for $name",
Text::Wrap::wrap("", "", join('', map { "$_\n" }
@@ -271,7 +259,7 @@ sub dkms_compile {
"Please report to the maintainer of $name",
)),
"Iurt the rebuild bot <$config->{admin}>", 0);
- system("sudo mv $chroot_tmp/var/lib/dkms/$realname/$realversion/$kerver/ $chroot_tmp/var/lib/dkms/$realname/$realversion/$modulesdir/");
+ next;
}
$cache->{dkms}{"$realname-kernel-$modulesdir-$realversion"} = 1;
if (system("sudo chroot $chroot_tmp /usr/sbin/dkms mkrpm -m $realname -v $realversion --rpm_safe_upgrade -k $modulesdir")) {
@@ -298,12 +286,6 @@ sub dkms_compile {
join(" or ", map { "$chroot_tmp$_/*.rpm" } @dkms_rpm_dirs) .
" to $dkms_spool/$media ($!)\n") if !$copied;
- if ($kerver ne $modulesdir) {
- system("sudo rm -f $chroot_tmp/lib/modules/$kerver");
- if (-e "$chroot_tmp/lib/modules/$kerver.tmp") {
- system("sudo mv $chroot_tmp/lib/modules/$kerver.tmp $chroot_tmp/lib/modules/$kerver");
- }
- }
process_dkms_queue($self, 0, 0, $media, "$dkms_spool/$media");
# compile dkms modules
}