Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev - Support primary or alternate option to choose the file system #100

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pioneerAlone
Copy link

Hello ,

I mentioned before on this issue#99 that I hope this library supports access to the alternate file system of Qualcomm modules. After my research, I implemented it. Since the library can only access the primary file system by default, few users usually change it. , most of the time, the alternate file system will be operated to read/write some user information.

So I open a pull request. If it is helpful to you, you can adopt it. If there are any problems, please let me know.

Regards,
Bakewell

Below are examples,
#1 Access primary file system with 'efs' option

$ **sudo ./qcsuper.py --usb-modem /dev/ttyUSB0 --efs-shell efs**
[sudo] password for q:

>>> ls
+--------------------------------------------------------------------------------------------------------------------------------------------+
+ File type           | Special flags | File rights | File name                      | File size | Modification        | Creation            +
+--------------------------------------------------------------------------------------------------------------------------------------------+
+ Directory (S_IFDIR) |               | rwxr-xr-x   | '.efs_private'                 |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Directory (S_IFDIR) |               | rwxrwxrwx   | 'Data_Profiles'                |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Directory (S_IFDIR) |               | rwx------   | 'F4oFHMWm-DRw2nIFvDTr6MuP16I_' |           | 2024-01-05 14:00:55 | 2024-01-05 14:00:55 +
+ Directory (S_IFDIR) |               | rwxrwxrwx   | 'GNSS'                         |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Directory (S_IFDIR) |               | rwx------   | 'apn_throttle'                 |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Directory (S_IFDIR) |               | rwxrwxrwx   | 'cgps'                         |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Directory (S_IFDIR) |               | rwxrwxrwx   | 'data'                         |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Directory (S_IFDIR) |               | rwxrwxrwx   | 'ds'                           |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Directory (S_IFDIR) |               | rwxrwxrwx   | 'mmode'                        |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Directory (S_IFDIR) |               | rwxr-xr-x   | 'nv'                           |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Directory (S_IFDIR) |               | rwxrwxrwx   | 'nvm'                          |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Directory (S_IFDIR) |               | rwxrwxrwx   | 'nvruim'                       |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Directory (S_IFDIR) |               | rw-rw-rw-   | 'rfc'                          |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Directory (S_IFDIR) |               | rwx------   | 'rpm'                          |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Directory (S_IFDIR) |               | rwxr-xr-x   | 'safe'                         |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Directory (S_IFDIR) |               | rwxrwxrwx   | 'scrub'                        |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Directory (S_IFDIR) |               | rwxrwxrwx   | 'sd'                           |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Directory (S_IFDIR) |               | rwxrwxrwx   | 'selfcal'                      |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Directory (S_IFDIR) |               | rwxrwxrwx   | 'sms'                          |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Directory (S_IFDIR) |               | rwxrwxrwx   | 'ufs'                          |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+--------------------------------------------------------------------------------------------------------------------------------------------+
>>>

#2 Access primary file system with 'efs2' option

$ sudo ./qcsuper.py --usb-modem /dev/ttyUSB0 --efs-shell efs2

>>> ls
+---------------------------------------------------------------------------------------------------------------------------------+
+ File type              | Special flags | File rights | File name        | File size | Modification        | Creation            +
+---------------------------------------------------------------------------------------------------------------------------------+
+ Directory (S_IFDIR)    |               | rwxr-xr-x   | '.efs_private'   |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Directory (S_IFDIR)    |               | rwxrwxrwx   | 'datatx'         |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Directory (S_IFDIR)    |               | rwxrwxrwx   | 'efs_public'     |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Directory (S_IFDIR)    |               | rwxrwxrwx   | 'firmware'       |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Directory (S_IFDIR)    |               | rwxrwxrwx   | 'location'       |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Directory (S_IFDIR)    |               | rwxrwxrwx   | 'nv'             |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Directory (S_IFDIR)    |               | rwxrwxrwx   | 'nvm'            |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Directory (S_IFDIR)    |               | rwxrwxrwx   | 'quectel'        |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Regular file (S_IFREG) |               | rw-------   | 'rdm_config.csv' | 2048      | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Directory (S_IFDIR)    |               | rwxrwxrwx   | 'ril'            |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Directory (S_IFDIR)    |               | rwxr-xr-x   | 'safe'           |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+ Directory (S_IFDIR)    |               | rwxrwxrwx   | 'ssl'            |           | 2023-11-02 16:46:05 | 2023-11-02 16:46:05 +
+ Directory (S_IFDIR)    |               | rwxrwxrwx   | 'ufs'            |           | 1980-01-06 08:00:00 | 1980-01-06 08:00:00 +
+---------------------------------------------------------------------------------------------------------------------------------+
>>>

@p1-mmr
Copy link
Collaborator

p1-mmr commented Apr 8, 2024

Hello!

Thank you for your pull request.

In the source code, I see:

parser.add_argument('--efs-shell', nargs='?', const='efs', default=False, choices=['efs', 'efs2'], help='Spawn an interactive shell to navigate within the embedded filesystem (EFS) of the baseband device. Optionally specify "primary" or "alternate" to choose the file system.')

It seems that the documentation talks about choosing between primary and alternate, but that the codes accepted by the source code are efs and efs2, is it wanted?

I think that it could more clean and easy to use to keep two separate arguments, like --efs2-shell and --efs-shell, so that backwards compatibility is preserved and there is less to type for the user.

Regards,

@pioneerAlone
Copy link
Author

I think that it could more clean and easy to use to keep two separate arguments, like --efs2-shell and --efs-shell, so that backwards compatibility is preserved and there is less to type for the user.

Yes,I agree with your idea,let me try to modify it then raise a ne pr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants