I am maintaining a img creation backup script on https://github.com/UnconnectedBedna/shrink-backup
I rescently got a request to also include f2fs so I started looking into it, not that much to change tbh so I started trying to implementing it, and by doing so cleaning up a bit of spaghetti code.
So to the bug I have discovered.
This is the snippet that fails:The sleep 1 is there for a reason, because if it is not, only the path to ROOT is found with lsblk, BOOT does not get set.
If I add a pause in the script, open up another terminal and manually run the lsblk command, there is absolutely no problem finding the path.
Root is always found, but boot ONLY with sleep in the code.
I thought it might gave to do with the UUID for boot always being capitalized, so I added -i to grep, but no change.
All variables gets set correctly, I have quadruple checked... xD
What is going on here?
Is this a bug?
Can I report that somewhere?
Thanks in advance.
I rescently got a request to also include f2fs so I started looking into it, not that much to change tbh so I started trying to implementing it, and by doing so cleaning up a bit of spaghetti code.
So to the bug I have discovered.
This is the snippet that fails:
Code:
sleep 1IMG_DEV_BOOT_PATH=$(lsblk -o path,uuid "$LOOP" | grep "$LOCAL_BOOT_UUID" | awk '{print $1}')IMG_DEV_ROOT_PATH=$(lsblk -o path,uuid "$LOOP" | grep "$LOCAL_ROOT_UUID" | awk '{print $1}')
If I add a pause in the script, open up another terminal and manually run the lsblk command, there is absolutely no problem finding the path.
Root is always found, but boot ONLY with sleep in the code.
I thought it might gave to do with the UUID for boot always being capitalized, so I added -i to grep, but no change.
All variables gets set correctly, I have quadruple checked... xD
What is going on here?
Is this a bug?
Can I report that somewhere?
Thanks in advance.
Statistics: Posted by bedna — Thu Apr 25, 2024 10:32 pm — Replies 0 — Views 47