edison-fw / meta-intel-edison

Here is the meta-intel-edison that builds, tries to stay up to date. Master is based on Yocto Poky Gatesgarth LTS 5.10.yy vanilla kernels. It builds a 32bit kernel (Gatesgarth branch 64bit) with ACPI enabled and corresponding rootfs. Telegram group: https://t.me/IntelEdison Web-site:
https://edison-fw.github.io/meta-intel-edison/
MIT License
60 stars 38 forks source link

altering the partition table prevents subsequent dfu updates #131

Closed humanoid2050 closed 3 years ago

humanoid2050 commented 3 years ago

I previously got my Edison running from the zeus branch. More specifically, I was using the Debian image with a modified file system as described on this document: https://edison-fw.github.io/meta-intel-edison/2.6-Building-Debian.html. I had removed the update and home partitions from the mmc, grown the root fs to the full mmc, and moved home to the sd card.

Today I thought I would upgrade to dunfell.

Apparently, uboot will refuse to go into dfu mode if the file system does not match what it expects

Target:blank
Partitioning already done...
Flashing already done...
Couldn't find part #9 on mmc device #0
DFU entities configuration failed!
(partition table does not match dfu_alt_info?)
dfu - Device Firmware Upgrade

Usage:
dfu <USB_controller> [<interface> <dev>] [<timeout>] [list]
  - device firmware upgrade via <USB_controller>
    on device <dev>, attached to interface
    <interface>
    [<timeout>] - specify inactivity timeout in seconds
    [list] - list available alt settings

Digging into the uboot env shows that the update and home partitions are directly coded into the methods that populate dfu_alt_info.

do_dfu_alt_info_mmc=setenv dfu_alt_info "ifwi${hardware_id} raw 0 8192 mmcpart 1;ifwib${hardware_id} raw 0 8192 mmcpart 2;u-boot0 part 0 1;u-boot-env0 part 0 2;u-boot1 part 0 3;u-boot-env1 part 0 4;boot part 0 7;rootfs part 0 8;update part 0 9;home part 0 10;bzImage fat 0 7;initrd fat 0 7"

I don't know if there is a great solution for handling this in an automated way, but I figured it would be worthwhile to document the edge case.

htot commented 3 years ago

I believe that may have been a bug at the time that was fixed later. Normally updating U-Boot happens at the same time as updating env. But you can also fix env later in a manner as here: https://edison-fw.github.io/meta-intel-edison/6.4-Installing-an-updated-U-Boot.html#install-updated-u-boot-env-over-the-air-ota

humanoid2050 commented 3 years ago

Hmmm... Looks like I'm just bad at reading documentation. Perhaps an additional reminder in the section https://edison-fw.github.io/meta-intel-edison/2.6-Building-Debian.html#optional-optimizing-of-disk-partitions-for-emmc-installations that some changes will need to be reflected in the U-Boot env would be helpful.

htot commented 3 years ago

I haven't reread each page with each update, so you may well find inconsistencies.