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

Minor build tweaks #2

Merged
merged 16 commits into from
Mar 28, 2020
Merged

Minor build tweaks #2

merged 16 commits into from
Mar 28, 2020

Conversation

NiLuJe
Copy link
Contributor

@NiLuJe NiLuJe commented Mar 27, 2020

Mainly to make it build against older Kobo kernels, as that's what I use in my ToolChains ;).

Hid the g_serial stuff behind an ifdef/make arg, and made it somewhat portable ;).

(The keycodes definitions were split into a dedicated header at one
point. This works in both cases, as <linux/input.h> includes it).
That's still a Linux >= 3.9 feature, which means it won't actually do
anything at runtime on anything older than Mk. 7
Silences warnings about using C++-only options with a C compiler
Don't override CFLAGS
And abort if there's no g_serial module
Random sleep amount needed, otherwise the serial tty isn't up on the
initial g_serial load...
Won't affect binary size too much, as the main culprit on that front are
the bitmap fonts, which we need ;).
e.g., I kinda prefer size 2 on the H2O for Terminus ;).
@NiLuJe
Copy link
Contributor Author

NiLuJe commented Mar 27, 2020

Other than that, I didn't even double-check the serial stuff since the raw tty mode worked out just fine for a quick'n dirty test ;).

And, yep, stuff appears to work out just fine (even my fancy ZSH prompt, or a curses UI like nano's). 👍


I didn't touch/test the KFMon script, but you'll probably want to get rid of the crash screen stuff (it currently depends on KOReader's fonts, so it won't work as-is anyway ;p) ;).

(I highly recommend keeping fbdepth to switch to 8bpp, though, as that'll help performance).

(Also not sure if the dropbear binary was imported on purpose?)

Get rid of some more KOReader-specific bits
Get rid of the crash screen, which relied on KOReader font, among other
things.
Simplify fbdepth handling, because we don't have to care about KSM.
@NiLuJe
Copy link
Contributor Author

NiLuJe commented Mar 28, 2020

Okay, I lied ;p. Cleaned up the KFMon startup script :).

@NiLuJe
Copy link
Contributor Author

NiLuJe commented Mar 28, 2020

I had a PW2 plugged in, so I tried a Kindle build, for shit'n giggles ;).

inkvt

It's basically as simple as using the right TC w/

diff --git a/Makefile b/Makefile
index 9d08cf9..91d1344 100644
--- a/Makefile
+++ b/Makefile
@@ -68,7 +68,7 @@ build/libfbink.a:
 build/libfbink_kobo.a:
        mkdir -p build
        make -C FBInk clean
-       make -C FBInk CROSS_TC=$(CROSS_TC) KOBO=true MINIMAL=true FONTS=true staticlib
+       make -C FBInk CROSS_TC=$(CROSS_TC) KINDLE=true MINIMAL=true FONTS=true staticlib
        cp FBInk/Release/libfbink.a build/libfbink_kobo.a
 
 build/fbdepth:

(We don't care about fbdepth on Kindle, they're all @ 8bpp (or 4bpp for really old ones).)

@llandsmeer
Copy link
Owner

Woah this is great, thanks for putting so much effort into this!! 😃 It's really nice to see this working on different devices

And sorry for the kind of verbatim stealing of the koreader startup scripts. I got fed up with ptrace breaking on arm in unexpected ways.. (I got tracexec running in an arm emulator, but the kobo is still different apparently..) :/ The 8bpp creates indeed a nice speedup


Thanks for telling me about printf("%m\n") :)


As for dropbear, I hoped it would also be an SSH client .. which it was not. I tried multiple times to cross-compile a static dbclient (dropbear ssh client) but failed miserable. Do you maybe-maybe have one lying around which I could integrate here?

@llandsmeer llandsmeer merged commit c629cc5 into llandsmeer:master Mar 28, 2020
@llandsmeer
Copy link
Owner

// TODO: Making the font & size configurable might be nice ;).

As for that, I was thinking about creating a named pipe so any program can give commands to the terminal emulator. And then some method to allow images to be displayed on top of certain areas - you'd be able to run full jupyter notebooks with plotting and all from the terminal o.o

@llandsmeer
Copy link
Owner

Build works fine 👍. The MINIMAL=true options seems to have decreased the binary size by 100Kb

@NiLuJe
Copy link
Contributor Author

NiLuJe commented Mar 28, 2020

I do have a bundle 'o stuff centered around an SSH server ;).

(Actual binaries are around here.
FYI, dropbear is built as a multi-call binary, like busybox, which means either run it via a symlink (e.g., dropbear -> dropbearmulti, which is how it's setup here), or pass the requested "app" as the first argument (dropbearmulti dropbear ...)).


EDIT: Okay, just realized you said client :D. Weeeell, it also installs both dbclient and the OpenSSH suite ;).

@llandsmeer
Copy link
Owner

Great, works perfectly! Now I even have zsh and tmux :) And font size 2 is indeed a lot nicer

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

Successfully merging this pull request may close these issues.

None yet

2 participants