View Single Post
Old 10-22-2020, 09:43 AM   #2
csakakirc
Junior Member
csakakirc began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Feb 2020
Location: Isaszeg, Hungary
Device: KT, KT3
Update

Upon researching in the forum, I found KindleTools package forked by NiLuJe
With this I can recreate the diagkern.bin and flash it back with this magical method:
https://www.mobileread.com/forums/sh...d.php?t=296032

Under Win10 WSL looks promising, giving an Ubuntu command line in 10 minutes, after some package install the simple make finishes but the create recovery2 fails somehow.

Console output:
Spoiler:
Code:
root@X230:/home/akirc/KindleTool/KindleTool# make create recovery2 [bin.bin]
cc -O3 -ffast-math -march=native -fomit-frame-pointer -frename-registers -fweb -pipe -Iincludes -Llib -Wl,-O1 -Wl,--as-needed  create.c   -o create
create.c: In function ‘kindle_create_main’:
create.c:2725:38: warning: ‘%s’ directive output may be truncated writing 32 bytes into a region of size between 0 and 4095 [-Wformat-truncation=]
 2725 |   snprintf(tartmpfile, PATH_MAX, "%s/%s", kt_tempdir, "kindletool_create_tarball_XXXXXX");
      |                                      ^~               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from kindle_tool.h:41,
                 from create.h:26,
                 from create.c:23:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘__builtin___snprintf_chk’ output between 34 and 4129 bytes into a destination of size 4096
   67 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   68 |        __bos (__s), __fmt, __va_arg_pack ());
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
create.c:542:42: warning: ‘%s’ directive output may be truncated writing 28 bytes into a region of size between 0 and 4095 [-Wformat-truncation=]
  542 |  snprintf(sigabsolutepath, PATH_MAX, "%s/%s", kt_tempdir, "kindletool_create_sig_XXXXXX");
      |                                          ^~               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from kindle_tool.h:41,
                 from create.h:26,
                 from create.c:23:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘__builtin___snprintf_chk’ output between 30 and 4125 bytes into a destination of size 4096
   67 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   68 |        __bos (__s), __fmt, __va_arg_pack ());
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
create.c:546:42: warning: ‘%s’ directive output may be truncated writing 28 bytes into a region of size between 0 and 4095 [-Wformat-truncation=]
  546 |  snprintf(bundle_filename, PATH_MAX, "%s/%s", kt_tempdir, "kindletool_create_idx_XXXXXX");
      |                                          ^~               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from kindle_tool.h:41,
                 from create.h:26,
                 from create.c:23:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘__builtin___snprintf_chk’ output between 30 and 4125 bytes into a destination of size 4096
   67 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   68 |        __bos (__s), __fmt, __va_arg_pack ());
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
create.c:688:44: warning: ‘%s’ directive output may be truncated writing 28 bytes into a region of size between 0 and 4095 [-Wformat-truncation=]
  688 |    snprintf(sigabsolutepath, PATH_MAX, "%s/%s", kt_tempdir, "kindletool_create_sig_XXXXXX");
      |                                            ^~               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from kindle_tool.h:41,
                 from create.h:26,
                 from create.c:23:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘__builtin___snprintf_chk’ output between 30 and 4125 bytes into a destination of size 4096
   67 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   68 |        __bos (__s), __fmt, __va_arg_pack ());
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
/usr/bin/ld: /tmp/ccjzrRZJ.o: in function `sign_file':
create.c:(.text+0x4b): undefined reference to `nettle_sha256_init'
/usr/bin/ld: create.c:(.text+0x5f): undefined reference to `nettle_sha256_update'
/usr/bin/ld: create.c:(.text+0x9c): undefined reference to `__gmpz_init'
/usr/bin/ld: create.c:(.text+0xaa): undefined reference to `nettle_rsa_sha256_sign'
/usr/bin/ld: create.c:(.text+0xdf): undefined reference to `__gmpz_export'
/usr/bin/ld: create.c:(.text+0xe7): undefined reference to `__gmpz_clear'
/usr/bin/ld: create.c:(.text+0x1b7): undefined reference to `__gmpz_clear'
/usr/bin/ld: /tmp/ccjzrRZJ.o: in function `metadata_filter':
create.c:(.text+0x340): undefined reference to `archive_read_disk_can_descend'
/usr/bin/ld: create.c:(.text+0x350): undefined reference to `archive_match_new'
/usr/bin/ld: create.c:(.text+0x362): undefined reference to `archive_match_exclude_pattern'
/usr/bin/ld: create.c:(.text+0x379): undefined reference to `archive_match_exclude_pattern'
/usr/bin/ld: create.c:(.text+0x388): undefined reference to `archive_match_path_excluded'
/usr/bin/ld: create.c:(.text+0x39a): undefined reference to `archive_entry_pathname'
/usr/bin/ld: create.c:(.text+0x3bf): undefined reference to `archive_match_free'
/usr/bin/ld: create.c:(.text+0x3da): undefined reference to `archive_match_free'
/usr/bin/ld: create.c:(.text+0x3f4): undefined reference to `archive_error_string'
/usr/bin/ld: create.c:(.text+0x424): undefined reference to `archive_error_string'
/usr/bin/ld: create.c:(.text+0x45a): undefined reference to `archive_read_disk_descend'
/usr/bin/ld: create.c:(.text+0x474): undefined reference to `archive_error_string'
/usr/bin/ld: /tmp/ccjzrRZJ.o: in function `create_from_archive_read_disk':
create.c:(.text+0x4cb): undefined reference to `archive_read_disk_new'
/usr/bin/ld: create.c:(.text+0x4d3): undefined reference to `archive_entry_new'
/usr/bin/ld: create.c:(.text+0x4e6): undefined reference to `archive_read_disk_set_standard_lookup'
/usr/bin/ld: create.c:(.text+0x4f3): undefined reference to `archive_read_disk_open'
/usr/bin/ld: create.c:(.text+0x51a): undefined reference to `archive_entry_clear'
/usr/bin/ld: create.c:(.text+0x525): undefined reference to `archive_read_next_header2'
/usr/bin/ld: create.c:(.text+0x560): undefined reference to `archive_entry_set_uid'
/usr/bin/ld: create.c:(.text+0x56f): undefined reference to `archive_entry_set_uname'
/usr/bin/ld: create.c:(.text+0x579): undefined reference to `archive_entry_set_gid'
/usr/bin/ld: create.c:(.text+0x588): undefined reference to `archive_entry_set_gname'
/usr/bin/ld: create.c:(.text+0x590): undefined reference to `archive_entry_filetype'
/usr/bin/ld: create.c:(.text+0x5a3): undefined reference to `archive_entry_filetype'
/usr/bin/ld: create.c:(.text+0x5ce): undefined reference to `archive_entry_filetype'
/usr/bin/ld: create.c:(.text+0x5e6): undefined reference to `archive_entry_set_perm'
/usr/bin/ld: create.c:(.text+0x5f3): undefined reference to `archive_entry_filetype'
/usr/bin/ld: create.c:(.text+0x60d): undefined reference to `archive_entry_set_size'
/usr/bin/ld: create.c:(.text+0x621): undefined reference to `archive_entry_copy_pathname'
/usr/bin/ld: create.c:(.text+0x62b): undefined reference to `archive_entry_set_uid'
/usr/bin/ld: create.c:(.text+0x63a): undefined reference to `archive_entry_set_uname'
/usr/bin/ld: create.c:(.text+0x644): undefined reference to `archive_entry_set_gid'
/usr/bin/ld: create.c:(.text+0x653): undefined reference to `archive_entry_set_gname'
/usr/bin/ld: create.c:(.text+0x660): undefined reference to `archive_entry_set_perm'
/usr/bin/ld: create.c:(.text+0x678): undefined reference to `archive_read_disk_descend'
/usr/bin/ld: create.c:(.text+0x68b): undefined reference to `archive_entry_pathname'
/usr/bin/ld: create.c:(.text+0x6b6): undefined reference to `archive_write_header'
/usr/bin/ld: create.c:(.text+0x6c8): undefined reference to `archive_entry_size'
/usr/bin/ld: create.c:(.text+0x6e2): undefined reference to `archive_entry_filetype'
/usr/bin/ld: create.c:(.text+0x704): undefined reference to `archive_read_disk_descend'
/usr/bin/ld: create.c:(.text+0x734): undefined reference to `archive_error_string'
/usr/bin/ld: create.c:(.text+0x796): undefined reference to `archive_read_close'
/usr/bin/ld: create.c:(.text+0x79e): undefined reference to `archive_read_free'
/usr/bin/ld: create.c:(.text+0x7a6): undefined reference to `archive_entry_free'
/usr/bin/ld: create.c:(.text+0x7f4): undefined reference to `archive_error_string'
/usr/bin/ld: create.c:(.text+0x87a): undefined reference to `archive_read_data_block'
/usr/bin/ld: create.c:(.text+0x89e): undefined reference to `archive_write_data'
/usr/bin/ld: create.c:(.text+0x8ee): undefined reference to `archive_write_data'
/usr/bin/ld: create.c:(.text+0x921): undefined reference to `archive_entry_set_perm'
/usr/bin/ld: create.c:(.text+0x934): undefined reference to `archive_entry_filetype'
/usr/bin/ld: create.c:(.text+0x947): undefined reference to `archive_entry_pathname'
/usr/bin/ld: create.c:(.text+0x985): undefined reference to `archive_entry_copy_pathname'
/usr/bin/ld: create.c:(.text+0x994): undefined reference to `archive_entry_pathname'
/usr/bin/ld: create.c:(.text+0x99f): undefined reference to `archive_entry_pathname'
/usr/bin/ld: create.c:(.text+0x9ce): undefined reference to `archive_entry_set_perm'
/usr/bin/ld: create.c:(.text+0x9f5): undefined reference to `archive_read_disk_set_metadata_filter_callback'
/usr/bin/ld: create.c:(.text+0xa04): undefined reference to `archive_error_string'
/usr/bin/ld: create.c:(.text+0xa34): undefined reference to `archive_entry_pathname'
/usr/bin/ld: create.c:(.text+0xa3f): undefined reference to `archive_entry_pathname'
/usr/bin/ld: create.c:(.text+0xa74): undefined reference to `archive_entry_pathname'
/usr/bin/ld: create.c:(.text+0xa8f): undefined reference to `archive_entry_pathname'
/usr/bin/ld: create.c:(.text+0xab4): undefined reference to `archive_read_disk_descend'
/usr/bin/ld: create.c:(.text+0xb5e): undefined reference to `archive_error_string'
/usr/bin/ld: create.c:(.text+0xb9b): undefined reference to `archive_entry_pathname'
/usr/bin/ld: create.c:(.text+0xbcc): undefined reference to `archive_entry_pathname'
/usr/bin/ld: create.c:(.text+0xbd7): undefined reference to `archive_entry_pathname'
/usr/bin/ld: create.c:(.text+0xc10): undefined reference to `archive_entry_set_perm'
/usr/bin/ld: create.c:(.text+0xc18): undefined reference to `archive_entry_filetype'
/usr/bin/ld: create.c:(.text+0xc3c): undefined reference to `archive_entry_pathname'
/usr/bin/ld: create.c:(.text+0xc61): undefined reference to `archive_entry_pathname'
/usr/bin/ld: create.c:(.text+0xc94): undefined reference to `archive_read_close'
/usr/bin/ld: create.c:(.text+0xc9c): undefined reference to `archive_read_free'
/usr/bin/ld: create.c:(.text+0xca4): undefined reference to `archive_entry_free'
/usr/bin/ld: create.c:(.text+0xd06): undefined reference to `archive_error_string'
/usr/bin/ld: create.c:(.text+0xd3b): undefined reference to `archive_read_disk_descend'
/usr/bin/ld: /tmp/ccjzrRZJ.o: in function `kindle_create_ota_update':
create.c:(.text+0xe0b): undefined reference to `demunger'
/usr/bin/ld: create.c:(.text+0xe26): undefined reference to `md5_sum'
/usr/bin/ld: create.c:(.text+0xe43): undefined reference to `md'
/usr/bin/ld: create.c:(.text+0xe73): undefined reference to `munger'
/usr/bin/ld: create.c:(.text+0xeac): undefined reference to `md5_sum'
/usr/bin/ld: /tmp/ccjzrRZJ.o: in function `kindle_create_recovery':
create.c:(.text+0x1031): undefined reference to `demunger'
/usr/bin/ld: create.c:(.text+0x104c): undefined reference to `md5_sum'
/usr/bin/ld: create.c:(.text+0x1069): undefined reference to `md'
/usr/bin/ld: create.c:(.text+0x109b): undefined reference to `munger'
/usr/bin/ld: create.c:(.text+0x10dc): undefined reference to `md5_sum'
/usr/bin/ld: /tmp/ccjzrRZJ.o: in function `kindle_create_main':
create.c:(.text+0x123c): undefined reference to `nettle_rsa_private_key_init'
/usr/bin/ld: create.c:(.text+0x1254): undefined reference to `nettle_rsa_keypair_from_sexp'
/usr/bin/ld: create.c:(.text+0x16ad): undefined reference to `nettle_rsa_privkey_from_pem'
/usr/bin/ld: create.c:(.text+0x179f): undefined reference to `kt_with_unknown_devcodes'
/usr/bin/ld: create.c:(.text+0x1a95): undefined reference to `get_bundle_version'
/usr/bin/ld: create.c:(.text+0x1bc5): undefined reference to `nettle_rsa_private_key_clear'
/usr/bin/ld: create.c:(.text+0x2041): undefined reference to `archive_match_new'
/usr/bin/ld: create.c:(.text+0x2049): undefined reference to `archive_entry_new'
/usr/bin/ld: create.c:(.text+0x208a): undefined reference to `archive_match_exclude_pattern'
/usr/bin/ld: create.c:(.text+0x20a6): undefined reference to `archive_entry_copy_pathname'
/usr/bin/ld: create.c:(.text+0x20b1): undefined reference to `archive_match_path_excluded'
/usr/bin/ld: create.c:(.text+0x20c2): undefined reference to `archive_entry_free'
/usr/bin/ld: create.c:(.text+0x20ca): undefined reference to `archive_match_free'
/usr/bin/ld: create.c:(.text+0x2131): undefined reference to `kt_tempdir'
/usr/bin/ld: create.c:(.text+0x22e0): undefined reference to `get_bundle_version'
/usr/bin/ld: create.c:(.text+0x2333): undefined reference to `kt_with_unknown_devcodes'
/usr/bin/ld: create.c:(.text+0x2391): undefined reference to `kt_with_unknown_devcodes'
/usr/bin/ld: create.c:(.text+0x247c): undefined reference to `get_bundle_version'
/usr/bin/ld: create.c:(.text+0x25fd): undefined reference to `convert_device_id'
/usr/bin/ld: create.c:(.text+0x270a): undefined reference to `kt_tempdir'
/usr/bin/ld: create.c:(.text+0x2746): undefined reference to `kt_tempdir'
/usr/bin/ld: create.c:(.text+0x279c): undefined reference to `archive_write_new'
/usr/bin/ld: create.c:(.text+0x27a7): undefined reference to `archive_write_add_filter_gzip'
/usr/bin/ld: create.c:(.text+0x27af): undefined reference to `archive_write_set_format_gnutar'
/usr/bin/ld: create.c:(.text+0x27bc): undefined reference to `archive_write_set_bytes_per_block'
/usr/bin/ld: create.c:(.text+0x27c9): undefined reference to `archive_write_set_bytes_in_last_block'
/usr/bin/ld: create.c:(.text+0x27d4): undefined reference to `archive_write_open_fd'
/usr/bin/ld: create.c:(.text+0x28f3): undefined reference to `archive_write_close'
/usr/bin/ld: create.c:(.text+0x28fb): undefined reference to `archive_write_free'
/usr/bin/ld: create.c:(.text+0x2a95): undefined reference to `archive_write_close'
/usr/bin/ld: create.c:(.text+0x2a9d): undefined reference to `archive_write_free'
/usr/bin/ld: create.c:(.text+0x2bf5): undefined reference to `nettle_rsa_private_key_clear'
/usr/bin/ld: create.c:(.text+0x2e6b): undefined reference to `demunger'
/usr/bin/ld: create.c:(.text+0x2e8a): undefined reference to `md5_sum'
/usr/bin/ld: create.c:(.text+0x2eac): undefined reference to `md'
/usr/bin/ld: create.c:(.text+0x2f2c): undefined reference to `md'
/usr/bin/ld: create.c:(.text+0x2fa8): undefined reference to `munger'
/usr/bin/ld: create.c:(.text+0x317c): undefined reference to `demunger'
/usr/bin/ld: create.c:(.text+0x319b): undefined reference to `md5_sum'
/usr/bin/ld: create.c:(.text+0x31bd): undefined reference to `md'
/usr/bin/ld: create.c:(.text+0x337a): undefined reference to `munger'
/usr/bin/ld: create.c:(.text+0x345d): undefined reference to `convert_board_id'
/usr/bin/ld: create.c:(.text+0x346c): undefined reference to `convert_platform_id'
/usr/bin/ld: create.c:(.text+0x382d): undefined reference to `kt_tempdir'
/usr/bin/ld: create.c:(.text+0x3a72): undefined reference to `md5_sum'
/usr/bin/ld: create.c:(.text+0x3b57): undefined reference to `archive_error_string'
/usr/bin/ld: create.c:(.text+0x3bc6): undefined reference to `kt_with_unknown_devcodes'
/usr/bin/ld: create.c:(.text+0x3cb5): undefined reference to `kt_with_unknown_devcodes'
/usr/bin/ld: create.c:(.text+0x3dbb): undefined reference to `convert_platform_id'
/usr/bin/ld: create.c:(.text+0x3ddf): undefined reference to `convert_board_id'
/usr/bin/ld: create.c:(.text+0x41f3): undefined reference to `kt_with_unknown_devcodes'
/usr/bin/ld: create.c:(.text+0x425d): undefined reference to `md5_sum'
/usr/bin/ld: create.c:(.text+0x4281): undefined reference to `md5_sum'
/usr/bin/ld: create.c:(.text+0x4424): undefined reference to `kt_with_unknown_devcodes'
/usr/bin/ld: create.c:(.text+0x46a3): undefined reference to `kt_with_unknown_devcodes'
/usr/bin/ld: create.c:(.text+0x4771): undefined reference to `archive_entry_free'
/usr/bin/ld: create.c:(.text+0x477b): undefined reference to `archive_match_free'
/usr/bin/ld: create.c:(.text+0x480f): undefined reference to `kt_with_unknown_devcodes'
/usr/bin/ld: create.c:(.text+0x4893): undefined reference to `convert_board_id'
/usr/bin/ld: create.c:(.text+0x48a2): undefined reference to `convert_platform_id'
/usr/bin/ld: create.c:(.text+0x48f7): undefined reference to `convert_platform_id'
/usr/bin/ld: create.c:(.text+0x491b): undefined reference to `convert_board_id'
/usr/bin/ld: create.c:(.text+0x4b43): undefined reference to `kt_with_unknown_devcodes'
/usr/bin/ld: create.c:(.text+0x4d7e): undefined reference to `kt_with_unknown_devcodes'
/usr/bin/ld: create.c:(.text+0x51a1): undefined reference to `kt_with_unknown_devcodes'
/usr/bin/ld: create.c:(.text+0x5245): undefined reference to `kt_with_unknown_devcodes'
/usr/bin/ld: create.c:(.text+0x542c): undefined reference to `kt_with_unknown_devcodes'
/usr/bin/ld: /tmp/ccjzrRZJ.o:create.c:(.text+0x5570): more undefined references to `kt_with_unknown_devcodes' follow
/usr/bin/ld: /tmp/ccjzrRZJ.o: in function `kindle_create_main':
create.c:(.text+0x5c57): undefined reference to `archive_error_string'
/usr/bin/ld: create.c:(.text+0x77c6): undefined reference to `from_base'
/usr/bin/ld: create.c:(.text+0x77cc): undefined reference to `kt_with_unknown_devcodes'
/usr/bin/ld: create.c:(.text+0x77dc): undefined reference to `convert_device_id'
/usr/bin/ld: create.c:(.text+0x7869): undefined reference to `kt_with_unknown_devcodes'
/usr/bin/ld: create.c:(.text+0x787f): undefined reference to `convert_device_id'
/usr/bin/ld: create.c:(.text+0x798e): undefined reference to `convert_device_id'
/usr/bin/ld: create.c:(.text+0x7a02): undefined reference to `kt_with_unknown_devcodes'
/usr/bin/ld: create.c:(.text+0x7a0c): undefined reference to `convert_device_id'
/usr/bin/ld: create.c:(.text+0x7a73): undefined reference to `from_base'
/usr/bin/ld: create.c:(.text+0x7a79): undefined reference to `kt_with_unknown_devcodes'
/usr/bin/ld: create.c:(.text+0x7a8a): undefined reference to `convert_device_id'
collect2: error: ld returned 1 exit status
make: *** [<builtin>: create] Error 1
csakakirc is offline   Reply With Quote