Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - minor fault in the QNX4 Net manager: (16 Items)
   
minor fault in the QNX4 Net manager  
We have uncovered a minor fault in the QNX4 Net manager,
for all recent versions.
The -m switch that sets the network mapping entry is ignored when the Net manager is built into a boot file.

The cause being that talking marks around the mapping entry are not stripped by the buildqnx utility,
and the Net manager ignores entries with talking marks included.

for example
if we enter a net command from a shell we get
Net -m "1 1 00008c 123456" &
sin -P Net arg
Net -m 1 1 00008c 123456

but when the Net manager is started from the boot file
sin -P Net arg
Net -m "1 1 00008c 123456"

and a netmap command shows the mapping entry missing.

In our case a diskless workstation does not boot until it receives some other message from the boot server
and adds its netmap entry automatically to the table.
If nameloc has stopped polling the network this can be a reasonable amount of time.

Karl.
Re: minor fault in the QNX4 Net manager  
Hi Karl,

I'll answer you after full testing.

-- 
Respectfully,
Oleg

> We have uncovered a minor fault in the QNX4 Net manager,
> for all recent versions.
> The -m switch that sets the network mapping entry is ignored when the
>  Net manager is built into a boot file.
> 
> The cause being that talking marks around the mapping entry are not
>  stripped by the buildqnx utility, and the Net manager ignores entries
>  with talking marks included.
> 
> for example
> if we enter a net command from a shell we get
> Net -m "1 1 00008c 123456" &
> sin -P Net arg
> Net -m 1 1 00008c 123456
> 
> but when the Net manager is started from the boot file
> sin -P Net arg
> Net -m "1 1 00008c 123456"
> 
> and a netmap command shows the mapping entry missing.
> 
> In our case a diskless workstation does not boot until it receives some
>  other message from the boot server and adds its netmap entry
>  automatically to the table.
> If nameloc has stopped polling the network this can be a reasonable
>  amount of time.
> 
> Karl.
> 
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post39037
> 
Re: minor fault in the QNX4 Net manager  
Hi Karl,

I've found solution for your problem. You need set number of node mapping 
elements (use -n option with Net). Auto detect of number of nodes doesn't 
working until sinit is started. So add following line to your build file 
(use appropriate value for -n):

Net -m "1 1 00008c 123456" -n 20

-- 
Respectfully,
Oleg

> We have uncovered a minor fault in the QNX4 Net manager,
> for all recent versions.
> The -m switch that sets the network mapping entry is ignored when the
>  Net manager is built into a boot file.
> 
> The cause being that talking marks around the mapping entry are not
>  stripped by the buildqnx utility, and the Net manager ignores entries
>  with talking marks included.
> 
> for example
> if we enter a net command from a shell we get
> Net -m "1 1 00008c 123456" &
> sin -P Net arg
> Net -m 1 1 00008c 123456
> 
> but when the Net manager is started from the boot file
> sin -P Net arg
> Net -m "1 1 00008c 123456"
> 
> and a netmap command shows the mapping entry missing.
> 
> In our case a diskless workstation does not boot until it receives some
>  other message from the boot server and adds its netmap entry
>  automatically to the table.
> If nameloc has stopped polling the network this can be a reasonable
>  amount of time.
> 
> Karl.
> 
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post39037
> 
Re: minor fault in the QNX4 Net manager  
Hi Oleg,

Actually we are already using the -n switch (-n100)
and this does not have any effect on the -m "..."
switch being ignored.
The mapping entry only gets added after packets are received.
If no packets are received the machine will sit waiting....

Try testing with no nameloc.
Sometimes when our customers boot lots of nodes at once
nameloc can become stuck. ( ie waiting on a missing reply )

Karl.
Re: minor fault in the QNX4 Net manager  
Hi Karl,

Please post here your build file and output of sin ver utility. Note that I 
didn't start network driver (and nameloc) on some my tests, so packets are 
not received any way.

-- 
Respectfully,
Oleg

> Hi Oleg,
> 
> Actually we are already using the -n switch (-n100)
> and this does not have any effect on the -m "..."
> switch being ignored.
> The mapping entry only gets added after packets are received.
> If no packets are received the machine will sit waiting....
> 
> Try testing with no nameloc.
> Sometimes when our customers boot lots of nodes at once
> nameloc can become stuck. ( ie waiting on a missing reply )
> 
> Karl.
> 
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post39149
> 
Re: minor fault in the QNX4 Net manager  
Hi Oleg,

From a diskless node that was sitting waiting...

--- sin ve -- cut ---
PROGRAM                 NAME         VERSION DATE
sys/Proc32              Proc         4.25Q   Jul 18 2005
sys/Proc32              Slib16       4.23G   Oct 04 1996
sys/Slib32              Slib32       4.24B   Aug 12 1997
/bin/Net                Net          4.25G   Jul 06 2009
/bin/Net.rtl            Net.rtl      4.25D   Jun 28 2009
--- sin ve -- cut ---

also

--- sin arg -- cut ---
  PID USER NAME    ARGUMENTS
    1 System       Proc32 -l11 
    2 System       Slib32 
    4 System       Net -n100 -m "1 1 00008C00E9C6" 
    5 System       Net.rtl -l1 
    6 System       Not available.                  
    7 System       Not available.                  
--- sin arg -- cut ---

Karl.
Attachment: Text ws32.rtl 182 bytes
Re: minor fault in the QNX4 Net manager  
Hi Karl,

I still can't reproduce your error. I've prepared PC which has 
configuration as similar to yours as possible. No namelock was started on 
both nodes.

What version of software products are installed on your 1st node?

-- 
Respectfully,
Oleg

> Hi Oleg,
> 
> >From a diskless node that was sitting waiting...
> 
> --- sin ve -- cut ---
> PROGRAM                 NAME         VERSION DATE
> sys/Proc32              Proc         4.25Q   Jul 18 2005
> sys/Proc32              Slib16       4.23G   Oct 04 1996
> sys/Slib32              Slib32       4.24B   Aug 12 1997
> /bin/Net                Net          4.25G   Jul 06 2009
> /bin/Net.rtl            Net.rtl      4.25D   Jun 28 2009
> --- sin ve -- cut ---
> 
> also
> 
> --- sin arg -- cut ---
>   PID USER NAME    ARGUMENTS
>     1 System       Proc32 -l11
>     2 System       Slib32
>     4 System       Net -n100 -m "1 1 00008C00E9C6"
>     5 System       Net.rtl -l1
>     6 System       Not available.
>     7 System       Not available.
> --- sin arg -- cut ---
> 
> Karl.
> 
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post39338
> 
Re: minor fault in the QNX4 Net manager  
Hi Oleg,

I've setup two small vmware virtual machines one with a file system (the core node),
and one with just a pre-build boot file (the boot node - /boot/build/ws32.ether2100).

If you open both in vmware and add qnx/tcprt licenses to the core node,
the boot node doesn't start up a login prompt until it receives a packet from the core node (start nameloc).

The vmware images can be found at http://users.tpg.com.au/kleake/qnx-oleg.zip

Karl.
Re: minor fault in the QNX4 Net manager  
Hi Karl,

Thanks for vmware images. It helps. ;-} I think I've found error in your build file. Try to quote the $(netmap) variable
:

-----
/bin/Net
$ Net -n100 -m "$(netmap)"
-----

Respectfully,
Oleg


> Hi Oleg,
> 
> I've setup two small vmware virtual machines one with a file system (the core 
> node),
> and one with just a pre-build boot file (the boot node - /boot/build/ws32.
> ether2100).
> 
> If you open both in vmware and add qnx/tcprt licenses to the core node,
> the boot node doesn't start up a login prompt until it receives a packet from 
> the core node (start nameloc).
> 
> The vmware images can be found at http://users.tpg.com.au/kleake/qnx-oleg.zip
> 
> Karl.


Re: minor fault in the QNX4 Net manager  
Hi Oleg,

That doesn't seem to work because the shell will strip the new quotes off
and then buildqnx will replace $(netmap) with the netmap environment variable which
includes it's own quotes
"1 1 000c297700f4"

tftpd does something like

    sprintf ( string, "netmap=\"%d %d %s\"", node, lan, mac_address );
    putenv ( string );
    // then runs a shell to build the boot image

I can work around this though if I change my bootptab file from

:bf=|cd /boot; buildqnx -b0x10000 build/ws32.ether2100 | mkQNXnbi:

to

:bf=|cd /boot; fix -b0x10000 build/ws32.ether2100 | mkQNXnbi:

where fix strips all the quotes from the environment variable netmap

---cut--- fix.c --
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <env.h>

void main ( int argc, char **argv, char **envp )
{
    char *ptr;
    char *str;
    char *quote;

    if ( ptr = getenv ( "netmap" ) ) {

        str = strdup ( ptr );

        while ( quote = strchr ( str, 0x22 ) ) {
            *quote = 0x20;
        }
        setenv ( "netmap", str, -1 );
        free ( str );
    }

    execve ( "/bin/buildqnx", argv, envp );
}
---cut--- fix.c --

Thanks,
Karl.
Re: minor fault in the QNX4 Net manager  
Hi Oleg,

I should have said buildqnx strips the new quotes off.

If you are still interested I have updated the virtual machines to do a full bootp/tftpd boot, and have included the 
binary to strip off the offending quotes.

http://users.tpg.com.au/kleake/qnx-bootp-oleg.zip

Karl.
Re: minor fault in the QNX4 Net manager  
Hi Karl,

To sure that all works fine you can create simple build file without using 
environment variables. Also you can add netmap utility to your build file 
and look at the output while booting. So there are no problems with Net, 
buildqnx and others.

Please note you can use command line arguments instead of environment 
variables. Followed commands creates equivalent boot images:

lnode=2 netmap="1 1 000C297700F4" buildqnx -v /boot/build/ws32.ether2100
buildqnx -v lnode=2 netmap="1 1 000C297700F4" /boot/build/ws32.ether2100

In first case we set lnode and netmap environment variables. In second case 
we pass lnode and netmap via command line argument. In both cases Boot 
Node boots fine.

How do you set netmap environment variable? I think there is no need to 
use your fix program.

-- 
Respectfully,
Oleg

> Hi Oleg,
> 
> That doesn't seem to work because the shell will strip the new quotes
>  off and then buildqnx will replace $(netmap) with the netmap
>  environment variable which includes it's own quotes
> "1 1 000c297700f4"
> 
> tftpd does something like
> 
>     sprintf ( string, "netmap=\"%d %d %s\"", node, lan, mac_address );
>     putenv ( string );
>     // then runs a shell to build the boot image
> 
> I can work around this though if I change my bootptab file from
> 
> :bf=|cd /boot; buildqnx -b0x10000 build/ws32.ether2100 | mkQNXnbi:
> 
> to
> 
> :bf=|cd /boot; fix -b0x10000 build/ws32.ether2100 | mkQNXnbi:
> 
> where fix strips all the quotes from the environment variable netmap
> 
> ---cut--- fix.c --
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> #include <env.h>
> 
> void main ( int argc, char **argv, char **envp )
> {
>     char *ptr;
>     char *str;
>     char *quote;
> 
>     if ( ptr = getenv ( "netmap" ) ) {
> 
>         str = strdup ( ptr );
> 
>         while ( quote = strchr ( str, 0x22 ) ) {
>             *quote = 0x20;
>         }
>         setenv ( "netmap", str, -1 );
>         free ( str );
>     }
> 
>     execve ( "/bin/buildqnx", argv, envp );
> }
> ---cut--- fix.c --
> 
> Thanks,
> Karl.
> 
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post39471
> 
Re: minor fault in the QNX4 Net manager  
Hi Oleg,

We let tftpd set the netmap environment variable automatically.

Just to clarify we only see the fault when we are using bootpd/tftpd to dynamically build a boot file.

Also the etherboot boot rom that we use seems to have a limit of about 80 characters for the build string that bootpd 
passes,
so we are a bit limited in how much extra script can be added in.

Karl.
Re: minor fault in the QNX4 Net manager  
Hi Karl,

Please provide me more detailed information how you set netmap environment 
variable. Also post output of the echo $netmap utility.

You can create shell script which will build appropriate boot image 
according to command line arguments.

PS1: In previous post I've made a mistake with buildqnx command lines. 
Correct lines are:

lnode=2 netmap="1 1 000C297700F4" buildqnx -v /boot/build/ws32.ether2100 \ 
/boot/images/ws32.ether2100

buildqnx -v lnode=2 netmap="1 1 000C297700F4" /boot/build/ws32.ether2100 \ 
/boot/images/ws32.ether2100

-- 
Respectfully,
Oleg

> Hi Oleg,
> 
> We let tftpd set the netmap environment variable automatically.
> 
> Just to clarify we only see the fault when we are using bootpd/tftpd to
>  dynamically build a boot file.
> 
> Also the etherboot boot rom that we use seems to have a limit of about
>  80 characters for the build string that bootpd passes, so we are a bit
>  limited in how much extra script can be added in.
> 
> Karl.
> 
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post39569
> 
Re: minor fault in the QNX4 Net manager  
Hi Oleg,

We have followed the qnx 4 documentation for dynamically booting with bootp/tftp almost to the letter

http://www.qnx.com/developers/docs/qnx_4.25_docs/qnx4/user_guide/netinstall.html#BOOTP
http://users.tpg.com.au/kleake/bootpd.html
( this link is dead http://www.qnx.com/developers/docs/qnx_4.25_docs/tcpip/user_guide/utils/bootpd.html )

tftpd sets the environment variable.

Updated virtual machines to do a full bootp/tftp boot,
including the binary to strip off the offending quotes are at

http://users.tpg.com.au/kleake/qnx-bootp-oleg.zip

(the ip addresses need to be updated in /etc/bootptab if you get an ip address other than 192.168.95.138)

I have attached a screen shot of the boot node with netmap built into the boot image.

Karl
Attachment: Bitmap etherboot.bmp 843.8 KB
Re: minor fault in the QNX4 Net manager  
Hi Karl,

You are right, the tftpd sets $(netmap) variable with a quotes. So simple 
way to fix this case would be removing quotes from the environment variable 
(i.e. using your own fix program).

-- 
Respectfully,
Oleg

> Hi Oleg,
> 
> We have followed the qnx 4 documentation for dynamically booting with
>  bootp/tftp almost to the letter
> 
> http://www.qnx.com/developers/docs/qnx_4.25_docs/qnx4/user_guide/netins
> tall.html#BOOTP http://users.tpg.com.au/kleake/bootpd.html
> ( this link is dead
>  http://www.qnx.com/developers/docs/qnx_4.25_docs/tcpip/user_guide/util
> s/bootpd.html )
> 
> tftpd sets the environment variable.
> 
> Updated virtual machines to do a full bootp/tftp boot,
> including the binary to strip off the offending quotes are at
> 
> http://users.tpg.com.au/kleake/qnx-bootp-oleg.zip
> 
> (the ip addresses need to be updated in /etc/bootptab if you get an ip
>  address other than 192.168.95.138)
> 
> I have attached a screen shot of the boot node with netmap built into
>  the boot image.
> 
> Karl
> 
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post39652
>