#476 [grub] broken test command

Open
opened 5 months ago by swiftgeek · 0 comments

[ -e (ahci0,gpt1) ] works only if device is mounted.

IMHO it should work always if device exist and use following to check if filesystem is mounted

[ -e (ahci0,gpt1)/ ] works only if device is mounted.

test is implemented in grub-core/commands/test.c

get_fileinfo() seems to be reponsible for a lot of bad assumptions

expand if (! fs) and keep track of (.*)/ trailing /

Or check before fs = grub_fs_probe (dev); if strings is equal to device_name (so without any trailing characters) and if so - return true for device before if (! fs) . Probably checking path length would be enough in that place

`[ -e (ahci0,gpt1) ] works only if device is mounted.` IMHO it should work always if device exist and use following to check if filesystem is mounted `[ -e (ahci0,gpt1)/ ] works only if device is mounted.` `test` is implemented in `grub-core/commands/test.c` `get_fileinfo()` seems to be reponsible for a lot of bad assumptions expand `if (! fs)` and keep track of `(.*)/` trailing / Or check before `fs = grub_fs_probe (dev);` if strings is equal to `device_name` (so without any trailing characters) and if so - return true for device before `if (! fs)` . Probably checking `path` length would be enough in that place
Sign in to join this conversation.
Loading...
Cancel
Save
There is no content yet.