Cboot in 32.7.2 fails to read extlinux.conf

Apparently there is a size problem:
[0005.447] I> ext4_read_data_from_extent:298: Total file read should not be larger than file stat size

If you go to your flash content’s original “boot/extlinux/extlinux.conf” source used to create the image, located somewhere like:

~/nvidia/nvidia_sdk/JetPack_...version.../Linux_for_Tegra/rootfs/boot/extlinux/extlinux.conf

…then look at the “extlinux.conf” file, what size is this file? What is the content of that file (you could attach it to the forum)? This should be the source of creating that file.

Do you also still have “Linux_for_Tegra/bootloader/system.img.raw”? If you do, then this can be loopback mounted and the actual image’s extlinux.conf examined. For example:

sudo -s
mount -o loop ./system.img.raw /mnt
cd /mnt/boot/extlinux
ls -l extlinux.conf
cat extlinux.conf
cd
umount /mnt
exit

Can anyone else who boots 32.7.2 please create a dummy extlinux.conf file and see if the uart boot log shows the same error about accessing extlinux.conf?

I have only 2 boot entries in the extlinux.conf and the file can’t be too large. The same extlinux.conf worked fine with 32.7.1.

We can reproduce this issue with pure jetpack. Will check this.

We have found exactly this issue after doing an “apt upgrade” on a machine with JetPack 4.6.1 and L4T 32.7.1.

It would be good to get a fix quickly as this is stopping us from upgrading to JetPack 4.6.2 as we need a custom dtb to be able to use SPI on the 40 pin connector.

Please try this within your cboot, reflash the cboot and it shall work with extlinux.conf.

diff --git a/lib/fs/ext4/ext4.c b/lib/fs/ext4/ext4.c
index c994c0f..6e8e2e7 100644
--- a/lib/fs/ext4/ext4.c
+++ b/lib/fs/ext4/ext4.c
@@ -244,6 +244,9 @@
     uint8_t *buf_ptr = NULL;
     off_t total_bytes_read = 0;
     int err = 0;
+    uint32_t file_len_in_blocks = 0;
+    uint32_t total_blocks_read;
+    uint32_t block_size;
 
     LTRACE_ENTRY;
 
@@ -254,6 +257,15 @@
     }
 
     buf_ptr = (uint8_t *)buf;
+    block_size = E2FS_BLOCK_SIZE(ext2->super_blk);
+
+    if (len != 0UL) {
+        file_len_in_blocks = len/block_size;
+        if ((len % block_size) != 0U) {
+            file_len_in_blocks++;
+        }
+        LTRACEF("file_len_in_blocks: %u\n", file_len_in_blocks);
+    }
 
     /* Extract extents info */
     extent_header = (struct ext4_extent_header *)inode->e2di_blocks;
@@ -284,21 +296,37 @@
             err = ext4_read_extent(ext2, (struct ext4_extent_header *)buf2, buf_ptr, &bytes_read);
             total_bytes_read += bytes_read;
             buf_ptr += bytes_read;
-			if ((len != 0) && (total_bytes_read > len)) {
-				TRACEF("Total file read should not be larger than file stat size\n");
-				err = ERR_NOT_VALID;
-				goto fail;
-			}
+
+            total_blocks_read = total_bytes_read/block_size;
+            if ((total_bytes_read % block_size) != 0U) {
+                total_blocks_read++;
+            }
+
+            /* Check if extra block isn't read */
+            if ((len != 0) && (total_blocks_read > file_len_in_blocks)) {
+                TRACEF("More blocks are read (%u) than file block count (%u)\n",
+                        total_blocks_read, file_len_in_blocks);
+                err = ERR_NOT_VALID;
+                goto fail;
+            }
         }
     } else {
         /* Read leaf node */
         err = ext4_read_extent(ext2, extent_header, buf_ptr, &bytes_read);
         total_bytes_read += bytes_read;
-		if ((len != 0) && (total_bytes_read > len)) {
-			TRACEF("Total file read should not be larger than file stat size\n");
-			err = ERR_NOT_VALID;
-			goto fail;
-		}
+
+        total_blocks_read = total_bytes_read/block_size;
+        if ((total_bytes_read % block_size) != 0U) {
+            total_blocks_read++;
+        }
+
+        /* Check if extra block isn't read */
+        if ((len != 0) && (total_blocks_read > file_len_in_blocks)) {
+            TRACEF("More blocks are read (%u) than file block count (%u)\n",
+                    total_blocks_read, file_len_in_blocks);
+            err = ERR_NOT_VALID;
+            goto fail;
+        }
     }
 
     LTRACEF("err %d, bytes_read %lu\n", err, total_bytes_read);
2 Likes

I tried to download Cboot Sources T194 from Jetson Linux R32.7.2 Release Page | NVIDIA Developer

It can’t even build unmodified. Has anybody tried to build it as is? The tarball has some nvidia internal build tool, as pointed out in this other post.

Please follow the readme file and build it manually.

Here is what I did on my Debian x86_64 box:

  1. Downloaded cboot_src_t19x.tbz2 and l4t-gcc-7-3-1-toolchain-64-bit into /tmp from Jetson Linux R32.7.2 Release Page | NVIDIA Developer
cd /tmp
rm -rf cboot
mkdir cboot
tar -C cboot -xf cboot_src_t19x.tbz2
tar xf l4t-gcc-7-3-1-toolchain-64-bit
export CROSS_COMPILE=/tmp/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
export TEGRA_TOP=$PWD
export TOP=$PWD
make -C ./bootloader/partner/t18x/cboot PROJECT=t194 TOOLCHAIN_PREFIX="${CROSS_COMPILE}" DEBUG=2 BUILDROOT="${PWD}"/out NV_TARGET_BOARD=t194ref NV_BUILD_SYSTEM_TYPE=l4t NOECHO=@
  1. I got below output:
make -C ./bootloader/partner/t18x/cboot PROJECT=t194 TOOLCHAIN_PREFIX="${CROSS_COMPILE}" DEBUG=2 BUILDROOT="${PWD}"/out NV_TARGET_BOARD=t194ref NV_BUILD_SYSTEM_TYPE=l4t NOECHO=@
make: Entering directory '/tmp/cboot/bootloader/partner/t18x/cboot'
LKROOT=. LKINC=". " make -rR -f ./engine.mk -I. 
make[1]: Entering directory '/tmp/cboot/bootloader/partner/t18x/cboot'
PROJECT = t194
PLATFORM = t194
TARGET = t194
TEGRA_TOP = /tmp/cboot
TOOLCHAIN_PREFIX = /tmp/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
LIBGCC = /tmp/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/7.3.1/libgcc.a
GLOBAL_COMPILEFLAGS = -g -fno-builtin -finline -W -Wall -Wno-multichar -Wno-unused-parameter -Wno-unused-function -include /tmp/cboot/out/build-t194/build_config.h -ffunction-sections -fdata-sections 
including app app/kernel_boot dev kernel lib/console lib/exit lib/lwip lib/menu platform platform/t194/../../../../common/arch/arm64 platform/t194/../../../../common/drivers/comb_uart platform/t194/../../../../common/drivers/display platform/t194/../../../../common/drivers/eeprom platform/t194/../../../../common/drivers/eqos platform/t194/../../../../common/drivers/gpcdma platform/t194/../../../../common/drivers/gpio platform/t194/../../../../common/drivers/i2c platform/t194/../../../../common/drivers/i2c_dev platform/t194/../../../../common/drivers/keyboard platform/t194/../../../../common/drivers/nvme platform/t194/../../../../common/drivers/pcie platform/t194/../../../../common/drivers/phy platform/t194/../../../../common/drivers/pmic platform/t194/../../../../common/drivers/pmic/max77620 platform/t194/../../../../common/drivers/pwm platform/t194/../../../../common/drivers/qspi platform/t194/../../../../common/drivers/qspi_flash platform/t194/../../../../common/drivers/regulator platform/t194/../../../../common/drivers/sata platform/t194/../../../../common/drivers/sdmmc platform/t194/../../../../common/drivers/spi platform/t194/../../../../common/drivers/ufs platform/t194/../../../../common/drivers/usb/storage platform/t194/../../../../common/drivers/usbh platform/t194/../../../../common/lib/a_b_boot platform/t194/../../../../common/lib/blockdev platform/t194/../../../../common/lib/cbo platform/t194/../../../../common/lib/eeprom_manager platform/t194/../../../../common/lib/exit platform/t194/../../../../common/lib/ipc platform/t194/../../../../common/lib/psci platform/t194/../../../../common/lib/tegrabl_error platform/t194/../../../../t18x/common/lib/mce platform/t194/../../../../t19x/common/drivers/fuse platform/t194/../../../../t19x/common/drivers/padctl platform/t194/../../../../t19x/common/drivers/soc/t194/clocks platform/t194/../../../../t19x/common/drivers/timer platform/t194/../../../../t19x/common/lib/device_prod platform/t194/../../../../t19x/common/lib/tegrabl_auth platform/t194/../../../../t19x/common/lib/tegrabl_brbct platform/t194/../../../../t19x/common/lib/tegrabl_brbit platform/t194/../../../../t19x/common/soc/t194/ccplex_cache platform/t194/../../../../t19x/common/soc/t194/ccplex_nvg platform/t194/../../../../t19x/common/soc/t194/misc platform/t194/../../../../t19x/common/soc/t194/qual_engine platform/tegra_shared target
including app/kernel_boot/../../../../common/drivers/uart app/kernel_boot/../../../../common/drivers/wdt app/kernel_boot/../../../../common/lib/bootloader_update app/kernel_boot/../../../../common/lib/console app/kernel_boot/../../../../common/lib/debug app/kernel_boot/../../../../common/lib/fastboot app/kernel_boot/../../../../common/lib/frp app/kernel_boot/../../../../common/lib/gpt app/kernel_boot/../../../../common/lib/linuxboot app/kernel_boot/../../../../common/lib/malloc app/kernel_boot/../../../../common/lib/nvblob app/kernel_boot/../../../../common/lib/nvblob_bmp app/kernel_boot/../../../../common/lib/partition_manager app/kernel_boot/../../../../common/lib/utils app/kernel_boot/verified_boot/vblib_v1 lib/debug lib/libc platform/t194/../../../../common/drivers/display/../../lib/graphics platform/t194/../../../../common/drivers/i2c/../dpaux
including ../../common/lib/clib ../../common/lib/external/asn1 ../../common/lib/external/mbedtls ../../common/lib/external/mincrypt ../common/soc/t186/pkc_ops app/kernel_boot/../../../../common/lib/fastboot/../../../common/drivers/usbf/class/transport app/kernel_boot/../../../../common/lib/fastboot/../../../common/drivers/usbf/xusbf app/kernel_boot/../../../../common/lib/fastboot/../../../common/lib/sparse app/kernel_boot/../../../../common/lib/linuxboot/../../../t18x/common/lib/partitionloader app/kernel_boot/../../../../common/lib/linuxboot/../board_info app/kernel_boot/../../../../common/lib/linuxboot/../decompress app/kernel_boot/../../../../common/lib/linuxboot/../devicetree app/kernel_boot/../../../../common/lib/linuxboot/../external/libufdt app/kernel_boot/../../../../common/lib/linuxboot/../file_manager app/kernel_boot/../../../../common/lib/linuxboot/../libfdt app/kernel_boot/../../../../common/lib/linuxboot/../odmdata app/kernel_boot/../../../../common/lib/linuxboot/../plugin_manager
including app/kernel_boot/../../../../common/lib/linuxboot/../file_manager/../fs
including app/kernel_boot/../../../../common/lib/linuxboot/../file_manager/../fs/ext2 app/kernel_boot/../../../../common/lib/linuxboot/../file_manager/../fs/ext4
including app/kernel_boot/../../../../common/lib/linuxboot/../file_manager/../fs/ext2/../../bcache
Traceback (most recent call last):
  File "./build/get_branch_name.py", line 18, in <module>
    xml_tree = parse(manifest_file)
  File "/usr/lib/python2.7/xml/dom/minidom.py", line 1918, in parse
    return expatbuilder.parse(file)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 922, in parse
    fp = open(file, 'rb')
IOError: [Errno 2] No such file or directory: '/tmp/cboot/.repo/manifest.xml'
generating out/build-t194/bootloader/partner/t18x/cboot/platform/t194/module_config.h
generating out/build-t194/build_config.h
compiling bootloader/partner/t18x/cboot/platform/t194/platform.c
In file included from <command-line>:32:0:
/tmp/cboot/out/build-t194/build_config.h:178:25: error: missing terminating " character [-Werror]
 #define GLOBAL_INCLUDES "_I_tmp_cboot_out_build_t194
                         ^
/tmp/cboot/out/build-t194/build_config.h:179:1: error: unknown type name '_I__include'; did you mean '__has_include'?
 _I__include
 ^~~~~~~~~~~
 __has_include
/tmp/cboot/out/build-t194/build_config.h:181:1: error: expected '=', ',', ';', asm' or '__attribute__' before '_Iplatform_t194'
 _Iplatform_t194
 ^~~~~~~~~~~~~~~
/tmp/cboot/out/build-t194/build_config.h:181:1: error: unknown type name '_Iplatform_t194'
In file included from <command-line>:32:0:
/tmp/cboot/out/build-t194/build_config.h:459:89: error: missing terminating " character [-Werror]
 el_boot_____________common_lib_linuxboot____file_manager____fs____include_lib_
                                                                               
/tmp/cboot/out/build-t194/build_config.h:459:89: error: missing terminating " character
/tmp/cboot/out/build-t194/build_config.h:460:29: error: missing terminating " character [-Werror]
 #define GLOBAL_COMPILEFLAGS "_g
                             ^
/tmp/cboot/out/build-t194/build_config.h:471:17: error: missing terminating " character [-Werror]
 _fdata_sections_"
                 ^
/tmp/cboot/out/build-t194/build_config.h:471:17: error: missing terminating " character
/tmp/cboot/out/build-t194/build_config.h:473:23: error: missing terminating " character [-Werror]
 #define GLOBAL_CFLAGS "__std=gnu99
                       ^
/tmp/cboot/out/build-t194/build_config.h:477:0: error: "_WERROR" redefined [-Werror]
 #define _WERROR unused_label
 
/tmp/cboot/out/build-t194/build_config.h:476:0: note: this is the location of the previous definition
 #define _WERROR strict_prototypes
 
/tmp/cboot/out/build-t194/build_config.h:478:0: error: "_WERROR" redefined [-Werror]
 #define _WERROR int_to_pointer_cast
 
/tmp/cboot/out/build-t194/build_config.h:477:0: note: this is the location of the previous definition
 #define _WERROR unused_label
 
/tmp/cboot/out/build-t194/build_config.h:479:0: error: "_WERROR" redefined [-Werror]
 #define _WERROR address
 
/tmp/cboot/out/build-t194/build_config.h:478:0: note: this is the location of the previous definition
 #define _WERROR int_to_pointer_cast
 
/tmp/cboot/out/build-t194/build_config.h:480:0: error: "_WERROR" redefined [-Werror]
 #define _WERROR array_bounds
 
/tmp/cboot/out/build-t194/build_config.h:479:0: note: this is the location of the previous definition
 #define _WERROR address
 
/tmp/cboot/out/build-t194/build_config.h:481:0: error: "_WERROR" redefined [-Werror]
 #define _WERROR char_subscripts
 
/tmp/cboot/out/build-t194/build_config.h:480:0: note: this is the location of the previous definition
 #define _WERROR array_bounds
 
/tmp/cboot/out/build-t194/build_config.h:482:0: error: "_WERROR" redefined [-Werror]
 #define _WERROR enum_compare
 
/tmp/cboot/out/build-t194/build_config.h:481:0: note: this is the location of the previous definition
 #define _WERROR char_subscripts
 
/tmp/cboot/out/build-t194/build_config.h:483:0: error: "_WERROR" redefined [-Werror]
 #define _WERROR implicit_int
 
/tmp/cboot/out/build-t194/build_config.h:482:0: note: this is the location of the previous definition
 #define _WERROR enum_compare
 
/tmp/cboot/out/build-t194/build_config.h:484:0: error: "_WERROR" redefined [-Werror]
 #define _WERROR implicit_function_declaration
 
/tmp/cboot/out/build-t194/build_config.h:483:0: note: this is the location of the previous definition
 #define _WERROR implicit_int
 
/tmp/cboot/out/build-t194/build_config.h:485:0: error: "_WERROR" redefined [-Werror]
 #define _WERROR comment
 
/tmp/cboot/out/build-t194/build_config.h:484:0: note: this is the location of the previous definition
 #define _WERROR implicit_function_declaration
 
/tmp/cboot/out/build-t194/build_config.h:486:0: error: "_WERROR" redefined [-Werror]
 #define _WERROR main
 
/tmp/cboot/out/build-t194/build_config.h:485:0: note: this is the location of the previous definition
 #define _WERROR comment
 
/tmp/cboot/out/build-t194/build_config.h:487:0: error: "_WERROR" redefined [-Werror]
 #define _WERROR missing_braces
 
/tmp/cboot/out/build-t194/build_config.h:486:0: note: this is the location of the previous definition
 #define _WERROR main
 
/tmp/cboot/out/build-t194/build_config.h:488:0: error: "_WERROR" redefined [-Werror]
 #define _WERROR nonnull
 
/tmp/cboot/out/build-t194/build_config.h:487:0: note: this is the location of the previous definition
 #define _WERROR missing_braces
 
/tmp/cboot/out/build-t194/build_config.h:489:0: error: "_WERROR" redefined [-Werror]
 #define _WERROR reorder
 
/tmp/cboot/out/build-t194/build_config.h:488:0: note: this is the location of the previous definition
 #define _WERROR nonnull
 
/tmp/cboot/out/build-t194/build_config.h:490:0: error: "_WERROR" redefined [-Werror]
 #define _WERROR return_type
 
/tmp/cboot/out/build-t194/build_config.h:489:0: note: this is the location of the previous definition
 #define _WERROR reorder
 
/tmp/cboot/out/build-t194/build_config.h:491:0: error: "_WERROR" redefined [-Werror]
 #define _WERROR sequence_point
 
/tmp/cboot/out/build-t194/build_config.h:490:0: note: this is the location of the previous definition
 #define _WERROR return_type
 
/tmp/cboot/out/build-t194/build_config.h:492:0: error: "_WERROR" redefined [-Werror]
 #define _WERROR switch
 
/tmp/cboot/out/build-t194/build_config.h:491:0: note: this is the location of the previous definition
 #define _WERROR sequence_point
 
/tmp/cboot/out/build-t194/build_config.h:493:0: error: "_WERROR" redefined [-Werror]
 #define _WERROR trigraphs
 
/tmp/cboot/out/build-t194/build_config.h:492:0: note: this is the location of the previous definition
 #define _WERROR switch
 
/tmp/cboot/out/build-t194/build_config.h:494:0: error: "_WERROR" redefined [-Werror]
 #define _WERROR unknown_pragmas
 
/tmp/cboot/out/build-t194/build_config.h:493:0: note: this is the location of the previous definition
 #define _WERROR trigraphs
 
/tmp/cboot/out/build-t194/build_config.h:495:0: error: "_WERROR" redefined [-Werror]
 #define _WERROR volatile_register_var
 
/tmp/cboot/out/build-t194/build_config.h:494:0: note: this is the location of the previous definition
 #define _WERROR unknown_pragmas
 
/tmp/cboot/out/build-t194/build_config.h:496:0: error: "_WERROR" redefined [-Werror]
 #define _WERROR unused_variable
 
/tmp/cboot/out/build-t194/build_config.h:495:0: note: this is the location of the previous definition
 #define _WERROR volatile_register_var
 
/tmp/cboot/out/build-t194/build_config.h:497:0: error: "_WERROR" redefined [-Werror]
 #define _WERROR unused_value
 
/tmp/cboot/out/build-t194/build_config.h:496:0: note: this is the location of the previous definition
 #define _WERROR unused_variable
 
/tmp/cboot/out/build-t194/build_config.h:498:0: error: "_WERROR" redefined [-Werror]
 #define _WERROR empty_body
 
/tmp/cboot/out/build-t194/build_config.h:497:0: note: this is the location of the previous definition
 #define _WERROR unused_value
 
/tmp/cboot/out/build-t194/build_config.h:499:0: error: "_WERROR" redefined [-Werror]
 #define _WERROR type_limits
 
/tmp/cboot/out/build-t194/build_config.h:498:0: note: this is the location of the previous definition
 #define _WERROR empty_body
 
/tmp/cboot/out/build-t194/build_config.h:500:0: error: "_WERROR" redefined [-Werror]
 #define _WERROR format_extra_args
 
/tmp/cboot/out/build-t194/build_config.h:499:0: note: this is the location of the previous definition
 #define _WERROR type_limits
 
/tmp/cboot/out/build-t194/build_config.h:501:0: error: "_WERROR" redefined [-Werror]
 #define _WERROR unused_but_set_variable
 
/tmp/cboot/out/build-t194/build_config.h:500:0: note: this is the location of the previous definition
 #define _WERROR format_extra_args
 
/tmp/cboot/out/build-t194/build_config.h:502:0: error: "_WERROR" redefined [-Werror]
 #define _WERROR overflow
 
/tmp/cboot/out/build-t194/build_config.h:501:0: note: this is the location of the previous definition
 #define _WERROR unused_but_set_variable
 
/tmp/cboot/out/build-t194/build_config.h:503:0: error: "_WERROR" redefined [-Werror]
 #define _WERROR uninitialized
 
/tmp/cboot/out/build-t194/build_config.h:502:0: note: this is the location of the previous definition
 #define _WERROR overflow
 
/tmp/cboot/out/build-t194/build_config.h:504:0: error: "_WERROR" redefined [-Werror]
 #define _WERROR parentheses
 
/tmp/cboot/out/build-t194/build_config.h:503:0: note: this is the location of the previous definition
 #define _WERROR uninitialized
 
/tmp/cboot/out/build-t194/build_config.h:507:33: error: missing terminating " character [-Werror]
 _Wno_missing_field_initializers_"
                                 ^
/tmp/cboot/out/build-t194/build_config.h:507:33: error: missing terminating " character
/tmp/cboot/out/build-t194/build_config.h:508:25: error: missing terminating " character [-Werror]
 #define GLOBAL_CPPFLAGS "_fno_exceptions
                         ^
/tmp/cboot/out/build-t194/build_config.h:510:25: error: missing terminating " character [-Werror]
 _fno_threadsafe_statics_"
                         ^
/tmp/cboot/out/build-t194/build_config.h:510:25: error: missing terminating " character
/tmp/cboot/out/build-t194/build_config.h:512:24: error: missing terminating " character [-Werror]
 #define GLOBAL_LDFLAGS "__gc_sections
                        ^
/tmp/cboot/out/build-t194/build_config.h:517:51: error: missing terminating " character [-Werror]
 #define _MAP _tmp_cboot_out_build_t194_lk_elf_map_"
                                                   ^
In file included from <command-line>:32:0:
/tmp/cboot/out/build-t194/bootloader/partner/t18x/cboot/platform/t194/module_config.h:11:21: error: missing terminating " character [-Werror]
 #define MODULE_DEPS "platform_tegra_shared
                     ^
/tmp/cboot/out/build-t194/bootloader/partner/t18x/cboot/platform/t194/module_config.h:61:46: error: missing terminating " character [-Werror]
 platform_t194_____________common_drivers_phy_"
                                              ^
/tmp/cboot/out/build-t194/bootloader/partner/t18x/cboot/platform/t194/module_config.h:61:46: error: missing terminating " character
In file included from ./include/debug.h:26:0,
                 from /tmp/cboot/bootloader/partner/t18x/cboot/platform/t194/platform.c:13:
/tmp/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/lib/gcc/aarch64-linux-gnu/7.3.1/include/stdarg.h:99:9: error: unknown type name '__gnuc_va_list'
 typedef __gnuc_va_list va_list;
         ^~~~~~~~~~~~~~
In file included from platform/t194/../../../..//common/include/lib/tegrabl_debug.h:15:0,
                 from /tmp/cboot/bootloader/partner/t18x/cboot/platform/t194/platform.c:22:
/tmp/cboot/out/build-t194/build_config.h:178:25: error: missing terminating " character [-Werror]
 #define GLOBAL_INCLUDES "_I_tmp_cboot_out_build_t194
                         ^
In file included from platform/t194/../../../..//common/include/lib/tegrabl_debug.h:15:0,
                 from /tmp/cboot/bootloader/partner/t18x/cboot/platform/t194/platform.c:22:
/tmp/cboot/out/build-t194/build_config.h:459:89: error: missing terminating " character [-Werror]
 el_boot_____________common_lib_linuxboot____file_manager____fs____include_lib_
                                                                               
/tmp/cboot/out/build-t194/build_config.h:460:29: error: missing terminating " character [-Werror]
 #define GLOBAL_COMPILEFLAGS "_g
                             ^
/tmp/cboot/out/build-t194/build_config.h:471:17: error: missing terminating " character [-Werror]
 _fdata_sections_"
                 ^
/tmp/cboot/out/build-t194/build_config.h:473:23: error: missing terminating " character [-Werror]
 #define GLOBAL_CFLAGS "__std=gnu99
                       ^
/tmp/cboot/out/build-t194/build_config.h:507:33: error: missing terminating " character [-Werror]
 _Wno_missing_field_initializers_"
                                 ^
/tmp/cboot/out/build-t194/build_config.h:508:25: error: missing terminating " character [-Werror]
 #define GLOBAL_CPPFLAGS "_fno_exceptions
                         ^
/tmp/cboot/out/build-t194/build_config.h:510:25: error: missing terminating " character [-Werror]
 _fno_threadsafe_statics_"
                         ^
/tmp/cboot/out/build-t194/build_config.h:512:24: error: missing terminating " character [-Werror]
 #define GLOBAL_LDFLAGS "__gc_sections
                        ^
/tmp/cboot/out/build-t194/build_config.h:517:51: error: missing terminating " character [-Werror]
 #define _MAP _tmp_cboot_out_build_t194_lk_elf_map_"
                                                   ^
In file included from ../../common/include/lib/tegrabl_utils.h:17:0,
                 from ../../common/include/tegrabl_error.h:30,
                 from platform/t194/../../../..//common/include/lib/tegrabl_debug.h:20,
                 from /tmp/cboot/bootloader/partner/t18x/cboot/platform/t194/platform.c:22:
../../common/include/tegrabl_compiler.h:95:29: error: conflicting types for 'va_list'
 typedef __builtin_va_list   va_list;
                             ^~~~~~~
In file included from ./include/debug.h:26:0,
                 from /tmp/cboot/bootloader/partner/t18x/cboot/platform/t194/platform.c:13:
/tmp/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/lib/gcc/aarch64-linux-gnu/7.3.1/include/stdarg.h:99:24: note: previous declaration of 'va_list' was here
 typedef __gnuc_va_list va_list;
                        ^~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [make/compile.mk:45: /tmp/cboot/out/build-t194/bootloader/partner/t18x/cboot/platform/t194/platform.o] Error 1
make[1]: Leaving directory '/tmp/cboot/bootloader/partner/t18x/cboot'
make: *** [makefile:13: _top] Error 2
make: Leaving directory '/tmp/cboot/bootloader/partner/t18x/cboot'

No such file or directory: '/tmp/cboot/.repo/manifest.xml' is what is mentioned in this other post.

ok, found the issue in the file bootloader/partner/t18x/cboot/make/macros.mk

As suggested in this post, I modified the line 14,15 from

SPACE :=
SPACE +=

to

E =
SPACE = $E $E

The build completes, though still giving the error No such file or directory: '/tmp/cboot/.repo/manifest.xml'. I guess that could be ignored.

Is this cboot patch also fixing this? If not, can you provide one as well?

1 Like

Honestly, we don’t think that is really a bug… That was why we didn’t have any fix.

The record of the conclusion from my side is, your issue should just be avoided by changing the boot order in the cbo.

If that does not resolve your issue, you need to share the log but not just tell us it is a bug.

I mean we need the log for this status.

But turns out you come back and tell us the rel-32.7.2 extlinux.conf issue. That was different case.

The original problem that we had 209345 was that we could not turn the SPI on using JetsonIO. That was a bug. After some considerable time looking at this we discovered that it was because the boot procedure was not properly checking all the available boot options in the boot-order and was giving up at nvme when one was present. Having remedied (ie not fixed) that by changing the boot order, the next machine we tried to set up we could no longer boot with our custom dtb that was turning SPI on and after some more considerable time we discovered that it was because extlinux.conf was not not being read and thus found this thread.

So I am inclined to agree with user100090 that these are all related and part of the same issue. Recompiling cboot is clearly raising more bugs and I am not inclined to try it and will rather stick with 32.7.1 and change to boot-order.

So when will the combined boot-order + extlinux.conf bugs be fixed?

Can someone at least show us what is the exact error you got when you change the boot order and with the extlinux.conf patch?

My purpose here is only “if your nvme is not a boot disk, then please move it out from the boot order”

My point is that if the boot-order was worked through without giving up at the first device found, there wouldn’t be a problem. Even if there was an option to edit the boot order as part of the Jetpack installer then that wouldn’t be a problem. Ok it is quite easy to edit the boot order once you know what to do, but starting from a position of not even knowing what a dtb was then that involved quite a bit of reading. My interpretation of this thread is that user100090 has successfully recompiled cboot after editing one of the makefiles and I presume that their system is now booting correctly. If you are interested in another log from when it does not read extlinux.conf correctly without recompiling cboot but after changing the boot order then see below:

[0002.449] I> boot-dev-order :-
[0002.452] I> 1.emmc
[0002.454] I> 2.sd
[0002.456] I> 3.usb
[0002.458] I> 4.nvme
[0002.460] I> 5.net
[0002.461] I> Hit any key to stop autoboot:	4	3	2	1
[0004.469] initializing target
[0004.469] calling apps_init()
[0004.470] starting app kernel_boot_app
[0004.489] I> found decompressor handler: lz4-legacy
[0004.490] I> decompressing BMP blob ...
[0004.501] I> Kernel type = Normal
[0004.501] I> ########## Fixed storage boot ##########
[0004.501] I> Loading kernel-bootctrl from partition
[0004.502] I> Loading partition kernel-bootctrl at 0xa42d0000 from device(0x1)
[0004.508] W> tegrabl_get_kernel_bootctrl: magic number(0x00000000) is invalid
[0004.509] W> tegrabl_get_kernel_bootctrl: use default dummy boot control data
[0004.516] I> Already published: 00010003
[0004.516] I> Look for boot partition
[0004.517] I> Fallback: assuming 0th partition is boot partition
[0004.523] I> Detect filesystem
[0004.550] I> Loading extlinux.conf ...
[0004.550] I> Loading extlinux.conf binary from rootfs ...
[0004.550] I> rootfs path: /sdmmc_user/boot/extlinux/extlinux.conf
[0004.611] I> ext4_read_data_from_extent:298: Total file read should not be larger than file stat size
[0004.612] E> file /sdmmc_user/boot/extlinux/extlinux.conf read failed!!
[0004.612] W> Failed to load extlinux.conf binary from rootfs (err=202113305)
[0004.613] E> Failed to find/load /boot/extlinux/extlinux.conf
[0004.614] I> Loading kernel ...
[0004.617] I> No kernel binary path
[0004.620] I> Continue to load from partition ...

Hi,

The error you posted is just the patch we shared out. If you don’t want to compile the cboot, then you can only wait for the next release.

My point here was user100090 seems telling us he still has a bug on his side with the boot-order issue. So I would like to know what is that.

I have replied in the original thread in this post. Maybe it is not clear. Let me re-state here. The boot-order issue is not really a boot-order issue, but when boot-order was changed and the extlinux.conf on the emmc is finally being read, a different problem in extlinux.conf caused the boot failed. At the time I didn’t have the uart console access so thought the boot-order change caused the boot failed. But in reality, the boot-order change revealed a different compatibility issue in extlinux.conf

The extlinux.conf had the default entry:

TIMEOUT 30
DEFAULT primary

MENU TITLE L4T boot options

LABEL primary
      MENU LABEL primary kernel
      LINUX /boot/Image
      INITRD /boot/initrd
      APPEND ${cbootargs} quiet

# When testing a custom kernel, it is recommended that you create a backup of
# the original kernel and add a new entry to this file so that the device can
# fallback to the original kernel. To do this:
#
# 1, Make a backup of the original kernel
#      sudo cp /boot/Image /boot/Image.backup
#
# 2, Copy your custom kernel into /boot/Image
#
# 3, Uncomment below menu setting lines for the original kernel
#
# 4, Reboot

# LABEL backup
#    MENU LABEL backup kernel
#    LINUX /boot/Image.backup
#    INITRD /boot/initrd
#    APPEND ${cbootargs}

It worked fine in JP 4.3, but now it failed the boot, because ${cbootargs} in the APPEND line no longer includes root=/dev/... so I have to explicitly specify the root device. After I change APPEND ${cbootargs} quiet to APPEND ${cbootargs} quiet root=/dev/mmcblk0p1. It started to boot.

Hi,

Do you still need to do that after you enable our extlinux patch in cboot?

Could you tell me if there is any error on your side if you don’t do any other change except the extlinux cboot patch we provided?
I don’t think it is normal that you need to append the root=xxxx to your extlinux.conf manually.

If there is any problem, could you share me the log?

See attached boot log, and the system get into recovery shell.
boot-fail.txt (28.2 KB)

Here is how to reproduce:

  1. use the patched cboot from above
  1. update cbo.dts to remove nvme from the boot-order list.
  2. flash 32.7.2
  3. system boots properly, and now update /boot/extlinux/extlinux.conf to use the default
TIMEOUT 30
DEFAULT primary

MENU TITLE L4T boot options

LABEL primary
      MENU LABEL primary kernel
      LINUX /boot/Image
      INITRD /boot/initrd
      APPEND ${cbootargs} quiet

reboot and the system will drop in the failed shell, see attached uart log.