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

psh: some binaries aren't visible when type ls command #194

Closed
damianloew opened this issue Sep 24, 2021 · 6 comments
Closed

psh: some binaries aren't visible when type ls command #194

damianloew opened this issue Sep 24, 2021 · 6 comments
Labels
bug Something isn't working help wanted Extra attention is needed psh

Comments

@damianloew
Copy link
Contributor

damianloew commented Sep 24, 2021

target = ia32-generic - qemu

For example here 'ls' binary isn't visible in bin.
Screenshot from 2021-09-24 12-42-41

'ls' uses 'readdir' function, which reads subsequent files in chosen directory. It seems like that files aren't visible for 'readdir' also. Mentioned binaries are present in _fs directory on host-pc and can be executed using exec.

The problem occurs, when there is some larger amount of binaries in a directory, because when building without test component all executable files are visible.

When creating even several hundreds of files (not executable, just normal files) using touch the problem doesn't occur.

Test with test case reproducing issue (assert_ls_pshcmds: checking if all psh commands are listed in bin):
phoenix-rtos/phoenix-rtos-tests#52

@damianloew damianloew added bug Something isn't working help wanted Extra attention is needed labels Sep 24, 2021
@nalajcie
Copy link
Member

Please specify the TARGET as it's probably connected with the filesystem being used for /bin. I cannot reproduce the issue when building ia32-generc (busybox ls returns the same number of binaries in /bin - 85).

@damianloew
Copy link
Contributor Author

The problem doesn't occur, when building all components. Please try build using following command:
'TARGET=ia32-generic ./phoenix-rtos-build/build.sh clean core fs test project image'

@damianloew
Copy link
Contributor Author

damianloew commented Sep 27, 2021

Missing commands from Github Actions runner (phoenix-rtos/phoenix-rtos-tests#52): mkdir, mount, ping, runfile, top
Screenshot from 2021-09-27 13-35-59

@nalajcie
Copy link
Member

I can confirm that the issue is present in the disk file produced as an artifact of CI showcasing the problem.

Extracted the ext2 partition and e2ls shows the correct /bin contents, to do it by Yourself:

dd if=phoenix-ia32-generic.disk of=part.ext2 skip=4096 count=100000 bs=512
e2ls part.ext2:/bin/

I don't know if this is an ext2 issue of readdir implementation one (no way to test it on ia32-generic because of #114).

@damianloew
Copy link
Contributor Author

damianloew commented Sep 28, 2021

It returns correct list with all commands, when I use
dd if=phoenix-ia32-generic.disk of=part.ext2 skip=4096 count=100000 bs=512
e2ls part.ext2:/bin/

@damianloew
Copy link
Contributor Author

Seems to work properly now (5f7a0eb phoenix-rtos-project). Test case to cover it is present in ls tests: phoenix-rtos/phoenix-rtos-tests#52

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

No branches or pull requests

2 participants