#!/bin/bash # We install some required libraries for building/compiling # This script installs podman and qemu-user-static, which is required for the following Dockerfile to work. # It omits the error "exec container process `/bin/sh`: Exec format error" # The Dockerfile inside THIS directory is used to create two different arches for cross-building of the *.deb and *.rpm files sudo apt install podman gsasl libgsasl7-dev libssl-dev libclang-dev cmake clang capnproto mosquitto mosquitto-clients devscripts build-essential debhelper debtags alien libpcsclite-dev qemu-user-static sudo systemctl daemon-reload # Please note: we need to install these images as root user! pack="fabinfra/debianpackage" echo -e "\n\nThis script will (re)-create podman images for bffh builds. This may take a lot of time.\n\n" read -p "Do you really want to continue? y/n?" -n 1 -r echo if [[ $REPLY =~ ^[Yy]$ ]]; then for arch in arm64/v8 arm/v7; do sudo podman image rm localhost/${pack}_${arch} --force echo -e "\n+++++++++++++++++++++++++++++++++++++++++++" echo -e "creating local podman container registry for ${pack}_${arch}. This may take a while ..." echo -e "++++++++++++++++++++++++++++++++++++++++++\n" sudo time podman build --platform=linux/${arch} -f Dockerfile -t ${pack}_${arch} #this should get ubuntu:noble if [ $? != 0 ]; then echo -e "\nBuild did no finish. Probably you got an error like 'container process (missing dynamic library?)'. In this case a system restart should fix!" fi done echo -e "\n+++++++++++++++++++++++++++++++++++++++++++" echo "listing installed images ..." echo -e "+++++++++++++++++++++++++++++++++++++++++++\n" PACK=${pack} sudo podman images | grep localhost/$PACK fi