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.
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.
You’ve created the Ram drive. You now have to mount it. You need something like:
devb-ram ram capacity=2000 &
waitfor /dev/hd1t77 2 (wait 2 second for Ram drive to appear)
mount -t qnx4 /dev/hd1t77 /etc (where you want to mount it)
Note: The output from your ‘df’ command doesn’t look right (I don’t see the Ram drive listed by ‘df’ so I wonder if the command failed in some manner).
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.