View topic - Make Static Route Persistent Over Reboots

Make Static Route Persistent Over Reboots

anything that doesn't fit to other groups.

Re: Make Static Route Persistent Over Reboots

Postby nico04 » Thu Oct 04, 2018 6:41 am

Mitchell,

Yes, I gave the link of the reply on openqnx. In this reply, there is this link : https://imgur.com/a/AgAmwAO where you can see the CPU is PPC.

Nicolas
nico04
Senior Member
 
Posts: 113
Joined: Wed Sep 29, 2010 9:59 am
Location: France

Re: Make Static Route Persistent Over Reboots

Postby webbyz » Thu Oct 04, 2018 6:33 pm

I know that it boots from flash. But I don't have much knowledge of the inter-workings of the hardware itself and how it was programmed at this level. So no BSP resources.

I am most familiar with the application that it running on the hardware which is for building automation. The static routing function isn't something that is supported in their GUI/programming tools.

There is a need for this functionality. I am just trying to accomplish a solution that is outside of the software that is running on the device.
webbyz
New Member
 
Posts: 9
Joined: Thu Sep 27, 2018 5:19 pm

Re: Make Static Route Persistent Over Reboots

Postby Tim » Thu Oct 04, 2018 10:28 pm

Webbyz,

If the device boots from flash there may not even be any writable medium (hard disk, CF card etc). How big is the physical device and do you know if it has a writable medium. If it doesn't there is NO way you will be able to modify routes in a permanent manner.

If you can't open the device or judge by it's size whether it has writable medium then can you try doing a 'df' command and see what it reports for disks. It's entirely possible there is nothing but flash memory that contains a bootable QNX image (which essentially can't be modified).

Tim
Tim
Senior Member
 
Posts: 1425
Joined: Wed Mar 10, 2004 12:28 am

Re: Make Static Route Persistent Over Reboots

Postby webbyz » Fri Oct 05, 2018 11:50 am

If there wasn't a medium to write to, then II would think that there wouldn't be a way for me to make changes to the IP addresses at all?

Maybe I am wrong in thinking that? But from conversations in the past, I have always been told that there is flash memory on board.
webbyz
New Member
 
Posts: 9
Joined: Thu Sep 27, 2018 5:19 pm

Re: Make Static Route Persistent Over Reboots

Postby nico04 » Fri Oct 05, 2018 12:09 pm

If there wasn't a medium to write to, then II would think that there wouldn't be a way for me to make changes to the IP addresses at all?

You're wrong.

On embedded systems, most of the time, there is an in-RAM file system initialised at startup. This file system is populated with the content of the QNX image created with BSP tools. So, you get a writeable file system that is reinitialised at each boot.
nico04
Senior Member
 
Posts: 113
Joined: Wed Sep 29, 2010 9:59 am
Location: France

Re: Make Static Route Persistent Over Reboots

Postby nico04 » Fri Oct 05, 2018 12:14 pm

As requested by Tim, can you execute "df" command on your QNX system to show which file systems are active ?
nico04
Senior Member
 
Posts: 113
Joined: Wed Sep 29, 2010 9:59 am
Location: France

Re: Make Static Route Persistent Over Reboots

Postby webbyz » Mon Oct 08, 2018 5:36 pm

# df
/dev/etfs6 11776 1156 10620 10% /aram0/
/dev/etfs4 1920 106 1814 6% /ram0/
/dev/etfs2 122880 57712 65168 47% /ffs0/
/dev/etfs6 11960 11960 0 100% (/aram0/)
/dev/etfs5 0 0 0 100%
/dev/etfs4 1950 1950 0 100% (/ram0/)
/dev/etfs3 0 0 0 100%
/dev/etfs2 124800 124800 0 100% (/ffs0/)
/dev/etfs1 8320 8320 0 100%
#
webbyz
New Member
 
Posts: 9
Joined: Thu Sep 27, 2018 5:19 pm

Re: Make Static Route Persistent Over Reboots

Postby nico04 » Tue Oct 09, 2018 9:52 am

It looks like you get a "Flash File System" on your machine.

To go further, can you send me the content of /proc/boot/.scritp file in a private message ?
Copy/paste will not work as this is a binary file (with text inside).
This script file is executed at startup. Decoding it will show what's executed at startup. Maybe another writeable script file is executed from it.
Beware that this file can contain private data so you might not want to share it.
nico04
Senior Member
 
Posts: 113
Joined: Wed Sep 29, 2010 9:59 am
Location: France

Re: Make Static Route Persistent Over Reboots

Postby webbyz » Tue Oct 09, 2018 1:51 pm

Sent. Thanks!
webbyz
New Member
 
Posts: 9
Joined: Thu Sep 27, 2018 5:19 pm

Re: Make Static Route Persistent Over Reboots

Postby nico04 » Wed Oct 10, 2018 2:06 pm

Ok, so here is your .script content :

Code: Select all
procmgr_symlink ../../proc/boot/libc.so.3 /usr/lib/ldqnx.so.2
optslotscan
dbgjmpr
reopen /dev/serconsole
display_msg Welcome to QNX Neutrino 6.4 on the NPM 2xx (ppc405)

ksh /sys/bin/rc.local
ksh /sys/bin/tinit &


In order of execution :
- The fisrt line is always there in .script files. : libc.so.3 is redirected to ldqnx.so.2
- optslotscan and dbgjmpr are executed.
- Standard input, standard output, and standard error are redirected to /dev/serconsole
- Display the Welcome message
- Execute /sys/bin/rc.local through ksh
- Execute /sys/bin/tinit through ksh in background

ksh refers to /proc/boot/ksh

optslotscan and dbgjmpr are executed with no environment variables defined.

/sys/bin/rc.local and /sys/bin/tinit are executed with the following environment variables :
SYSNAME=nto
TERM=qansi
HOME=/
PATH=:/proc/boot:/bin:/usr/bin:/opt/bin:/sys/bin:
LD_LIBRARY_PATH=:/proc/boot:/lib:/usr/lib:/lib/dll:/opt/lib:
nico04
Senior Member
 
Posts: 113
Joined: Wed Sep 29, 2010 9:59 am
Location: France

Previous

Return to General Programming

Who is online

Users browsing this forum: No registered users and 6 guests

cron