# -*-perl-*- # stuff to handle pcmcia devices $pcic = ""; $pcmcia_opts = ""; # This should not be needed with the new card services #$pcmcia_3c589 = ""; sub pcmcia_init { if ($rh_testing) { return 1 }; &rhs_infobox("PCMCIA", < Probing for PCMCIA devices. > EOM , 70); # This is just to look good... sleep(1); $pcic = ""; open(SAVEERR, ">&STDERR"); open(STDERR, ">/dev/null"); open(PROC, "probe|") || &newdie("PCMCIA probe failed!"); while () { /Intel PCIC probe/ && (/not found/ || ($pcic = "i82365")); /Databook TCIC-2 probe/ && (/not found/ || ($pcic = "tcic")); } close PROC; open(STDERR, ">&SAVEERR"); if ($pcic eq "") { return 1; } if (!rhs_yesno("PCMCIA", < You appear to have $pcic PCMCIA support. > Is this true? > EOM , 70)) { $pcic = ""; return 1; } &mount_bootdisk(); # This should not be needed with the new card services # if (&rhs_yesno("3COM 3c589", #< #If you have a 3COM 3c589 PCMCIA Ethernet card, #are you using 10base2 (also known as BNC, or thin #net, or coax)? #> # (If you are not using a 3c589, just press enter) #> #EOM # , 70)) { # $pcmcia_3c589 = " module \"3c589_cs\" opts \"if_port=3\""; # } else { # $pcmcia_3c589 = " module \"3c589_cs\" # opts \"if_port=3\""; # } # This should not be needed with the new card services # open(FD, "/etc/pcmcia/config.in"); # open(OF, ">/etc/pcmcia/config"); # while () { ## if (/^PCIC=/) { ## $_ = "PCIC=$pcic\n"; ## } # if (/module \"3c589_cs/) { # $_ = "$pcmcia_3c589\n"; # } # print OF; # } # close FD; # close OF; $pcmcia_opts = ""; &rhs_infobox("PCMCIA", < Loading PCMCIA core module. > EOM , 70); &invoke("insmod /lib/modules/current/pcmcia/pcmcia_core.o"); &rhs_infobox("PCMCIA", < Loading PCMCIA $pcic module. > EOM , 70); &invoke("insmod /lib/modules/current/pcmcia/$pcic.o $pcmcia_opts"); &rhs_infobox("PCMCIA", < Loading PCMCIA ds module. > EOM , 70); &invoke("insmod /lib/modules/current/pcmcia/ds.o"); &rhs_infobox("PCMCIA", < Running PCMCIA card manager. > EOM , 70); &invoke("cardmgr"); return 1; } sub finish_pcmcia { local ( $ans ); if (! -f "$fsmount/etc/sysconfig/pcmcia") { return 1; } if ($pcic) { $ans = "yes"; } else { $ans = "no"; } open(FD, ">$fsmount/etc/sysconfig/pcmcia"); print FD <$fsmount/etc/sysconfig/pcmcia-scripts/config.new"); # while () { # if (/module \"3c589_cs/) { # $_ = "$pcmcia_3c589\n"; # } # print FD; # } # close IFD; # close FD; # # unlink("$fsmount/etc/sysconfig/pcmcia-scripts/config"); # link("$fsmount/etc/sysconfig/pcmcia-scripts/config.new", # "$fsmount/etc/sysconfig/pcmcia-scripts/config"); # unlink("$fsmount/etc/sysconfig/pcmcia-scripts/config.new"); return 1; } ####### 1;