summaryrefslogtreecommitdiffstats
path: root/images/update_kernel
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2013-10-30 20:36:51 +0000
committerColin Guthrie <colin@mageia.org>2013-10-30 20:36:51 +0000
commit4fcf71c999dc5970a7ecce93ea51a9a4f4058b4f (patch)
treeccf41ec5186ac5895d83833538bab421d822de91 /images/update_kernel
parent3afd27c8728b52985ceb538512496990ade84197 (diff)
downloaddrakx-4fcf71c999dc5970a7ecce93ea51a9a4f4058b4f.tar
drakx-4fcf71c999dc5970a7ecce93ea51a9a4f4058b4f.tar.gz
drakx-4fcf71c999dc5970a7ecce93ea51a9a4f4058b4f.tar.bz2
drakx-4fcf71c999dc5970a7ecce93ea51a9a4f4058b4f.tar.xz
drakx-4fcf71c999dc5970a7ecce93ea51a9a4f4058b4f.zip
images: Clear out some stuff that no longer used.
Now that initrds are generated via dracut, there is no need to prepare kernel modules. This sadly removes support for passing in a kernel rpm file, but such is life.
Diffstat (limited to 'images/update_kernel')
-rwxr-xr-ximages/update_kernel38
1 files changed, 2 insertions, 36 deletions
diff --git a/images/update_kernel b/images/update_kernel
index 934f5195e..a16513eac 100755
--- a/images/update_kernel
+++ b/images/update_kernel
@@ -15,18 +15,14 @@ use list_modules;
my $rpm = 'rpm --nosignature';
-@ARGV or die "usage: ./update_kernel [--move] (<kernel rpm> ... | <installed kernel name> ...)\n";
+@ARGV or die "usage: ./update_kernel <installed kernel name> ...\n";
eval { rm_rf('all.kernels') }; #- remove old things
mkdir 'all.kernels';
my @kernels = map {
my $kern_ver = rpm2version($_);
- if (/\.rpm$/) {
- extract_kernel($_, $kern_ver);
- } else {
extract_installed_rpm('', $kern_ver);
- }
$kern_ver;
} @ARGV;
@@ -41,40 +37,10 @@ sub rpm2version {
`$rpm $opt $kernel_rpm` =~ m!/boot/vmlinuz-(.*)! && $1 or die "can't find vmlinuz in $kernel_rpm (is it installed?)\n";
}
-sub extract_kernel {
- my ($kernel_rpm, $kern_ver) = @_;
-
- my $dir = "all.kernels/$kern_ver";
-
- warn "Extracting kernel $kern_ver\n";
-
- eval { rm_rf($dir) };
- mkdir_p("$dir/modules");
- sys("rpm2cpio $kernel_rpm | (cd $dir ; cpio -id)");
-
- extract_installed_rpm($dir, $kern_ver);
-
- eval { rm_rf("$dir$_") } foreach qw(/boot /lib /usr);
-}
-
sub extract_installed_rpm {
my ($installed_dir, $kern_ver) = @_;
my $local_dir = "all.kernels/$kern_ver";
- mkdir_p("$local_dir/modules");
+ mkdir_p("$local_dir");
sys('cp', "$installed_dir/boot/vmlinuz-$kern_ver", "$local_dir/vmlinuz");
- sys("cp $installed_dir/lib/modules/$kern_ver/modules.* $local_dir");
-
- open(my $F, "find $installed_dir/lib/modules/$kern_ver -name '*.ko.?z' |");
- my $file; while ($file = <$F>) {
- chomp($file);
- system('cp', $file, "$local_dir/modules/" . basename($file)) == 0
- or warn "conflict for $file\n";
- }
-
- sys('perl', '../kernel/modules.pl', 'remove_unneeded_modules', $kern_ver);
- sys('perl', '../kernel/modules.pl', 'get_firmwares', $kern_ver);
- sys('perl', '../kernel/modules.pl', 'make_modules_per_image', $kern_ver);
-
- rm_rf("$local_dir/modules");
}