I am unable to execute a shell script(create_signed_swu.sh
) in my recipe(panther2-swu.bb
) which inherit swupdate
and if I remove inherit swupdate
, I see do_compile gets compiled and script executes successfully.
Here is panther2-swu.bb
recipe:
DESCRIPTION = "Building swupdate image (.swu ) for panther2 board"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
inherit swupdate
FILESEXTRAPATHS_append := "${THISDIR}/../../../../build/tmp/deploy/images/panther2/"
SRC_URI = "file://sw-description \
file://postinstall_swu.sh \
file://bzImage \
file://create_signed_swu.sh \
file://priv.pem \
file://passphrase \
"
do_compile() {
${WORKDIR}/create_signed_swu.sh
}
DEPENDS = "openssl-native"
Here is the create_signed_swu.sh
:
#!/bin/bash
IMAGES="bzImage panther2-usb-panther2.ext4"
FILES="sw-description sw-description.sig postinstall_swu.sh $IMAGES"
echo "Executing swu signing script..."
cp ../sw-description .
cp ../postinstall_swu.sh .
cp ../../../../../deploy/images/panther2/bzImage .
cp ../../../../../deploy/images/panther2/panther2-usb-panther2.ext4 .
read -d ' ' SHA_ROOTFS < <(sha256sum panther2-usb-panther2.ext4)
read -d ' ' SHA_BZIMAGE < <(sha256sum bzImage)
read -d ' ' SHA_POSTINSTALL < <(sha256sum postinstall_swu.sh)
sed -i ':a;N;$!ba; s/sha256 = "[0-9A-Za-z]*"/sha256 = '"\"${SHA_ROOTFS}"\"'/1' sw-description
sed -i ':a;N;$!ba; s/sha256 = "[0-9A-Za-z]*"/sha256 = '"\"${SHA_BZIMAGE}"\"'/2' sw-description
sed -i ':a;N;$!ba; s/sha256 = "[0-9A-Za-z]*"/sha256 = '"\"${SHA_POSTINSTALL}"\"'/3' sw-description
openssl dgst -sha256 -sign ../priv.pem -passin file:../passphrase sw-description > sw-description.sig
for i in $FILES;do
echo $i;done | cpio -ov -H crc > panther2-swu-$USER-devbuild.swu
cp panther2-swu-$USER-devbuild.swu ../../../../../deploy/images/panther2
rm -f sw-description
rm -f postinstall_swu.sh
rm -f sw-description.sig
rm -f bzImage
rm -f panther2-usb-panther2.ext4
rm -f panther2-swu-$USER-devbuild.swu
I have tried ROOTFS_POSTPROCESS_COMMAND
as well but it doen't execute my srcipt either.
Any help would really be appreciated, Thanks in advance...!!!