From 04060a90cd3b63b59403ee84ca5ddb6923252766 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Sun, 9 Nov 2008 15:03:51 -0500 Subject: [PATCH] Use the contents file for the Ksplice core module. Signed-off-by: Tim Abbott --- ksplice-apply.in | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/ksplice-apply.in b/ksplice-apply.in index fd6ca06..19f7982 100644 --- a/ksplice-apply.in +++ b/ksplice-apply.in @@ -37,6 +37,21 @@ chdir($tmpdir); my $ksplice = unpack_update($file); chdir($ksplice); +die "No contents file in $file\n" if (!-e "contents"); +open(CONTENTS, '<', "contents"); +my $core; +while () { + my @line = split(' ', $_); + if ($line[0] eq 'core') { + die "Multiple core modules in $file!" if (defined $core); + $core = { + module => $line[1], + file => $line[2], + }; + } +} +close(CONTENTS); + my $nounload = runstr("lsmod") =~ m/- $/m; (my $kid = $ksplice) =~s|ksplice[-_]([^-_]+)|$1|; @@ -51,12 +66,13 @@ if(update_loaded($kid)) { } runstr_err(qw(modprobe -q ksplice)) eq "" || die; -if (-e "ksplice-$kid.ko") { - if (runstr("lsmod") =~ m/^ksplice_$kid\s+/) { - die "Ksplice core module ksplice_$kid already loaded."; +if (defined $core) { + die "Could not find Ksplice core module $core->{file}\n" if (!-e $core->{file}); + if (runstr("lsmod") =~ m/^\Q$core->{module}\E\s+/) { + die "Ksplice core module $core already loaded."; } - if (!load_module("ksplice-$kid.ko", "debug=$debug")) { - die "Error loading Ksplice core for update $kid"; + if (!load_module($core->{file}, "debug=$debug")) { + die "Error loading Ksplice core module $core->{module} for update $kid"; } } -- 2.11.4.GIT