Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - rootfs: (8 Items)
   
rootfs  
Hello,

We are running an QNX image on ARM platform.
We are booting via uboot. The QNX image ( .ifs) is loaded from a FAT partition on SD card, into RAM.
the root partition we are getting is not writable.
Also, it is not persistent
we want to mount the SD card as root.
Unable to find any flag or boot setting in the build file of boot script which points to the folder which is mounted as 
root.
My question is how to mount the root file system from SD card, the way we do for linux based systems?

thanks and Regards,

AAA
Re: rootfs  
wich version are You using?
Is Your SD card already formatted , ie have You a QNX4/QNX6 partition type?

First , in the build file have You insert the start of sd card diver? 

This is an example line for an imx6 cpu that use SDIO4 channel and mounts a qnx6 fs(t179) with rw :

#start a sd card driver
devb-sdmmc-mx6 cam pnp,nopriv,verbose blk rw,cache=2M,automount=sd40t179:/:qnx6 sdio addr=0x0219c000,irq=57,bs=nocd disk
 name=sd4

Mario

Re: rootfs  
thanks for the quick reply.
the following are the answers

which version are You using? 
[-> we are using QNX 7]

Is Your SD card already formatted , ie have You a QNX4/QNX6 partition type? 
[-> yes, our SD card is formatted. we load the ifs image from a fat32 partition, ( as uboot does not recognosize QNX 
file types), and then the second partition on the SD card is QNX 4]

First , in the build file have You insert the start of sd card diver? 
[-> we the build file and the startup script loads the SD card driver. 
we are able to mount the SD card and access it. ]

[->the problem is better explained as follows-
when we load the ifs into ram, it creates a rootfs in the ram. 
this rootfs is read only. 
we are not able to create folders/copy files in /etc etc....
we are able to mount the SD card at one of the locations.., that is working.
but that does not make /etc writable.
So, how mount the entire rootfs from the SD card? or how to make the default /etc read/write?
 On Linux, we can give a path from where to load the rootfs. Similarly, can we specify a folder from where to mount the 
rootfs on QNX?

Thanks 

AAA
]

This is an example line for an imx6 cpu that use SDIO4 channel and mounts a qnx6 fs(t179) with rw :

#start a sd card driver
devb-sdmmc-mx6 cam pnp,nopriv,verbose blk rw,cache=2M,automount=sd40t179:/:qnx6 sdio addr=0x0219c000,irq=57,bs=nocd disk

 name=sd4
Re: rootfs  
Advant, maybe You have something wrong in Your buil file, can You try to attach it?
I'm surprise You are using qnx4 because it is not more supported in qnx7, You meant qnx6?

> So, how mount the entire rootfs from the SD card?
In my case, I do this using this option when running the driver in the build file (startup): 
==> automount=sd40t179:/:qnx6 name=sd4
Or You can start the driver and mount the root later in Your startup script
 mount -tqnx6 /dev/sd40t179 /          (mount is rw by default, if media permit)

maybe some pam permit are not corretly assigned in the build file, something like this:
###########################################################################
## PAM configurations addon build file
###########################################################################
[uid=0 gid=0 type=dir dperms=0755] /usr
[uid=0 gid=0 type=dir dperms=0755] /usr/lib
[uid=0 gid=0 type=dir dperms=0755] /etc
[uid=0 gid=0 type=dir dperms=0755] /etc/pam.d

Note that qnx7 requires some PAM security configurations, just see
QNX_Neutrino_RTOS_7.1_System_Security_Guide_20210513.pdf
QNX_SDP_7.1_PAM_Reference_20210513.pdf
and check if the files on sd card qnx partition have the corrected attributes 


mario
Re: rootfs  
The terminology of "rootfs" is perhaps misleading you. QNX can mount as many file systems as you want at / (though 
that's not a good practice). You can also mount various file systems at different mount points.

1. The IFS provides a read-only file system. You can never mount it writable. By default it is mounted under /proc/boot.

2. Once the SD card driver has started you should see entries for the partitions you have under /dev (e,g,, /dev/hd0t177
 for the QNX partition and /dev/hd0t12 for the FAT partitions - the names may very well be different on your system). 
Each of these partitions can be mounted by the IFS script using the "mount" command. To have a writable /etc directory 
you typically mount a file system with an etc directory at /, though there are alternatives if you want to avoid 
mounting anything at /.

--Elad
Re: rootfs  
Hi Elad, Mario,

Thanks for your replies.

We are using QNX 6 file system.
we are using the default build file we got for RCar boards, with some modifications.
We are able to mount the SD card. 
We can also mount it at root.

Our problem is that before mounting the SD card at /, we get a file system which already has a /etc folder.
This /etc is read only. It does not allow us to create files there.
Can this default file system be made read /write?
we are checking the PAM section in the build file, as suggested by Mario.

As suggested by Elad, we created a /etc folder in SD card, and then mounted the SD card at /
This way we could not create new folders in /etc ( after mounting).
But won't this create any conflict, because already another folder was present as /etc? Will all writes go to the SD 
card?

Attached is the section of build file.
Regards,

AAA

-------------------------------------------------
Attachment: Text rcar_h3ulcb (1).build 28.79 KB
Re: rootfs  
Hi Adwant,
>we are using the default build file we got for RCar boards, with some modifications.
>We are able to mount the SD card. 
>We can also mount it at root.
Can You use the chmod, chown, login, su.. utilities?
Just try to login with root/root, qnxuser/qnxuser 
If not works, maybe You have still problems with PAM configurations

>Our problem is that before mounting the SD card at /, we get a file system which already has a /etc folder.
>This /etc is read only. It does not allow us to create files there.
>Can this default file system be made read /write?

>we are checking the PAM section in the build file, as suggested by Mario.
maybe You can add also this one
[uid=0 gid=0 perms=0755] /usr/lib/libpam.so=libpam.so

>As suggested by Elad, we created a /etc folder in SD card, and then mounted the SD card at /
>This way we could not create new folders in /etc ( after mounting).
>But won't this create any conflict, because already another folder was present as /etc? 
>Will all writes go to the SD card?

Search "Ordering mountpoints", generally if You have more filesystems mounted on same 
mountpoint,new mounts go on top of or down of any existing ones.
You can specify the order of resolution when You mount the filesystem:
path will be resolved starting searching from the top mountpoint,
so the down 'duplicated' file will be shadowed by top file. 
If You SD card  filesystem /etc is on top, the build's /etc will be shadowed, 

mario
Re: rootfs  
Yes, you can have two (or more) file systems provide the same directory, and the result would be the union of these file
 systems (i.e., if file system A provides /etc/a and /etc/b, and file system B provides /etc/b and /etc/c you will see /
etc/a, /etc/b and /etc/c; the provider of /etc/b depends on the mount order).
However, union file systems, while extremely neat, usually result in more harm than good due to confusion (at the very 
least). What I suggest is that you move all /etc entries from you build files (which generates the read-only IFS) to /
etc on the SD card. Just make sure to mount that before anything that needs /etc.

--Elad