View topic - How to add passwd command support to QNX OS image?
How to add passwd command support to QNX OS image?
5 posts
• Page 1 of 1
How to add passwd command support to QNX OS image?
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.
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.
- midlevel
- New Member
- Posts: 5
- Joined: Mon Sep 26, 2016 8:57 am
Re: How to add passwd command support to QNX OS image?
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.
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.
- denkelly
- Senior Member
- Posts: 163
- Joined: Sat Aug 02, 2008 3:27 pm
Re: How to add passwd command support to QNX OS image?
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.
- Code: Select all
# cd /etc
# df
/dev/fs0p1 100096 79 100016 1% /fs0p1
# devb-ram ram capacity=2000 &
[1] 155663
# Path=0 -
target=0 lun=0 Direct-Access(0) - ram Rev:
[1] + Done devb-ram ram capacity=20
# df
/dev/fs0p1 100096 79 100016 1% /fs0p1
#
- midlevel
- New Member
- Posts: 5
- Joined: Mon Sep 26, 2016 8:57 am
Re: How to add passwd command support to QNX OS image?
You lose it after a reboot.
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).
Tim
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).
Tim
- Tim
- Senior Member
- Posts: 1466
- Joined: Wed Mar 10, 2004 12:28 am
Re: How to add passwd command support to QNX OS image?
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.
Cheers,
- Malte
Cheers,
- Malte
- Thunderblade
- Senior Member
- Posts: 489
- Joined: Thu Apr 07, 2005 11:52 am
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 2 guests