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

Missing tls.h in released version 0.8.10 #451

Closed
kkarhan opened this issue Aug 28, 2023 · 8 comments
Closed

Missing tls.h in released version 0.8.10 #451

kkarhan opened this issue Aug 28, 2023 · 8 comments

Comments

@kkarhan
Copy link

kkarhan commented Aug 28, 2023

Apparently the tls.h is missing from the released version of toybox.

user@host:~/projects/os1337/build/toybox-0.8.10$ LDFLAGS=--static CROSS_COMPILE=i686-linux-musl-cross/bin/i686-linux-musl- make ARCH=x86 toybox
scripts/make.sh
generated/{flags.h}
Compile toybox
...........toys/net/wget.c:60:10: fatal error: tls.h: No such file or directory
   60 | #include <tls.h>
      |          ^~~~~~~
compilation terminated.
make: *** [Makefile:17: toybox] Error 1

Bildschirmfoto vom 2023-08-28 04-15-32

And yes, I really want a so radically cut-down toybox: that I did basically cut out anything from .config except the built-in wget...

Not shure if this issue only applies to cross-compiling with musl for i686 as per website.

But any help would be appreciated.
Thx.

@landley
Copy link
Owner

landley commented Aug 28, 2023

That's because tls.h isn't part of toybox, it's in /usr/include if you installed that host library. You can configure wget to use openssl, libtls, or neither (in which case it just supports http not https).

In the toybox source directory run "make menuconfig", and in the "networking commands" directory, note that wget has a sub-option "Enable HTTPS support for wget via LibTLS". The help text for that option says "Use TOYBOX_LIBCRYPTO to enable HTTPS support via OpenSSL." (Which is in the Toybox global settings menu. Yeah, it's awkward having them apart like that but OpenSSL if enabled is used for multiple things and libtls is only used here, so far.)

I have a todo item to implement built-in https support (something busybox has apparently done in the past few years), but that's post-1.0 release.

Either change your config not to request an external library, or install the library on your host to satisfy the build prerequisite you've configured in.

@landley
Copy link
Owner

landley commented Aug 28, 2023

Note that using this library while cross compiling means you need to install the library into your cross compiler, not into your host. You can use -I and -L to point it to where you built the library (-I is the include directory, -L is the library directory, yes both are capital letters), I did that with my own build of zlib in mkroot's optional dropbear build, see here:

https://github.com/landley/toybox/blob/master/mkroot/packages/dropbear#L29

(I only built the static libraries because I was doing a static build...)

@landley
Copy link
Owner

landley commented Aug 28, 2023

Looking at your project: the toybox shell is about 80% of the way to usable, but there are still some quite noticeable rough edges. (There's are reasons it's still in pending. Working on it...)

@kkarhan
Copy link
Author

kkarhan commented Aug 28, 2023

@landley thanks for your extensive replies and answers even if my question seems naive...

I should've RTFM'd that before opening up an issue at the current stage of OS/1337 development:
It should end up to be a SSH terminal bootable from floppy.
Kinda like a frugal alternative to commercial solutions like openthinclient's thinclient-on-a-stick that allows one to just boot and SSH into stuff...

Wget with SSL is a "nice to have" at this point, and in subsequent versions that ain't constrained by a 1440kB total size limit I could workaround that and at worst shove a tiny-curl binary onto it.
Not elegant, I know, but a workaround that is feasible.

I mean, it would make things easier in regards to some future tangents but I do already appreciate the fact that toybox seems to be a stable and simple way to avoid the whole mess of GNUtils and shared libraries, even tho that'll get me hated by so many purists aka RMS fanboys.

I just don't like BusyBox for the same reasons you do.

Thanks again for your time and feedback.

@landley
Copy link
Owner

landley commented Aug 29, 2023

Should I close this issue, or do you have more questions?

@kkarhan
Copy link
Author

kkarhan commented Aug 30, 2023

Feel free to close the issue - at least from my end that's fine...

I do hope this will at least help others stumbling upon the same issue to find out what the problem is and get hinted at pulling LibTLS or OpenSSL and installing it....

Thanks again for your time.

@kkarhan
Copy link
Author

kkarhan commented Aug 31, 2023

I would've used the static precompiled binary provided if I wasn't constrained by needing to fit it onto 1440kB disk space alongside the Kernel and Dropbear (as SSH-Client) as of now...

OFC I do want to make things transparently reproducible so I opensorced the .config for the quite gutted Toybox I build from source...

Besides that "SSH Terminal on a Bootable Floppy" version I do intend to use the published precompiled binaries as those can trade space for functionality very easily...

Thanks again for your time, but free to reopen the issue if need be.

@kkarhan kkarhan closed this as completed Aug 31, 2023
@kkarhan
Copy link
Author

kkarhan commented Sep 1, 2023

Will keep this issue referenced if need be...

@kkarhan kkarhan closed this as not planned Won't fix, can't repro, duplicate, stale Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants