![]() |
#1 |
( ͡° ͜ʖ ͡°){ʇ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
|
![]()
EDIT: This would be just the same for a 3.4 - as the _defconfig is identical
----------------------------------------------------------------------------------------- For my 500th Post I was hoping to be able to post something special A buildroot of a linux 2.6.26-lab126 kernal with the benfits that brings seemed appropriately cool. NOTE THIS IS TO BUILD A KERNAL = NOT INSTALL OR RUN ONE!!! Can't help you there. We make the files here, do what you will. I'll update the guide with tips as and if I find or make em. READ THE DOCS!!! The buildroot docs are your friend for general support on different platforms I did this on Linux Mint 13 32 bit Lxde with the CodeSourcery arm 2012.03 TC. CS 2007q3 TC (get it from Kek) There are undoubtedly better ways of doing this. For my part I am hoping that eventually compiling the sources against the right headers and relevant patches in an automated way will bring us a faster way to create and manage packages (Buildroot LOCAL and other flags are the way forward here I think, or maybe Git) Buildroot needs Wget, subversion, bazaar, git, mercurial among others so make sure you are ready to install some stuff if it complains : ) Preamble ends. EDIT: I have now compiled every relevant (I think) package in buildroot just to save you finding the fails - See post 2 for details) OKAY SO THE GUIDE: (this is lilable to change and perhaps has a few tiny foofs - feel free to point fingers) Open buildroot: I just used the newest one. It's a solid app. If you don't already have it go get it via GIT. First decide where to build it: read the docs. The easy decision here is "do nothing" the other is "create a build folder" we will talk about that first: create a folder to build in or just grab the entire buildroot via git and build in there - cd the buildroot build folder IF YOU MADE ONE. OR: The other choice "Do nothing", if you choose the "Do nothing" path the stuff is compiled into /output actually _in_ the Git repo version. Re the whole build folder - not build folder thing - see buildroot docs, don't HAVE to make one, but it's tidy, up to _you_. IF YOU CHOSE A BUILD FOLDER: From your build folder make xconfig (with -C your buildroot folder IF YOU MADE A BUILD FOLDER - like I say: read buildroot docs) (you also may need -O $PWD, read the docs) OR IF YOU CHOSE DO NOTHING: Simply, from the root of the buildroot Git repo type: make xconfig NEXT UP: Configure Buildroot: (In the make xconfig menu, you can also do gconfig or w/e) Settings: For Kindle 3 Keyboard. Arch: Arm (little endian) Variant: arm1136jf_s Target ABI: EABI Build options, Commands, Mirrors as they are Toolchain: Type: External Toolchain: Sourcery CodeBench ARM 2007.q3 Origin: Pre-installed Path: /opt/arm-2007.q3 (or whatever) [x] enable mmu support SYSTEM: /dev: static Init: Busybox (choose some packages if you want - or do it second pass) FILESYSTEM IMAGES: tar (for easy access to files, usually just choose this to get at the files) (optionally also choose cpio for emu kindle and iniramfs - WARNING THIS WILL BE HUGE AND BREAK WITH BIG SOFTWARE - THIS IS NOT A SUPPORTED OPTION _ YMMV _ DONT _ SAY _ I _ DIDNT _ WARN _ YOU) Bootloaders: OPTIONALLY CHOOSE U-Boot - or nothing if you're not bothered about it actually loading in that way. KERNAL: Linux Version: Custom tarball URL of custom tarball: http://ThisIsNotARealDomain.net/linu...lab126.tar.bz2 (NB!!! insert your OWN HOSTING here, or serve it locally like: http://localhost/linux-2.6.26-lab126.tar.bz2 from your machine via a local web service, the support for LOCAL on buildroot is quite new once I confirm it now works via file calls i'll update this guide) So to confirm: Enter URL of linux-2.6.26-lab126.tar.bz2 of extracted from Kindle_src_3.3_611680021.tar.gz (host it yourself. find it online or just feed it via a local http) CUSTOM KERNAL PATCHES: For some reason BR doesnt like applying this patch. Have to apply it manually until we get that figure out. so leave PATH blank and apply it yourself as outlined below. Path is at https://svn.ak-team.com/svn/Configs/...buildfix.patch Kernal Config: use a defconfig Defconfig name: imx35_luigi Kernal Binary Format: zImage (you can choose uImage or whatever works for you) One note: You _CAN_ Choose from options of software in list... _BUT_ I chose hardly any as I want it to finish quick to let me manually interrupt the buildroot 'make' process when the kernal comes around to building. you can always just do a make again - the new software will just be added - the old work not lost. Save it and close run make Either read the buildroot docs and do the specific steps to incrementally make up the the kernal OR This is what I do: I have added I think copious notes extra here to determine WHEN TO STOP the automated build by Sigterm. There are better ways, this suits me fine however. NOTES ON WHERE TO STOP THE INITIAL BUILDROOT BUILD MANUALLY, BEGIN WHEN to STOP: The kernal build will appear highlighted in White on Black [Kernal blah blah blah] It will start the download from your Custom URL THE DOWNLOAD HAS COMPLETED. THIS IS NOT A QUICK PROCESS. (unless you host locally) so wait for the DOWNLOAD to get to 100% Then it will start the configure just CTRL +C there. So to confirm: Just CNTRL + C at some point there after the dl has completed. and before the build has started - so at some point during the configure Its not critical really WHERE, just before buildroot starts making the kernal as the MAKE CLEAN is a bit overly aggressive according to Niluje so I have added these extra notes about WHERE to keep things simple. Okay: NOTES ON WHERE TO STOP THE INITIAL BUILDROOT BUILD MANUALLY, conclude So what now? The kindle kernel source code Kindle_src_3.3_611680021.tar.gz will have appeared unzipped in /build/linux-custom - go there. Edit the Makefile (in /build/linux-custom) ARCH ?= (SUBARCH) BECOMES ARCH ?= arm CROSS_COMPILE ?= BECOMES CROSS_COMPILE = arm-none-linux-gnueabi- (check your path has the bins in!) Save it and close run make imx35_luigi_defconfig to generate a .config file. Edit .config file search "CONFIG_INITRAMFS_SOURCE" with the reference to a skeleton change it to CONFIG_INITRAMFS_SOURCE="" (as in no value in quotes) add modules you might want to build etc. I added binfmt_misc as a module for example Save it and close One more thing: $ cat> include/linux/kindle_version.h << EOF # ifndef __KINDLE_VERSION_H__ # define __KINDLE_VERSION_H__ # define VERSION_TAG "000000" # endif EOF as this is not generated by the makes (unless you applied the Niluje patch already, it does this for you as espoused below) The mighty NiLuje has kindly provided https://svn.ak-team.com/svn/Configs/...buildfix.patch which comprises this kindle_version.s file creation and some make cleansing for the Amazon makes. It does not make the .config so that step is still required, That's https: //svn.ak-team.com/svn/Configs/trunk/Kindle/Misc/kindle-3.3-kernel-buildfix.patch Without the space... run make Should complete. You should be able to then go back and install MORE options in the make xconfig stage and run make again in your root buildroot folder to create the additional packages without having to repeat the kernal steps. Enjoy. export LD_LIBRARY_PATH=/mnt/us/lib:/mnt/us/usr/lib:/lib:/usr/lib on the device for course testing of stuff splattered onto /mnt/us/* : ) Thanks for being such a great community. I have had a solid time. Here's to the future of tiny devices and tiny groups of people doing big things. And Happy Supercentenarian for me! Last edited by twobob; 09-28-2012 at 01:24 PM. Reason: you're not your, other minutia |
![]() |
![]() |
![]() |
#2 |
( ͡° ͜ʖ ͡°){ʇ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
|
I will add here a list of things that BREAK with the 2006q3 TC OOTB
WHY WOULD YOU BOTHER DOING THIS??? Well, Buildroot allows us to create staged sections to each build, meaning that once I have each of these packages built - I can go back an cherry pick which stage to tweak, what Makefile etc... Basically I also didnt want anyone else to have to try a package only to find it broken. So there you go, 16 hours later here's the info. The Deathlist: Spoiler:
Okay onwards. Here is a complete list of everything I EXCLUDED: Not built: (implicitly excluding the above stuff that died obviously) These packages were not included in the build - They either were pointless given the hardware - outdated or duplicated - or relied on something that currently can't build, or for some other ineffable reason I didn't like the cut of their gib. BUSYBOX Spoiler:
Audio and video applications Spoiler:
ALSA utils selection Spoiler:
Debugging, profiling and benchmark Spoiler:
Development tools Spoiler:
Graphic libraries and applications (graphic/text) Spoiler:
HARDWARE: Spoiler:
INTERPRETERS: Spoiler:
LIBRARIES: AUDIO Spoiler:
LIBS: CRYPTO Spoiler:
LIBS: FS Spoiler:
LIBS: GRAPHICS Spoiler:
LIBS: HW Spoiler:
LIBS: MULTIMEDIA Spoiler:
LIBS: NETWORKING Spoiler:
LIBS: TEXT Spoiler:
MISC: All elided. NETWORKING APPS: Spoiler:
Package managers: IPKG: The Itsy Package Installer from handhelds.org Opkg built instead. Real-Time XENOMAI: Real-Time Framework for Linux http://www.xenomai.org Xenomai is split in two parts: a kernel part and an userspace part. So, No. System tools QUOTA: Implementation of the disk quota system. Selects: BR2_PACKAGE_UTIL_LINUX (which select UUID stuffs, which die, see death reports) Text editors and viewers nano is NOT optimized for size Host utilities Spoiler:
Bootloaders Spoiler:
That's all folks. Everything else built just fine. More details on that in a moment Last edited by twobob; 08-19-2012 at 03:00 PM. Reason: better info |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
( ͡° ͜ʖ ͡°){ʇ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
|
What IS built. Here's a rough overview. 'Find' is your friend.
Yay Readelf is in the list! Yay. Anyways here it is... [root@kindle bin]# cd /mnt/us/usr/bin [root@kindle bin]# ls PHP Code:
[root@kindle bin]# cd /mnt/us/sbin [root@kindle sbin]# ls PHP Code:
/lib contains the new kernel modules and libs obviously [root@kindle bin]# cd /mnt/us/lib [root@kindle lib]# ls PHP Code:
[root@kindle lib]# cd /mnt/us/etc [root@kindle etc]# ls PHP Code:
[root@kindle etc]# cd /mnt/us/usr/lib [root@kindle lib]# ls Spoiler:
That concludes the brief - What is in the box? That can be a purposeful development environment in an emulator for damn sure. No shortage of twiddling fiddles there. Might have to Wangle pkg-config in the short term. Anyways - that was my day. Building that lot so you lot can be sure what to expect. [root@kindle bin]# ./opkg-cl --version opkg version 0.1.8 [root@kindle bin]# ./autoconf --version Code:
autoconf (GNU Autoconf) 2.68 Last edited by twobob; 08-18-2012 at 07:11 PM. Reason: more stuff |
![]() |
![]() |
![]() |
#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
|
tomorrow. Lua
![]() EDIT: Or not based on the reaction to that thought below. heh. Hmm so what shall I do.. ponder ponder LUA: as knc1 says. LUAJIT: LuaJIT implements the full set of language features defined by Lua 5.1. The virtual machine (VM) is API- and ABI-compatible to the standard Lua interpreter and can be deployed as a drop-in replacement. Sounded handy. OFF TOPIC: RANDOM NOTES: Quote:
linking shortnames: you@dev /opt $ cd /opt/arm-2010q1/bin you@dev /opt/arm-2010q1/bin $ sudo su dev bin # for F in `ls -1` ; do ln -sf ${F} ${F#arm-none-linux-gnueabi-} ; done dev bin # exit Last edited by twobob; 09-13-2012 at 03:14 PM. Reason: Reactions - tar notes |
|
![]() |
![]() |
![]() |
#5 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Some of it.
Buildroot can generate many of the add-ons for the Lua language. In both cases, Lua-5.1. Lua-5.2 was released last December but as of yet, very few Lua-5.1 packages have been ported to Lua-5.2. Buildroot 2012.08-rc1 2012.08-rc2 is released for testing now, will become the official release (2012.08) by the end of the month. Edit: That info was only good for two hours before the next -rc was released. ![]() The Buildroot project is now merging (in branch buildroot-next) the things that will be included in Buildroot 2012.11 release. Of more interest for 2012.11 than the six years worth of independently written Lua-5.1 packages to be ported is the ability of Buildroot to generate a native toolchain for the target machine. Right now, it is still an "Open Question" on the BR M.L. As it stands now: Only when using the BR internally generated toolchain can BR generate a native target toolchain. BR can only generate a uClibc based toolchain internally. To generate (e)glibc based programs, BR must use one of the external toolchain options (crosstool-ng, user provided, etc). BR, even when building its own, internally generated, toolchain has been a bit (no pun intended) flaky about doing a true "Canadian Cross" (google that) toolchain and more than a bit of bit-rot has accumulated. None of the active developers are employed in an industry that requires the production of a native toolchain on the target. So the open question is: Should the bit-rotted ability of creating a native toolchain be pulled out of Buildroot or should it be fixed and extended to do true "Canadian Cross" toolchain builds? Having someone volunteer to do the support of fixing what is there would sway the decision to be made for 2012.11. Any reader here with an opinion and/or time on their hands to do the work should join the open BR mailing list and add to the discussion of this open question. One of the things on the project's development plan is to replace BR's toolchain generation with an integration of crosstool-ng. That integration has been done over the past year, so it is now time to settle this open question. Since crosstool-ng never did, nor was intended to do, Canadian Cross toolchain builds. . . Making it the only **internal** toolchain generator now (to complete the development plan's goal) would also mean dropping any ability to generate a native toolchain for the target. My position on this open question is to be found on the BR mailing list. Last edited by knc1; 08-15-2012 at 10:13 AM. |
![]() |
![]() |
![]() |
#7 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
|
Oh the joys of cross-compiling. I do have highest respect for you trying to maintain a proper toolchain. Folks like me still wonder how they might have gotten a working one in the end, after frantically pushing bits and pieces around in an undocumentable, manual way.
Last edited by hawhill; 08-15-2012 at 09:40 AM. |
![]() |
![]() |
![]() |
#8 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
While looking for the post I found before, where Rob Landley discussed creating a native tcc for ARM by compiling it on x86 gcc with ARM code generation, then using that to compile on the ARM target with ARM code generation to create a true native ARM tcc compiler. Although he did not name that process, it is identical to the definition of a "Canadian Cross".
Although I did not find the post I was looking for, I found Rob's new announcement that he plans to create "qcc" which merges QEMU code generation with his fork of "tcc" and Febrice Belard's original "tcc": http://www.landley.net/code/tinycc/ That looks useful if and when it becomes available. Merging QEMU code generation and the tcc forks is just too cool. ![]() ![]() EDIT: The page linked above includes this "and -run doesn't work on a 64 bit host kernel if it's producing 32 bit code", which probably explains why "tcc -run" does not work on my 64-bit linux. Last edited by geekmaster; 08-15-2012 at 10:43 AM. |
![]() |
![]() |
![]() |
#9 | |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
Thanks. |
|
![]() |
![]() |
![]() |
#10 |
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
|
I just updated the patch to include the fix previously documented in my X-TC scripts to avoid a nameclash when building headers (so you can use the lab126 kernels as the kernel headers source for your TC build).
|
![]() |
![]() |
![]() |
#11 | |
( ͡° ͜ʖ ͡°){ʇ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
|
Legends all
Quote:
![]() @ everyone. Thanks very much for such great feedback on the toolset. I'm just the pushy button - write it down - guy at this point. Really pleased to get some feedback on the whole porting lua thing. Sidelined I think in favour of other works. Thanks to all who made it possible. ![]() I am finding this a much more go-to solution for the underlying guts I was after. perhaps giving this another go as a mounted emulator image may have some value. have to see. |
|
![]() |
![]() |
![]() |
#12 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Wander around in the Buildroot tree, probably under configs/qemu, and you will find a "read.me" with the qemu command line to mount the generated image.
|
![]() |
![]() |
![]() |
#13 |
( ͡° ͜ʖ ͡°){ʇ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
|
peek inside. what we got?
A look inside the kindle after transferring files from a rebuilt Buildroot.
With a few bits of software thrown in. [root@kindle bin]# pwd /mnt/us/usr/bin Spoiler:
[root@kindle usr]# cd /mnt/us/bin [root@kindle bin]# ls Spoiler:
[root@kindle bin]# cd /mnt/us/lib [root@kindle lib]# ls Spoiler:
[root@kindle lib]# cd /mnt/us/usr/lib [root@kindle lib]# ls Spoiler:
Last edited by twobob; 08-15-2012 at 08:27 PM. Reason: spoilers |
![]() |
![]() |
![]() |
#14 |
( ͡° ͜ʖ ͡°){ʇ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
|
[root@kindle root]# modprobe -c
# On-demand autoloading of the watchdog driver - Jean II Spoiler:
So now to see about including. /BLDS/buildroot/build/linux-custom/fs/binfmt_misc.ko EDIT: [root@kindle root]# cd /mnt/us [root@kindle us]# ls bin* bin/ binfmt_misc.ko [root@kindle us]# insmod binfmt_misc.ko Does some further reading... http://linux.about.com/od/commands/l...l8_modprob.htm http://linux.about.com/od/commands/l/blcmdl8_insmod.htm http://linux.about.com/library/cmd/blcmdl8_depmod.htm http://linux.about.com/library/cmd/blcmdl8_lsmod.htm <-- This one I think http://en.wikipedia.org/wiki/Binfmt_misc Ah yeah. lsmod. [root@kindle us]# lsmod Code:
Module Size Used by binfmt_misc 8392 0 option 12512 2 usbserial 27756 5 option ehci_hcd 38880 1 option usbcore 136388 4 option,usbserial,ehci_hcd g_serial 16844 0 arcotg_udc 38628 1 g_serial ar6000 161076 0 ppp_async 8612 1 crc_ccitt 1856 1 ppp_async ppp_generic 19252 5 ppp_async slhc 5984 1 ppp_generic volume 8900 0 fiveway 23552 1 mxc_keyb 15904 1 uinput 7776 0 fuse 48348 2 mwan 7324 2 ehci_hcd,ppp_async eink_fb_shim 118588 0 eink_fb_hal_broads 397532 0 eink_fb_hal 59764 8 eink_fb_shim,eink_fb_hal_broads there you go. Hope this helps out knc1 some for his emu. seems to swallow it okay. EDIT THE ATTACHMENT IS NOW BUILT WITH THE CS2006q3 TC. Thanks. Last edited by twobob; 08-17-2012 at 07:47 PM. Reason: added wikilink |
![]() |
![]() |
![]() |
#15 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Try to insmod using a full, absolute path and filename, on your K3 - if the kernel accepts it, it will work.
Also, a "modinfo" command (again, use full, absolute path and filename) on both the new binfmt_misc and any existing *.ko in the Amazon release will show some of the compatability settings in the info header. Somewhere in my repository I have directions for registering lua5.1, lua5.2 and tcc as part of one of the projects. |
![]() |
![]() |
![]() |
Tags |
buildroot, compile, howto, kernal, kindle 3.3 |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Linux | Titus | enTourage Archive | 6 | 09-07-2010 11:23 AM |
So as a Linux..... | tajreed | General Discussions | 13 | 04-05-2010 12:51 PM |
Linux? | Ron46 | Ectaco jetBook | 8 | 12-24-2009 08:07 AM |
Linux | coredump | Sony Reader | 12 | 11-17-2009 05:07 AM |
Linux Help | clewley | Bookeen | 3 | 04-04-2008 08:40 AM |