Conversation
Mke sure I won't forget again ;).
Because vfat. And pain. And misery. And blood & tears.
Crappy workaround to make sure OTA updates will finally behave on Kindle...
(Make shellcheck happy. Because it's right, quotes are the bomb).
|
(Wasn't technically broken (well, more broken than usual :D) in the previous stable, so not putting this in a milestone). (Although the OTA workaround is new, and should be a neat QoL fix). |
I'm not sure if that quite makes sense. I see it more as things that are part of it, in any case. |
Frenzie
left a comment
There was a problem hiding this comment.
Looks fine, added a potential nitpick
| # the file, see koreader#1644. | ||
| cd $(INSTALL_DIR) && \ | ||
| tar -I"gzip --rsyncable" -cah --no-recursion -f ../$(KINDLE_PACKAGE_OTA) \ | ||
| tar --hard-dereference -I"gzip --rsyncable" -cah --no-recursion -f ../$(KINDLE_PACKAGE_OTA) \ |
There was a problem hiding this comment.
This is technically only for Kindle?
(I'm fine keeping it the same everywhere for simplicity; just asking.)
There was a problem hiding this comment.
Yeah, although I figured this couldn't hurt, since most of those will be deployed on vfat anyway, and all of them were already using --dereference (h).
| # living in a magical land that doesn't suffer from gross filesystem deficiencies. | ||
| # Otherwise, the vfat+fuse mess means an OTA update will break the script on exit, | ||
| # and potentially leave the user in a broken state, with the WM still paused... | ||
| if [ "$(dirname "${0}")" != "/var/tmp" ]; then |
There was a problem hiding this comment.
Does it need to be preserved on reboot?
There was a problem hiding this comment.
It's a tmpfs, so it'll go poof on reboot.
I'm fine with leaving however kb this takes when we exit, it's 32MB by default, we've got more than enough space in there ;).
There was a problem hiding this comment.
Although, since it's no longer on a crappy FS, it also wouldn't hurt to unlink on exit, now that I think about it ;).
There was a problem hiding this comment.
It will? Hmm… odd.
https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05s15.html
5.15. /var/tmp : Temporary files preserved between system reboots
5.15.1. PurposeThe /var/tmp directory is made available for programs that require temporary files or directories that are preserved between system reboots. Therefore, data stored in /var/tmp is more persistent than data in /tmp.
Files and directories located in /var/tmp must not be deleted when the system is booted. Although data stored in /var/tmp is typically deleted in a site-specific manner, it is recommended that deletions occur at a less frequent interval than /tmp.
There was a problem hiding this comment.
Anyway, I guess I mean that /var/tmp seems needlessly longer than /tmp if there's no special reason to prefer /var/tmp
There was a problem hiding this comment.
I don't have the Kindle plugged in for details, but /var is a tmpfs on Kindle, and /tmp is either not one at all, or another, much smaller one, and that one might be noexec in some setups.
So, yeah, /var/tmp should be a safer bet than /tmp, on Kindle at least ;).
(FWIW, both /tmp and /var/tmp are tmpfs on my desktop ^^).
There was a problem hiding this comment.
The TL;DR being: That was a concerted decision after checking the state of /tmp vs. /var/tmp on various Kindle generations ;).
Make sure we always use our own (as on legacy devices, people may not have a recent copy anywhere else, if at all), AND make sure it won't bork an OTA update...
|
Interesting, on my voyage, /var is tmpfs, no /tmp entry. E.g. it's rootfs? |
|
Quite possibly, yeah (so, double trouble: not a tmpfs, and, worst of all, ro :D). |
* Deref hardlinks in tarballs * Ensure an OTA won't break the launcher script, which'd screw the user on exit.
Regression since #5715 (because I forgot to test with tarballs, and links be weird).
Also, pile on yet another stupid Kindle workaround to make sure an OTA update won't break the launcher script itself because of truncation, which would break the exit sequence, leaving the user with an apparently hung device, simply because the WM was never unpaused...
Yay Kindle. -_-"
Fix #5721
This change is