diff options
Diffstat (limited to 'rescue')
-rwxr-xr-x | rescue/drvinst | 73 | ||||
-rw-r--r-- | rescue/list | 5 | ||||
-rw-r--r-- | rescue/list.i386 | 2 | ||||
-rwxr-xr-x | rescue/make_rescue_img | 9 |
4 files changed, 87 insertions, 2 deletions
diff --git a/rescue/drvinst b/rescue/drvinst new file mode 100755 index 000000000..5abd220b1 --- /dev/null +++ b/rescue/drvinst @@ -0,0 +1,73 @@ +#!/usr/bin/perl + +# +# Guillaume Cottenceau (gc@mandrakesoft.com) +# +# Copyright 2000 MandrakeSoft +# +# This software may be freely redistributed under the terms of the GNU +# public license. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# + +local $_ = join '', @ARGV; + +"@ARGV" =~ /-h/ and die "usage: drivers_install [drivertype1 drivertype2..]\n"; + + +sub pci_probe { + my @pci; + foreach (`/usr/bin/lspcidrake`) { + my %pci_entry; + if (/^(\S+)\s*: (.+) \[([^\]]+)/) { + $pci_entry{driver} = $1; + $pci_entry{description} = $2; + $pci_entry{type} = $3; + } elsif (/^(\S+)\s*: (.+)/) { + $pci_entry{driver} = $1; + $pci_entry{description} = $2; + $pci_entry{type} = "NOT_DEFINED"; + } else { + next; + } + push @pci, \%pci_entry; + } + \@pci; +} + +sub install_module($$) { + my ($driver, $descr) = @_; + print "Installing driver $driver (for \"$descr\")\n"; + system("/sbin/modprobe $driver") and print "\tfailed\n"; +} + + +#- start + +my $pci = pci_probe(); + +foreach $pci_card (@$pci) { + + $pci_card->{type} eq "DISPLAY_VGA" and next; + $pci_card->{driver} eq "unknown" and next; + + if ($#ARGV != -1) { + $pci_card->{type} =~ /$_/i and install_module($pci_card->{driver}, $pci_card->{description}) foreach (@ARGV); + } else { + install_module($pci_card->{driver}, $pci_card->{description}); + } +} + + + +#------------------------------------------------- +#- $Log$ +#- Revision 1.1 2001/02/12 14:31:10 uid535 +#- - add lspci, lspcidrake, vim-minimal +#- - better /etc/issue +#- - better PS1 +#- - write embryonic tool (installation of detected drivers according to pci cards) +#- diff --git a/rescue/list b/rescue/list index d0d59bb8c..c9a28ec86 100644 --- a/rescue/list +++ b/rescue/list @@ -131,3 +131,8 @@ /usr/lib/perl5/5.6.0/warnings.pm /usr/lib/perl5/5.6.0/Carp.pm /usr/lib/perl5/5.6.0/Exporter.pm +/usr/bin/lspci +/usr/share/pci.ids +/usr/bin/lspcidrake +/usr/share/ldetect-lst/pcitable +/bin/vim-minimal diff --git a/rescue/list.i386 b/rescue/list.i386 index de2ee38c1..0170ca4d9 100644 --- a/rescue/list.i386 +++ b/rescue/list.i386 @@ -1,8 +1,6 @@ /usr/sbin/ext2resize /usr/sbin/rescuept /sbin/mkreiserfs -/usr/bin/lspci -/usr/share/pci.ids /boot/grub/stage[12] /usr/lib/perl5/5.6.0/i386-linux/CORE/libperl.so /usr/lib/perl5/site_perl/5.6.0/i386-linux/packdrake.pm diff --git a/rescue/make_rescue_img b/rescue/make_rescue_img index a26fa7f2c..8d35efe5a 100755 --- a/rescue/make_rescue_img +++ b/rescue/make_rescue_img @@ -31,6 +31,13 @@ sub install_ { sub install { install_($_[0], "-a") } sub install_lib { install_($_[0], "") } +sub installown($$) { + my ($own, $dir) = @_; + return if -e "$tmp$dir$own"; + commands::mkdir_("-p", "$tmp$dir") unless -d "$tmp$dir"; + _ "$sudo cp -a $own $tmp$dir"; +} + _ "$sudo rm -rf $tmp" if -e $tmp; _ "mkdir $tmp"; _ 'find . -name "*~" | xargs rm -f'; @@ -58,6 +65,8 @@ foreach (cat_("aliases")) { } _ "cp ../modules/modules.{cz*,dep} $tmp/modules"; +installown("drvinst", "/usr/bin"); + _ "install -s kernel_read_part $tmp/sbin" if $arch =~ /i.86/; __ "$sudo strip $tmp/{lib,bin,sbin}/* $tmp/usr/{bin,sbin}/* 2>/dev/null"; |