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

Handling symbolic links as a file? #41

Open
someone5678 opened this issue Mar 2, 2023 · 3 comments
Open

Handling symbolic links as a file? #41

someone5678 opened this issue Mar 2, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@someone5678
Copy link

Android device tree generator
Version 0.1.0

[INFO] Figuring out partitions scheme
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/someone5678/android/dump/aospdtgen/aospdtgen/__main__.py", line 11, in <module>
    main()
  File "/home/someone5678/android/dump/aospdtgen/aospdtgen/main.py", line 31, in main
    dump = DeviceTree(args.dump_path)
  File "/home/someone5678/android/dump/aospdtgen/aospdtgen/device_tree.py", line 36, in __init__
    self.partitions = Partitions(self.path)
  File "/home/someone5678/.local/lib/python3.10/site-packages/sebaubuntu_libs/libandroid/partitions/partitions.py", line 25, in __init__
    self.partitions[PartitionModel.SYSTEM] = AndroidPartition(PartitionModel.SYSTEM, system)
  File "/home/someone5678/.local/lib/python3.10/site-packages/sebaubuntu_libs/libandroid/partitions/partition.py", line 38, in __init__
    self.files = get_files_list(self.path)
  File "/home/someone5678/.local/lib/python3.10/site-packages/sebaubuntu_libs/libandroid/partitions/partition.py", line 29, in get_files_list
    files.extend(get_files_list(i))
  File "/home/someone5678/.local/lib/python3.10/site-packages/sebaubuntu_libs/libandroid/partitions/partition.py", line 29, in get_files_list
    files.extend(get_files_list(i))
  File "/home/someone5678/.local/lib/python3.10/site-packages/sebaubuntu_libs/libandroid/partitions/partition.py", line 25, in get_files_list
    for i in path.iterdir():
  File "/usr/lib/python3.10/pathlib.py", line 1017, in iterdir
    for name in self._accessor.listdir(self):
FileNotFoundError: [Errno 2] No such file or directory: '../dumpyara/working/miui_MONDRIAN_V14.0.23.2.13.DEV_16aad31db7_13.0/system/system/lib/libc.so'

As I found, currently, aospdtgen following all symbolic links instead of just handling it as a file.
To workaround for above issue I should delete all symlink files by running command
find . -type l -delete .
After that I can finally generate dt.

@SebaUbuntu
Copy link
Member

If they're broken symlinks erroring out is fine imho, let me know if they're valid symlinks

@someone5678
Copy link
Author

If they're broken symlinks erroring out is fine imho, let me know if they're valid symlinks

Oh yes. As I checked, they are all valid symlinks.

@SebaUbuntu SebaUbuntu added the bug Something isn't working label Mar 3, 2023
@SebaUbuntu
Copy link
Member

SebaUbuntu commented Mar 14, 2023

I'm sure libc.so is a broken symlink since it usually points to /apex on a real device, not sure how I can just let pathlib ignore broken symlinks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants