-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Enable access to 'less' as a busybox applet #2189
Conversation
We do suffer a bit from feature creep in HAOS. Also, the full journal will be available from the frontend soon (see home-assistant/supervisor#3291). That said, missing How big is less?
In what way did it not play nicely? |
I did not look into the size of less because it's a core pager that should not be too large. What I was getting with the I will see if I can do three builds (no-less, busybox-less, br2-less) and compare the final image size. This really shouldn't add too much to the image. |
Side note - I thought that with this commit, |
These are the symbols that are automatically selected for
|
Side observation: Not sure if this is by design, but when I switch back to a branch that does not have the |
The size of the release seems to change when I |
So 3 builds with the source code unchanged, separated by So putting aside the PR at hand, are these builds not supposed to be reproducible? Or did I miss something in my setup? |
So I instead consulted Package name,Package size,Package size in system (%)
I hope you can make sense of the above, as I am drawing a blank at the inconsistencies and the seemingly arbitrary output. I'd be interested to see if someone else running a similar build environment is also getting the numbers above or similar inconsistencies. My build environment is:
And I keep the source tree on a separate |
Yeah that is a Buildroot limitation: the
Define reproducible... A while ago, getting sha256sum accurate builds was next to impossible as timestamps, randomness from order of object files at link time etc caused minor differences in the binaries (these differences are not really functional, just code stored in a different order in the binary etc.) In the last few years the reproducible build effort got big mainly for security reasons. But it needs compiler flags and careful crafted Makefiles to work a 100%. There is
The above mentioned linking order can also affect binary size, afaik that is mostly because optimization passes might end up with different outcome depending on what order the object files got added. Probably highly specific on compiler version etc. So the answer to your question: No, builds are not 100% reproducible currently. The size difference can also come from compression efficiency differences, but that is just a guess. 5-20KiB seems to be a bit more than I would have expected, but I guess it can add up here and there. I did work with Yocto's reproducible build support previously. I only got aware of Buildroot's |
It seems to me your very first number is a bit off. How do you apply changes? Buildroot is not that good in tracking changes to your configuration/updating output. So a previous make invocation can absolutely influence the state of our output directory, and that can cause different results. Busybox Without less
I then do:
So about 22KiB. Compiling with
So about 186KiB. Would be nice if we can use Busybox less. Could be pager related (see this comment in the systemd repo). |
Just my two cents here to the matter: I would also suggest to use busybox' own less implementation even if this might be to some extend not so feature rich. I didn't follow this ticket completely, but my own experience is, that the less implementation of busybox is feature rich enough for normal use cases, especially if it comes to development or debugging purposes. In addition, the underlying operating system behind Home Assistant should be kept as slim as possible and not slowly promoted to a full fledged linux operating system with all its gimmicks and usual tools. Therefore, I would suggest to use the stripped down less implementation of busybox rather than the full fledged less that is commonly shipped with mainstream linux distros. |
Thank you for your input. I can confirm that it is in the works. We will be modifying the PR to use the |
It appears that the culprit causing I also explicitly defined the symbols that This also enables truncate, which one can override when desired. With this change, I will address your other questions soon, but I think this commit is ready for a another look. |
Yeah I agree with that, what I actually do usually is to re-add the generated
|
What I've been doing is diff the |
You could also consider changing the top-level
after having used https://github.com/jens-maus/RaspberryMatic/blob/master/Makefile#L130-L140 |
This adds
less
to all currentboards
/platforms
as a BR2 package (BR2_PACKAGE_LESS
)This addition was requested on the community forums for the purpose of having it as a default pager for
journalctl
.While
BusyBox
does offer a stripped down version ofless
, it did not play nice withjournalctl
when I compiled it in, and appeared to be broken in general. Perhaps this was an issue with my specific environment, though I tested it in a new VM after deploying a freshly builtova
.The
buildroot
package is automatically used byjournalctl
once built (the same should happen with thebusybox
sourced version, but again, it was not playing nice in my quick test).*** Only tested the
ova
build. ***