I am working on a system builder project where I am building an OS image for a PPC 440EP device. What is the correct way of adding passwd or any other command that enables setting password for root user? My current project status is as following.I have added passwd binary to the project (/bin). Also /etc/passwd file exists. When I try to set root password for QNX with passwd root command, I get the following error:

unable to lock password database (No such file or directory)

After creating the image, adding files or folders to /etc is not doable (I think because it is read-only). Please provide step by step instructions for adding passwd from the beginning. I think I have not been doing it correctly until now.

denkelly wrote:The /etc/ directory must be read/write so /etc/passwd can be saved. If you create /etc/passwd in the ifs, you can never change password.

One option is to mount a devb-ram instance at /etc and copy passwd file there. You will be able to change the password - but of course it will only last until you reboot.

Could you give more details on how to do this? Do you mean if I set password by this method, I will lose it after a reboot or I won't be able to set it again?When I run these commands it has no effect.

If you want persistent file storage, naturally you need to add a filesystem like fs-qnx4 or fs-qnx6 to your system (for block devices).Or a devf driver (for NOR flash) or fs-etfs (for NAND flash). Is one of the three part of your BSP? If so, start the corresponding driver and filesystem, create a partition, and in there you can then create directories and files, like /etc/, and so on, and change them.