![]() |
#16 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
|
Errm, while I think raspberry pi will run hardfloat binaries, *but* it is just a ARMv6 core (as opposed to the newer Kindles which have an ARMv7)! A Raspberry Pi is certainly great fun, but this might be a reason to check out other boards, too. Just an example, as there are many more, the Olimex' A... boards: https://www.olimex.com/Products/OLinuXino/A10/
|
![]() |
![]() |
![]() |
#17 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Hah, and this is why I should read here more often.
Just went out and bought one. Will look at those other boards now... ![]() |
![]() |
![]() |
Advert | |
|
![]() |
#18 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Why in the world did the authors of ld.so choose a variable escape character significant to the shell?
Grumble, well, they did. But relative runpaths can be inserted (if you try hard enough). The Cliff's Notes version: Code:
bin # export INT=`printf '%s' '/mnt/us/extensions/system/lib/ld-linux-armhf.so.3'` bin # echo $INT /mnt/us/extensions/system/lib/ld-linux-armhf.so.3 core2quad bin # patchelf --set-interpreter $INT busybox bin # export LIB=`printf '%s' '$' 'ORIGIN/../lib' '$' 'ORIGIN/../usr/lib'` bin # echo $LIB $ORIGIN/../lib:$ORIGIN/../usr/lib bin # patchelf --set-rpath $LIB busybox ==== bin # readelf -dl busybox - - - - Dynamic section at offset 0x13a180 contains 24 entries: Tag Type Name/Value 0x0000001d (RUNPATH) Library runpath: [$ORIGIN/../lib:$ORIGIN/../usr/lib] ==== [root@kindle root]# echo $PATH /mnt/us/extensions/system/bin:/usr/local/bin:/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/python/bin [root@kindle root]# LD_DEBUG=libs busybox 27571: find library=libc.so.6 [0]; searching - - - - 27571: calling init: /mnt/us/extensions/system/bin/../lib/libc.so.6 - - - - BusyBox v1.22.1 (2014-06-11 02:23:01 CDT) multi-call binary. BusyBox is copyrighted by many authors between 1998-2012. etc. Last edited by knc1; 06-11-2014 at 05:27 PM. |
![]() |
![]() |
![]() |
#19 |
Force-Aware Elf
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,757
Karma: 11557898
Join Date: Feb 2014
Location: Valinor
Device: Kindle 4 w/SO
|
So what is this?
|
![]() |
![]() |
![]() |
#20 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Directions / Information to other software developers on how we intend to run Debian/Ubuntu distribution applications in USB storage.
This technical thread is of interest to perhaps a total of five of the members here but is vital to their work. |
![]() |
![]() |
Advert | |
|
![]() |
#21 |
Force-Aware Elf
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,757
Karma: 11557898
Join Date: Feb 2014
Location: Valinor
Device: Kindle 4 w/SO
|
I see. Thanks for explaining in english
![]() |
![]() |
![]() |
![]() |
#22 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Version 0.2 - Remaining Gottcha's
Our newly build libc.so.6 is importing symbols from an (Amazon) system library and that library (libenvload.so) was not built during the Buildroot glibc build.
This is even though libenvload.so is not among the glibc (NEEDED) entries. ???? Putting on the: "To worry about later" list. Spoiler:
Top post edited. Last edited by knc1; 06-11-2014 at 08:46 PM. |
![]() |
![]() |
![]() |
#23 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,492
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Is there an LD_PRELOAD set in the env? o_O
|
![]() |
![]() |
![]() |
#24 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Nice thought, but no.
These are the only clues (not much): Code:
31380: relocation processing: /usr/lib/libenvload.so (lazy) 31380: symbol=__gmon_start__; lookup in file=./libc.so.6 [0] 31380: symbol=__gmon_start__; lookup in file=/usr/lib/libenvload.so [0] 31380: symbol=__gmon_start__; lookup in file=/mnt/us/extensions/system/lib/ld-linux-armhf.so.3 [0] 31380: symbol=_Jv_RegisterClasses; lookup in file=./libc.so.6 [0] 31380: symbol=_Jv_RegisterClasses; lookup in file=/usr/lib/libenvload.so [0] 31380: symbol=_Jv_RegisterClasses; lookup in file=/mnt/us/extensions/system/lib/ld-linux-armhf.so.3 [0] 31380: symbol=__cxa_finalize; lookup in file=./libc.so.6 [0] 31380: binding file /usr/lib/libenvload.so [0] to ./libc.so.6 [0]: normal symbol `__cxa_finalize' [GLIBC_2.4] Might be something that hooks the loader's audit interface. And if nothing else help, then I'll: objdump -d /usr/lib/libenvload.so on the turkey. ![]() Last edited by knc1; 06-12-2014 at 06:05 AM. |
![]() |
![]() |
![]() |
#25 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Development plan (and post #1) updated.
(Yes, I do re-use these 'update notice' posts for later details.) |
![]() |
![]() |
![]() |
#26 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
|
![]() |
![]() |
![]() |
#27 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,492
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@knc1: Gotcha!
Code:
cat MAIN/etc/ld.so.preload /usr/lib/libenvload.so Fired up IDA: at least it does what it says on the tin: open something, read it, do some string karate, and calls setenv, supposedly with the results from said string chopping. (AFAICT: I still abysmally suck at any kind of assembly). Could it be how they implemented the env tweaks for some daemons? (There's an env leaf in the elektra db for some daemons, and adding one to a daemon that hasn't got one by default is honored, I briefly used it at one point in the K3 Fonts Hacks to trick the browser, it works). I could see how, being a preload, they'd want to avoid relying on libelektra and instead went the dirty way to keep the overhead to a minimum. Weird. Also pure conjecture ;p. EDIT: Meh, maybe not. Nothing uses it anymore in current FW version, and I only tried it on daemons managed by pmond, and pmon happens to have a config leaf pointing to the env utility, so, that was probably handled by pmond... For ref, what I was talking about: Code:
cat /etc/kdb/system/daemon/pmond/browserd/env RG002 40 <DATA> LD_LIBRARY_PATH=/mnt/us/linkfonts/lib Last edited by NiLuJe; 06-12-2014 at 11:49 AM. |
![]() |
![]() |
![]() |
#28 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
@NiLuJe:
Thanks a lot for finding that one. Hmm... It might be required to leave it alone, for compatibly with the existing Amazon system. Well, at least we know now what to research. (patch, delete, etc.) ![]() Note: I keep editing the top post - V-0.2 should happen today. Last edited by knc1; 06-12-2014 at 12:04 PM. |
![]() |
![]() |
![]() |
#29 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,492
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Okay, yep, that wasn't it at all.
It simply parses /var/local/system/locale & /var/local/system/tzVar to add LANG, LC_ALL & KINDLE_TZ to the env. Simple testcase with env & environ: Code:
[root@kindle root]# env -i ./environ LANG=en_US.utf8 LC_ALL=en_US.utf8 KINDLE_TZ=GMT+01:38 environ.c Code:
#include <unistd.h> #include <stdio.h> extern char **environ; main() { int i = 0; while(environ[i]) { printf("%s\n", environ[i++]); } } Code:
#!/usr/bin/env python2 import os for key in os.environ.keys(): print "%s=%s" % (key,os.environ[key]) Last edited by NiLuJe; 06-12-2014 at 02:18 PM. |
![]() |
![]() |
![]() |
#30 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
|
or /usr/bin/env :-) "env -i env" (looking a bit funny, but should do it as well, the first "env -i" cleaning up, the single "env" just displaying.)
Edit: Ah, the second command should be the armhf version, right? So I was a bit fast writing that. |
![]() |
![]() |
![]() |
Tags |
armhf |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Kindle Nicknaming Scheme, Using Kindle with Calibre, and Hacking the Kindle | Klif | Amazon Kindle | 11 | 09-12-2012 05:11 PM |
$0.01 in Kindle Store: Interactive Sudoku for Kindle 2 and Kindle DX - Volume 1 | Xia | Deals and Resources (No Self-Promotion or Affiliate Links) | 2 | 11-07-2009 10:06 AM |