[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#58266: bf-2.2.7: PCMCIA network install is broken



Hi.

I wish to consult this problem to Brian, the maintainer of pcmcia related
packages, because he is the expert on pcmcia, I think.

In article <[🔎] 20000217124333.C2660@paradigm.rfc822.org>,
  at Thu, 17 Feb 2000 12:43:33 +0100,
    on Bug#58266: bf-2.2.7: PCMCIA network install is broken,
 Florian Lohoff <flo@rfc822.org> writes:

> On Thu, Feb 17, 2000 at 06:53:42AM +0100, Geert Stappers wrote:
> > At 16:55 -0600 2/16/00, <ccheney@cheney.cx> wrote:
> > >Package: boot-floppies
> > >I tried to install potato using bf-2.2.7 today and I could not get pcmcia
> > >[snip]
> > >something about no network card being found (sorry I don't have the exact
> > >message).  I went to the second console and did an ifconfig and there was
> > >no [snip]
> > >This gave more error messages (sorry I don't remember the exact errors) one of
> > >them was about start-stop-daemon.  If needed I can try again and get the exact
> > >error messages.
> > 
> > Please try it again and report the exact error messages
> 
> The error is that the modules are not there from my experience ...
> 
> > You are allowed to use classic tools such as paper and pencil
> 
> I sent an email concerning the exact same problem - It failed to
> load the xirc_ps.o module because it was not available in /lib/modules/
>
> Doing an symlink on the second console from /lib/modules to
> /target/lib/modules - Doing depmod -a - and retry worked for
> me ...

I know your mail, Florian.

In article <[🔎] 20000216121333.A305@paradigm.rfc822.org>,
  at Wed, 16 Feb 2000 12:13:33 +0100,
    on 2.2.7 PCMCIA no-go,
 Florian Lohoff <flo@rfc822.org> writes:

> Hi,
> 
> i tried to install on a ThinkPad 390E (Xircom Realport 10/100 Ethernet PCMCIA)
> with the 2.2.7 (feb11) boot disks. There are a couple of bugs fixed from 2.2.6
> but i am not able to install with PCMCIA as the cardmgr does detect the card,
> (One beep) tries to load the module (another beep) but then fails to load
> the module (deep beep) as it does not exist in /lib/modules - Adding a symlink
> from /lib/modules to /target/lib/modules and running depmod solves this problem.

I check the code in utilities/dbootstrap/pcmcia.c, and it has:

    174       /*
    175        * Link /target/etc/pcmcia to /etc/pcmcia
    176        */
    177       getcwd(prtbuf,PRTBUFSIZE);
    178       chdir("/etc");
    179       symlink("/target/etc/pcmcia","pcmcia");
    180       chdir(prtbuf);
    181 
    182       getcwd(prtbuf,PRTBUFSIZE);
    183       chdir("/lib");
    184       if(!stat("/lib/modules",&tmp))
    185         unlink("modules");
    186       symlink("/target/lib/modules/","modules");
    187       chdir(prtbuf);

But rootdisk has /lib/modules as directory, and man page for unlink(2)
said:

       int unlink(const char *pathname);
(snip)
       EISDIR pathname refers to a directory.

So we have to check the return value of stat(2) using S_ISDIR(m),
and if it is a directory, use rmdir(2) (after removing the all
contents of that directory).

 # maybe using "rm -rf" is more easy way, but I don't know
 # if it is the better or not.

Ahh, I found the root1440compact.bin has "/lib/modules/misc/af_packet.o",
so just adding rmdir(2) will not work here.

So maybe rename(2) is better than unlink(2) or rmdir(2).
The patch for checking "modules.old", and do rename(2) is here:

--- pcmcia.c.0	Fri Feb 18 09:20:57 2000
+++ pcmcia.c	Fri Feb 18 09:30:21 2000
@@ -181,8 +181,12 @@
 
       getcwd(prtbuf,PRTBUFSIZE);
       chdir("/lib");
-      if(!stat("/lib/modules",&tmp))
-	unlink("modules");
+      if(!stat("/lib/modules",&tmp)) {
+      /* we can't use modules.old here, since baseconfig.c uses it */
+         if(rename("/lib/modules", "/lib/modules0")) {
+            return PCMCIA_MOD_ERROR;
+         }
+      }
       symlink("/target/lib/modules/","modules");
       chdir(prtbuf);
 #endif

Perhaps this may fix the problem.

Adding to this, I wish to move the lines in scripts/drivers/install.sh

     25         ln -sf `pwd`/sbin/ifport /sbin/ifport
     26         ln -sf `pwd`/sbin/ifuser /sbin/ifuser
     27         ln -sf `pwd`/sbin/cardmgr /sbin/cardmgr

into pcmcia.c, because this causes some difficulties for me.

I did install for test, and having trouble in "Install the Base System"
using pcmcia network install, reboot the system with floppies again,
and skip "Install Operating System Kernel and Modules" and
"Configure Device Driver Modules" because I think I have finished these
steps. (The target partition already has the files for these.)

But the lack of the required symlinks causes the troubles,
while this can be avoided if these symlinking is done in _activate_pcmcia()
in pcmcia.c. So I think it is better to move these symlinking into there.

Maybe the another line in scripts/drivers/install.sh:

     21 test -f /bin/sed || ln -sf `pwd`/bin/sed /bin/sed

can be removed or commented out since we have now GNU sed
in our root system (root14440.bin, and root1440compact.bin).

I think the next line below in scripts/drivers/install.sh:

     22 test -f /usr/bin/whiptail || ln -sf `pwd`/usr/bin/whiptail /usr/bin/whiptail

may be better to go into configure_drivers() in baseconfig.c.

    358 int configure_drivers (void) {
    359   struct stat statbuf;
    360
    361   if (NAME_ISDIR("/lib/modules", &statbuf) ) {
    362     rename("/lib/modules", "/lib/modules.old");
    363   }
    364   unlink("/lib/modules");
    365   chdir("/lib");
    366   symlink("/target/lib/modules", "modules");

Adding

    if (stat("/usr/bin/whiptail", &statbuf)) {
          symlink("/target/usr/bin/whiptail" "/usr/bin/whiptail");
    }

is enough, I think.

BTW, /etc/pcmcia/network and /etc/init.d/pcmcia use some command
that are not available on root system (boot-floppies) such as netstat
(/etc/pcmcia/network), start-stop-daemon and fgrep (/etc/init.d/pcmcia).

I don't know if they cause the trouble or not, and I wish to ask Brian
about these.

Thanks.

-- 
  Taketoshi Sano: <sano@debian.org>,<sano@debian.or.jp>,<kgh12351@nifty.ne.jp>



Reply to: