Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 09-10-2019, 05:22 AM   #1
WaseemAlkurdi
Zealot
WaseemAlkurdi began at the beginning.
 
Posts: 147
Karma: 20
Join Date: Jul 2019
Device: Kindle Touch (K5) Wi-Fi x 2, Kindle (7th Gen, KT2), Paperwhite 3rd Gen
U-Boot compilation issues

I'm trying to compile U-Boot and the i.MX6SL Kindle Linux kernel as to run them in qemu-system-arm. The Linux kernel compiles successfully, but the resulting Image and zImage won't boot in QEMU. I then told myself that it was a good "excuse" to get U-Boot compiled too.
However, the U-Boot compile is failing. I have no idea why it's doing that.

Code:
$ :/path/to/uboot_2009.08$ TYPE=prod CROSS_COMPILE=~/arm-2014.05/bin/arm-none-linux-gnueabi- ARCH=arm make
for dir in tools examples/standalone examples/api ; do make -C $dir _depend ; done
make[1]: Entering directory '/path/to/uboot_2009.08/tools'
make[1]: Nothing to be done for '_depend'.
make[1]: Leaving directory '/path/to/uboot_2009.08/tools'
make[1]: Entering directory '/path/to/uboot_2009.08/examples/standalone'
make[1]: Nothing to be done for '_depend'.
make[1]: Leaving directory '/path/to/uboot_2009.08/examples/standalone'
make[1]: Entering directory '/path/to/uboot_2009.08/examples/api'
make[1]: Nothing to be done for '_depend'.
make[1]: Leaving directory '/path/to/uboot_2009.08/examples/api'
make -C tools all
make[1]: Entering directory '/path/to/uboot_2009.08/tools'
gcc -g -Wall -idirafter /path/to/uboot_2009.08/include -idirafter /path/to/uboot_2009.08/include2 -idirafter /path/to/uboot_2009.08/include -I /path/to/uboot_2009.08/libfdt -I /path/to/uboot_2009.08/tools -DTEXT_BASE=0xF8007000 -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -O -c -o mkimage.o /path/to/uboot_2009.08/tools/mkimage.c
In file included from /path/to/uboot_2009.08/tools/../include/libfdt.h:55,
                 from /path/to/uboot_2009.08/tools/fdt_host.h:25,
                 from /path/to/uboot_2009.08/tools/mkimage.h:33,
                 from /path/to/uboot_2009.08/tools/mkimage.c:25:
/usr/include/fdt.h:57:8: error: redefinition of ‘struct fdt_header’
 struct fdt_header {
        ^~~~~~~~~~
In file included from /path/to/uboot_2009.08/tools/fdt_host.h:24,
                 from /path/to/uboot_2009.08/tools/mkimage.h:33,
                 from /path/to/uboot_2009.08/tools/mkimage.c:25:
/path/to/uboot_2009.08/tools/../include/fdt.h:6:8: note: originally defined here
 struct fdt_header {
        ^~~~~~~~~~
In file included from /path/to/uboot_2009.08/tools/../include/libfdt.h:55,
                 from /path/to/uboot_2009.08/tools/fdt_host.h:25,
                 from /path/to/uboot_2009.08/tools/mkimage.h:33,
                 from /path/to/uboot_2009.08/tools/mkimage.c:25:
/usr/include/fdt.h:76:8: error: redefinition of ‘struct fdt_reserve_entry’
 struct fdt_reserve_entry {
        ^~~~~~~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/tools/fdt_host.h:24,
                 from /path/to/uboot_2009.08/tools/mkimage.h:33,
                 from /path/to/uboot_2009.08/tools/mkimage.c:25:
/path/to/uboot_2009.08/tools/../include/fdt.h:25:8: note: originally defined here
 struct fdt_reserve_entry {
        ^~~~~~~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/tools/../include/libfdt.h:55,
                 from /path/to/uboot_2009.08/tools/fdt_host.h:25,
                 from /path/to/uboot_2009.08/tools/mkimage.h:33,
                 from /path/to/uboot_2009.08/tools/mkimage.c:25:
/usr/include/fdt.h:81:8: error: redefinition of ‘struct fdt_node_header’
 struct fdt_node_header {
        ^~~~~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/tools/fdt_host.h:24,
                 from /path/to/uboot_2009.08/tools/mkimage.h:33,
                 from /path/to/uboot_2009.08/tools/mkimage.c:25:
/path/to/uboot_2009.08/tools/../include/fdt.h:30:8: note: originally defined here
 struct fdt_node_header {
        ^~~~~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/tools/../include/libfdt.h:55,
                 from /path/to/uboot_2009.08/tools/fdt_host.h:25,
                 from /path/to/uboot_2009.08/tools/mkimage.h:33,
                 from /path/to/uboot_2009.08/tools/mkimage.c:25:
/usr/include/fdt.h:86:8: error: redefinition of ‘struct fdt_property’
 struct fdt_property {
        ^~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/tools/fdt_host.h:24,
                 from /path/to/uboot_2009.08/tools/mkimage.h:33,
                 from /path/to/uboot_2009.08/tools/mkimage.c:25:
/path/to/uboot_2009.08/tools/../include/fdt.h:35:8: note: originally defined here
 struct fdt_property {
        ^~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/include/image.h:56,
                 from /path/to/uboot_2009.08/tools/mkimage.c:26:
/usr/include/libfdt.h:150:21: error: redefinition of ‘fdt_offset_ptr_w’
 static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen)
                     ^~~~~~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/tools/fdt_host.h:25,
                 from /path/to/uboot_2009.08/tools/mkimage.h:33,
                 from /path/to/uboot_2009.08/tools/mkimage.c:25:
/path/to/uboot_2009.08/tools/../include/libfdt.h:126:21: note: previous definition of ‘fdt_offset_ptr_w’ was here
 static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen)
                     ^~~~~~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/include/image.h:56,
                 from /path/to/uboot_2009.08/tools/mkimage.c:26:
/usr/include/libfdt.h:258:1: error: redefinition of ‘fdt_set_magic’
 fdt_set_hdr_(magic);
 ^~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/tools/fdt_host.h:25,
                 from /path/to/uboot_2009.08/tools/mkimage.h:33,
                 from /path/to/uboot_2009.08/tools/mkimage.c:25:
/path/to/uboot_2009.08/tools/../include/libfdt.h:157:21: note: previous definition of ‘fdt_set_magic’ was here
  static inline void fdt_set_##name(void *fdt, uint32_t val) \
                     ^~~~~~~~
/path/to/uboot_2009.08/tools/../include/libfdt.h:162:1: note: in expansion of macro ‘__fdt_set_hdr’
 __fdt_set_hdr(magic);
 ^~~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/include/image.h:56,
                 from /path/to/uboot_2009.08/tools/mkimage.c:26:
/usr/include/libfdt.h:259:1: error: redefinition of ‘fdt_set_totalsize’
 fdt_set_hdr_(totalsize);
 ^~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/tools/fdt_host.h:25,
                 from /path/to/uboot_2009.08/tools/mkimage.h:33,
                 from /path/to/uboot_2009.08/tools/mkimage.c:25:
/path/to/uboot_2009.08/tools/../include/libfdt.h:157:21: note: previous definition of ‘fdt_set_totalsize’ was here
  static inline void fdt_set_##name(void *fdt, uint32_t val) \
                     ^~~~~~~~
/path/to/uboot_2009.08/tools/../include/libfdt.h:163:1: note: in expansion of macro ‘__fdt_set_hdr’
 __fdt_set_hdr(totalsize);
 ^~~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/include/image.h:56,
                 from /path/to/uboot_2009.08/tools/mkimage.c:26:
/usr/include/libfdt.h:260:1: error: redefinition of ‘fdt_set_off_dt_struct’
 fdt_set_hdr_(off_dt_struct);
 ^~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/tools/fdt_host.h:25,
                 from /path/to/uboot_2009.08/tools/mkimage.h:33,
                 from /path/to/uboot_2009.08/tools/mkimage.c:25:
/path/to/uboot_2009.08/tools/../include/libfdt.h:157:21: note: previous definition of ‘fdt_set_off_dt_struct’ was here
  static inline void fdt_set_##name(void *fdt, uint32_t val) \
                     ^~~~~~~~
/path/to/uboot_2009.08/tools/../include/libfdt.h:164:1: note: in expansion of macro ‘__fdt_set_hdr’
 __fdt_set_hdr(off_dt_struct);
 ^~~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/include/image.h:56,
                 from /path/to/uboot_2009.08/tools/mkimage.c:26:
/usr/include/libfdt.h:261:1: error: redefinition of ‘fdt_set_off_dt_strings’
 fdt_set_hdr_(off_dt_strings);
 ^~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/tools/fdt_host.h:25,
                 from /path/to/uboot_2009.08/tools/mkimage.h:33,
                 from /path/to/uboot_2009.08/tools/mkimage.c:25:
/path/to/uboot_2009.08/tools/../include/libfdt.h:157:21: note: previous definition of ‘fdt_set_off_dt_strings’ was here
  static inline void fdt_set_##name(void *fdt, uint32_t val) \
                     ^~~~~~~~
/path/to/uboot_2009.08/tools/../include/libfdt.h:165:1: note: in expansion of macro ‘__fdt_set_hdr’
 __fdt_set_hdr(off_dt_strings);
 ^~~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/include/image.h:56,
                 from /path/to/uboot_2009.08/tools/mkimage.c:26:
/usr/include/libfdt.h:262:1: error: redefinition of ‘fdt_set_off_mem_rsvmap’
 fdt_set_hdr_(off_mem_rsvmap);
 ^~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/tools/fdt_host.h:25,
                 from /path/to/uboot_2009.08/tools/mkimage.h:33,
                 from /path/to/uboot_2009.08/tools/mkimage.c:25:
/path/to/uboot_2009.08/tools/../include/libfdt.h:157:21: note: previous definition of ‘fdt_set_off_mem_rsvmap’ was here
  static inline void fdt_set_##name(void *fdt, uint32_t val) \
                     ^~~~~~~~
/path/to/uboot_2009.08/tools/../include/libfdt.h:166:1: note: in expansion of macro ‘__fdt_set_hdr’
 __fdt_set_hdr(off_mem_rsvmap);
 ^~~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/include/image.h:56,
                 from /path/to/uboot_2009.08/tools/mkimage.c:26:
/usr/include/libfdt.h:263:1: error: redefinition of ‘fdt_set_version’
 fdt_set_hdr_(version);
 ^~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/tools/fdt_host.h:25,
                 from /path/to/uboot_2009.08/tools/mkimage.h:33,
                 from /path/to/uboot_2009.08/tools/mkimage.c:25:
/path/to/uboot_2009.08/tools/../include/libfdt.h:157:21: note: previous definition of ‘fdt_set_version’ was here
  static inline void fdt_set_##name(void *fdt, uint32_t val) \
                     ^~~~~~~~
/path/to/uboot_2009.08/tools/../include/libfdt.h:167:1: note: in expansion of macro ‘__fdt_set_hdr’
 __fdt_set_hdr(version);
 ^~~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/include/image.h:56,
                 from /path/to/uboot_2009.08/tools/mkimage.c:26:
/usr/include/libfdt.h:264:1: error: redefinition of ‘fdt_set_last_comp_version’
 fdt_set_hdr_(last_comp_version);
 ^~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/tools/fdt_host.h:25,
                 from /path/to/uboot_2009.08/tools/mkimage.h:33,
                 from /path/to/uboot_2009.08/tools/mkimage.c:25:
/path/to/uboot_2009.08/tools/../include/libfdt.h:157:21: note: previous definition of ‘fdt_set_last_comp_version’ was here
  static inline void fdt_set_##name(void *fdt, uint32_t val) \
                     ^~~~~~~~
/path/to/uboot_2009.08/tools/../include/libfdt.h:168:1: note: in expansion of macro ‘__fdt_set_hdr’
 __fdt_set_hdr(last_comp_version);
 ^~~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/include/image.h:56,
                 from /path/to/uboot_2009.08/tools/mkimage.c:26:
/usr/include/libfdt.h:265:1: error: redefinition of ‘fdt_set_boot_cpuid_phys’
 fdt_set_hdr_(boot_cpuid_phys);
 ^~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/tools/fdt_host.h:25,
                 from /path/to/uboot_2009.08/tools/mkimage.h:33,
                 from /path/to/uboot_2009.08/tools/mkimage.c:25:
/path/to/uboot_2009.08/tools/../include/libfdt.h:157:21: note: previous definition of ‘fdt_set_boot_cpuid_phys’ was here
  static inline void fdt_set_##name(void *fdt, uint32_t val) \
                     ^~~~~~~~
/path/to/uboot_2009.08/tools/../include/libfdt.h:169:1: note: in expansion of macro ‘__fdt_set_hdr’
 __fdt_set_hdr(boot_cpuid_phys);
 ^~~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/include/image.h:56,
                 from /path/to/uboot_2009.08/tools/mkimage.c:26:
/usr/include/libfdt.h:266:1: error: redefinition of ‘fdt_set_size_dt_strings’
 fdt_set_hdr_(size_dt_strings);
 ^~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/tools/fdt_host.h:25,
                 from /path/to/uboot_2009.08/tools/mkimage.h:33,
                 from /path/to/uboot_2009.08/tools/mkimage.c:25:
/path/to/uboot_2009.08/tools/../include/libfdt.h:157:21: note: previous definition of ‘fdt_set_size_dt_strings’ was here
  static inline void fdt_set_##name(void *fdt, uint32_t val) \
                     ^~~~~~~~
/path/to/uboot_2009.08/tools/../include/libfdt.h:170:1: note: in expansion of macro ‘__fdt_set_hdr’
 __fdt_set_hdr(size_dt_strings);
 ^~~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/include/image.h:56,
                 from /path/to/uboot_2009.08/tools/mkimage.c:26:
/usr/include/libfdt.h:267:1: error: redefinition of ‘fdt_set_size_dt_struct’
 fdt_set_hdr_(size_dt_struct);
 ^~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/tools/fdt_host.h:25,
                 from /path/to/uboot_2009.08/tools/mkimage.h:33,
                 from /path/to/uboot_2009.08/tools/mkimage.c:25:
/path/to/uboot_2009.08/tools/../include/libfdt.h:157:21: note: previous definition of ‘fdt_set_size_dt_struct’ was here
  static inline void fdt_set_##name(void *fdt, uint32_t val) \
                     ^~~~~~~~
/path/to/uboot_2009.08/tools/../include/libfdt.h:171:1: note: in expansion of macro ‘__fdt_set_hdr’
 __fdt_set_hdr(size_dt_struct);
 ^~~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/include/image.h:56,
                 from /path/to/uboot_2009.08/tools/mkimage.c:26:
/usr/include/libfdt.h:653:36: error: redefinition of ‘fdt_get_property_w’
 static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset,
                                    ^~~~~~~~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/tools/fdt_host.h:25,
                 from /path/to/uboot_2009.08/tools/mkimage.h:33,
                 from /path/to/uboot_2009.08/tools/mkimage.c:25:
/path/to/uboot_2009.08/tools/../include/libfdt.h:390:36: note: previous definition of ‘fdt_get_property_w’ was here
 static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset,
                                    ^~~~~~~~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/include/image.h:56,
                 from /path/to/uboot_2009.08/tools/mkimage.c:26:
/usr/include/libfdt.h:750:21: error: redefinition of ‘fdt_getprop_w’
 static inline void *fdt_getprop_w(void *fdt, int nodeoffset,
                     ^~~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/tools/fdt_host.h:25,
                 from /path/to/uboot_2009.08/tools/mkimage.h:33,
                 from /path/to/uboot_2009.08/tools/mkimage.c:25:
/path/to/uboot_2009.08/tools/../include/libfdt.h:441:21: note: previous definition of ‘fdt_getprop_w’ was here
 static inline void *fdt_getprop_w(void *fdt, int nodeoffset,
                     ^~~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/include/image.h:56,
                 from /path/to/uboot_2009.08/tools/mkimage.c:26:
/usr/include/libfdt.h:1295:19: error: redefinition of ‘fdt_setprop_inplace_cell’
 static inline int fdt_setprop_inplace_cell(void *fdt, int nodeoffset,
                   ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/tools/fdt_host.h:25,
                 from /path/to/uboot_2009.08/tools/mkimage.h:33,
                 from /path/to/uboot_2009.08/tools/mkimage.c:25:
/path/to/uboot_2009.08/tools/../include/libfdt.h:779:19: note: previous definition of ‘fdt_setprop_inplace_cell’ was here
 static inline int fdt_setprop_inplace_cell(void *fdt, int nodeoffset,
                   ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/include/image.h:56,
                 from /path/to/uboot_2009.08/tools/mkimage.c:26:
/usr/include/libfdt.h:1373:19: error: redefinition of ‘fdt_property_cell’
 static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val)
                   ^~~~~~~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/tools/fdt_host.h:25,
                 from /path/to/uboot_2009.08/tools/mkimage.h:33,
                 from /path/to/uboot_2009.08/tools/mkimage.c:25:
/path/to/uboot_2009.08/tools/../include/libfdt.h:845:19: note: previous definition of ‘fdt_property_cell’ was here
 static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val)
                   ^~~~~~~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/include/image.h:56,
                 from /path/to/uboot_2009.08/tools/mkimage.c:26:
/usr/include/libfdt.h:1618:19: error: redefinition of ‘fdt_setprop_cell’
 static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name,
                   ^~~~~~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/tools/fdt_host.h:25,
                 from /path/to/uboot_2009.08/tools/mkimage.h:33,
                 from /path/to/uboot_2009.08/tools/mkimage.c:25:
/path/to/uboot_2009.08/tools/../include/libfdt.h:995:19: note: previous definition of ‘fdt_setprop_cell’ was here
 static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name,
                   ^~~~~~~~~~~~~~~~
In file included from /path/to/uboot_2009.08/tools/mkimage.c:26:
/path/to/uboot_2009.08/include/image.h:524:12: warning: inline function ‘fit_parse_subimage’ declared but never defined
 inline int fit_parse_subimage (const char *spec, ulong addr_curr,
            ^~~~~~~~~~~~~~~~~~
/path/to/uboot_2009.08/include/image.h:522:12: warning: inline function ‘fit_parse_conf’ declared but never defined
 inline int fit_parse_conf (const char *spec, ulong addr_curr,
            ^~~~~~~~~~~~~~
make[1]: *** [Makefile:211: mkimage.o] Error 1
make[1]: Leaving directory '/path/to/uboot_2009.08/tools'
make: *** [Makefile:357: tools] Error 2
For the record, I'm using a Linaro toolchain (from this direct link), recommended in a kernel compilation guide on this forum, instead of Amazon's own, because that fails to compile too. But let's leave that aside.
WaseemAlkurdi is offline   Reply With Quote
Old 09-10-2019, 09:00 AM   #2
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
That's probably the wrong TC for the job.

Never built uboot myself, so I can't vouch for it, but you probably need to use Amazon's TC, or build one that sticks as close to it as possible.

What you're using is much older than the already old TC you probably should be using .

(A close fit is probably the final GCC 4.9 Linaro release).

Possibly critical sidebar: I'm not even sure if we actually can build uboot with a Linux TC, it might need a baremetal one?

Last edited by NiLuJe; 09-10-2019 at 09:03 AM.
NiLuJe is offline   Reply With Quote
Advert
Old 09-12-2019, 03:43 AM   #3
WaseemAlkurdi
Zealot
WaseemAlkurdi began at the beginning.
 
Posts: 147
Karma: 20
Join Date: Jul 2019
Device: Kindle Touch (K5) Wi-Fi x 2, Kindle (7th Gen, KT2), Paperwhite 3rd Gen
Quote:
Originally Posted by NiLuJe View Post
That's probably the wrong TC for the job.

Never built uboot myself, so I can't vouch for it, but you probably need to use Amazon's TC, or build one that sticks as close to it as possible.

What you're using is much older than the already old TC you probably should be using .

(A close fit is probably the final GCC 4.9 Linaro release).

Possibly critical sidebar: I'm not even sure if we actually can build uboot with a Linux TC, it might need a baremetal one?
Thanks a lot for the reply @NiLuJe!
Quote:
Possibly critical sidebar: I'm not even sure if we actually can build uboot with a Linux TC, it might need a baremetal one?
It could be, but Amazon's BUILD_HOW_TO.txt doesn't say anything about a bare-metal toolchain ... nor does this guide where a U-Boot compile was done.
Edited to add:This U-Boot building guide for some other Freescale-based board seems to use a Linux toolchain, too. Is that correct?

And building Amazon's toolchain results in this odd error while building binutils. It's as if there is an error in the Tex files for the documentation. I tried to remove them, but the compile refuses to continue without building them.
Code:
$ make
make -C build/binutils  
make[1]: Entering directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils'
make[2]: Entering directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils'
make[3]: Entering directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/libiberty'
make[4]: Entering directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/libiberty/testsuite'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/libiberty/testsuite'
make[3]: Leaving directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/libiberty'
make[3]: Entering directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/intl'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/intl'
make[3]: Entering directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/bfd'
Making info in doc
make[4]: Entering directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/bfd/doc'
make[4]: Nothing to be done for 'info'.
make[4]: Leaving directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/bfd/doc'
Making info in po
make[4]: Entering directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/bfd/po'
make[4]: Nothing to be done for 'info'.
make[4]: Leaving directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/bfd/po'
make[4]: Entering directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/bfd'
make[4]: Nothing to be done for 'info-am'.
make[4]: Leaving directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/bfd'
make  all-recursive
make[4]: Entering directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/bfd'
Making all in doc
make[5]: Entering directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/bfd/doc'
make[5]: Nothing to be done for 'all'.
make[5]: Leaving directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/bfd/doc'
Making all in po
make[5]: Entering directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/bfd/po'
make[5]: Nothing to be done for 'all'.
make[5]: Leaving directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/bfd/po'
make[5]: Entering directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/bfd'
make[5]: Leaving directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/bfd'
make[4]: Leaving directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/bfd'
make[3]: Leaving directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/bfd'
make[3]: Entering directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/opcodes'
make  all-recursive
make[4]: Entering directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/opcodes'
Making all in .
make[5]: Entering directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/opcodes'
make[5]: Leaving directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/opcodes'
Making all in po
make[5]: Entering directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/opcodes/po'
make[5]: Nothing to be done for 'all'.
make[5]: Leaving directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/opcodes/po'
make[4]: Leaving directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/opcodes'
make[3]: Leaving directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/opcodes'
make[3]: Entering directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/binutils'
Making info in doc
make[4]: Entering directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/binutils/doc'
restore=: && backupdir=".am$$" && \
rm -rf $backupdir && mkdir $backupdir && \
if (makeinfo --split-size=5000000 --split-size=5000000 --version) >/dev/null 2>&1; then \
  for f in binutils.info binutils.info-[0-9] binutils.info-[0-9][0-9] binutils.i[0-9] binutils.i[0-9][0-9]; do \
    if test -f $f; then mv $f $backupdir; restore=mv; else :; fi; \
  done; \
else :; fi && \
if makeinfo --split-size=5000000 --split-size=5000000 -I "../../../../src/binutils-2.21.0.20110327/binutils/doc" -I "../../../../src/binutils-2.21.0.20110327/binutils/../libiberty" -I "../../../../src/binutils-2.21.0.20110327/binutils/../bfd/doc" -I ../../bfd/doc  -I ../../../../src/binutils-2.21.0.20110327/binutils/doc \
 -o binutils.info `test -f 'binutils.texi' || echo '../../../../src/binutils-2.21.0.20110327/binutils/doc/'`binutils.texi; \
then \
  rc=0; \
else \
  rc=$?; \
  $restore $backupdir/* `echo "./binutils.info" | sed 's|[^/]*$||'`; \
fi; \
rm -rf $backupdir; exit $rc
../../../../src/binutils-2.21.0.20110327/binutils/doc/binutils.texi:4191: warning: @itemx should not begin @table
../../../../src/binutils-2.21.0.20110327/binutils/doc/binutils.texi:4198: @itemx must follow @item
../../../../src/binutils-2.21.0.20110327/binutils/doc/binutils.texi:4202: @itemx must follow @item
../../../../src/binutils-2.21.0.20110327/binutils/doc/binutils.texi:4208: @itemx must follow @item
../../../../src/binutils-2.21.0.20110327/binutils/doc/binutils.texi:4212: @itemx must follow @item
../../../../src/binutils-2.21.0.20110327/binutils/doc/binutils.texi:4221: @itemx must follow @item
../../../../src/binutils-2.21.0.20110327/binutils/doc/binutils.texi:2291: warning: node next `ranlib' in menu `readelf' and in sectioning `size' differ
../../../../src/binutils-2.21.0.20110327/binutils/doc/binutils.texi:2344: warning: node prev `size' in menu `readelf' and in sectioning `ranlib' differ
../../../../src/binutils-2.21.0.20110327/binutils/doc/binutils.texi:2568: warning: node next `strip' in menu `elfedit' and in sectioning `c++filt' differ
../../../../src/binutils-2.21.0.20110327/binutils/doc/binutils.texi:3074: warning: node next `nlmconv' in menu `windres' and in sectioning `windmc' differ
../../../../src/binutils-2.21.0.20110327/binutils/doc/binutils.texi:3179: warning: node next `windmc' in menu `dlltool' and in sectioning `windres' differ
../../../../src/binutils-2.21.0.20110327/binutils/doc/binutils.texi:3179: warning: node prev `windmc' in menu `windres' and in sectioning `nlmconv' differ
../../../../src/binutils-2.21.0.20110327/binutils/doc/binutils.texi:3340: warning: node next `windres' in menu `windmc' and in sectioning `dlltool' differ
../../../../src/binutils-2.21.0.20110327/binutils/doc/binutils.texi:3340: warning: node prev `windres' in menu `nlmconv' and in sectioning `windmc' differ
../../../../src/binutils-2.21.0.20110327/binutils/doc/binutils.texi:3527: warning: node next `dlltool' in menu `Common Options' and in sectioning `readelf' differ
../../../../src/binutils-2.21.0.20110327/binutils/doc/binutils.texi:3527: warning: node prev `dlltool' in menu `windmc' and in sectioning `windres' differ
../../../../src/binutils-2.21.0.20110327/binutils/doc/binutils.texi:3921: warning: node next `readelf' in menu `size' and in sectioning `elfedit' differ
../../../../src/binutils-2.21.0.20110327/binutils/doc/binutils.texi:3921: warning: node prev `readelf' in menu `ranlib' and in sectioning `dlltool' differ
../../../../src/binutils-2.21.0.20110327/binutils/doc/binutils.texi:4151: warning: node next `elfedit' in menu `c++filt' and in sectioning `Common Options' differ
../../../../src/binutils-2.21.0.20110327/binutils/doc/binutils.texi:4151: warning: node prev `elfedit' in menu `strip' and in sectioning `readelf' differ
../../../../src/binutils-2.21.0.20110327/binutils/doc/binutils.texi:4243: warning: node prev `Common Options' in menu `dlltool' and in sectioning `elfedit' differ
make[4]: *** [Makefile:350: binutils.info] Error 1
make[4]: Leaving directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/binutils/doc'
Making info in po
make[4]: Entering directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/binutils/po'
make[4]: Nothing to be done for 'info'.
make[4]: Leaving directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/binutils/po'
make[4]: Entering directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/binutils'
make[4]: Nothing to be done for 'info-am'.
make[4]: Leaving directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/binutils'
make[3]: *** [Makefile:865: info-recursive] Error 1
make[3]: Leaving directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils/binutils'
make[2]: *** [Makefile:4189: all-binutils] Error 2
make[2]: Leaving directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils'
make[1]: *** [Makefile:851: all] Error 2
make[1]: Leaving directory '/path/to/amazon/toolchain/build_linaro-gcc_4.5.4/build/binutils'
make: *** [Makefile:118: stamp/binutils-install] Error 2
What do you think?

Last edited by WaseemAlkurdi; 09-12-2019 at 04:09 AM.
WaseemAlkurdi is offline   Reply With Quote
Old 09-12-2019, 07:19 AM   #4
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Don't build the docs?

And yeah, u-boot being fine with a Linux TC makes sense.
NiLuJe is offline   Reply With Quote
Old 09-12-2019, 08:04 PM   #5
schuhumi
Member
schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.
 
Posts: 17
Karma: 222284
Join Date: Jul 2018
Device: PW3
I just tried it and got a u-boot.bin:
Code:
┬─[simon@yogal390:~/D/g/uboot_2009.08]─[01:58:49]
╰─>$ ls 
api/                           doc/           lib_i386/        MAKEALL*      tools/
board/                         drivers/       lib_m68k/        Makefile      u-boot*
CHANGELOG                      examples/      lib_microblaze/  mkconfig*     u-boot.bin*
CHANGELOG-before-U-Boot-1.1.5  fs/            lib_mips/        nand_spl/     u-boot.lds
common/                        include/       lib_nios/        net/          u-boot.map
config.mk                      lib_arm/       lib_nios2/       onenand_ipl/  u-boot.srec*
COPYING                        lib_avr32/     lib_ppc/         post/
cpu/                           lib_blackfin/  lib_sh/          README
CREDITS                        libfdt/        lib_sparc/       rules.mk
disk/                          lib_generic/   MAINTAINERS      System.map
┬─[simon@yogal390:~/D/g/uboot_2009.08]─[01:59:01]
commands used:

Code:
cp ../linux-3.0.35/include/boardid.h ./include/
cp ../linux-3.0.35/include/boardid_base.h ./include/
cp ../linux-3.0.35/include/max77696_registers.h ./include/
cp ../linux-3.0.35/include/linux/frontlight.h  ./include/linux/
env TYPE=prod make CROSS_COMPILE=/usr/bin/arm-none-eabi- imx60_wario_config
env TYPE=prod make CROSS_COMPILE=/usr/bin/arm-none-eabi- -j8
The toolchain I used is arm-none-eabi-gcc49-linaro (from ArchLinux' AUR)

Last edited by schuhumi; 09-12-2019 at 08:11 PM.
schuhumi is offline   Reply With Quote
Advert
Old 09-13-2019, 07:17 AM   #6
WaseemAlkurdi
Zealot
WaseemAlkurdi began at the beginning.
 
Posts: 147
Karma: 20
Join Date: Jul 2019
Device: Kindle Touch (K5) Wi-Fi x 2, Kindle (7th Gen, KT2), Paperwhite 3rd Gen
Quote:
Originally Posted by NiLuJe View Post
Don't build the docs?

And yeah, u-boot being fine with a Linux TC makes sense.
Good, but how? I'm just running 'make' on the Amazon toolchain. The toolchain's Makefile is supposed to build 'binutils' automatically (so there's no option to skip docs except modifying the Amazon toolchain Makefile ... and that doesn't feel right.)

I tried building U-Boot again with this toolchain ("gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi.tar.xz" from: https://releases.linaro.org/componen...linux-gnueabi/), but the build fails with the same exact error.

I'm going to try building U-Boot again with the toolchain recommended by @schuhumi.
EDIT: It's AUR ... and I have to build it myself. Normally, I don't have an issue, but "build anxiety" strikes hard this time. And it seems to point back to Linaro's source archives.
EDIT 2: Turns out that AUR depends on the 'makepkg' command, only available with 'pacman' on Arch. I'm on Ubuntu, which has APT.
What should I do?

Last edited by WaseemAlkurdi; 09-13-2019 at 07:30 AM.
WaseemAlkurdi is offline   Reply With Quote
Old 09-13-2019, 08:45 AM   #7
schuhumi
Member
schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.
 
Posts: 17
Karma: 222284
Join Date: Jul 2018
Device: PW3
Quote:
Originally Posted by WaseemAlkurdi View Post
EDIT: It's AUR ... and I have to build it myself. Normally, I don't have an issue, but "build anxiety" strikes hard this time. And it seems to point back to Linaro's source archives.
EDIT 2: Turns out that AUR depends on the 'makepkg' command, only available with 'pacman' on Arch. I'm on Ubuntu, which has APT.
What should I do?
makepkg uses a file named "PKGBUILD" that is essentially a simple recipe on how to build this thing. You can look at it yourself here: https://aur.archlinux.org/cgit/aur.g...i-gcc49-linaro

You can see:
  • What exactly it downloads
  • What dependencies it installs (those might have slightly different names on Ubuntu)
  • That it adds 3 patches (those hare in the same folder as the PKGBUILD https://aur.archlinux.org/cgit/aur.g...i-gcc49-linaro , I'm not sure though what they do or whether they're neccesary )
  • What commands and parameters are used to build it
Alternatively you could put Arch in a docker container and then build it in there I guess. Also there needs to be some official documentation from linaro on how to build it, that would cover Ubuntu probably
schuhumi is offline   Reply With Quote
Old 09-14-2019, 06:23 PM   #8
WaseemAlkurdi
Zealot
WaseemAlkurdi began at the beginning.
 
Posts: 147
Karma: 20
Join Date: Jul 2019
Device: Kindle Touch (K5) Wi-Fi x 2, Kindle (7th Gen, KT2), Paperwhite 3rd Gen
Quote:
Originally Posted by schuhumi View Post
makepkg uses a file named "PKGBUILD" that is essentially a simple recipe on how to build this thing. You can look at it yourself here: https://aur.archlinux.org/cgit/aur.g...i-gcc49-linaro

You can see:
  • What exactly it downloads
  • What dependencies it installs (those might have slightly different names on Ubuntu)
  • That it adds 3 patches (those hare in the same folder as the PKGBUILD https://aur.archlinux.org/cgit/aur.g...i-gcc49-linaro , I'm not sure though what they do or whether they're neccesary )
  • What commands and parameters are used to build it
Alternatively you could put Arch in a docker container and then build it in there I guess. Also there needs to be some official documentation from linaro on how to build it, that would cover Ubuntu probably
Thanks for this! I'll see what I can cook up. It's probably going to be an Arch chroot.
WaseemAlkurdi is offline   Reply With Quote
Old 09-15-2019, 07:41 AM   #9
schuhumi
Member
schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.
 
Posts: 17
Karma: 222284
Join Date: Jul 2018
Device: PW3
Quote:
Originally Posted by WaseemAlkurdi View Post
Thanks for this! I'll see what I can cook up. It's probably going to be an Arch chroot.
What exactly do you have in mind? Arch's gnulibc is too new for the kindle's kernel. But you can use "proot -k 4" as a shim that partially implements missing features (Although I had trouble with pacman hooks when trying it out, execv was "missing file", but execv seems to be a syscall so no idea what's going on there). See here: https://www.reddit.com/r/archlinux/c...le_via_a_proot

What I'm not sure about is why you need uboot for this?
schuhumi is offline   Reply With Quote
Old 09-16-2019, 12:43 PM   #10
WaseemAlkurdi
Zealot
WaseemAlkurdi began at the beginning.
 
Posts: 147
Karma: 20
Join Date: Jul 2019
Device: Kindle Touch (K5) Wi-Fi x 2, Kindle (7th Gen, KT2), Paperwhite 3rd Gen
Quote:
Originally Posted by schuhumi View Post
What exactly do you have in mind? Arch's gnulibc is too new for the kindle's kernel. But you can use "proot -k 4" as a shim that partially implements missing features (Although I had trouble with pacman hooks when trying it out, execv was "missing file", but execv seems to be a syscall so no idea what's going on there). See here: https://www.reddit.com/r/archlinux/c...le_via_a_proot

What I'm not sure about is why you need uboot for this?
I'm planning on running the whole Kindle firmware inside QEMU, as some sort of a Kindle emulator, which I believe to be a good tool for use by Kindle devs and the general public.
I'm doing it primarily to learn more about both QEMU and Linux on the Kindle, and it should work in theory because QEMU has an i.MX6 board that is very close to the i.MX6SL in the Kindle Paperwhite 2 and above.

I tried booting the Kindle's stock kernel without U-Boot (directly in QEMU, by passing appropriate kernel and console parameters) but to no avail (QEMU doesn't start). This gave me the idea of building U-Boot, since it's going to be needed later on to define idme variables and fake serial number information for the Kindle firmware to completely boot in QEMU.

Last edited by WaseemAlkurdi; 09-16-2019 at 12:48 PM.
WaseemAlkurdi is offline   Reply With Quote
Old 09-16-2019, 04:19 PM   #11
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Ah, a small problem with your plan ...
QEMU is a 'single program' loader, stock QEMU can not load two programs (u-boot and kernel).

There is published the means to patch QEMU to load the multi-part u-boot and multi-part kernel along with the description of how-to do it and a worked example.
I found that using a common web search tool.
knc1 is offline   Reply With Quote
Old 09-16-2019, 06:49 PM   #12
pazos
cosiñeiro
pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.
 
Posts: 1,406
Karma: 2451781
Join Date: Apr 2014
Device: BQ Cervantes 4
U-boot is normally used as Stage2 bootloader and used to setup cpu timmings and sdram. Stage1 bootloader is normally part of the hardware and it is loaded and executed from On Chip RAM (OCRAM).

The process of building u-boot is similar to build the kernel itself. Set a cross compile toolchain, make a .config using an already available defconfig and make to build. Normally (on imx at least) a little header is wrapped at the beginning of the binary and that is specific to your model DRAM configuration.

I don't know much about Kindle but the sources of Kobo's uboot ship with a helper script that does exactly the steps mentioned above.

Quote:
Originally Posted by knc1
QEMU is a 'single program' loader, stock QEMU can not load two programs (u-boot and kernel).
I had no idea, I have no CS background and never played with QEMU but sounds to me as a normal bootstrap: stage1/qemu loads stage2 and jumps there, stage2 loads kernel and jumps there and so on. In any case I would like to see the link as my search skills suck and I can't found such info. Thanks in advance

But yeah, OP has a difficult task at hand. Good luck and keep us informed

edit: I found a interesting link about the topic. Basically you can try the same but using a different device configuration. It seems that i.MX6 Dual Lite SABRE is available on qemu 2 and should be a good place to start. Use that instead of "versatile"

Last edited by pazos; 09-16-2019 at 07:01 PM. Reason: link
pazos is offline   Reply With Quote
Old 09-17-2019, 04:07 AM   #13
WaseemAlkurdi
Zealot
WaseemAlkurdi began at the beginning.
 
Posts: 147
Karma: 20
Join Date: Jul 2019
Device: Kindle Touch (K5) Wi-Fi x 2, Kindle (7th Gen, KT2), Paperwhite 3rd Gen
Quote:
Originally Posted by knc1 View Post
Ah, a small problem with your plan ...
QEMU is a 'single program' loader, stock QEMU can not load two programs (u-boot and kernel).

There is published the means to patch QEMU to load the multi-part u-boot and multi-part kernel along with the description of how-to do it and a worked example.
I found that using a common web search tool.
Thanks for the heads-up!
For now, I don't think this is an issue. If I actually get U-Boot successfully built and booted in QEMU, then it would be very easy to follow a set of instructions to patch QEMU accordingly.

Quote:
Originally Posted by pazos View Post
U-boot is normally used as Stage2 bootloader and used to setup cpu timmings and sdram. Stage1 bootloader is normally part of the hardware and it is loaded and executed from On Chip RAM (OCRAM).
Wait, what? So how do we build this stage 1 bootloader? Or we can skip it altogether and start with U-Boot?
Quote:
The process of building u-boot is similar to build the kernel itself. Set a cross compile toolchain, make a .config using an already available defconfig and make to build. Normally (on imx at least) a little header is wrapped at the beginning of the binary and that is specific to your model DRAM configuration.
The Kindle has a custom, ancient U-Boot tree in the sources, and that tree has the appropriate defconfig files, where one executes make imx60_wario_config, for example, to configure the tree for that board. Does this prepare the header you mentioned in your post?
Quote:
I had no idea, I have no CS background and never played with QEMU but sounds to me as a normal bootstrap: stage1/qemu loads stage2 and jumps there, stage2 loads kernel and jumps there and so on. In any case I would like to see the link as my search skills suck and I can't found such info. Thanks in advance
I'm also finding this odd, because qemu-system-x86_64 doesn't have this issue (one can chainload N bootloaders without any issue). But I guess it's ARM architecture quirks.
Quote:
But yeah, OP has a difficult task at hand. Good luck and keep us informed
Thanks! Definitely will!

Quote:
edit: I found a interesting link about the topic. Basically you can try the same but using a different device configuration. It seems that i.MX6 Dual Lite SABRE is available on qemu 2 and should be a good place to start. Use that instead of "versatile"
This board this exactly what I'm using (and reading about the presence of this board is what inspired me to do this, actually). I've never tried the versatile boards because they are too far from the Kindle boards. But both the stock kernel and a custom-built kernel from Amazon's trees don't boot (where QEMU shows a blank serial stdout).

Edit:

1. When doing a chroot with an image of the Kindle's main partition + user-mode QEMU ARM + Xephyr, I noticed that some Kindle executables work, namely xtestlab126. But starting the Kindle's framework properly requires init, or at least executing the Upstart scripts in the correct order. I thought I'd make it easier and scrap that plan, especially when a complete Kindle emulation in QEMU is much more "accurate".

2. According to this message on the U-Boot mailing list, the U-Boot compilation problem is caused by the system's own version of libfdt. But removing that package only makes matters worse:
Code:
$ env TYPE=prod make CROSS_COMPILE=~/arm-2014.05/bin/arm-linux-gnueabi- -j8
for dir in tools examples/standalone examples/api ; do make -C $dir _depend ; done
make[1]: Entering directory '/path/to/uboot_2009.08/tools'
make[1]: Nothing to be done for '_depend'.
make[1]: Leaving directory '/path/to/uboot_2009.08/tools'
make[1]: Entering directory '/path/to/uboot_2009.08/examples/standalone'
make[1]: Nothing to be done for '_depend'.
make[1]: Leaving directory '/path/to/uboot_2009.08/examples/standalone'
make[1]: Entering directory '/path/to/uboot_2009.08/examples/api'
make[1]: Nothing to be done for '_depend'.
make[1]: Leaving directory '/path/to/uboot_2009.08/examples/api'
make -C tools all
make -C examples/standalone all
make[1]: Entering directory '/path/to/uboot_2009.08/tools'
make -C examples/api all
make[1]: Entering directory '/path/to/uboot_2009.08/examples/standalone'
make -C cpu/arm_cortexa8 start.o
make[1]: Entering directory '/path/to/uboot_2009.08/examples/api'
make[1]: *** No rule to make target '/usr/include/libfdt_env.h', needed by 'mkimage.o'.  Stop.
make[1]: Leaving directory '/path/to/uboot_2009.08/tools'
make: *** [Makefile:357: tools] Error 2
make: *** Waiting for unfinished jobs....
make[1]: *** No rule to make target '~/arm-2014.05/lib/gcc/arm-none-linux-gnueabi/4.8.3/include/stdarg.h', needed by 'hello_world.o'.  Stop.
make[1]: Leaving directory '/path/to/uboot_2009.08/examples/standalone'
make: *** [Makefile:357: examples/standalone] Error 2
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/path/to/uboot_2009.08/examples/api'

Last edited by WaseemAlkurdi; 09-17-2019 at 04:58 PM.
WaseemAlkurdi is offline   Reply With Quote
Old 09-19-2019, 06:29 AM   #14
WaseemAlkurdi
Zealot
WaseemAlkurdi began at the beginning.
 
Posts: 147
Karma: 20
Join Date: Jul 2019
Device: Kindle Touch (K5) Wi-Fi x 2, Kindle (7th Gen, KT2), Paperwhite 3rd Gen
Finally! It compiled when using a Ubuntu chroot!
But the final product didn't boot in QEMU.
I'm going to build the mainline U-Boot tree for the "versatilepb" target to see if my build setup produces anything that boots at all in QEMU.
Edit: That worked. Why doesn't this one work?

Last edited by WaseemAlkurdi; 09-19-2019 at 08:28 AM.
WaseemAlkurdi is offline   Reply With Quote
Old 09-19-2019, 09:24 AM   #15
WaseemAlkurdi
Zealot
WaseemAlkurdi began at the beginning.
 
Posts: 147
Karma: 20
Join Date: Jul 2019
Device: Kindle Touch (K5) Wi-Fi x 2, Kindle (7th Gen, KT2), Paperwhite 3rd Gen
When targeting the vexpress board for a mainline U-Boot compile, the compiled U-Boot works flawlessly.
But when targeting any i.MX6 board that has a corresponding QEMU "machine" on mainline, it won't boot. I'm stumped.

Last edited by WaseemAlkurdi; 09-19-2019 at 09:39 AM.
WaseemAlkurdi is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Please help with these compilation errors darkbreath Sigil 24 07-22-2016 11:47 AM
How to show kernel boot information instead Amazon boot picture? madtrapper Kindle Developer's Corner 8 01-04-2013 08:51 AM
Can I make a compilation within a compilation? Villordsutch Amazon Kindle 5 01-04-2012 03:10 AM
Opus cannot boot, stuck on boot screen baloma Bookeen 35 11-13-2010 04:20 AM
Compilation of Q&A FGFuzaxx iRex 14 07-17-2006 07:51 AM


All times are GMT -4. The time now is 10:27 PM.


MobileRead.com is a privately owned, operated and funded community.