3

I need to configure u-boot to boot immediately (disabling the press key to interrupt prompt) for a yocto build.

I've added the following bbappend to do so:

# u-boot_%.bbappend

FILESEXTRAPATHS_prepend := "${THISDIR}/u-boot:"

SRC_URI_append_edge = " \
  file://disable-boot-delay.cfg \
"

where disable-boot-delay.cfg looks like this:

CONFIG_AUTOBOOT_KEYED=y
CONFIG_AUTOBOOT_KEYED_CTRLC=n
CONFIG_BOOTDELAY=-2

This successfully disables the boot prompt, but also causes the FAT partition that u-boot is installed on to become corrupt:

$ # without above bbappend
$ dosfsck /dev/mapper/loop0p1
fsck.fat 4.1 (2017-01-24)
/dev/mapper/loop0p1: 49 files, 6510/20431 clusters
$ # with above bbappend
$ dosfsck /dev/mapper/loop0p1
fsck.fat 4.1 (2017-01-24)
/OVERLAYS/.
  Bad short file name (.).
1) Drop file
2) Rename file
3) Auto-rename
4) Keep it
? 4
/OVERLAYS/..
  Bad short file name (..).
1) Drop file
2) Rename file
3) Auto-rename
4) Keep it
? 4
/dev/mapper/loop0p1: 49 files, 6510/20431 clusters

I'm massively, massively confused as to how this change could be causing file system corruption.

Environment:

  • Yocto Warrior (2.7)
  • meta-raspberrypi (warrior branch)
  • RPI_USE_U_BOOT = "1"

Diffing workdir/build/.config with and without the above append:

229c229
< CONFIG_BOOTDELAY=2
---
> CONFIG_BOOTDELAY=-2
306c306,311
< # CONFIG_AUTOBOOT_KEYED is not set
---
> CONFIG_AUTOBOOT_KEYED=y
> CONFIG_AUTOBOOT_PROMPT="Autoboot in %d seconds\n"
> # CONFIG_AUTOBOOT_ENCRYPTION is not set
> CONFIG_AUTOBOOT_DELAY_STR=""
> CONFIG_AUTOBOOT_STOP_STR=""
> # CONFIG_AUTOBOOT_KEYED_CTRLC is not set
Hayden Ball
  • 307
  • 5
  • 13
  • Diff the configuration file that is actually produced with & without your additions to make sure it's being applied correctly. – Richard Nixon Sep 11 '19 at 16:39
  • @RichardNixon updated the description with the diff - the config is being applied successfully. But why would that lead to FAT errors? – Hayden Ball Sep 12 '19 at 08:14
  • Probably worth mentioning - if `disable-boot-delay.cfg` is empty (but included with the recipe append), the FAT partition is fine. If I add just `CONFIG_BOOTDELAY=-2`, or just `CONFIG_AUTOBOOT_KEYED=y` and `CONFIG_AUTOBOOT_KEYED_CTRLC=n`, the FAT partition is bad. – Hayden Ball Sep 12 '19 at 08:59
  • I'm guessing the issue is something to do with the size of the resulting `u-boot.bin` binary, but not understanding why this would cause problems? – Hayden Ball Sep 12 '19 at 08:59
  • I've seen config additions badly integrated in the past switching off other important CONFIG_... elements. – Richard Nixon Sep 12 '19 at 17:12
  • Have you tried adding the config changes one by one? – Richard Nixon Sep 12 '19 at 17:13
  • I've tried `CONFIG_BOOTDELAY` on its own, which is the one I'm really needing. That causes still causes dosfsck to complain. Regardless, how would switching on / off other `CONFIG_` elements cause the fat partition to be bad in that way? – Hayden Ball Sep 13 '19 at 08:52
  • @HaydenBall Your choice of `CONFIG_BOOTDELAY` is interesting, as it's a negative number. Did you try setting it to zero? – seldak Sep 16 '19 at 01:34
  • @seldak I haven't, however `-2` is a documented option for `CONFIG_BOOTDELAY`: https://github.com/u-boot/u-boot/blob/23b93e33adde0a8313388eda7c78d1d0786e3c92/common/Kconfig#L363 – Hayden Ball Sep 16 '19 at 09:07
  • My guess is that a combination of the config fragment plus your `bootcmd` (or some other configuration) is causing a `saveenv` or an environment variable to be written to the VFAT partition which you have u-boot on. Without more information, it will be hard to help. On another note the difference between `0` and `-2` for `CONFIG_BOOTDELAY` is that for the latter u-boot will not check for abort. Both do autoboot without delay which is what you're looking for. – seldak Sep 16 '19 at 13:19

0 Answers0