summaryrefslogtreecommitdiffstats
path: root/kernel/list_modules.pm
blob: 11516e72c552286363a79953a988b4f929c67fee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
package list_modules; # $Id: list_modules.pm 268192 2010-05-04 09:37:32Z pterjan $

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 (detect_devices.pm and many files in perl-install)

our %l = (
  ################################################################################
  network => 
  {
    atm => [ qw(ambassador eni firestream fore_200e he horizon idt77252 iphase lanai nicstar solos-pci zatm) ],
    main => [
      if_(arch() =~ /ppc/, qw(bmac fec_mpc52xx ibm_emac mace oaknet sungem)),
      if_(arch() =~ /^sparc/, qw(sunbmac sunhme sunqe)),
      if_(arch() !~ /alpha|sparc/,
        qw(3c501 3c503 3c505 3c507 3c509 3c515 3c990 3c990fx),
        qw(82596 ac3200 acenic aironet4500_card amd8111e at1700 atl2 atp),
        qw(bcm4400 cassini cs89x0 cx82310_eth de600 de620),
        qw(depca dmfe e2100 eepro eexpress enic eth16i),
        qw(ewrk3 hp hp-plus hp100),
        qw(iph5526), #- fibre channel
        qw(jme lance ne ni5010 ni52 ni65 nvnet),
        qw(prism2_plx qlge r6040 rcpci rhineget),
        qw(sb1000 sc92031 smc-ultra smc9194 smsc9420 smsc95xx),
        qw(tc35815 tlan uli526x vmxnet3),
      ),
      if_(arch() !~ /alpha/,
        qw(b44 com20020-pci de2104x),
        qw(defxx), # most unused
        qw(dgrs e100 eepro100 epic100 fealnx hamachi natsemi),
        qw(ne2k-pci pcnet32 plip sis900 skfp starfire tulip),
        qw(typhoon via-rhine winbond-840 forcedeth),
        qw(sungem sunhme), # drivers for ultrasparc, but compiled in ix86 kernels...
      ),
      qw(3c59x 8139too 8139cp cpmac niu sundance), #rtl8139
      # add all phys
      qw(amd broadcom cicada davicom et1011c icplus lxt marvell micrel),
      qw(national qsemi realtek smsc ste10Xp vitesse),
    ],
    firewire => [ qw(eth1394 pcilynx) ],
    gigabit => [
      qw(atl1 atl1c atl1e be2net bna bnx2 bnx2x cxgb cxgb3 cxgb4 dl2k e1000 e1000e et131x igb ipg ixgb ixgbe),
      qw(myri_sbus myri10ge netxen_nic ns83820 pch_gbe qla3xxx r8169 s2io sfc sxg_nic),
      qw(sis190 sk98lin skge sky2 slicoss spidernet stmmac tehuti tg3 via-velocity virtio_net vxge yellowfin),
      qw(bcm5820 bcm5700), #- encrypted
    ],

    raw => [
      qw(ppp_generic ppp_async ppp_deflate bsd_comp),
    ],
    pcmcia => [ 
      qw(3c574_cs 3c589_cs axnet_cs fmvj18x_cs),
      qw(ibmtr_cs libertas_cs nmclan_cs pcnet_cs smc91c92_cs),
      qw(xirc2ps_cs xircom_cb xircom_tulip_cb),
    ],
   #- generic NIC detection for USB seems broken (class, subclass, 
   #- protocol reported are not accurate) so we match network adapters against
   #- known drivers :-(
    usb => [ 
      qw(asix catc cdc_ether dm9601 kaweth mcs7830 pegasus rtl8150 smsc75xx smsc95xx usbnet),
    ],
    wireless => [
      qw(acx-pci acx-usb adm8211 agnx airo airo_cs aironet4500_cs),
      qw(aironet_cs ar9170usb arlan arusb_lnx at76_usb at76c50x_usb ath5k ath6kl ath6kl_usb ath9k ath9k_htc),
      qw(ath_pci atmel_cs atmel_pci b43 b43legacy bcm43xx bcm_wimax brcm80211 brcmsmac brcmfmac carl9170 com20020_cs),
      qw(dyc_ar5 hostap_cs hostap_pci hostap_plx i2400m-usb ipw2100),
      qw(i2400m_usb ipw2200 ipw3945 iwl3945 iwl4965 iwlagn iwlwifi madwifi_pci),
      qw(mwifiex_usb mwl8k ndiswrapper netwave_cs orinoco orinoco_cs),
      qw(orinoco_nortel orinoco_pci orinoco_plx orinoco_tmd orinoco_usb p54pci),
      qw(p54usb prism2_cs prism2_pci prism2_usb prism54 qmi_wwan r8180),
      qw(r8187se r8192_pci r8192s_usb r8192u_usb r8712u ray_cs rndis_wlan rt2400 rt2400pci rt2500),
      qw(rt2500pci rt2500usb rt2570 rt2800pci rt2800usb rt2860 rt2860sta rt2870),
      qw(rt3070sta rt61 rt61pci rt73 rt73usb rtl8180 rtl8187 rtl8187se rtusb ),
      qw(rtl8192se rtl8192cu rtl8192de spectrum_cs usb8xxx usbvnet_rfmd vt6655_stage vt6656_stage vt_ar5k w35und),
      qw(wavelan_cs wl wl3501_cs wvlan_cs zd1201 zd1211rw),
      if_(arch() =~ /ppc/, qw(airport)),
    ],
    isdn => [
      qw(avmfritz c4 cdc-acm b1pci divas hfc4s8s_l1 hfc_usb hfc4s8s_l1 hisax hisax_st5481 hisax_fcpcipnp hysdn sedlfax t1pci tpam w6692pci),
      qw(avmfritz hfcpci hfcmulti hfcsusb mISDNinfineon netjet), # mISDN
      qw(fcpci fcdsl fcdsl fcdsl2 fcdslsl fcdslslusb fcdslusb fcdslusba fcusb fcusb2 fxusb fxusb_CZ)
    ],
    cellular => [
      qw(hso nozomi option sierra),
    ],
    modem => [
      qw(ltmodem mwave sm56 ft1000),
    ],
    slmodem => [
      qw(slamr slusb snd-ali5451 snd-atiixp-modem snd-intel8x0m snd-via82xx-modem),
    ],
    wan => [ qw(c101 cosa cyclomx cycx_drv dlci dscc4 farsync hdlc hostess_sv11 lapbether lmc n2 pc300 pci200syn sbni sdla sdladrv sealevel syncppp wanxl z85230) ],
    usb_dsl => [ qw(cxacru speedtch ueagle-atm usbatm xusbatm) ],
    virtual => [ qw(xen-netfront) ],
  },

  ################################################################################
  disk => 
  {
    # ide drivers compiled as modules:
    ide => [
        qw(aec62xx ali14xx alim15x3 amd74xx atiixp cmd64x cy82c693 cs5520 cs5530 cs5535 cs5536),
        qw(delkin_cb dtc2278 hpt34x hpt366 ns87415 ht6560b it8172 it8213 it821x jmicron),
        qw(opti621 pdc202xx_new pdc202xx_old piix qd65xx rz1000 sc1200 serverworks siimage sis5513 slc90e66),
        qw(tc86c001 triflex trm290 tx4938ide tx4939ide umc8672 via82cxxx ide-pci-generic ide-generic),
    ],
    scsi => [
      if_(arch() =~ /ppc/, qw(mesh mac53c94)),
      if_(arch() =~ /^sparc/, qw(qlogicpti)),
      if_(arch() !~ /alpha|sparc/,
	'53c7,8xx',
        qw(a100u2w advansys aha152x aha1542 aha1740 AM53C974 atp870u),
        qw(be2iscsi bfa BusLogic dc395x dc395x_trm dmx3191d dtc eata eata_dma),
        qw(eata_pio fdomain g_NCR5380 in2000 initio mpt2sas mvsas NCR53c406a),
        qw(nsp32 pas16 pci2220i pm8001 psi240i qla1280 qla2x00 qla2xxx),
        qw(qlogicfas qlogicfc seagate shasta sim710 stex sym53c416),
        qw(t128 tmscsim u14-34f ultrastor vmw_pvscsi wd7000),
      ),
      qw(aic7xxx aic7xxx_old aic79xx pci2000 qlogicfas408 sym53c8xx lpfc lpfcdd), # ncr53c8xx
    ],
    sata => [
      # note that ata_piix manage RAID devices on ICH6R
      qw(ahci aic94xx ata_adma ata_piix pata_pdc2027x pdc_adma),
      qw(sata_fsl sata_inic162x sata_mv sata_nv sata_promise),
      qw(sata_qstor sata_sil sata_sil24 sata_sis sata_svw sata_sx4 sata_uli sata_via sata_vsc sx8),
      # new drivers: old ide drivers ported over libata:
      qw(ata_generic mv-ahci pata_ali pata_amd pata_artop pata_atiixp pata_atp867x),
      qw(pata_bf54x pata_cmd640 pata_cmd64x pata_cs5520 pata_cs5530),
      qw(pata_cs5535 pata_cs5536 pata_cypress pata_efar pata_hpt366),
      qw(pata_hpt37x pata_hpt3x2n pata_hpt3x3 pata_isapnp pata_it8172),
      qw(pata_it8213 pata_it821x pata_jmicron pata_legacy pata_marvell),
      qw(pata_mpiix pata_netcell pata_ninja32 pata_ns87410),
      qw(pata_ns87415 pata_oldpiix pata_opti pata_optidma),
      qw(pata_pdc2027x pata_pdc202xx_old pata_piccolo pata_platform pata_qdi),
      qw(pata_radisys pata_rdc pata_rz1000 pata_sc1200 pata_sch),
      qw(pata_serverworks pata_sil680 pata_sis pata_sl82c105),
      qw(pata_triflex pata_via pata_winbond),
      if_(arch() =~ /ppc/, 'sata_fsl'),
      qw(pata_acpi),
    ],
    hardware_raid => [
      if_(arch() =~ /^sparc/, qw(pluto)),
      if_(arch() !~ /alpha|sparc/,
        # 3w-xxxx drives ATA-RAID, 3w-9xxx and arcmsr drive SATA-RAID
        qw(3w-9xxx 3w-sas 3w-xxxx a320raid aacraid arcmsr cciss cpqarray),
        qw(cpqfc DAC960 dpt_i2o gdth hpsa hptiop i2o_block imm ipr ips isci),
        qw(it8212 it821x iteraid megaide megaraid megaraid_mbox),
        qw(megaraid_sas mptfc mptsas mptscsih mptspi pdc-ultra pmcraid ppa),
        qw(qla2100 qla2200 qla2300 qla2322 qla4xxx qla6312 qla6322),
      ),
    ],
    virtual => [ qw(hv_storvsc virtio_blk virtio_scsi xenblk) ],
    pcmcia => [ qw(aha152x_cs fdomain_cs nsp_cs qlogic_cs ide-cs pata_pcmcia sym53c500_cs) ],
    raw => [ qw(ide-gd_mod sd_mod) ],
    usb => [ qw(keucr uas ums-alauda ums-cypress ums-datafab ums-eneub6250 ums-freecom ums-isd200),
	     qw(ums-jumpshot ums-karma ums-onetouch ums-realtek ums-sddr09 ums-sddr55 ums-usbat usb-storage) ],
    firewire => [ qw(sbp2) ],
    cdrom => [ qw(ide-cd_mod sr_mod) ],
    card_reader => [ qw(sdhci sdhci-pci tifm_sd tifm_7xx1) ],
  },

  ################################################################################

  bus => 
  {
    usb => [ qw(c67x00 ehci-hcd fhci hwa-hc imx21-hcd isp116x-hcd isp1362-hcd
	    isp1760 ohci-hcd oxu210hp-hcd r8a66597-hcd renesas-usbhs sl811_cs
	    sl811-hcd u132-hcd uhci-hcd usb-ohci usb-uhci whci-hcd xhci-hcd) ],
    bluetooth => [ qw(bcm203x bfusb bpa10x btusb) ],
    firewire => [ qw(ohci1394) ],
    i2c => [
      qw(i2c-ali1535 i2c-ali1563 i2c-ali15x3 i2c-amd756 i2c-amd8111 i2c-i801 i2c-i810 i2c-nforce2),
      qw(i2c-piix4 i2c-prosavage i2c-savage4 i2c-sis5595 i2c-sis630 i2c-sis96x i2c-via i2c-viapro i2c-voodoo3),
      if_(arch() !~ /^ppc/, qw(i2c-hydra i2c-ibm_iic i2c-mpc)),
    ],
    pcmcia => [
      if_(arch() !~ /^sparc/, qw(au1x00_ss i82365 i82092 pd6729 tcic vrc4171_card vrc4173_cardu yenta_socket)), # cb_enabler
    ],
    hid => [ qw(ff-memless hid-a4tech hid-apple hid-aureal hid-belkin hid-cypress
	    hid-cherry hid hid-axff hid-dr hid-elecom hid-emsff hid-generic hid-holtekff
	    hid-hyperv hid-lcpower hid-magicmouse hid-multitouch hid-ortek
	    hid-picolcd hid-primax hid-prodikeys hid-roccat hid-roccat-arvo
	    hid-roccat-common hid-roccat-isku hid-roccat-kone
	    hid-roccat-koneplus hid-roccat-kovaplus hid-roccat-pyra
	    hid-speedlink hid-twinhan hid-waltop hid-wiimote hid-zydacron
	    hid-chicony hid-drff hid-ezkey hid-gaff hid-gyration hid-kensington
	    hid-keytouch hid-kye hid-logitech hid-logitech-dj hid-microsoft
	    hid-monterey hid-multilaser hid-ntrig hid-petalynx hid-pl hid-saitek 
	    hid-samsung hid-sjoy hid-sony hid-sunplus hid-tivo hid-tmff hid-topseed
	    hid-uclogic hid-wacom hid-zpff ) ],

   #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 smbfs) ],
    cdrom => [ qw(isofs) ],
    loopback => [ qw(isofs loop squashfs) ],
    local => [
      if_(arch() =~ /^ppc/, qw(hfs)),
      qw(btrfs ext3 ext4 jfs nilfs2 ntfs reiserfs vfat xfs),
    ],
    various => [ qw(romfs ufs unionfs fuse) ],

  },

  ################################################################################
  multimedia => 
  {
    sound => [
      if_(arch() =~ /ppc/, qw(dmasound_pmac snd-aoa snd-powermac)),
      if_(arch() =~ /sparc/, qw(snd-sun-amd7930 snd-sun-cs4231 snd-sun-dbri)),
      if_(arch() !~ /^sparc/,
          qw(ad1816 ad1848 ad1889 ali5455 audigy audio awe_wave cmpci cs4232 cs4281 cs46xx cx88-alsa),
          qw(emu10k1 es1370 es1371 esssolo1 forte gus i810_audio ice1712 kahlua mad16 maestro),
          qw(maestro3 mpu401 msnd_pinnacle nm256_audio nvaudio opl3 opl3sa opl3sa2 pas2 pss),
          qw(rme96xx sam9407 sb sgalaxy snd-ad1816a snd-ad1848 snd-ad1889 snd-ali5451 snd-als100 snd-als300),
          qw(snd-als4000 snd-atiixp snd-au8810 snd-au8820 snd-au8830 snd-audigyls snd-aw2 snd-azt2316 snd-azt2320 snd-azt3328 snd-azx),
          qw(snd-asihpi snd-at73c213 snd-bt87x snd-ca0106 snd-cmi8330 snd-cmi8788 snd-cmipci),
          qw(snd-cs4231 snd-cs4232 snd-cs4236 snd-cs4281 snd-cs46xx snd-cs5530 snd-cs5535audio),
          qw(snd_ctxfi),
          qw(snd-darla20 snd-darla24 snd-dt019x snd-echo3g snd-emu10k1 snd-emu10k1x),
          qw(snd-ens1370 snd-ens1371 snd-es1688 snd-es18xx snd-es1938 snd-es1968 snd-es968),
          qw(snd-fm801 snd-gina20 snd-gina24 snd-gina3g),
          qw(snd-gusclassic snd-gusextreme snd-gusmax),
          qw(snd-hda-intel snd-hdsp snd-hdspm snd-ice1712 snd-ice1724),
          qw(snd-indi snd-indigo snd-indigodj snd-indigodjx snd-indigoio snd-indigoiox snd-intel8x0 snd-interwave),
          qw(snd-interwave-stb snd-korg1212 snd-layla20 snd-layla24 snd-layla3g snd-lola snd-lx6464es),
          qw(snd-maestro3 snd-mia snd-mixart snd-mona snd-mpu401 snd-nm256),
          qw(snd-opl3sa2 snd-opti92x-ad1848 snd-opti92x-cs4231 snd-opti93x snd-oxygen snd-pcsp snd-pcxhr snd-riptide snd-rme32),
          qw(snd-rme96 snd-rme9652 snd-sb16 snd-sb8 snd-sbawe snd-sc6000 snd-sgalaxy snd-sis7019 snd-sonicvibes),
          qw(snd-sscape snd-trident snd-via82xx snd-virtuoso snd-vx222 snd-vxp440 snd-vxpocket snd-wavefront),
          qw(snd-ymfpci sonicvibes sscape trident via82cxxx_audio wavefront ymfpci),
      ),
  ],
    tv => [ qw(bt878 bttv cx23885 cx25821 cx8800 cx8802 cx88-blackbird dpc7146),
            qw(ivtv mxb pvrusb2 saa7134 saa7164 zr36067) ],
    dvb => [
        qw(b2c2-flexcop-pci b2c2-flexcop-usb budget budget-av),
        qw(budget-ci cinergyT2 dm1105 dvb-dibusb dvb-ttpci),
        qw(dvb-ttusb-budget dvb-usb-a800 dvb-usb-af9015 dvb-usb-ce6230),
        qw(dvb-usb-cinergyT2 dvb-usb-cxusb dvb-usb-dib0700),
        qw(dvb-usb-dibusb-mb dvb-usb-dibusb-mc dvb-usb-digitv),
        qw(dvb-usb-dtt200u dvb-usb-dtv5100 dvb-usb-ec168 dvb-usb-friio dvb-usb-gp8ps),
        qw(dvb-usb-nova-t-usb2 dvb-usb-ttusb2 dvb-usb-umt-010),
        qw(dvb-usb-vp702x dvb-usb-vp7045 earth-pt1 firedtv hexium_gemini),
        qw(hexium_orion pluto2 skystar2 smsusb ttusb_dec),
    ],
    photo => [ qw(dc2xx mdc800) ],
    radio => [ qw(radio-gemtek-pci radio-maestro radio-maxiradio radio-miropcm20 radio-usb-si470x) ],
    scanner => [ qw(scanner microtek) ],
    firewire => [ qw(snd-firewire-speakers snd-isight) ],
    gameport => [ qw(cs461x ns558 emu10k1-gp fm801-gp lightning ns558 vortex) ],
    usb_sound => [ qw(audio dabusb dsbr100 snd-usb-audio snd-usb-6fire snd-usb-caiaq snd-usb-usx2y usb-midi) ],
    webcam => [
        qw(cafe_ccic cpia2 cpia_usb cyber2000fb em28xx et61x251 gspca),
        qw(ibmcam konicawc mod_quickcam ov511 ov511-alt ov518_decomp),
        qw(ov51x-jpeg ovfx2 pwc qc-usb-messenger quickcam quickcam_messenger),
        # both STV06xx & stv06xx b/c drivers/media/video/gspca/stv06xx/stv06xx.h
        # wrongly use upcase letters:
        qw(se401 sn9c102 STV06xx stv06xx stv680 tcm825x ultracam),
        qw(usbvideo usbvision vicam w9968cf zc0301 zc3xx),
    ],
  },

  # USB input stuff get automagically loaded by hotplug and thus
  # magically work through /dev/input/mice multiplexing:
  input => {
      joystick => [
          qw(iforce xpad),
          # there're more drivers in drivers/input/joystick but they support non USB or PCI devices
          # and thus cannot be detected but by slow (and maybe dangerous?) load_category:
          qw(a3d adi analog cobra db9 gamecon gf2k grip grip_mp guillemot interact),
          qw(joydump magellan sidewinder spaceball spaceorb stinger tmdc turbografx warrior)
      ],
      remote => [ qw(ati_remote) ],
      # USB tablets and touchscreens:
      tablet => [ qw(acecad aiptek wacom kbtab) ],
      touchscreen => [ qw(ads7846_ts gunze hp680_ts_input itmtouch mk712 mtouch usbtouchscreen) ],
  },

  various => 
  # just here for classification, unused categories (nor auto-detect, nor load_thiskind)
  {
    raid => [
      qw(dm-crypt dm-log dm-log-userspace dm-mirror dm-mod dm-multipath dm-queue-length dm-raid dm-region-hash dm-round-robin),
      qw(dm-service-time dm-snapshot dm-zero faulty linear lvm-mod md-mod multipath md-mod raid0 raid10 raid1 raid456),
      # needed by raid456 and dm-raid 456 target
      qw(async_memcpy async_pq async_raid6_recov async_tx async_xor raid6_pq xor),
    ],
    mouse => [
      qw(atixlmouse busmouse generic_serial inport ioc3_serial logibm logibusmouse msbusmouse pcips2 qpmouse synclinkmp),
      if_(arch() =~ /ppc/, 'macserial'),
      qw(mousedev usbhid usbmouse synaptics_usb),
    ],
    char => [
      if_(arch() =~ /ia64/, qw(efivars)),
      qw(applicom n_r3964 nvram pc110pad ppdev),
      qw(wdt_pci i810-tco sx), #- what are these???
    ],
    crypto => [
      qw(aes-i586 aes-x86_64 aes_generic aesni_intel amd768_rng amd7xx_tco cbc cryptd hw_random i810_rng leedslite padlock sha256_generic xts),
    ],
    laptop => [
      qw(i8k sonypi toshiba),
    ],
    serial => [
      qw(8250_pci 8250 epca esp isicom istallion jsm moxa mxser mxser_new stallion sx synclink synclinkmp),
    ],
    other => [
      qw(defxx ide-floppy ide-scsi ide-tape loop lp nbd sg st),
      qw(parport_pc parport_serial),
      qw(btaudio mmc_block),

      'cryptoloop',
      if_(arch() =~ /sparc/, 'openprom'),

      qw(crc32c crc32c-intel),
      
      qw(evdev), qw(usblp printer), 'floppy', 'microcode',

      #- these need checking
      qw(rrunner meye),

      qw(virtio_pci virtio_balloon),
      qw(mei pch_phub),
    ],
    agpgart => [
      if_(arch() =~ /alpha/, qw(alpha-agp)),
      if_(arch() =~ /ia64/, qw(hp-agp i460-agp)),
      if_(arch() =~ /ppc/, qw(uninorth-agp)),

      qw(ali-agp amd64-agp amd-k7-agp ati-agp efficeon-agp intel-agp),
	 qw(k7-agp mch-agp nvidia-agp sis-agp sworks-agp via-agp),
    ],
  },
);

my %moddeps;

sub load_dependencies {
    my ($file, $o_root) = @_;

    %moddeps = ();
    foreach (cat_($o_root . $file)) {
	my ($m, $d) = split ':';
	my $path = $m;
	my ($filename, @fdeps) = map {
	    s![^ ]*/!!g;
	    s!\.ko!!g;
	    s!\.[gx]z!!g;
	    $_;
	} $m, split(' ', $d);

	my ($modname, @deps) = map { filename2modname($_) } $filename, @fdeps;
	$moddeps{$modname}{deps} = \@deps;
	$moddeps{$modname}{filename} = $filename;
	if (!begins_with($path, "/")) {
		#- with newer module-init-tools, modules.dep can contain
		#- relative paths
		$path = dirname($file) . '/' . $path;
	}
 	$moddeps{$modname}{path} = $path;
    }
}

sub dependencies_closure {
    my @l = map { dependencies_closure($_) } @{exists $moddeps{$_[0]} && $moddeps{$_[0]}{deps} || []};
    (@l, $_[0]);
}

sub filename2modname {
    my ($modname) = @_;
    $modname =~ s/-/_/g;
    $modname;
}

sub load_default_moddeps() {
    require c;
    load_dependencies('/lib/modules/' . c::kernel_version() . '/modules.dep');
}

sub modname2filename {
    load_default_moddeps() if !%moddeps;
    $moddeps{$_[0]}{filename};
}

sub modname2path {
    load_default_moddeps() if !%moddeps;
    $moddeps{$_[0]}{path};
}

sub category2modules {
    map {
	my ($t1, $t2s) = m|(.*)/(.*)|;
	my @sub = $t2s eq '*' ? keys %{$l{$t1}} : split('\|', $t2s);
	map {
	    my $l = $l{$t1}{$_} or die "bad category $t1/$_\n" . backtrace();
	    map { filename2modname($_) } @$l;
	} @sub;
    } split(' ', $_[0]);
}

sub all_modules() {
    map { @$_ } map { values %$_ } values %l;
}

sub module2category {
    my ($module) = @_;
    $module = filename2modname($module);
    foreach my $t1 (keys %l) {
	my $h = $l{$t1};
	foreach my $t2 (keys %$h) {
	  $module eq filename2modname($_) and return "$t1/$t2" foreach @{$h->{$t2}};
      }
    }
    return;
}

sub ethernet_categories() {
    'network/main|gigabit|pcmcia|usb|wireless|firewire';
}

sub sub_categories {
    my ($t1) = @_;
    keys %{$l{$t1}};
}

1;
s="hl opt">)) . ($individual ? "\n\n" . _("You will be able to choose them more specifically in the next step.") : ''), create_packtable({}, [ _("Percentage of packages to install") . ' ', $spin, "%", my $mb = new Gtk::Label ], [ undef, new Gtk::HScrollbar($adj) ], ), create_okcancel($w) ) ); $spin->signal_connect(changed => my $changed = sub { $val = $spin->get_value_as_int / 100 * $max_size_; $mb->set(sprintf("(%dMB)", pkgs::correctSize($val / sqr(1024)))); }); &$changed(); $spin->signal_connect(activate => sub { $w->{retval} = 1; Gtk->main_quit }); $spin->grab_focus(); $w->main and $val + 1; #- add a single byte (hack?) to make selection of 0 bytes ok. } sub reallyChooseGroups { my ($o, $size_to_display, $individual, $val) = @_; my $w = my_gtk->new(''); my $tips = new Gtk::Tooltips; my $w_size = new Gtk::Label(&$size_to_display); my $entry = sub { my ($e) = @_; my $text = translate($o->{compssUsers}{$e}{label}); my $help = translate($o->{compssUsers}{$e}{descr}); my $file = do { my $f = "$ENV{SHARE_PATH}/icons/" . ($o->{compssUsers}{$e}{icons} || 'default'); -e "$f.png" or $f .= "_section"; -e "$f.png" or $f = "$ENV{SHARE_PATH}/icons/default_section"; "$f.png"; }; my $check = Gtk::CheckButton->new($text); $check->set_active($val->{$e}); $check->signal_connect(clicked => sub { $val->{$e} = $check->get_active; $w_size->set(&$size_to_display); }); gtkset_tip($tips, $check, $help); gtkpack_(new Gtk::HBox(0,0), 0, gtkpng($file), 1, $check); #$check; }; my $entries_in_path = sub { my ($path) = @_; translate($path), map { $entry->($_) } grep { !/Utilities/ && $o->{compssUsers}{$_}{path} eq $path } @{$o->{compssUsersSorted}}; }; gtkadd($w->{window}, gtkpack($w->create_box_with_title(_("Package Group Selection")), gtkpack_(new Gtk::VBox(0,0), 1, gtkpack_(new Gtk::HBox(0,0), 1, gtkpack(new Gtk::VBox(0,0), $entries_in_path->('Workstation'), '', $entry->('Development|Development'), $entry->('Development|Documentation'), ), 0, gtkpack(new Gtk::VBox(0,0), $entries_in_path->('Server'), '', $entries_in_path->('Graphical Environment'), ), ), ), '', gtkadd(new Gtk::HBox(0,0), $w_size, if_($individual, do { my $check = Gtk::CheckButton->new(_("Individual package selection")); $check->set_active($$individual); $check->signal_connect(clicked => sub { $$individual = $check->get_active }); $check; }), gtksignal_connect(new Gtk::Button(_("Ok")), clicked => sub { Gtk->main_quit }), ), ), ); $w->{rwindow}->set_default_size($::windowwidth * 0.8, $::windowheight * 0.8); $w->main; 1; } sub choosePackagesTree { my ($o, $packages) = @_; $o->set_help('choosePackagesTree'); my ($curr, $parent, $info_widget, $w_size, $go, $idle, $flat); my $auto_deps = 1; my (%wtree, %ptree); my $w = my_gtk->new(''); my $details = new Gtk::VBox(0,0); my $tree = Gtk::CTree->new(3, 0); $tree->set_selection_mode('browse'); $tree->set_column_width(0, 200); $tree->set_column_auto_resize($_, 1) foreach 1..2; gtkadd($w->{window}, gtkpack_(new Gtk::VBox(0,5), 0, _("Choose the packages you want to install"), 1, gtkpack(new Gtk::HBox(0,0), createScrolledWindow($tree), gtkadd(gtkset_usize(new Gtk::Frame(_("Info")), $::windowwidth - 490, 0), createScrolledWindow($info_widget = new Gtk::Text), )), 0, my $l = new Gtk::HBox(0,15), 0, gtkpack(new Gtk::HBox(0,10), $go = gtksignal_connect(new Gtk::Button(_("Install")), "clicked" => sub { $w->{retval} = 1; Gtk->main_quit }), ) )); gtkpack__($l, my $toolbar = new Gtk::Toolbar('horizontal', 'icons')); gtkpack__($l, gtksignal_connect(gtkset_active(new Gtk::CheckButton(_("Show automatically selected packages")), $auto_deps), clicked => sub { invbool \$auto_deps })); $l->pack_end($w_size = new Gtk::Label(''), 0, 1, 20); $w->{window}->set_usize(map { $_ - 2 * $my_gtk::border - 4 } $::windowwidth, $::windowheight); $go->grab_focus; $w->{rwindow}->show_all; my $pix_base = [ gtkcreate_png("$ENV{SHARE_PATH}/rpm-base.png") ]; my $pix_selected = [ gtkcreate_png("$ENV{SHARE_PATH}/rpm-selected.png") ]; my $pix_unselect = [ gtkcreate_png("$ENV{SHARE_PATH}/rpm-unselected.png") ]; my $pix_semisele = [ gtkcreate_png("$ENV{SHARE_PATH}/rpm-semiselected.png") ]; my $pix_installed= [ gtkcreate_png("$ENV{SHARE_PATH}/rpm-installed.png") ]; my $add_parent; $add_parent = sub { $_[0] or return undef; if (my $w = $wtree{$_[0]}) { return $w } my $s; foreach (split '\|', $_[0]) { my $s2 = $s ? "$s|$_" : $_; $wtree{$s2} ||= do { my $n = $tree->insert_node($s ? $add_parent->($s) : undef, undef, [$_, '', ''], 5, (undef) x 4, 0, 0); $n; }; $s = $s2; } $tree->node_set_pixmap($wtree{$s}, 1, $pix_semisele->[0], $pix_semisele->[1]); $wtree{$s}; }; my $add_node = sub { my ($leaf, $root) = @_; my $p = pkgs::packageByName($packages,$leaf) or return; pkgs::packageMedium($p)->{selected} or return; my $node = $tree->insert_node($add_parent->($root), undef, [$leaf, '', ''], 5, (undef) x 4, 1, 0); my $pix = pkgs::packageFlagBase($p) ? $pix_base : pkgs::packageFlagSelected($p) ? $pix_selected : pkgs::packageFlagInstalled($p) ? $pix_installed : $pix_unselect; $tree->node_set_pixmap($node, 1, $pix->[0], $pix->[1]); push @{$ptree{$leaf}}, $node; }; my $add_nodes = sub { %ptree = %wtree = (); $tree->freeze; while (1) { $tree->remove_node($tree->node_nth(0) || last) } if ($flat = $_[0]) { $add_node->($_, undef) foreach sort grep { my $pkg = pkgs::packageByName($packages, $_); pkgs::packageMedium($pkg)->{selected} } keys %{$packages->{names}}; } else { foreach my $root (@{$o->{compssUsersSorted}}) { my (%fl, @firstchoice, @others); $fl{$_} = 1 foreach @{$o->{compssUsers}{$root}{flags}}; foreach my $p (values %{$packages->{names}}) { my ($rate, @flags) = pkgs::packageRateRFlags($p); next if !($rate && grep { grep { !/^!/ && $fl{$_} } split('\|\|') } @flags); $rate >= 3 ? push(@firstchoice, pkgs::packageName($p)) : push(@others, pkgs::packageName($p)); } $add_node->($_, $root ) foreach sort @firstchoice; $add_node->($_, $root . '|' . _("Other")) foreach sort @others; } } $tree->thaw; }; $add_nodes->($flat); my %toolbar = my @toolbar = ( ftout => [ _("Expand Tree") , sub { $tree->expand_recursive(undef) } ], ftin => [ _("Collapse Tree") , sub { $tree->collapse_recursive(undef) } ], reload=> [ _("Toggle between flat and group sorted"), sub { $add_nodes->(!$flat) } ], ); $toolbar->set_button_relief("none"); foreach (grep_index { $::i % 2 == 0 } @toolbar) { gtksignal_connect($toolbar->append_item(undef, $toolbar{$_}[0], undef, gtkpng("$ENV{SHARE_PATH}/$_.png")), clicked => $toolbar{$_}[1]); } $toolbar->set_style("icons"); my $display_info = sub { my $p = pkgs::packageByName($packages, $curr) or return gtktext_insert($info_widget, ''); pkgs::extractHeaders($o->{prefix}, [$p], pkgs::packageMedium($p)); pkgs::packageHeader($p) or die; my $imp = translate($pkgs::compssListDesc{pkgs::packageFlagBase($p) ? 5 : pkgs::packageRate($p)}); gtktext_insert($info_widget, $@ ? _("Bad package") : _("Name: %s\n", pkgs::packageName($p)) . _("Version: %s\n", pkgs::packageVersion($p) . '-' . pkgs::packageRelease($p)) . _("Size: %d KB\n", pkgs::packageSize($p) / 1024) . ($imp && _("Importance: %s\n", $imp)) . "\n" . formatLines(c::headerGetEntry(pkgs::packageHeader($p), 'description'))); pkgs::packageFreeHeader($p); #c::headerFree(delete $p->[$HEADER]); 0; }; my $update_size = sub { my $size = pkgs::selectedSize($packages); $w_size->set(_("Total size: %d / %d MB", pkgs::correctSize($size / sqr(1024)), install_any::getAvailableSpace($o) / sqr(1024))); }; my $select = sub { my %l; my $isSelection = !pkgs::packageFlagSelected($_[0]); foreach (@_) { pkgs::togglePackageSelection($packages, $_, my $l = {}); @l{grep {$l->{$_}} keys %$l} = (); } if (my @l = keys %l) { #- check for size before trying to select. my $size = pkgs::selectedSize($packages); foreach (@l) { my $p = $packages->{names}{$_}; pkgs::packageFlagSelected($p) or $size += pkgs::packageSize($p); } if (pkgs::correctSize($size / sqr(1024)) > install_any::getAvailableSpace($o) / sqr(1024)) { return $o->ask_warn('', _("You can't select this package as there is not enough space left to install it")); } @l > @_ && $auto_deps and $o->ask_okcancel('', [ $isSelection ? _("The following packages are going to be installed") : _("The following packages are going to be removed"), join(", ", common::truncate_list(20, sort @l)) ], 1) || return; $isSelection ? pkgs::selectPackage($packages, $_) : pkgs::unselectPackage($packages, $_) foreach @_; foreach (@l) { my $p = $packages->{names}{$_}; my $pix = pkgs::packageFlagSelected($p) ? $pix_selected : $pix_unselect; $tree->node_set_pixmap($_, 1, $pix->[0], $pix->[1]) foreach @{$ptree{$_}}; } &$update_size; } else { $o->ask_warn('', _("You can't select/unselect this package")); } }; my $children = sub { map { $packages->{names}{($tree->node_get_pixtext($_, 0))[0]} } gtkctree_children($_[0]) }; my $toggle = sub { if (ref $curr && ! $_[0]) { $tree->toggle_expansion($curr); } else { if (ref $curr) { my @l = grep { !pkgs::packageFlagBase($_) } $children->($curr) or return; my @unsel = grep { !pkgs::packageFlagSelected($_) } @l; my @p = @unsel ? @unsel : # not all is selected, select all @l; $select->(@p); $parent = $curr; } else { my $p = $packages->{names}{$curr} or return; if (pkgs::packageFlagBase($p)) { return $o->ask_warn('', _("This is a mandatory package, it can't be unselected")); } elsif (pkgs::packageFlagInstalled($p)) { return $o->ask_warn('', _("You can't unselect this package. It is already installed")); } elsif (pkgs::packageFlagUpgrade($p)) { if ($::expert) { if (pkgs::packageFlagSelected($p)) { $o->ask_yesorno('', _("This package must be upgraded\nAre you sure you want to deselect it?")) or return; } } else { return $o->ask_warn('', _("You can't unselect this package. It must be upgraded")); } } $select->($p); } if (my @l = $children->($parent)) { my $nb = grep { pkgs::packageFlagSelected($_) } @l; my $pix = $nb==0 ? $pix_unselect : $nb<@l ? $pix_semisele : $pix_selected; $tree->node_set_pixmap($parent, 1, $pix->[0], $pix->[1]); } } }; $tree->signal_connect(key_press_event => sub { my ($w, $e) = @_; my $c = chr($e->{keyval} & 0xff); $toggle->(0) if $e->{keyval} >= 0x100 ? $c eq "\r" || $c eq "\x8d" : $c eq ' '; 1; }); $tree->signal_connect(tree_select_row => sub { Gtk->timeout_remove($idle) if $idle; if ($_[1]->row->is_leaf) { ($curr) = $tree->node_get_pixtext($_[1], 0); $parent = $_[1]->row->parent; $idle = Gtk->timeout_add(100, $display_info); } else { $curr = $_[1]; } $toggle->(1) if $_[2] == 1; }); &$update_size; $w->main; } #------------------------------------------------------------------------------ sub beforeInstallPackages { my ($o) = @_; $o->SUPER::beforeInstallPackages; install_any::copy_advertising($o); } #------------------------------------------------------------------------------ sub installPackages { my ($o, $packages) = @_; my ($current_total_size, $last_size, $nb, $total_size, $start_time, $last_dtime, $trans_progress_total); my $w = my_gtk->new(_("Installing")); $w->sync; my $text = new Gtk::Label; my ($advertising, $change_time, $i); my $show_advertising = bool(@install_any::advertising_images); my ($msg, $msg_time_remaining, $msg_time_total) = map { new Gtk::Label($_) } '', (_("Estimating")) x 2; my ($progress, $progress_total) = map { new Gtk::ProgressBar } (1..2); $w->{rwindow}->set_policy(1, 1, 1); gtkadd($w->{window}, my $box = new Gtk::VBox(0,10)); $box->pack_end(gtkshow(gtkpack(gtkset_usize(new Gtk::VBox(0,5), $::windowwidth * 0.8, 0), $msg, $progress, create_packtable({}, [_("Time remaining "), $msg_time_remaining], # [_("Total time "), $msg_time_total], ), $text, $progress_total, gtkadd(create_hbox(), my $cancel = new Gtk::Button(_("Cancel")), my $details = new Gtk::Button(_("Details")), ), )), 0, 1, 0); $details->hide if !@install_any::advertising_images; $w->sync; $msg->set(_("Please wait, preparing installation")); gtkset_mousecursor_normal($cancel->window); my $advertize = sub { @install_any::advertising_images or return; $show_advertising ? $_->hide : $_->show foreach $msg, $progress, $text; gtkdestroy($advertising) if $advertising; if ($show_advertising && $_[0]) { $change_time = time(); my $f = $install_any::advertising_images[$i++ % @install_any::advertising_images]; log::l("advertising $f"); eval { gtkpack($box, $advertising = gtkpng($f)) }; } else { $advertising = undef; } }; $cancel->signal_connect(clicked => sub { $pkgs::cancel_install = 1 }); $details->signal_connect(clicked => sub { invbool \$show_advertising; $advertize->(1); }); $advertize->(); my $oldInstallCallback = \&pkgs::installCallback; local *pkgs::installCallback = sub { my $m = shift; if ($m =~ /^Starting installation/) { $nb = $_[0]; $total_size = $_[1]; $current_total_size = 0; $start_time = time(); $msg->set(_("%d packages", $nb)); $w->flush; } elsif ($m =~ /^Starting installing package/) { $progress->update(0); my $name = $_[0]; $msg->set(_("Installing package %s", $name)); $current_total_size += $last_size; my $p = pkgs::packageByName($o->{packages}, $name); $last_size = c::headerGetEntry(pkgs::packageHeader($p), 'size'); $text->set((split /\n/, c::headerGetEntry(pkgs::packageHeader($p), 'summary'))[0] || ''); $advertize->(1) if $show_advertising && $total_size > 20 * sqr(1024) && time() - $change_time > 20; $w->flush; } elsif ($m =~ /^Progressing installing package/) { $progress->update($_[2] ? $_[1] / $_[2] : 0); my $dtime = time() - $start_time; my $ratio = $total_size ? ($_[1] + $current_total_size) / $total_size : 0; $ratio >= 1 and $ratio = 1; my $total_time = $ratio ? $dtime / $ratio : time(); $progress_total->update($ratio); if ($dtime != $last_dtime && $current_total_size > 10 * sqr(1024)) { $msg_time_total->set(formatTime(10 * round($total_time / 10) + 10)); $msg_time_remaining->set(formatTime(10 * round(max($total_time - $dtime, 0) / 10) + 10)); $last_dtime = $dtime; } $w->flush; } else { unshift @_, $m; goto $oldInstallCallback } }; #- the modification is not local as the box should be living for other package installation. undef *install_any::changeMedium; *install_any::changeMedium = sub { my ($method, $medium) = @_; #- if not using a cdrom medium, always abort. $method eq 'cdrom' and do { local $my_gtk::grab = 1; my $name = pkgs::mediumDescr($o->{packages}, $medium); local $| = 1; print "\a"; my $time = time(); my $r = $name !~ /Application/ || ($o->{useless_thing_accepted2} ||= $o->ask_from_list_('', formatAlaTeX(_(" Warning Please read carefully the terms below. If you disagree with any portion, you are not allowed to install the next CD media. Press 'Refuse' to continue the installation without using these media. Some components contained in the next CD media are not governed by the GPL License or similar agreements. Each such component is then governed by the terms and conditions of its own specific license. Please read carefully and comply with such specific licenses before you use or redistribute the said components. Such licenses will in general prevent the transfer, duplication (except for backup purposes), redistribution, reverse engineering, de-assembly, de-compilation or modification of the component. Any breach of agreement will immediately terminate your rights under the specific license. Unless the specific license terms grant you such rights, you usually cannot install the programs on more than one system, or adapt it to be used on a network. In doubt, please contact directly the distributor or editor of the component. Transfer to third parties or copying of such components including the documentation is usually forbidden. All rights to the components of the next CD media belong to their respective authors and are protected by intellectual property and copyright laws applicable to software programs. ")), [ __("Accept"), __("Refuse") ], "Accept") eq "Accept"); $r &&= $o->ask_okcancel('', _("Change your Cd-Rom! Please insert the Cd-Rom labelled \"%s\" in your drive and press Ok when done. If you don't have it, press Cancel to avoid installation from this Cd-Rom.", $name)); #- add the elapsed time (otherwise the predicted time will be rubbish) $start_time += time() - $time; $r; }; }; my $install_result; catch_cdie { $install_result = $o->install_steps::installPackages($packages); } sub { if ($@ =~ /^error ordering package list: (.*)/) { $o->ask_yesorno('', [ _("There was an error ordering packages:"), $1, _("Go on anyway?") ], 1) and return 1; ${$_[0]} = "already displayed"; } elsif ($@ =~ /^error installing package list: (.*)/) { $o->ask_yesorno('', [ _("There was an error installing packages:"), $1, _("Go on anyway?") ], 1) and return 1; ${$_[0]} = "already displayed"; } 0; }; if ($pkgs::cancel_install) { $pkgs::cancel_install = 0; die "setstep choosePackages\n"; } $w->destroy; $install_result; } sub set_help { my ($o, @l) = @_; $o->{current_help} = formatAlaTeX(join "\n", map { _ deref($help::steps{$_}) } @l); gtktext_insert($o->{help_window_text}, $o->{current_help}); 1; } #-###################################################################################### #- Wonderful perl :( #-###################################################################################### 1; #