Closed enzo-digex closed 1 year ago
Err, this here is not meta-iot2000, thus not a Yocto project - hope that is clear :wink:.
I think you want to study https://github.com/ilbers/isar/blob/master/meta-isar/recipes-app/prebuilt-deb/prebuilt-deb_0.1.bb for your problem. There is also https://github.com/ilbers/isar/blob/master/doc/user_manual.md#prebuilt-deb-packages-from-somewhere.
My apologies for this mistake...of course I that this is not a Yocto project ;-) Applying the prebuilt-deb example, it integrates the package. But at the moment it is preparing to unpack the package it comes to the error "Unsupported Linux distribution". Well...I unpacked the *.deb file and looked in the DEBIAN/preinst file:
#!/bin/sh
# check OS type
if [ -d /run/systemd/system ]; then
INIT_SYSTEM=systemd
else
echo "Unsupported Linux distribution"
exit 7
fi
# detect hardware platform
ARCH=`uname -m`
case "$ARCH" in
armv7l)
;;
aarch64)
;;
*)
echo "Unsupported hardware platform"
exit 8
;;
esac
# in case of update scenario, otherwise it's an install
if [ "$1" = "2" -o "$1" = "upgrade" ]
then
case $INIT_SYSTEM in
systemd)
systemctl stop hasplmd
systemctl disable hasplmd
;;
esac
fi
Obviously, it doesn't find the directory "/run/systemd/system"...How to get around this problem? Do I need to "patch" the deb package or is there any other possibility? I did not find any hint in the isar documentation...
Yes, you will need to massage the binary package before the do_dpkg_build task. We don't have a published example for that yet (AFAIK), but it could look similar to this:
inherit dpkg-prebuilt
...
do_repackage[cleandirs] = "${WORKDIR}/repack-tmp"
do_repackage() {
cd ${WORKDIR}/repack-tmp
rm -rf *
ar xo $MY_DEB_FILE
mkdir control
tar -C control -xf control.tar
mkdir data
tar -C data -xf data.tar.zst
<massage control or data content>
tar -C control --owner=0 --group=0 -cf control.tar .
tar -C data --owner=0 --group=0 -cf data.tar .
xz -T0 data.tar
ar rc $MY_DEB_FILE debian-binary control.tar data.tar.xz
}
addtask repackage after do_unpack before do_dpkg_build
BTW, that arch check of the preinst script is pretty pointless. You normally encode the supported arch into the meta data of the deb file. But, yeah... I've seen a lot of nonsense in downstream binary packages already.
Yes...I know...but this is what we got from our supplier and customer wants this in his image...
Nevertheless...the do_repackage section was the missing part! thx for you help!
I close this issue
I know that it is an awful idea...but there is no other way: We need to integrate a debian package into our yocto project. Can anyone give me a hint how such a recipe should look like?
My bb file is:
But this throws an error:
I triple checked the situation...and the deb file is definitely in my recipe, but is not copied. So I suspect that my recipe is crap.