![]() |
#1 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 456
Karma: 1287375
Join Date: Jan 2013
Location: West Gardiner, Maine
Device: Touch (5.3.7)
|
Help with cross-compiling tools?
I've been reading and reading and... I just don't seem to understand what I should do here:
I've looked at CodeSourcery and Linero and Scratchbox2 and Buildroot?? I've downloaded tons of stuff and am still trying to figure out what is best. What is the easiest and/or most used path here? Should I use the filesystem from the Kindle as a skeleton or use ??? I have a debian arm chroot working with qemu-arm-static so I can apt-get update in it, I thought I could compile in that? I guess not? Many of the pages linked on this site for development are 404'd. Just some general guidance on what you use, and or maybe a config file or 2? Thanks, as I have no more hair to pull out! ![]() |
![]() |
![]() |
![]() |
#2 |
(offline)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,907
Karma: 6736094
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
I'm not cross-compiling much, but I've used Linaro because it's trivial to install and "just works" - in my case, for experimenting with u-boot (I wrote that for 10.04, but it continues to work after the upgrade to 12.04).
I guess others (twobob, knc1, NiLuJe...) will be more knowledgeable than I am, so you may want to wait for their opinion ![]() |
![]() |
![]() |
Advert | |
|
![]() |
#3 | ||
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
I just thought that food would be a better long-term investment. Quote:
https://www.mobileread.com/forums/sho...d.php?t=222850 Describes three different approaches. |
||
![]() |
![]() |
![]() |
#4 |
( ͡° ͜ʖ ͡°){ʇ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
|
hmm...
It's up to you. if the project is BIG then you will NEED to cross compile. if the project is TINY you could use something like tcc on the device. in the "middle" is the grey area. The osmo, galculator and a few other bits (star-dict) I have actually built ON THE KINDLE touch. This has many advantages to the layman, easy to include lib headers (apt-get libwhatever-dev), stable, plenty of "native arm" versions of possibly complicated libs to compile, dependency resolution. The final choice I suppose would be the toolchain (or something like Buildroot that provides a Toolchain) and there there are few options now... Assuming you are focusing down binaries for your device and later only... The Linaro stuff or Code Sourcery and probably an awful lot more... okay... All that said, let's presume you want an on-device solution... AN ON-DEVICE SOLUTION:: If you are LOOKING for an "on device" solution I would suggest: Debian Wheezy via grip (important as SID is now NOT making stuff our libc can run) (I have a few sizes of this already built 500MB, 1Gb and 2Gb) root@kindle:/# apt-get install libtool build-essential ccache automake I would guess that this would, with the debian grip guts, weigh in around 320 MB) (then inside debian) root@kindle:/# mkdir -p /mnt/us/extensions (on my system that becomes /mnt/us/debian/mnt/us/extensions) build stuff like: root@kindle:/# ./configure --prefix=/mnt/us/extensions/{thing}/usr <other options> root@kindle:/# make clean; PATH=/usr/lib/ccache:$PATH make ; make install then MOVE(/COPY) the /mnt/us/debian/mnt/us/extensions stuff to /mnt/us/extensions from outside the chroot. and run it to test it. perhaps KNC1 will be kind enough to let me update those debian images somewhere to replace the older ones I believe he is currently hosting. Hope that helps. Last edited by twobob; 09-23-2013 at 07:46 AM. |
![]() |
![]() |
![]() |
#5 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
( ͡° ͜ʖ ͡°){ʇ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
|
Thanks. I think I have thought of a solution that WONT take up your space...
I've shoved a 500MB version (now zipped to 160mb) on dropbox and post INSTRUCTIONS to make it LARGER. (not smaller) EDIT: and here is a 7zipped (110Mb) link to the same file... 7 zipped 500Mb debian You can find 7zip for the kindle here https://www.mobileread.com/forums/sho...d.php?t=223212 the following example will make the seed 500MB into a 2 Gb partition FILENAME=/mnt/base-us/deb.5gb.ext3 dd if=/dev/zero of=$FILENAME bs=1M count=1500 oflag=append conv=notrunc e2fsck -f $FILENAME resize2fs $FILENAME (You can choose ANY size just swap the 1500 for however many MB you want ADDED) SEE THIS POST FOR A KINDLE DD THAT SUPPORTS THE RIGHT OPTIONS, (or do it on your PC) That seems an efficient solution. Alternately as pointed out by Icantbebothered: FILENAME=/mnt/base-us/deb.5gb.ext3 dd if=/dev/zero bs=1M count=512 >> $FILENAME e2fsck -f $FILENAME resize2fs $FILENAME The above is OKAY because the ext3 file should never be "being written to" anyways during this process.. so yeah. Good point by him. deb.5gb.ext3 is a general purpose image that WILL need the additional steps outlined above doing to make it a "build system", when you are bored of it or you screw it up just replace it again. (EDIT: I did this just last night) Enjoy The script to mount this partition is available on the DEBIAN ON A PAPERWHITE thread (and ill post it again below) Last edited by twobob; 09-27-2013 at 07:27 AM. Reason: /mnt/base-us |
![]() |
![]() |
![]() |
#7 |
( ͡° ͜ʖ ͡°){ʇ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
|
Code:
#!/bin/sh unset LD_PRELOAD rm /dev/loop/debian mknod -m0660 /dev/loop/debian b 7 250 echo "[*] Mounting Rootfs..." /bin/mount -o loop=/dev/loop/debian,noatime -t ext3 /mnt/base-us/debian.ext3 /mnt/us/debian echo "[*] Preparing Filesystem..." /bin/mount -o bind /dev /mnt/us/debian/dev /bin/mount -o bind /proc /mnt/us/debian/proc /bin/mount -o bind /sys /mnt/us/debian/sys /bin/mount -o bind /dev/pts /mnt/us/debian/dev/pts #optionally make the kindle available inside debian... #mount -o bind /mnt/base-us /mnt/us/debian/kindle/mnt/us #mount -o bind /mnt/base-us /mnt/us/debian/kindle/mnt/base-us echo "[*] Preparing Network Connections..." cp /etc/hosts /mnt/us/debian/etc/hosts cp /etc/resolv.conf /mnt/us/debian/etc/resolv.conf echo "[*] Starting Debian shell..." chroot /mnt/us/debian /bin/bash $@ #chroot /mnt/debian echo echo "[*] Unmounting Rootfs..." #optionally remove that kindle inside the debian stuff #umount /mnt/us/debian/kindle/mnt/us #umount /mnt/us/debian/kindle/mnt/base-us /bin/umount /mnt/us/debian/dev/pts /bin/umount /mnt/us/debian/dev /bin/umount /mnt/us/debian/proc /bin/umount /mnt/us/debian/sys /bin/umount -d /mnt/us/debian echo "[*] Debian unmounted." Please note that this script EXPECTS the debian image to be called debian.ext3 and to be on the FAT ROOT like /mnt/us/debian.ext3 so rename your image to that and put it there... put this script wherever you would like and run it directly via SSH. Last edited by twobob; 09-23-2013 at 02:10 PM. |
![]() |
![]() |
![]() |
#8 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Ah, you could:
* run the increase size stuff on your copy - * gzip (or zip) the result - All of those unused blocks will compress nicely, might even be smaller that the present non-compressed image file. |
![]() |
![]() |
![]() |
#9 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
|
![]() |
![]() |
![]() |
#10 | |
( ͡° ͜ʖ ͡°){ʇ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
|
one more thing... the busybox dd does NOT support these append modes...
Here is one that does. Enjoy. Quote:
|
|
![]() |
![]() |
![]() |
#11 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
And provided you want to go the cross way, like ixtab said, a Linaro or CodeSourcery TC is probably the easiest thing you can get your hands on, and, if you're only targetting the K4/K5, it usually works well enough without too many hair-pulling experiences
![]() I personally am building two different TCs with the help of crosstool-ng, one targetting the K2/K3, and the other the K5. I'm using bleeding edge GCC versions, so there is some hoop jumping to be done, especially for the K3 toolchain. My configs & build-scripts are available in the kindle-x-tc-YYYY.MM.tar.gz attachement of the gigantic K2/K3 hack threads. There are a *lot* of different ways to do it, and each of us tends to do our "own" stuff, so there isn't a really universal 'right way' to do it. For a cross TC, I'd say the closest to it would be the CodeSourcery TC, a recent one for the K5, and the truly awfully old one from 2009q7 (I think?) for the K3. If you have more specific questions, don't hesitate to ask, or to come looking for us on IRC ![]() Last edited by NiLuJe; 09-23-2013 at 09:24 AM. |
![]() |
![]() |
![]() |
#12 |
( ͡° ͜ʖ ͡°){ʇ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
|
|
![]() |
![]() |
![]() |
#13 | |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 456
Karma: 1287375
Join Date: Jan 2013
Location: West Gardiner, Maine
Device: Touch (5.3.7)
|
Quote:
Thank you all for the help! PS: I belong to a wonderful motorcycle forum where members can ask ANYTHING, even how to change your oil, and many will chime in with help and photos of where and what to do. No mocking, just good natured fun. This forum reminds me of that kind of comraderie. Thanks. |
|
![]() |
![]() |
![]() |
#14 | |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 456
Karma: 1287375
Join Date: Jan 2013
Location: West Gardiner, Maine
Device: Touch (5.3.7)
|
Quote:
![]() I also resized the twobob image to 2G and installed lots of stuff in that image on my Kindle. Looks very promising! Thanks! |
|
![]() |
![]() |
![]() |
#15 | |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
But . . . . The situation developed where many of my sites where only serving to web 'bots, not people. It reached such proportions, that I was getting "resource limits exceeded" messages more than once a day. To continue the way I was going, I would have needed to implement (by monthly purchase) a much higher resource system. I have been retired for almost 20 years - To do that would have made serious in-roads into my food budget - I decided in favor of food. (Literally, no humor intended.) I know, that is a voluntary choice of lifestyle, of which I am solely responsible, but the choice had to be made. So many of my "free" support services had to go. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compiling for Lubuntu (regarding compiling instructions) | jgratero | Sigil | 5 | 07-15-2012 07:54 PM |
Cross compiling for the Kindle - wrong glibc version | ninjageckoattack | Kindle Developer's Corner | 14 | 02-25-2012 04:44 PM |
cross compiling links | dent | Kindle Developer's Corner | 1 | 02-07-2011 08:42 AM |
cross-compiling gstreamer for the kindle3 | dent | Kindle Developer's Corner | 9 | 02-04-2011 08:39 AM |
Problems compiling | unkilbeeg | Sigil | 1 | 09-13-2009 01:49 PM |