View Single Post
Old 03-25-2023, 07:44 PM   #3
elinkser
Groupie
elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.
 
Posts: 186
Karma: 146236
Join Date: Oct 2022
Device: Kobo Clara HD
***PLS SEE SECURITY REMINDER ON TOP POST***

COPYING ELINKS BINARY TO KOBO CLARA HD WITHOUT COMPILING OR CHROOT:
(Some may find this an easier way to get the elinks browser.)

You can see dependencies of elinks from here.

Depends (6)
libbz2
libcrypto3
libexpat
libssl3
musl
zlib

You can get the packages from here.

You can get a CA certificate store from here.


DOWNLOAD THE REQUIRED PACKAGES:

$ wget https://dl-cdn.alpinelinux.org/alpin...-0.15.1-r1.apk

$ wget https://dl-cdn.alpinelinux.org/alpin...2-1.0.8-r4.apk

$ wget https://dl-cdn.alpinelinux.org/alpin...3-3.0.8-r1.apk

$ wget https://dl-cdn.alpinelinux.org/alpin...t-2.5.0-r0.apk

$ wget https://dl-cdn.alpinelinux.org/alpin...3-3.0.8-r1.apk

$ wget https://dl-cdn.alpinelinux.org/alpin...l-1.2.3-r4.apk

$ wget https://dl-cdn.alpinelinux.org/alpin...-1.2.13-r0.apk

$ wget https://curl.se/ca/cacert.pem


RUN THESE COMMANDS FROM LINUX DESKTOP OR ENVIRONMENT(really just need to unarchive and copy some files, but the tar command fails if you try it on the vfat filesystem /mnt/onboard of the Kobo because of vfat not supporting symlinks. I didn't try on the root filesystem partition e.g. /opt):

$ mkdir myalpine

$ cd myalpine/

$ tar zxvf elinks-0.15.1-r1.apk

$ tar zxvf libbz2-1.0.8-r4.apk

$ tar zxvf libcrypto3-3.0.8-r1.apk

$ tar zxvf libexpat-2.5.0-r0.apk

$ tar zxvf libssl3-3.0.8-r1.apk

$ tar zxvf musl-1.2.3-r4.apk

$ tar zxvf zlib-1.2.13-r0.apk

$ mkdir scripts

$ mv usr/bin/elinks scripts/

$ ls -l scripts/
-rwxr-xr-x 923356 elinks

$ mkdir libs

$ mv usr/lib/libbz2.so.1.0.8 libs/libbz2.so.1

$ mv lib/libcrypto.so.3 libs/

$ mv usr/lib/libexpat.so.1.8.10 libs/libexpat.so.1

$ mv lib/libssl.so.3 libs/

$ cp lib/ld-musl-armhf.so.1 libs/libc.musl-armv7.so.1

$ mv lib/ld-musl-armhf.so.1 libs/

$ mv lib/libz.so.1.2.13 libs/libz.so.1

$ ls -l libs
-rwxr-xr-x 525980 ld-musl-armhf.so.1
-rwxr-xr-x 69772 libbz2.so.1
-rwxr-xr-x 525980 libc.musl-armv7.so.1
-rwxr-xr-x 2233828 libcrypto.so.3
-rwxr-xr-x 132444 libexpat.so.1
-rwxr-xr-x 405904 libssl.so.3
-rwxr-xr-x 66856 libz.so.1

$ cp cacert.pem cert.pm
$ mkdir certs
$ cp cacert.pem certs/ca-certificates.crt


NOW CONNECT YOUR KOBO TO YOUR PC:

Note the contents of /mnt/onboard/.adds/koreader/scripts/ does not have any elinks binary.
Copy your elinks binary from the scripts/ folder on the PC to the /mnt/onboard/.adds/koreader/scripts/ folder on the kobo.

Note the contents of /mnt/onboard/.adds/koreader/libs/ already has a libz.so.1 lib.
Copy all libs except libz.so.1 from the libs/ folder on the PC to the /mnt/onboard/.adds/koreader/libs/ folder on the kobo.
Note that these new libs all have a different date than the default pre-existing libs.

Copy your cert.pm and certs/ca-certificates.crt to the /etc/ssl/ directory.(You may notice there is already one in the /mnt/onboard/.adds/koreader/data/ folder anyway.)



RUN THESE COMMANDS IN KOREADER TERMINAL, OR FROM A TELNET/SSH CLIENT CONNECTION:

***SECURITY REMINDER***
Telnet sessions are in cleartext INCLUDING LOGIN SESSIONS, so only use on a private network, if at all!
If you always have DEVMODE set to ON for whatever reasons , that means Telnet is on by default, unless you toggle it off , e.g. using NickelMenu.

You can install KOReader to get the more secure SSH option, and NiLuJe's kobostuff provides a package that includes an SSH binary.

You can start the KOReader SSH server via NickelMenu.

**********************************

IF RUNNING FROM KOREADER TERMINAL:

# elinks

IF RUNNING FROM A TELNET/SSH CLIENT CONNECTION:

# cd /mnt/onboard/.adds/koreader/
# export LD_LIBRARY_PATH=/mnt/onboard/.adds/koreader/libs/
# echo $LD_LIBRARY_PATH
# ./scripts/elinks


You then enter '.' to see current working directory, or enter a web address
(just keep pressing return if you get SSL errors).
Up and Down arrows to traverse the links.
Left and Right arrows to follow link or go back.
Space and 'b' to page forward and back.
'[' and ']' to go left and right.
Enter to edit a text field, 'd' to download link.
'a' to add a bookmark, 's' to see them, TAB to move through options.
ESC followed by Down arrow and Left/Right arrows to see menus.
'g' to enter a new address, 'q' to quit.


ALL THIS WORKED FOR ME, BUT I AM UNSURE IF IT IS BECAUSE OF SOMETHING I INSTALLED PREVIOUSLY!

YMMVVVVVVVVVVVVVV.....





***


***ADDENDUM - NANO AND WGET***

The nano editor has only the following dependencies:

Depends (2)
musl*
ncurses-libs


And it's not much additional effort to add wget .

Depends (6)
libcrypto3*
libidn2
libssl3*
musl*
pcre2
zlib*

*already got these from elinks install.


DOWNLOAD THE REQUIRED PACKAGES:

$ wget https://dl-cdn.alpinelinux.org/alpin...ano-7.0-r0.apk

$ wget https://dl-cdn.alpinelinux.org/alpin...0221119-r0.apk

$ wget https://dl-cdn.alpinelinux.org/alpin...0221119-r0.apk
(a dependency of ncurses-libs)

$ wget https://dl-cdn.alpinelinux.org/alpin...-1.21.3-r2.apk

$ wget https://dl-cdn.alpinelinux.org/alpin...2-2.3.4-r0.apk

$ wget https://dl-cdn.alpinelinux.org/alpin...ing-1.1-r0.apk
(a dependency of libidn2)

$ wget https://dl-cdn.alpinelinux.org/alpin...2-10.42-r0.apk



RUN THESE COMMANDS FROM LINUX DESKTOP:

$ cd myalpine/

$ tar zxvf nano-7.0-r0.apk

$ tar zxvf ncurses-libs-6.3_p20221119-r0.apk

$ tar zxvf ncurses-terminfo-base-6.3_p20221119-r0.apk

$ tar zxvf wget-1.21.3-r2.apk

$ tar zxvf libidn2-2.3.4-r0.apk

$ tar zxvf libunistring-1.1-r0.apk

$ tar zxvf pcre2-10.42-r0.apk

$ mv usr/bin/nano scripts/

$ mv usr/lib/libformw.so.6.3 libs/libformw.so.6

$ mv usr/lib/libmenuw.so.6.3 libs/libmenuw.so.6

$ mv usr/lib/libncursesw.so.6.3 libs/libncursesw.so.6

$ mv usr/lib/libpanelw.so.6.3 libs/libpanelw.so.6

$ mv usr/bin/wget scripts/wgets

$ mv usr/lib/libidn2.so.0.3.8 libs/libidn2.so.0

$ mv usr/lib/libunistring.so.5.0.0 libs/libunistring.so.5

$ mv usr/lib/libpcre2-8.so.0.11.2 libs/libpcre2-8.so.0

$ mv usr/lib/libpcre2-posix.so.3.0.4 libs/libpcre2-posix.so.3


NOW CONNECT YOUR KOBO TO YOUR PC:

Copy your nano/wgets binaries from the scripts/ folder on the PC to the /mnt/onboard/.adds/koreader/scripts/ folder on the kobo.

Copy new libs from the libs/ folder on the PC to the /mnt/onboard/.adds/koreader/libs/ folder on the kobo:
libformw.so.6
libmenuw.so.6
libncursesw.so.6
libpanelw.so.6
libidn2.so.0
libunistring.so.5
libpcre2-8.so.0
libpcre2-posix.so.3

Copy your etc/terminfo directory to the /etc/ directory.


RUN THESE FROM KOREADER TERMINAL:

# nano
(Ctrl-x to exit)

# /usr/bin/wget
BusyBox v1.31.1.kobo (2020-04-22 11:41:43 EDT) multi-call binary.
...

# wgets -V
GNU Wget 1.21.3 built on linux-musleabihf.
...

# wgets -O mr.html https://www.mobileread.com/forums/sh...91&postcount=3
(Ctrl-c if it hangs)

# elinks mr.html
(q to exit)




IF RUNNING FROM A TELNET/SSH CLIENT CONNECTION:


CREATE THE FILE "/korenv.sh":
#!/bin/sh
export PATH=/mnt/onboard/.adds/koreader/scripts:/mnt/onboard/.adds/koreader/plugins/terminal.koplugin/:$PATH
export LD_LIBRARY_PATH=/mnt/onboard/.adds/koreader/libs:$LD_LIBRARY_PATH
export TERM=xterm
export HOME=/mnt/onboard/.adds/koreader/
cd $HOME

Run the command " . ./korenv.sh"

Then run the commands from above.

(You will also be able to run the KOReader file manager as just "shfm", as listed here .


***




TRY THE W3M BROWSER AS AN ALTERNATIVE TO ELINKS:

The w3m web browser has only the following dependencies:

Depends (6)
gc
libcrypto3*
libssl3*
musl*
ncurses-libs*
zlib*

*already got these from elinks and nano installs.


$ wget https://dl-cdn.alpinelinux.org/alpin...0220429-r3.apk

$ wget https://dl-cdn.alpinelinux.org/alpin...c-8.2.2-r0.apk

$ wget https://dl-cdn.alpinelinux.org/alpin...0220924-r4.apk
(a dependency of gc)

$ wget https://dl-cdn.alpinelinux.org/alpin...0220924-r4.apk
(a dependency of gc)


$ tar zxvf w3m-0.5.3.20220429-r3.apk

$ tar zxvf gc-8.2.2-r0.apk

$ tar zxvf libgcc-12.2.1_git20220924-r4.apk

$ tar zxvf libstdc++-12.2.1_git20220924-r4.apk


$ mv usr/bin/w3m scripts/

$ cp -r usr/lib/w3m libs/

$ mv usr/share/w3m/w3mhelp.html libs/w3m/

$ mv usr/lib/libcord.so.1.5.0 libs/libcord.so.1

$ mv usr/lib/libgc.so.1.5.1 libs/libgc.so.1

$ mv usr/lib/libgctba.so.1.5.0 libs/libgctba.so.1

$ mv usr/lib/libgcc_s.so.1 libs/libgcc_s.so.1

$ mv usr/lib/libstdc++.so.6.0.30 libs/libstdc++.so.6


NOW CONNECT YOUR KOBO TO YOUR PC:

Copy your w3m binary from the scripts/ folder on the PC to the /mnt/onboard/.adds/koreader/scripts/ folder on the kobo.

Copy new libs from the libs/ folder on the PC to the /mnt/onboard/.adds/koreader/libs/ folder on the kobo:
w3m/
libcord.so.1
libgc.so.1
libgctba.so.1
libgcc_s.so.1
libstdc++.so.6


RUN THESE FROM KOREADER TERMINAL:

# cp -r libs/w3m/ /usr/lib/
# w3m -v
('U' to open link,e.g. http://w3m.sourceforge.net/ or https://github.com/tats/w3m , 'q' to quit)
('o' to get option list
Space down to Color Settings->Display with color
Tab to No
Enter
Space down to bottom of options page
Tab or Esc-Tab to OK
Enter
'q' , 'y' to quit)




***

When upgrading to OCP-KOReader-v2023.06 and copying libs from my old KOReader setup, KOReader would crash when opening pdf files.

The crash was because of libs installed for the w3m browser.

w3m libs not needed:
libgcc_s.so.1
libgctba.so.1
* this lib would crash KOReader when opening pdf files *

Ironically, if I don't copy those two libs to the new KOReader installation, w3m seems to work fine anyway.


***




ABBREVIATED OUTPUT OF "elinks -dump libs/w3m/w3mhelp.html":

Spoiler:



Page/Cursor motion

SPC,C-v Forward page
b,ESC v Backward page
l,C-f Cursor right
h,C-b Cursor left
j,C-n Cursor down
k,C-p Cursor up
J Roll up one line
K Roll down one line
^,C-a Go to the beginning of line
$,C-e Go to the end of line
w Go to next word
W Go to previous word
> Shift screen right
< Shift screen left
. Shift screen one column right
, Shift screen one column left
g,M-< Go to the first line
G,M-> Go to the last line
ESC g Go to specified line
Z Move to the center line
z Move to the center column
TAB Move to next hyperlink
C-u,ESC TAB Move to previous hyperlink
[ Go to the first link
] Go to the last link


Hyperlink operation

RET Follow hyperlink
a, ESC RET Save link to file
u Peek at link URL
i Peek at image URL
I View inline image
ESC I Save inline image to file
: Mark URL-like strings as links
ESC : Mark Message-ID-like strings as links
c Peek at current URL
= Display information about current document
C-g Show current line number
C-h View browser history
F Render frames
M Browse current document using external browser (prefix 2, 3,
..., or 9 to invoke alternate configured browsers, e.g. 3 M)
ESC M Browse link using external browser (prefixed as above, e.g. 3ESC M)


File/Stream operation

U Open URL
V View new file
@ Execute shell command and load
# Execute shell command and browse


Buffer operation

B Back to the previous buffer
v View HTML source
s Select buffer
E Edit buffer source
C-l Redraw screen
R Reload buffer
S Save buffer
ESC s Save source
ESC e Edit buffer image


Buffer selection mode

k, C-p Select previous buffer
j, C-n Select next buffer
D Delete current buffer
RET Go to the selected buffer


Bookmark operation

ESC b Load bookmark
ESC a Add current to bookmark


Search

/,C-s Search forward
?,C-r Search backward
n Search next
N Search previous
C-w Toggle search wrap mode


Miscellany

! Execute shell command
H Help (load this file)
o Set option
C-k Show cookie jar
C-c Stop
C-z Suspend
q Quit (with confirmation, if you like)
Q Quit without confirmation










***ADD A COUPLE OF GAMES***


The moon-buggy arcade shooting game has only the following dependencies:

Depends (2)
libncursesw**
musl*

* Already got it from the Elinks/Nano install above.
** Already got the equivalent from the Nano install above.


The ttyper typing test game has only the following dependencies:

Depends (2)
libgcc**
musl*

* Already got it from the Elinks/Nano install above.
** Already got it as a gc subdependency from the W3m install above.


DOWNLOAD THE REQUIRED PACKAGES:

wget https://dl-cdn.alpinelinux.org/alpin...-1.0.51-r1.apk

wget https://dl-cdn.alpinelinux.org/alpin...r-1.2.0-r1.apk


RUN THESE COMMANDS FROM LINUX DESKTOP:

$ cd myalpine/

$ tar zxvf moon-buggy-1.0.51-r1.apk

$ mv usr/bin/moon-buggy scripts/

$ tar zxvf ttyper-1.2.0-r1.apk

$ mv usr/bin/ttyper scripts/


NOW CONNECT YOUR KOBO TO YOUR PC:

Copy your moon-buggy/ttyper binaries from the scripts/ folder on the PC to the /mnt/onboard/.adds/koreader/scripts/ folder on the kobo.


RUN THESE FROM KOREADER TERMINAL:

# moon-buggy
(Space to jump, 'a' to fire, 'q' to quit)

# ttyper -w 5
(type any letter followed by backspace to see 5-word list, then type each word followed by a space. Slide up the right scrollbar to see score.)


***


***NOTE***

The links provided were valid at the time, and should be good for a while, especially if they are all from the same branch, i.e. 3.17 in this case.

But if you download packages from the edge branch, as was the case for moon-buggy, its dependencies will keep changing as the rolling edge branch keeps updating.

So at some point the provided links will be out of date, and you would have to search for the package yourself in the edge branch or the latest branch(e.g. 3.18):
https://pkgs.alpinelinux.org/packages?arch=armv7
This would list the up-to-date dependencies.

Then download the required binary the from the appropriate repository:
https://dl-cdn.alpinelinux.org/alpine/


***

Last edited by elinkser; 09-18-2023 at 06:28 PM. Reason: nano wgets + games + w3m libs not needed + edge note
elinkser is offline   Reply With Quote