UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Participant dsingh
Participant
1,534 Views
Registered: ‎02-01-2018

Multiple user account support and ability to change password at run time with Petalinux

Can Petalinux support any of these features? Is there a recommended way to achieve this? Petalinux allows password setting at config time but that is pretty useless.

0 Kudos
5 Replies
Moderator
Moderator
1,499 Views
Registered: ‎02-07-2018

Re: Multiple user account support and ability to change password at run time with Petalinux

Hi @dsingh,

 

Looks this is not specific to petalinux, its generic commands you need to use for creating multiple user accounts & change password at run time.

can you try below commands. Hope you are looking for same only, if i am wrong please let me know.Hope it should work.

 

Adding new users:
root@xilinx-zc702-2018_2:~# adduser test
New password:
Retype new password:
passwd: password updated successfully
root@xilinx-zc702-2018_2:~# adduser new_user
New password:
Retype new password:
passwd: password updated successfully

changing password:
root@xilinx-zc702-2018_2:~# passwd test
New password: random: crng init done

Retype new password:
passwd: password updated successfully
root@xilinx-zc702-2018_2:~#

swich to different user :
root@xilinx-zc702-2018_2:~# whoami
root
root@xilinx-zc702-2018_2:~# su test
test@xilinx-zc702-2018_2:/home/root$

test@xilinx-zc702-2018_2:~$ whoami
test
test@xilinx-zc702-2018_2:~$ su root
Password:
root@xilinx-zc702-2018_2:/home/test#

root@xilinx-zc702-2018_2:~# whoami
root
root@xilinx-zc702-2018_2:~# su new_user
new_user@xilinx-zc702-2018_2:/home/root$

 

Thanks & Regards

Aravind

 

 

Thanks & regards

Aravind

 

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------

 

0 Kudos
Participant dsingh
Participant
1,483 Views
Registered: ‎02-01-2018

Re: Multiple user account support and ability to change password at run time with Petalinux

Thanks Aravind.

 

The issue is how do you make either the password change or user account creation permanent on an embedded system.  That is the key question that I should have made clear earlier. The changes are lost as soon as your power is lost. What is needed is either store the information in the boot device in some way or on SD card (better way)  that I do have and apply these on Power Up. Hopefully that makes it clear or else send me an e-mail so that we can communicate more clearly.

 

I am hoping that Xilinx has thought about how to perform this kind of operations in the context of embedded system.

 

BR,

 

Daljeet    

0 Kudos
Highlighted
Contributor
Contributor
1,425 Views
Registered: ‎08-31-2016

Re: Multiple user account support and ability to change password at run time with Petalinux

Try changing the Petalinux build option to place the root FS onto SD card media rather than the default INITRAMFS (RAM disk).  This will allow Linux to write to a persistent filesystem on the boot media.  Full instructions on how to do this are in UG1144 Chapter 6, but essentially you run "petalinux-config" and then choose "SD Card" for the Root FS type. 

0 Kudos
Moderator
Moderator
1,379 Views
Registered: ‎02-07-2018

Re: Multiple user account support and ability to change password at run time with Petalinux

Hi @dsingh


Try to use rootfs from sdcard 2nd partiton, so that whatever the changes you do, it will not erase even after power off, and Make sure to change root as /dev/mmcblk0p2 .

 

1.   petalinux-config -c kernel

  General setup  --->

                [ ] Initial RAM filesystem and RAM disk (initramfs/initrd)  support -- by default is enabled , you should unselect it.

   save & exit

2. petalinux-build

3. petalinux-package --boot --fsbl images/linux/zynq_fsbl.elf --fpga  images/linux/download.bit --u-boot

4. copy BOOT.BIN and Image.ub into SD-Card 1st partition and extract the rootfs to 2nd partition like this below tar -xvf  rootfs.tar.gz  -C /media/rootfs/.

 
Once you get u-boot console run below command: 

     setenv bootargs 'console=ttyPS0,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait'

  

Thanks & regards

Aravind

 

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

0 Kudos
Visitor kautschuk
Visitor
1,370 Views
Registered: ‎03-29-2018

Re: Multiple user account support and ability to change password at run time with Petalinux

The hack-ish way...

 

Modify <PROJECT_DIR>/project-spec/meta-plnx-generated/recipes-core/images/petalinux-user-image.bb like so:

 

EXTRA_USERS_PARAMS = "usermod -P root root; useradd -P <PASS> <NAME>"

Be aware that this is a just a quick way to test things. PetaLinux WILL overwrite your changes at some point!

 

The better way...

 

Create a new recipe, inherit extrausers, add the line i showed you.

0 Kudos