summaryrefslogtreecommitdiffstats
path: root/perl-install/partition_table
Commit message (Expand)AuthorAgeFilesLines
* - fix detecting existing LVMs (#31228)Pascal Rigaux2008-01-282-2/+0
* - detect raid partitions based on either type 0xfd or vol_id detectingPascal Rigaux2008-01-281-2/+1
* fix previous commitPascal Rigaux2008-01-221-1/+1
* handle missing mbr_signature in /sys/firmware/edd/int13_dev*Pascal Rigaux2008-01-221-1/+1
* fix fs::proc_partitions::use_() case: $hd must be cleaned up from existing stuffPascal Rigaux2007-09-241-1/+2
* - diskdrake :Pascal Rigaux2007-09-192-0/+7
* create partition_table_initialize() and partition_table_clear_and_initialize()Pascal Rigaux2007-09-191-4/+3
* it's better to inheritate from partition_table::readonly, that way we can doPascal Rigaux2007-09-181-4/+9
* create partition_table::readonly and use itPascal Rigaux2007-09-182-9/+27
* oops, this one goes with previous commitPascal Rigaux2007-09-181-7/+0
* rename partition_table::raw::clear() into partition_table::initialize()Pascal Rigaux2007-09-182-18/+3
* rename ->zero_MBR into ->clear, and ->zero_MBR_and_dirty into ->clear_and_dirtyPascal Rigaux2007-09-182-11/+15
* create clear_existing()Pascal Rigaux2007-09-181-2/+7
* handle "LVM on full disk" like other partition tablesPascal Rigaux2007-09-181-0/+12
* create partition_table::raw::read_primary out of partition_table::read_primary()Pascal Rigaux2007-09-181-0/+11
* create pt_info_to_primary() out of partition_table::read_one()Pascal Rigaux2007-09-181-0/+14
* rename ->read to ->read_onePascal Rigaux2007-09-186-6/+6
* transform ->clear_raw into the more generic ->initializePascal Rigaux2007-09-187-17/+28
* - diskdrake:Pascal Rigaux2007-08-086-0/+11
* - allow using diskdrake even if there is only a lvm PV on full disk availablePascal Rigaux2007-08-081-0/+25
* re-sync after the big svn lossPascal Rigaux2007-04-253-8/+19
* conectiva 10's grub detection (thanks to bogdano)Pascal Rigaux2005-08-251-0/+1
* move is_xbox from common to detect_devicesOlivier Blin2005-08-051-1/+1
* ignore HDIO_GETGEO fail (useful for dmraid)Pascal Rigaux2005-06-201-13/+16
* - move functions using /proc/partitions out of fsedit to fs::proc_partitionsPascal Rigaux2005-06-101-0/+1
* add some "use xxx;" (the idea is to see what the package needs, but i may rol...Pascal Rigaux2005-06-101-0/+1
* don't need prefixing with current packagePascal Rigaux2005-06-091-1/+1
* create default_type() out of zero_MBR()Pascal Rigaux2005-04-131-4/+8
* do not drop field {info} that can be created in zero_MBRPascal Rigaux2005-03-151-1/+1
* Diskdrake mods for XBox (thks Pixel)Stew Benedict2005-03-101-0/+5
* catch bad use of get_rawCHS()Pascal Rigaux2005-03-101-0/+3
* better english (writing style rather than spoken one)Thierry Vignaud2004-12-133-8/+8
* - geometry XXX/240/63 is quite common, so add 240 to @valid_nb_headsPascal Rigaux2004-11-261-2/+2
* detect on lilo on floppy (bugzilla #12213)Pascal Rigaux2004-11-231-0/+1
* add some ";", remove some ";", as told by perl_checkerPascal Rigaux2004-11-183-8/+8
* empty partition table means sectors #0 and #1 are zeroes, not simply sector #0Pascal Rigaux2004-11-161-2/+2
* handle more nicely raw_lvm_PV (don't simply ignore them)Pascal Rigaux2004-11-161-39/+0
* fix yaboot detectionPascal Rigaux2004-11-161-1/+2
* don't die when failing to open a device (to get its geometry), skip it insteadPascal Rigaux2004-09-291-8/+15
* fix typosPascal Rigaux2004-09-271-2/+3
* simplify and handle LVM2, *but* since creating a LVM2 PV on a non partitionedPascal Rigaux2004-09-271-7/+2
* fail if legacy_sectors_per_track or legacy_max_head doesn't exist instead of ...Pascal Rigaux2004-09-271-3/+4
* perl_checker compliancePascal Rigaux2004-09-271-1/+1
* don't call compute_nb_cylinders() before checking {sectors} and {heads} are v...Pascal Rigaux2004-09-271-2/+2
* remove the backtracePascal Rigaux2004-09-221-1/+1
* more loggingPascal Rigaux2004-09-221-1/+3
* try to get geometry from EDDPascal Rigaux2004-09-172-2/+61
* - add field {fs_type} partially replacing {pt_type}Pascal Rigaux2004-07-275-14/+19
* big renaming of field {type} to {pt_type},Pascal Rigaux2004-07-056-49/+49
* perl now handle cleanly utf8 string in exceptions, no need to die \N("...")Pascal Rigaux2004-04-051-1/+1
r">"/usr/bin"); my @devices = (detect_devices::probeall(), detect_devices::getSCSI()); # Update me each time you handle one more devices class (aka configurator) sub unknown() { grep { $_->{media_type} !~ /BRIDGE|class\|Mouse|DISPLAY|Hub|MEMORY_RAM|MULTIMEDIA_(VIDEO|AUDIO|OTHER)|NETWORK|Printer|SERIAL_(USB|SMBUS)|STORAGE_(IDE|OTHER|RAID|SCSI)|SYSTEM_OTHER|tape|UPS/ && !member($_->{driver}, qw(cpia_usb cyber2000fb forcedeth ibmcam megaraid mod_quickcam nvnet ohci1394 ov511 ov518_decomp scanner ultracam usbvideo usbvision)) && $_->{driver} !~ /^ISDN|Mouse:USB|Removable:zip|class\|Mouse|sata|www.linmodems.org/ && $_->{type} ne 'network' && $_->{description} !~ /Alcatel|ADSL Modem/; } @devices; } my @alrd_dected; sub f { my @devs = grep { !member(pciusb_id($_), @alrd_dected) } grep { $_ } @_; push @alrd_dected, map { pciusb_id($_) } @devs; @devs; } # tree format ("CLASS_ID", "type", "type_icon", configurator, detect_sub) # NEVER, NEVER alter CLASS_ID or you'll see harddrake2 service detect changes # in hw configuration ... :-( # FIXME: add translated items sub is_removable { member($_[0], qw(FLOPPY ZIP DVDROM CDROM BURNER)) } sub is_auto_configurable_class { is_removable($_[0]) || member($_[0], qw(HARDDISK)) } sub is_auto_configurable_media { !detect_devices::isKeyUsb($_[0]) } sub set_removable_configurator { my ($class, $device) = @_; is_removable($class) ? "/usr/sbin/diskdrake --removable=$device->{device}" : undef; } sub set_media_auto_configurator { my ($device) = @_; return "/usr/sbin/drakupdate_fstab --auto --add $device->{device}" if is_auto_configurable_media($device); } sub set_media_remover { my ($device) = @_; return "/usr/sbin/drakupdate_fstab --del $device->{device}" if is_auto_configurable_media($device); } my $modules_conf = modules::any_conf->read; # Format is (HW class ID, l18n class name, icon, config tool , is_to_be_detected_on_boot) our @tree = ( { class => "SATA_STORAGE", string => N("SATA controllers"), icon => "ide_hd.png", configurator => "", detector => sub { f(detect_devices::probe_category('disk/sata')) }, checked_on_boot => 1, }, { class => "RAID_STORAGE", string => N("RAID controllers"), icon => "ide_hd.png", configurator => "", detector => sub { f(detect_devices::probe_category('disk/hardware_raid')), f(grep { $_->{media_type} =~ /STORAGE_RAID/ } @devices) }, checked_on_boot => 1, }, { class => "ATA_STORAGE", string => N("(E)IDE/ATA controllers"), icon => "ide_hd.png", configurator => "", detector => sub { f(detect_devices::probe_category('disk/ide')), f(grep { $_->{media_type} =~ /STORAGE_(IDE|OTHER)/ } @devices) }, checked_on_boot => 1, }, { class => "CARD_READER", string => N("Card readers"), icon => "ide_hd.png", configurator => "", detector => sub { f(detect_devices::probe_category('disk/card_reader')) }, checked_on_boot => 1, }, { class => "FIREWIRE_CONTROLLER", string => N("Firewire controllers"), icon => "usb.png", configurator => "", detector => sub { f(grep { $_->{driver} =~ /ohci1394/ } @devices) }, checked_on_boot => 1, }, { class => "PCMCIA_CONTROLLER", string => N("PCMCIA controllers"), icon => "hw-pcmcia.png", configurator => "", detector => sub { f(detect_devices::pcmcia_controller_probe()) }, checked_on_boot => 1, }, { class => "SCSI_CONTROLLER", string => N("SCSI controllers"), icon => "scsi.png", configurator => "", detector => sub { f(detect_devices::probe_category('disk/scsi'), grep { $_->{media_type} =~ /STORAGE_SCSI/ } @devices) }, checked_on_boot => 1, }, { class => "USB_CONTROLLER", string => N("USB controllers"), icon => "usb.png", configurator => "", detector => sub { f(grep { $_->{media_type} eq 'SERIAL_USB' } @devices) }, checked_on_boot => 1, }, { class => "USB_HUB", string => N("USB ports"), icon => "hw-usb.png", configurator => "", detector => sub { f(grep { $_->{media_type} =~ /Hub/ } @devices) }, checked_on_boot => 0, }, { class => "SMB_CONTROLLER", string => N("SMBus controllers"), icon => "hw-smbus.png", configurator => "", detector => sub { f(grep { $_->{media_type} =~ /SERIAL_SMBUS/ } @devices) }, checked_on_boot => 0, }, { class => "BRIDGE", string => N("Bridges and system controllers"), icon => "memory.png", configurator => "", detector => sub { f(grep { $_->{media_type} =~ /BRIDGE|MEMORY_RAM|SYSTEM_OTHER|MEMORY_OTHER|SYSTEM_PIC/ || $_->{description} =~ /Parallel Port Adapter/; } @devices) }, checked_on_boot => 0, }, { class => "FLOPPY", string => N("Floppy"), icon => "floppy.png", configurator => "", detector => \&detect_devices::floppies, checked_on_boot => 1, automatic => 1, }, { class => "ZIP", string => N("Zip"), icon => "floppy.png", configurator => "", detector => sub { my ($options) = @_; if ($options->{PARALLEL_ZIP_DETECTION}) { modules::load_parallel_zip($modules_conf) and $modules_conf->write; } detect_devices::zips(); }, checked_on_boot => 1, automatic => 1, }, { class => "HARDDISK", string => N("Hard Disk"), icon => "harddisk.png", configurator => "$sbindir/diskdrake", detector => sub { f(detect_devices::hds()) }, checked_on_boot => 1, automatic => 1, }, { class => "USB_STORAGE", string => N("USB Mass Storage Devices"), icon => "usb.png", configurator => "", detector => sub { f(grep { member($_->{driver}, qw(usb_storage ub)) } @devices) }, checked_on_boot => 0, }, { class => "CDROM", string => N("CDROM"), icon => "cd.png", configurator => "", detector => sub { f(grep { !(detect_devices::isBurner($_) || detect_devices::isDvdDrive($_)) } &detect_devices::cdroms) }, checked_on_boot => 1, automatic => 1, }, { class => "BURNER", string => N("CD/DVD burners"), icon => "cd.png", configurator => "", detector => sub { f(detect_devices::burners()) }, checked_on_boot => 1, automatic => 1, }, { class => "DVDROM", string => N("DVD-ROM"), icon => "cd.png", configurator => "", detector => sub { f(grep { ! detect_devices::isBurner($_) } detect_devices::dvdroms()) }, checked_on_boot => 1, automatic => 1, }, { class => "TAPE", string => N("Tape"), icon => "tape.png", configurator => "", detector => \&detect_devices::tapes, checked_on_boot => 0, }, # AGP devices must be detected prior to video cards because some DRM drivers doesn't like be loaded # after agpgart thus order in /etc/modprobe.preload is important (modules.pm should enforce such sorting): { class => "AGP", string => N("AGP controllers"), icon => "memory.png", configurator => "", detector => sub { f(detect_devices::probe_category('various/agpgart')) }, checked_on_boot => 1, }, { class => "VIDEO", string => N("Videocard"), icon => "video.png", configurator => "$sbindir/XFdrake", detector => sub { f(grep { $_->{driver} =~ /^(Card|Server):/ || $_->{media_type} =~ /DISPLAY_VGA/ } @devices) }, checked_on_boot => 1, }, { class => "DVB", string => N("DVB card"), icon => "tv.png", detector => sub { f(detect_devices::probe_category('multimedia/dvb')) }, checked_on_boot => 1, }, { class => "TV", string => N("Tvcard"), icon => "tv.png", configurator => "/usr/sbin/drakxtv", detector => sub { f(detect_devices::probe_category('multimedia/tv')), f(grep { $_->{media_type} =~ /MULTIMEDIA_VIDEO/ && $_->{bus} eq 'PCI' } @devices) }, checked_on_boot => 1, }, { class => "MULTIMEDIA_OTHER", string => N("Other MultiMedia devices"), icon => "multimedia.png", configurator => "", detector => sub { f(grep { $_->{media_type} =~ /MULTIMEDIA_OTHER/ } @devices) }, checked_on_boot => 0, }, { class => "AUDIO", string => N("Soundcard"), icon => "sound.png", configurator => "$sbindir/draksound", detector => sub { require list_modules; my @modules = list_modules::category2modules('multimedia/sound'); f(grep { $_->{media_type} =~ /MULTIMEDIA_AUDIO/ || member($_->{driver}, @modules) } @devices); }, checked_on_boot => 1, }, { class => "WEBCAM", string => N("Webcam"), icon => "webcam.png", configurator => "", detector => sub { require list_modules; my @modules = (list_modules::category2modules('multimedia/webcam'), 'Removable:camera'); f(grep { $_->{media_type} =~ /MULTIMEDIA_VIDEO|Video\|Video Control/ && $_->{bus} ne 'PCI' || member($_->{driver}, @modules) } @devices); }, # managed by hotplug: checked_on_boot => 0, }, { class => "CPU", string => N("Processors"), icon => "cpu.png", configurator => "", detector => sub { detect_devices::getCPUs() }, # maybe should we install schedutils? checked_on_boot => 1, }, { class => "ISDN", string => N("ISDN adapters"), icon => "modem.png", configurator => "$sbindir/drakconnect", detector => sub { require network::connection::isdn; my $isdn = network::connection::isdn::detect_backend($modules_conf); if_(@$isdn, f(@$isdn)) }, # we do not check these b/c this need user interaction (auth, ...): checked_on_boot => 0, }, { class => "USB_AUDIO", string => N("USB sound devices"), icon => "sound.png", configurator => "", detector => sub { f(detect_devices::probe_category('multimedia/usb_sound')) }, checked_on_boot => 0, }, { class => "RADIO", string => N("Radio cards"), icon => "tv.png", configurator => "", detector => sub { f(detect_devices::probe_category('multimedia/radio')) }, checked_on_boot => 0, }, { class => "ATM", string => N("ATM network cards"), icon => "hw_network.png", configurator => "", detector => sub { f(detect_devices::probe_category('network/atm')) }, checked_on_boot => 0, }, { class => "WAN", string => N("WAN network cards"), icon => "hw_network.png", configurator => "", detector => sub { f(detect_devices::probe_category('network/wan')) }, checked_on_boot => 0, }, { class => "BLUETOOTH", string => N("Bluetooth devices"), icon => "hw_network.png", configurator => "", detector => sub { f(detect_devices::probe_category('bus/bluetooth')) }, checked_on_boot => 1, }, { class => "ETHERNET", string => N("Ethernetcard"), icon => "hw_network.png", configurator => "$sbindir/drakconnect", detector => sub { require list_modules; my @net_modules = list_modules::category2modules(list_modules::ethernet_categories()); f(grep { $_->{media_type} && $_->{media_type} =~ /^NETWORK/ || $_->{type} && $_->{type} eq 'network' || member($_->{driver}, @net_modules); } @devices); }, checked_on_boot => 1, }, { class => "MODEM", string => N("Modem"), icon => "modem.png", configurator => "$sbindir/drakconnect", detector => sub { f(detect_devices::getModem($modules_conf)) }, # we do not check these b/c this need user interaction (auth, ...): checked_on_boot => 0, }, { class => "ADSL", string => N("ADSL adapters"), icon => "modem.png", configurator => "$sbindir/drakconnect", detector => sub { f(detect_devices::get_xdsl_usb_devices()), f(grep { $_->{description} =~ /Cohiba 3887 rev0/ } @devices); }, # we do not check these b/c this need user interaction (auth, ...): checked_on_boot => 0, }, { class => "MEMORY", string => N("Memory"), icon => "hw-memory.png", configurator => "", detector => sub { grep { member($_->{name}, 'Cache', 'Memory Module') } detect_devices::dmidecode() }, checked_on_boot => 0, }, { class => "PRINTER", string => N("Printer"), icon => "hw_printer.png", configurator => "$sbindir/printerdrake", detector => sub { require printer::detect; printer::detect::local_detect() }, # we do not check these b/c this need user interaction (auth, ...): checked_on_boot => 0, }, { class => "GAMEPORT", string => #-PO: these are joysticks controllers: N("Game port controllers"), icon => "joystick.png", configurator => "", detector => sub { f(detect_devices::probe_category('multimedia/gameport')) }, checked_on_boot => 0, }, { class => "JOYSTICK", string => N("Joystick"), icon => "joystick.png", configurator => "", detector => sub { f(detect_devices::probe_category('input/joystick')), f(grep { $_->{description} =~ /Joystick/i } @devices) }, checked_on_boot => 0, }, { class => "KEYBOARD", string => N("Keyboard"), icon => "hw-keyboard.png", configurator => "$sbindir/keyboarddrake", detector => sub { f(grep { $_->{description} =~ /Keyboard/i || $_->{media_type} =~ /Subclass\|Keyboard/i } @devices), # USB devices are filtered out since we already catch them through probeall(): grep { $_->{bus} ne 'usb' && $_->{driver} eq 'kbd' && $_->{description} !~ /PC Speaker/ } detect_devices::getInputDevices(); }, checked_on_boot => 0, }, { class => "MISC_INPUT", string => N("Tablet and touchscreen"), icon => "hw_mouse.png", detector => sub { f(detect_devices::probe_category('input/tablet'), detect_devices::probe_category('input/touchscreen')) }, configurator => "$sbindir/mousedrake", checked_on_boot => 0, }, { class => "MOUSE", string => N("Mouse"), icon => "hw_mouse.png", configurator => "$sbindir/mousedrake", detector => sub { f(grep { $_->{driver} =~ /^Mouse:|^Tablet:/ || $_->{media_type} =~ /class\|Mouse/ } @devices), # USB devices are filtered out since we already catch them through probeall(): grep { $_->{bus} ne 'usb' && $_->{Handlers}{mouse} } detect_devices::getInputDevices(); }, checked_on_boot => 1, automatic => 1, }, { class => "BIOMETRIC", string => N("Biometry"), icon => "ups.png", detector => sub { f(grep { $_->{description} =~ /fingerprint|biometric/i } @devices) }, checked_on_boot => 0, }, { class => "UPS", string => N("UPS"), icon => "ups.png", configurator => "$sbindir/drakups", detector => sub { f(detect_devices::getUPS()) }, checked_on_boot => 0, }, { class => "SCANNER", string => N("Scanner"), icon => "scanner.png", configurator => "$sbindir/scannerdrake", detector => sub { require scanner; f(map { $_->{drakx_device} } f(scanner::detect())); }, checked_on_boot => 0, }, { class => "UNKNOWN", string => N("Unknown/Others"), icon => "unknown.png", configurator => "", detector => sub { f(unknown()) }, checked_on_boot => 0, }, ); sub pciusb_id { my ($dev) = @_; my %alt = ( bus => 'usb_bus', description => 'usb_description', id => 'usb_id', pci_bus => 'usb_pci_bus', pci_device => 'usb_pci_device', vendor => 'usb_vendor', ); join(':', map { $dev->{$alt{$_}} || $dev->{$_} } qw(bus pci_bus pci_device vendor id subvendor subid description)); } sub custom_id { my ($device, $str) = @_; return if !ref($device); defined($device->{device}) ? $device->{device} : (defined($device->{processor}) ? N("cpu # ") . $device->{processor} . ": " . $device->{'model name'} : $device->{"Socket Designation"} ? "$device->{name} (" . $device->{"Socket Designation"} . ")" : $device->{name} ? $device->{name} : (defined($device->{description}) ? $device->{description} : (defined($device->{Vendor}) ? $device->{Vendor} : $str))); } 1;