Edit File in a QNX


After I boot from a QNX image in the CF, I want to edit the script files in the booted customized QNX OS.

Should the image which is Unzipped be R/W … if yes how do i mention it in the build file.

Also when i try to use “vi” it gives me the message
“Unrecognized TERM type”


The image which is unzipped is read-only. Any files which need to be modifiable must be placed onto a filesystem which is mounted at boot time.

The unrecognised term type occurs if you are missing the terminfo stuff from the full image (look at a full install to see the details for there) or are not specifying a valid type in the boot script.

hmmm … so I will have to have a FS with R/W set … and how will I make the build-file write some files over there. So, that the Unzipped Image can run scripts from the mounted file system.

I basically have a TXT file which the image reads and then executes to set the IP address of the board. Now, If I place that file in the boot FS it is read only but I also want to be able to change the TXT file so that I could change the IP address. In that case I will have to mount a separate FS, however how do i mention in the build file, that the IPADDRESS.TXT file should go to the mounted FS and not the boot FS image.


I don’t believe that it is possible to do this; besides, when it reboots it would copy the version from the image over the other (thus deleting any changes to it!). You need to create the necessary partition on some media (CF, HDD etc.) and simply copy the files there at the same time that you load the image onto the primary partition. The necessary code and scripts for loading the secondary partition and doing interesting things with it have been posted to previous questions on this forum.

The image and filesystem can be on the same partition.

In the image just mount the file system and then after that the program in the image can access the file on the filesystem.

You can mount the FS so that it appears in for example /etc/config/mystuff/IPADDRESS.TXT

Or I think you can create a link in the image that will have the file in the image point to the file in the FS, (that way you can avoid changing your program/build file)

Hadn’t thought of that… we had always used a secondary, but on further thought, there is no reason why the partition which contains the image file could not have additional files added to it once the dinit had been done and then simply mounting that filesystem during boot.

If dinit clears the filesystem present then this is OK once you have the image sorted out, but otherwise the dinit process will mean you have to rebuild the filesystem each time it changes, no?

I’m not sure how dinit fits into that? dinit is only required to “format” the partition and/or write the bool loader.

You’d only use dinit the first time you create the CF content.

If you need to change image, you don’t have to run dinit again. Just copy the new image over .boot file (as well you may want to copy old .boot over .altboot before doing that, if you know the old image was good enough and bootable but with some issues you just solved; in this case if freshly created image won’t boot at all you can hit Esc in order to load old image; always keep proven to boot image in .altboot file). If you unhappy with boot loader, you can use dloader to change boot loader and keep existing filesystem untouch.