diff options
author | Mystery Man <unknown@mandriva.org> | 2005-10-20 14:05:54 +0000 |
---|---|---|
committer | Mystery Man <unknown@mandriva.org> | 2005-10-20 14:05:54 +0000 |
commit | 9b6a0d83d135fad376b4eadcb2bd7bd8c8a07aa5 (patch) | |
tree | f3ef7ada2ce82dafb6d41cc087b0cc7fdfc40a46 /kernel | |
parent | 3e4ad5e1b687f262a1d7cc39a0b905a595ac7f95 (diff) | |
download | drakx-backup-do-not-use-9b6a0d83d135fad376b4eadcb2bd7bd8c8a07aa5.tar drakx-backup-do-not-use-9b6a0d83d135fad376b4eadcb2bd7bd8c8a07aa5.tar.gz drakx-backup-do-not-use-9b6a0d83d135fad376b4eadcb2bd7bd8c8a07aa5.tar.bz2 drakx-backup-do-not-use-9b6a0d83d135fad376b4eadcb2bd7bd8c8a07aa5.tar.xz drakx-backup-do-not-use-9b6a0d83d135fad376b4eadcb2bd7bd8c8a07aa5.zip |
This commit was manufactured by cvs2svn to create tagV10_34_11_100mdk
'V10_34_11_100mdk'.
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/.cvsignore | 3 | ||||
-rw-r--r-- | kernel/Makefile | 13 | ||||
-rwxr-xr-x | kernel/check_mar.pl | 30 | ||||
-rw-r--r-- | kernel/dependencies.pl | 13 | ||||
-rw-r--r-- | kernel/list_modules.pm | 227 | ||||
-rw-r--r-- | kernel/modules.pl | 201 | ||||
-rwxr-xr-x | kernel/strip_modules | 124 | ||||
-rwxr-xr-x | kernel/update_kernel | 184 |
8 files changed, 0 insertions, 795 deletions
diff --git a/kernel/.cvsignore b/kernel/.cvsignore deleted file mode 100644 index 827e0ba13..000000000 --- a/kernel/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -modules.description -all.modules -all.kernels diff --git a/kernel/Makefile b/kernel/Makefile deleted file mode 100644 index a821d3939..000000000 --- a/kernel/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -all: all.modules - -all.modules: ../mdk-stage1/mar/mar update_kernel list_modules.pm - `../tools/specific_arch ./update_kernel` - -../mdk-stage1/mar/mar: - make -C `dirname $@` mar - -clean: - rm -rf *~ modules.description all.modules all.modules64 - -check: - perl modules.pl check > /dev/null diff --git a/kernel/check_mar.pl b/kernel/check_mar.pl deleted file mode 100755 index 7b9fefbbf..000000000 --- a/kernel/check_mar.pl +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/perl - -use MDK::Common; - -my $mar = '../mdk-stage1/mar/mar'; --x $mar or die "ERROR: Sorry, need $mar binary\n"; - -my %sanity_check = ( - cdrom => [ - qw(aic7xxx), - if_(arch() !~ /ppc|x86_64/, 'advansys'), - ], - all => [ - qw(3c59x eepro100 tulip via-rhine ne2k-pci 8139too), - if_(arch() !~ /ppc/, 'e100'), - if_(arch() !~ /ppc|ia64/, 'tlan'), - ], -); - -my $main_version = chomp_(cat_("all.kernels/.main")); - -foreach (keys %sanity_check) { - my $marfile = "all.modules/$main_version/${_}_modules.mar"; - -e $marfile or die "ERROR: missing $marfile\n"; - - my @l = map { /(\S+)\.k?o/ } `$mar -l $marfile`; - my @pbs = difference2($sanity_check{$_}, \@l); - - @pbs and die "ERROR: sanity check should prove that " . join(" ", @pbs) . " be part of $marfile\n"; -} diff --git a/kernel/dependencies.pl b/kernel/dependencies.pl deleted file mode 100644 index e3be14212..000000000 --- a/kernel/dependencies.pl +++ /dev/null @@ -1,13 +0,0 @@ -use strict; - -use MDK::Common; -use list_modules; - -my $version = shift @ARGV; -my $depfile = shift @ARGV; -load_dependencies($depfile); -print STDERR "Loaded dependencies from $depfile\n"; - -my @modules = uniq(map { dependencies_closure($_) } @ARGV); -print join " ", map { $_ . ($version == 24 ? '.o' : '.ko') } @modules; -print "\n"; diff --git a/kernel/list_modules.pm b/kernel/list_modules.pm deleted file mode 100644 index 613b220d7..000000000 --- a/kernel/list_modules.pm +++ /dev/null @@ -1,227 +0,0 @@ -package list_modules; - -use MDK::Common; - -our @ISA = qw(Exporter); -our @EXPORT = qw(load_dependencies dependencies_closure category2modules module2category sub_categories); - -# the categories have 2 purposes -# - choosing modules to include on stage1's (cf update_kernel and mdk-stage1/pci-resource/update-pci-ids.pl) -# - performing a load_category or probe_category (modules.pm and many files in perl-install) - -our %l = ( - ################################################################################ - network => - { - main => [ - if_(arch() =~ /ppc/, qw(mace bmac gmac)), - if_(arch() =~ /^sparc/, qw(sunbmac sunhme sunqe)), - if_(arch() !~ /alpha|sparc/, - qw(3c501 3c503 3c505 3c507 3c509 3c515 3c90x), - qw(82596 abyss ac3200 acenic aironet4500_card at1700 atp com20020-pci), - qw(cs89x0 de600 de620), - qw(defxx), # most unused - qw(depca dgrs dmfe e100 e2100 eepro eepro100 eexpress epic100 eth16i), - qw(ewrk3 hamachi hp hp-plus hp100 ibmtr), - qw(lance natsemi ne ne2k-pci ni5010 ni52 ni65 nvnet olympic pcnet32 plip rcpci), - qw(sb1000 sis900 smc-ultra smc9194 starfire tlan tmspci tulip via-rhine), - qw(wd winbond-840 forcedeth), - qw(fealnx 3c990 3c990fx b44 bcm4400), - qw(skfp tc35815 lanstreamer farsync sdladrv prism2_plx), - - qw(iph5526), #- fibre channel - ), - qw(3c59x 8139too 8139cp sundance), #rtl8139 - ], - gigabit => [ - qw(dl2k myri_sbus yellowfin ns83820 r8169 tg3 e1000 sk98lin), - qw(bcm5820 bcm5700), #- encrypted - ], - - raw => [ - qw(ppp_generic ppp_async), - ], - pcmcia => [ - qw(3c574_cs 3c589_cs axnet_cs fmvj18x_cs), - qw(ibmtr_cs nmclan_cs pcnet_cs smc91c92_cs), - qw(xirc2ps_cs xircom_cb xircom_tulip_cb), - ], - usb => [ - qw(catc CDCEther kaweth pegasus rtl8150 usbnet), - ], - wireless => [ - qw(acx100_pci airo airo_cs aironet4500_cs aironet_cs at76c503 at76c503-rfmd atmel_cs), - qw(hermes netwave_cs orinoco orinoco_cs orinoco_pci orinoco_plx prism2_usb prism54 ray_cs usbvnet_rfmd vt_ar5k wavelan_cs wvlan_cs), - if_(arch() =~ /ppc/, qw(airport)), - ], - isdn => [ - qw(b1pci c4 hisax hisax_fcpcipnp hysdn t1pci tpam divas), - ], - }, - - ################################################################################ - disk => - { - scsi => [ - if_(arch() =~ /ppc/, qw(mesh mac53c94)), - if_(arch() =~ /^sparc/, qw(qlogicpti)), - if_(arch() !~ /alpha/ && arch() !~ /sparc/, - qw(3w-xxxx AM53C974 BusLogic NCR53c406a a100u2w advansys aha152x aha1542 aha1740), - qw(atp870u dc395x_trm dtc g_NCR5380 in2000 initio pas16 pci2220i psi240i fdomain), - qw(qla1280 qla2x00 qlogicfas qlogicfc), - qw(seagate wd7000 sim710 sym53c416 t128 tmscsim u14-34f ultrastor), - qw(eata eata_pio eata_dma mptscsih nsp32), - qw(ata_piix sata_promise sata_svw sata_via), - ), - '53c7,8xx', - qw(aic7xxx aic7xxx_old aic79xx pci2000 qlogicisp sym53c8xx lpfcdd), # ncr53c8xx - ], - hardware_raid => [ - if_(arch() =~ /^sparc/, qw(pluto)), - if_(arch() !~ /alpha/ && arch() !~ /sparc/, - qw(DAC960 dpt_i2o megaraid aacraid cciss cpqarray gdth i2o_block), - qw(cpqfc qla2200 qla2300 pdc-ultra), - qw(ips ppa imm), - if_(c::kernel_version =~ /^\Q2.4/, - qw(ataraid hptraid silraid pdcraid) - ), - ), - ], - pcmcia => [ qw(aha152x_cs fdomain_cs nsp_cs qlogic_cs ide-cs) ], #ide_cs - raw => [ qw(scsi_mod sd_mod) ], - usb => [ qw(usb-storage) ], - firewire => [ qw(sbp2) ], - cdrom => [ qw(ide-cd cdrom sr_mod) ], - }, - - ################################################################################ - - bus => - { - usb => [ qw(usbcore usb-uhci usb-ohci ehci-hcd uhci-hcd ohci-hcd usbkbd keybdev input) ], - firewire => [ qw(ohci1394 ieee1394) ], - pcmcia => [ - if_(arch() !~ /^sparc/, qw(pcmcia_core tcic ds i82365 i82092 yenta_socket)), # cb_enabler - ], - #serial_cs - #ftl_cs 3c575_cb apa1480_cb epic_cb serial_cb tulip_cb iflash2+_mtd iflash2_mtd - #cb_enabler - }, - - fs => - { - network => [ qw(af_packet nfs lockd sunrpc) ], - cdrom => [ qw(isofs) ], - loopback => [ qw(isofs loop), if_($ENV{MOVE}, qw(cryptoloop gzloop supermount)) ], - local => [ - if_(arch() =~ /^i.86|x86_64/, qw(vfat fat)), - if_(arch() =~ /^ppc/, qw(hfs)), - qw(reiserfs), - ], - various => [ qw(smbfs romfs jbd xfs) ], - - }, - - ################################################################################ - multimedia => - { - sound => [ - if_(arch() =~ /ppc/, qw(dmasound_pmac)), - if_(arch() !~ /^sparc/, - qw(ad1816 ad1848 ad1889 ali5455 awe_wave audigy cmpci cs46xx cs4232 cs4281 emu10k1 es1370 es1371 esssolo1 forte), - qw(gus i810_audio ice1712 kahlua mad16 maestro maestro3 mpu401 msnd_pinnacle nvaudio opl3 opl3sa opl3sa2 nm256_audio), - qw(pas2 pss rme96xx sb sgalaxy sam9407 sonicvibes sscape trident via82cxxx_audio wavefront ymfpci), - qw(snd-ali5451 snd-als100 snd-als4000 snd-azt2320 snd-azt3328 snd-cmi8330 snd-cmipci), - qw(snd-cs4231 snd-cs4232 snd-cs4236 snd-cs46xx snd-dt0197h snd-cs4281 snd-emu10k1), - qw(snd-ad1816a snd-ad1848 snd-gusclassic snd-gusextreme snd-gusmax snd-interwave), - qw(snd-mpu401 snd-opti93x snd-rme9652 snd-sb8 snd-sbawe), - qw(snd-ens1370 snd-ens1371 snd-es18xx snd-es968 snd-es1938 snd-es1968 snd-es1688), - qw(snd-fm801 snd-hdsp snd-ice1712 snd-ice1724 snd-intel8x0 snd-korg1212 snd-maestro3), - qw(snd-nm256 snd-rme96 snd-rme32 snd-opl3sa2 snd-sb16 snd-sgalaxy snd-sonicvibes), - qw(snd-trident audio snd-via82xx snd-vx222 snd-wavefront snd-ymfpci), - qw(snd-au8810 snd-au8820 snd-au8830), - ), - ], - tv => [ qw(bttv cpia_usb cyber2000fb ibmcam mod_quickcam ov511 ov518_decomp pwc saa7134 ultracam usbvideo) ], - photo => [ qw(dc2xx mdc800) ], - radio => [ qw(radio-maxiradio) ], - scanner => [ qw(scanner microtek) ], - joystick => [ qw(ns558 emu10k1-gp iforce) ], - }, - - various => - # just here for classification, unused categories (nor auto-detect, nor load_thiskind) - { - raid => [ - qw(linear raid0 raid1 raid5 lvm-mod md multipath xor), - ], - mouse => [ - qw(busmouse msbusmouse logibusmouse serial qpmouse atixlmouse), - ], - char => [ - if_(arch() =~ /ia64/, qw(efivars)), - qw(amd768_rng applicom n_r3964 nvram pc110pad ppdev), - qw(mxser moxa isicom wdt_pci epca synclink istallion sonypi i810-tco sx), #- what are these??? - ], - other => [ - qw(defxx i810_rng i810fb ide-floppy ide-scsi ide-tape loop lp nbd sg st), - qw(parport parport_pc parport_serial), - qw(btaudio), - - #- these need checking - qw(pcilynx sktr rrunner meye 3c559 buz paep), - ], - agpgart => [ - if_(arch() =~ /alpha/, qw(alpha-agp)), - if_(arch() =~ /ia64/, qw(hp-agp i460-agp)), - if_(arch() =~ /ppc/, qw(uninorth-agp)), - - qw(agpgart ali-agp amd64-agp amd-k7-agp ati-agp intel-agp), - qw(nvidia-agp sworks-agp sis-agp via-agp), - ], - }, -); - -my %dependencies; - -sub load_dependencies { - my ($file) = @_; - - %dependencies = map { - my ($f, $deps) = split ':'; - $f => [ split ' ', $deps ]; - } cat_($file); -} - -sub dependencies_closure { - my @l = map { dependencies_closure($_) } @{$dependencies{$_[0]} || []}; - (@l, $_[0]); -} - -sub category2modules { - map { - my ($t1, $t2s) = m|(.*)/(.*)|; - map { - my $l = $l{$t1}{$_} or die "bad category $t1/$_\n" . backtrace(); - @$l; - } split('\|', $t2s); - } split(' ', $_[0]); -} - -sub module2category { - my ($module) = @_; - foreach my $t1 (keys %l) { - my $h = $l{$t1}; - foreach my $t2 (keys %$h) { - $module eq $_ and return "$t1/$t2" foreach @{$h->{$t2}}; - } - } - return; -} - -sub sub_categories { - my ($t1) = @_; - keys %{$l{$t1}}; -} - -1; diff --git a/kernel/modules.pl b/kernel/modules.pl deleted file mode 100644 index edca4f713..000000000 --- a/kernel/modules.pl +++ /dev/null @@ -1,201 +0,0 @@ -use strict; - - -BEGIN { - #- for testing purpose - (my $f = __FILE__) =~ s|/[^/]*$||; - push @INC, $f; -} - -use MDK::Common; -use list_modules; - -#- seldom used modules -#- we don't bother making a special floppy for those -my %modules_only_for_all_img = ( - - 'network/main' => [ - qw(olympic acenic), - qw(aironet4500_card com20020-pci hamachi starfire winbond-840), - - # token ring - qw(tmspci ibmtr abyss), - - if_(arch() =~ /x86_64/, qw(orinoco_plx)), # don't support laptop for now - if_(arch() =~ /x86_64/, qw(hp100 epic100)), # old (nico) - if_(arch() =~ /alpha|ppc/, qw(sb1000)), - qw(iph5526), - - qw(ac3200 at1700 atp ni5010 ni52 ni65), #- unused from Jeff - ], - - 'bus/pcmcia' => [ - if_(arch() =~ /x86_64/, qw(pcmcia_core ds tcic yenta_socket)), # don't support laptop for now - if_(arch() =~ /x86_64/, qw(i82092 i82365)), # doco says "older laptops" - ], - - 'disk/scsi' => [ - # ISA cards: - qw(NCR53c406a aha152x psi240i qlogicfas qlogicfc wd7000 sim710 t128 ultrastor), '53c7,8xx', - qw(qla2x00 in2000 pas16 a100u2w seagate g_NCR5380), - if_(arch() =~ /x86_64/, qw(53c7,8xx nsp32 initio advansys atp870u)), #- old - qw(AM53C974), # deprecated by tmscsim - qw(u14-34f), #- duplicate from ultrastor.o - #- still used, keeping them: qw(aha1542 sym53c416), - qw(lpfcdd), #- HUGE!! - - qw(dc395x_trm mptscsih BusLogic fdomain), - qw(pci2220i eata eata_pio eata_dma), - 'aic7xxx_old', 'qlogicisp', - 'dtc', - ], - - 'disk/hardware_raid' => [ - if_(arch() =~ /x86_64/, qw(ataraid)), #- old - qw(i2o_block qla2200 qla2300 cpqfc DAC960 gdth pdc-ultra), - ], -); - -#- modules that will only be available in stage2 -#- those modules are NOT in all.img, network.img... -#- there should only be modules that can't be used on stage1 -#- completly unused modules should be removed directly from the kernel -#- (and so be removed from stage2 too) -my %modules_removed_from_stage1 = ( - 'network/main' => [ - 'plip' - ], - - 'disk/hardware_raid' => [ - qw(imm ppa), - ], -); - -my @modules_always_on_stage1 = qw(floppy); - - -sub flatten_and_check { - my ($h) = @_; - map { - my $category = $_; - my @l = @{$h->{$category}}; - if (my @bad = difference2(\@l, [ category2modules($category) ])) { - foreach (@bad) { - if (my $cat = module2category($_)) { - warn "ERROR in modules.pl: module $_ is in category $cat, not in $category\n"; - } else { - warn "ERROR in modules.pl: unknown module $_\n"; - } - } - exit 1; - } - @l; - } keys %$h; -} - -my @modules_only_for_all_img = flatten_and_check(\%modules_only_for_all_img); -my @modules_removed_from_stage1 = flatten_and_check(\%modules_removed_from_stage1); - - -my %images = ( - pcmcia => 'fs/cdrom disk/cdrom|raw|pcmcia bus/pcmcia', - cdrom => 'fs/cdrom disk/cdrom|raw|scsi', - network => 'bus/usb|pcmcia disk/raw|usb', - network_drivers => 'fs/network network/main|pcmcia|usb|raw|gigabit', - all => 'fs/cdrom disk/cdrom|raw bus/usb disk/usb|scsi fs/loopback|local bus/pcmcia disk/pcmcia|hardware_raid fs/network network/main|pcmcia|usb|raw|gigabit bus/firewire disk/firewire', -); - -my $verbose = "@ARGV" =~ /-v/; -images() if "@ARGV" =~ /images/; -check() if "@ARGV" =~ /check/; -pci_modules4stage1($1) if "@ARGV" =~ /pci_modules4stage1:(.*)/; - -sub images() { - while (my ($image, $l) = each %images) { - my @modules = if_($image !~ /drivers/, @modules_always_on_stage1); - push @modules, map { category2modules($_) } split(' ', $l); - - @modules = difference2(\@modules, \@modules_removed_from_stage1); - - if ($image !~ /all/) { - @modules = difference2(\@modules, \@modules_only_for_all_img); - } - printf qq(%s_modules_raw="%s"\n), $image, join ' ', @modules; - } - printf qq(images="%s"\n), join(' ', keys %images); -} - -sub pci_modules4stage1 { - print "$_\n" foreach uniq(map { dependencies_closure($_) } difference2([ category2modules($_[0]) ], \@modules_removed_from_stage1)); -} - -sub check() { - my $error; - my %listed; - while (my ($t1, $l) = each %list_modules::l) { - while (my ($t2, $l) = each %$l) { - ref $l or die "bad $l in $t1/$t2"; - foreach (@$l) { - $listed{$_} = "$t1/$t2"; - } - } - } - - my %module2category; - my %deprecated_modules = %listed; - my $not_listed = sub { - my ($msg, $verbose, @l) = @_; - my %not_listed; - foreach (@l) { - my ($mod) = m|([^/]*)\.k?o(\.gz)?$| or next; - delete $deprecated_modules{$mod}; - next if $listed{$mod}; - s|.*?mdk(BOOT)?/||; - s|kernel/||; s|drivers/||; s|3rdparty/||; - $_ = dirname $_; - $_ = dirname $_ if $mod eq basename($_); - $module2category{$mod} = $_; - push @{$not_listed{$_}}, $mod; - } - if ($verbose) { - print "$msg $_: ", join(" ", @{$not_listed{$_}}), "\n" foreach sort keys %not_listed; - } - }; - $not_listed->('NOT LISTED', 1, `cd all.kernels/2.6* ; find -name "*.k?o" -o -name "*.k?o.gz"`); - $not_listed->('not listed', $verbose, `rpm -qpl /RPMS/kernel-2.6*`); - if (%deprecated_modules) { - my %per_cat; - push @{$per_cat{$listed{$_}}}, $_ foreach keys %deprecated_modules; - foreach my $cat (sort keys %per_cat) { - print "bad/old modules ($cat) : ", join(" ", sort @{$per_cat{$cat}}), "\n"; - } - } - - { - require '/usr/bin/merge2pcitable.pl'; - my $pcitable = read_pcitable("/usr/share/ldetect-lst/pcitable"); - my $usbtable = read_pcitable("/usr/share/ldetect-lst/usbtable"); - - my @l1 = uniq grep { !/:/ && $_ ne 'unknown' } map { $_->[0] } values %$pcitable; - if (my @l = difference2(\@l1, [ keys %listed ])) { - my %not_listed; - push @{$not_listed{$module2category{$_}}}, $_ foreach @l; - if (my $l = delete $not_listed{''}) { - print "bad/old pcitable modules : ", join(" ", @$l), "\n"; - } - print STDERR "PCITABLE MODULES NOT LISTED $_: ", join(" ", @{$not_listed{$_}}), "\n" foreach sort keys %not_listed; - #$error = 1; - } - - my @l2 = uniq grep { !/:/ && $_ ne 'unknown' } map { $_->[0] } values %$usbtable; - if (my @l = difference2(\@l2, [ keys %listed ])) { - my %not_listed; - push @{$not_listed{$module2category{$_}}}, $_ foreach @l; - if ($verbose) { - print "usbtable modules not listed $_: ", join(" ", @{$not_listed{$_}}), "\n" foreach sort keys %not_listed; - } - } - } - - exit $error; -} diff --git a/kernel/strip_modules b/kernel/strip_modules deleted file mode 100755 index 98e4f4496..000000000 --- a/kernel/strip_modules +++ /dev/null @@ -1,124 +0,0 @@ -#!/bin/sh -# -# Given a list of objects, strip all static symbols except those -# required by insmod. -# -# Copyright Keith Owens <kaos@ocs.com.au>. GPL. -# Sat Feb 1 12:52:17 EST 1997 -# -# Mainly intended for reducing the size of modules to save space -# on emergency and install disks. Be aware that removing the -# static symbols reduces the amount of diagnostic information -# available for oops. Not recommended for normal module usage. -# -# This code requires the modules use MODULE_PARM and EXPORT_. -# Do not strip modules that have not been converted to use -# MODULE_PARM or are using the old method of exporting symbols. -# In particular do not use on modules prior to 2.1.20 (approx). -# -# The objects are stripped in /tmp, only if the strip works is -# the original overwritten. If the command line to strip the -# symbols becomes too long, the strip is done in multiple passes. -# Running strip_module twice on the same object is safe (and a -# waste of time). -# - -sizeofptr="/tmp/$$.sizeofptr" -echo 'int main() { return sizeof(void *); }' | gcc -xc - -o $sizeofptr -$sizeofptr -export SIZEOF_POINTER=$? -rm -f $sizeofptr - -cat > /tmp/$$.awk <<\EOF -BEGIN { - strip = "/usr/bin/objcopy"; - nm = "/usr/bin/nm"; - cp = "/bin/cp"; - mv = "/bin/mv"; - rm = "/bin/rm"; - tmp = "/tmp"; - command_size = 400; # arbitrary but safe - - getline < "/proc/self/stat"; - pid = $1; - tmpcopy = tmp "/" pid ".object"; - nmout = tmp "/" pid ".nmout"; - - for (i = 1; i < ARGC; ++i) - strip_module(ARGV[i]); - - do_command(rm " -f " tmpcopy " " nmout); - - exit(0); -} - -function strip_module(object, - keep_symbol, to_strip, symbol, command, changed) { - do_command(cp " -a " object " " tmpcopy); - do_command(nm " " tmpcopy " > " nmout); - # delete array_name sometimes breaks, internal error, play safe - for (symbol in keep_symbol) - delete keep_symbol[symbol]; - for (symbol in to_strip) - delete to_strip[symbol]; - new_module_format = 0; - ptrskip = 2 + 2 * ENVIRON["SIZEOF_POINTER"]; - while ((getline < nmout) > 0) { - $0 = substr($0, ptrskip); - # b static variable, uninitialised - # d static variable, initialised - # r static array, initialised - # t static label/procedures - if ($1 ~ /[bdrt]/) - to_strip[$2] = ""; - else if ($2 ~ /R __ksymtab_/) - keep_symbol[substr($2, 11)] = ""; - else if ($0 ~ /R __module_parm_/) - keep_symbol[substr($2, 15)] = ""; - else if ($1 != "?") - keep_symbol[$2] = ""; - if ($2 ~ /__module/) - new_module_format = 1; - } - close(nmout); - command = ""; - changed = 0; - failure = 0; - if (new_module_format) { - for (symbol in to_strip) { - if (!(symbol in keep_symbol)) { - changed = 1; - if (length(command) > command_size) { - failure = failure || do_command(strip command " " tmpcopy); - command = ""; - } - command = command " --strip-symbol=" symbol; - } - } - } - if (command != "") { - changed = 1; - failure = failure || do_command(strip command " " tmpcopy); - } - if (changed && !failure) - do_command(mv " " tmpcopy " " object); -} - -function do_command(command) { - if ((ret = system(command)) != 0) { - giveup("command \"" command "\" failed " ret, ret); - return 1; - } - return 0; -} - -function giveup(message, ret) { - print "strip_module: " message > "/dev/stderr"; -# exit(ret); -} -EOF - -awk -f /tmp/$$.awk "$@" -ret=$? -rm -f /tmp/$$.awk -exit $ret diff --git a/kernel/update_kernel b/kernel/update_kernel deleted file mode 100755 index 5da807e71..000000000 --- a/kernel/update_kernel +++ /dev/null @@ -1,184 +0,0 @@ -#!/bin/bash - -ALL_KERNELS="all.kernels" -RPMS=/export/Mandrake/RPMS - -ARCH=`uname -m | sed -e 's/i.86/i386/' -e 's/sparc.*/sparc/'` - - -# move stuff to this new "kernel" directory -if [ ! -d all.kernels ]; then - if [ -d ../all.kernels ]; then - mv ../all.kernels . - rm -rf ../all.modules - else - # make sure "all.kernels" directory exists - mkdir all.kernels - fi -fi - -function create_marfile() { - marfile=$1 - shift - $GIBASEDIR/mdk-stage1/mar/mar -c $marfile $* -} - -function build_kernel_is_26() { - uname -r | grep -q '^2\.6' -} - -function kern_version() { - if echo $1 | grep -q ^2.4; then - version=24 - objects="*.o" - else - version=25 - objects="*.ko" - fi -} - -function create_modules() { - kernel_path=$1 - kern=$2 - echo "Updating modules in '`pwd`' for kernel '$kern'" - kern_version $kern - find $kernel_path/lib/modules/ -name "$objects" -exec cp -f {} . \; - if [ $version -eq 24 ]; then - /sbin/depmod-24 -F $kernel_path/boot/System.map* -e *.o | perl -pe 's/\\\n//' \ - | perl -ne 's/\.o//g; s/[ \t]+/ /g; print if /: /' > modules.dep - else - cp $kernel_path/lib/modules/*/modules.dep . - perl -ni -e 's|/\S+/([^/]+)\.k?o(\.gz)|$1|g; print if /: /' modules.dep - fi - perl -pi -e 's/((plip|ppa|imm): parport)/$1 parport_pc/' modules.dep - - if build_kernel_is_26; then - /sbin/modinfo $objects | perl -lne 'print "$name\t$1" if $name && /^description:\s*(.*)/; $name = $1 if m!^filename:\s*(.*)\.k?o!' > modules.description - else - /sbin/modinfo-$version -f '%{filename} %{description}\n' $objects | perl -lne 'print "$1\t$2" if /(.*?)\.k?o "(.*)"/' > modules.description - fi -} - -function create_modules_mar() { - kern_version $kern - - if [ $version -eq 24 ]; then - echo -n "stripping $kern: " - $GIBASEDIR/kernel/strip_modules *.o 2>/dev/null - echo "done" - else - echo "don't strip on 2.6 since it breaks modules" - fi - - if [ -z "$MOVE" ]; then - echo -n "packdrake $kern: " - ls $objects | packdrake -b9s "modules.cz" 400000 - echo "done" - mv modules.cz ../modules.cz-$kern - fi - for i in $images; do - eval "modules=\$${i}_modules_raw" - modules_with_deps=`perl -I $GIBASEDIR/kernel $GIBASEDIR/kernel/dependencies.pl $version modules.dep $modules` - eval "create_marfile ${i}_modules.mar $modules_with_deps" - done - echo -} - -function install_kernel() { - rpm=$1 - - ver=$(rpm -qp --qf '%{name}' $rpm 2>/dev/null | perl -pe 's/kernel(-(BOOT))?-((\.?[0-9]+){3})\.(.*)/$3-$5$2/') - [ -n "$ver" ] || return - - if [ -n "$2" ]; then - [ -d $ALL_KERNELS/$ver ] && return - main_ver=$2 - echo Removing previous kernel $ALL_KERNELS/$main_ver* - rm -rf $ALL_KERNELS/$main_ver* - fi - - rm -rf $ALL_KERNELS/$ver - echo "Installing kernel $ver" - mkdir -p $ALL_KERNELS/$ver - rpm2cpio $rpm | (cd $ALL_KERNELS/$ver ; cpio -id) - - find $ALL_KERNELS/$ver -type f -name "*.o.gz" -o -name "*.ko.gz" | xargs gunzip - - # will get back when make_boot_img is called - for dir in /tftpboot /var/lib/tftpboot; do - rm -f $dir/{vmlinuz,network.rdz,all.rdz} - done -} - -[ -e $ALL_KERNELS/.main ] && main=$(cat $ALL_KERNELS/.main) - -if [ "$1" = "--move" ]; then - MOVE=1 - shift -fi - -if [ "$ARCH" == "ia64" ] || [ "$ARCH" == "ppc" ]; then - name=kernel -else - name=kernel-BOOT -fi - -if [ -n "$1" ]; then - #- allow specifying a kernel file on commandline (./update_kernel /RPMS/kernel-2.4.22.10mdk-1-1mdk.i586.rpm) - install_kernel $1 -else - install_kernel $RPMS/kernel-BOOT-2.4*.rpm 2.4 - install_kernel $RPMS/kernel-BOOT-2.6*.rpm 2.6 -fi - -[ -n "$main" -a -e $ALL_KERNELS/$main ] || { - cd $ALL_KERNELS - main=$(echo 2.6* | sed 's/.* //') - [ -n "$main" ] || main=$(echo 2.4* | sed 's/.* //') - echo "Choosing $main" - echo $main > .main - cd .. -} - - -if [ "$ARCH" == "i386" ]; then - for i in $ALL_KERNELS/*/boot/vmlinuz*; do - #disable any existing resolution!!! - /usr/sbin/rdev -v $i 65535 #788 #785 - done -fi - - -GIBASEDIR=`pwd`/.. - -rm -rf all.modules ; mkdir all.modules -for i in $ALL_KERNELS/*; do - kern=`basename $i` - ( - mkdir all.modules/$kern - cd all.modules/$kern - - create_modules ../../$i $kern - ) || exit 1 -done -cp -f all.modules/$main/modules.description . - -l=`MOVE=$MOVE perl modules.pl images` || exit 1 -eval $l - -for i in $ALL_KERNELS/*; do - kern=`basename $i` - ( - cd all.modules/$kern - - if [ "$kern" = "$main" ]; then - create_modules_mar ../../$i $kern - else - echo "$kern ($main)" - create_modules_mar ../../$i $kern 2>/dev/null - fi - ) || exit 1 -done - - -./check_mar.pl |