I am trying to build a signed swu file for my board using yocto/bitbake. The swu that gets created is signed, but the sha256 is not getting set in the sw-description file.
(below omitting some folders and files, showing relevant directory tree)
My build directory for yocto:
build-dir
+conf
bblayers.conf
local.conf
In my layers dir:
meta-swupdate
+classes
+conf
+recipes-core
+recpies-devtools
+...other recipes
README
meta-variscite-fslc
+conf
+dynamic-layers
+swupdate
+swupdate
+var-image-swu
+imx8mm-var-dart
sw-description
update.sh
swupdate_%d.bbappend
meta-mylayer
+conf
layer.conf
+recipes-blahblah
+wic
By adding this to my build-dir/conf/local.conf
I can get it to use
my-wks.in (to setup the paritions like I want it to).
Then adding these to my build-dir/conf/local.conf
SWUPDATE_SIGNING = "RSA"
SWUPDATE_PRIVATE_KEY = "/tmp/rsakey"
SWUPDATE_IMAGES = "var-image-swupdate update.sh"
makes it create a swu file (var-image-swu-imx8mm-var-dart.swu)
I generated my keys like this:
openssl genrsa -out /tmp/rsakey
openssl rsa -in /tmp/rsakey -out /tmp/rsakey.pub -outform PEM -pubout
But when I look inside the swu file, I do not see sha256 for my image file. And when I try to install this swu, I get this error:
swupdate -i /var-image-swu-imx8mm-var-dart.swu --hwrevision "imx8mm-var-dart:1.0" --key /rsakey.pub
ERROR] : SWUPDATE failed [0] ERROR core/parser.c : check_missing_hash : 76 : Hash not set for var-image-swupdate-imx8mm-var-dart.tar.gz Type archive
[ERROR] : SWUPDATE failed [0] ERROR core/swupdate.c : install_from_file : 335 : failed to parse sw-description!
So obviously sha256 hash is missing, how do I get it to add the hash in my sw-description file?
Note that I can manually edit sw-description file in this layer here:
meta-variscite-fslc
+conf
+dynamic-layers
+swupdate
+swupdate
+var-image-swu
+imx8mm-var-dart
sw-description
and add the sha256 hashes myself, then the swu that is generated successfully gets installed. But I think the sw-description file is supposed to get those hashes automagically inserted, and that magic is not happening. Not sure what I am missing.