Skip to content

Bug: mcuboot.conf is a broken symlink, breaks firmware build #6350

@omi-discord-vector

Description

@omi-discord-vector

Problem

Firmware build fails with linker error when compiling MCUboot bootloader:

undefined reference to '__device_dts_ord_149'

Root Cause

File: omi/firmware/omi/sysbuild/mcuboot.conf

Commit 32ccac5 ("change from fatFs to littleFs to adapt to hardware") attempted to replace a symlink with a regular file containing Kconfig options.

What happened:

  • Before: Symlink pointing to ../../bootloader/mcuboot/mcuboot.conf
  • After: Git incorrectly saved it as a symlink where the target is the entire config file content

Current state:

$ ls -la omi/firmware/omi/sysbuild/mcuboot.conf
lrwxrwxrwx 1 node node 717 Apr  3 21:40 mcuboot.conf -> # Example of sample specific Kconfig...(entire file content with \012 newlines)...

$ file omi/firmware/omi/sysbuild/mcuboot.conf
broken symbolic link to # Example of sample specific Kconfig...

The symlink target contains newlines (\012), making it invalid (File name too long). The OS cannot resolve it, so Zephyr's build system ignores the file entirely.

Impact

  • MCUboot compiles without CONFIG_SPI_NOR=y
  • SPI NOR driver tries to link against disabled SPI bus
  • Build fails with undefined reference errors

Fix

Convert the broken symlink to a regular file:

cd omi/firmware/omi/sysbuild
rm mcuboot.conf
cat > mcuboot.conf << 'EOF'
# Example of sample specific Kconfig changes when building sample with MCUboot
# when using sysbuild.
CONFIG_SPI_NOR=y
CONFIG_MCUBOOT_LOG_LEVEL_WRN=y
CONFIG_BOOT_UPGRADE_ONLY=y
CONFIG_MCUBOOT_DOWNGRADE_PREVENTION=y
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y

CONFIG_NORDIC_QSPI_NOR=n
CONFIG_BOOT_MAX_IMG_SECTORS=256
CONFIG_GPIO=y
CONFIG_SPI=y
CONFIG_FLASH=y
CONFIG_FLASH_JESD216_API=y
CONFIG_SPI_NOR_SFDP_DEVICETREE=y
CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
CONFIG_MULTITHREADING=y
CONFIG_DISK_DRIVER_SDMMC=y
CONFIG_DISK_ACCESS=y
CONFIG_DISK_DRIVER_SDMMC=y

CONFIG_FLASH_LOG_LEVEL_DBG=n

CONFIG_NRF53_MULTI_IMAGE_UPDATE=y
CONFIG_BOOT_UPGRADE_ONLY=y
CONFIG_BOOT_MAX_IMG_SECTORS=256
CONFIG_MCUBOOT_DOWNGRADE_PREVENTION=y
EOF
git add mcuboot.conf
git commit -m "fix: convert mcuboot.conf from broken symlink to regular file"

How This Happened

The author likely used git rm to remove the symlink, then created a new file with the same name. However, Git interpreted the file content as the symlink target instead of creating a regular file.

Proper workflow to replace a symlink:

# Remove symlink
rm file.conf  # Use shell rm, not git rm
# Create regular file
cat > file.conf << 'EOF'
...content...
EOF
# Stage both operations
git add file.conf

Or use git update-index:

git update-index --assume-unchanged file.conf
rm file.conf
<create new file>
git add file.conf

Verification

After fix, verify:

$ file omi/firmware/omi/sysbuild/mcuboot.conf
omi/firmware/omi/sysbuild/mcuboot.conf: ASCII text

$ west build
(should succeed)

Reported by: l4w1 (Discord user 261726922696818689)
Affected commit: 32ccac5
Date: 2026-04-05

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingbuildfirmwarefirmware workp2Priority: Important (score 14-21)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions