Closed argosphil closed 1 year ago
One commit which triggers this (linux-sparrow:do_package
is rerun without linux-sparrow:do_install
being run first) is oe-core's https://github.com/openembedded/openembedded-core/commit/80839835ec9fcb63069289225a3c1af257ffdef7 , which modifies the package script itself. Note that it is unlikely to be the specific cause in our case because it didn't happen quite at the right time.
ETA: I meant to say it's probably a similar commit which triggered this bug. I am convinced it is our bug and it was triggered by a similar commit.
This is an attempt to summarize the bug identified by @FlorentRevest as the likely cause of the recent bricking issues. Any mistakes are likely to be entirely my fault.
mkboot.bbclass
(as well asmkbootimg.bbclass
andabootimg.bbclass
) contains the following code:Note that while this is a
do_deploy
rule, the file is created in${D}
, not${DEPLOYDIR}
.Further code:
Note that the pattern passed to
find
is*$i*
, which matches "aboot" when$i
is "boot".What happens in an ordinary build is this:
linux-sparrow:do_package
is called and generates an emptykernel-image
packagelinux-sparrow:do_deploy
is called and modifies the${D}
dir by putting aboot.img
file in itfastboot
image is manually flashed to theboot
partition/boot/boot.img
, doesn't find it, and exitsBut what appears to happen sometimes is this:
linux-sparrow:do_package
is called and generates an emptykernel-image
packagelinux-sparrow:do_deploy
is called and modifies the${D}
dir by putting aboot.img
file in itlinux-sparrow:do_package
is called again and generates akernel-image
package containing/boot/boot.img
fastboot
image is manually flashed to theboot
partition/boot/boot.img
, finds it, and looks for a partition to install it tofind
pattern matchesaboot
andboot
. Sincebusybox
find
doesn't sort its output alphabetically, it's probably not deterministic that the first hit isaboot
, but it's possibledd if=/boot/boot.img of=/dev/disk/by-partlabel/aboot
is called and overwrites the wrong partitionAgain, the discovery isn't mine at all, I'm just trying to write this down since it's a bit long for the chat. Mistakes entirely mine.
The next step would be to figure out what the unknown reason is. Bitbake's documentation isn't clear on this, but I think
linux-sparrow:do_install
empties${D}
, so that would suggest it is not rerun butlinux-sparrow:do_package
is. I'd like to know how that can happen, so we can fix the two bugs above (use"$i"
as a pattern, includeboot_a
in the list of potential partitions, don't installboot.img
) and verify the bug doesn't reappear.I hope this is somehow helpful, but if it isn't feel free to close the issue.