more convenient build scripts for debian

This commit is contained in:
Mario Voigt 2025-03-15 14:53:11 +01:00
parent d1681ffecb
commit db8ea819cb
2 changed files with 24 additions and 14 deletions

View File

@ -108,6 +108,14 @@ for ARCH_L in "${!ARCHES_LR[@]}"; do
# - some environment vars (ARCH_LINUX, ARCH_RUST, required by the debian packager)
sudo podman run --replace -d --tty --interactive -v ${SRCDIR}:/srcdir -v ${DOWNLOAD}:/download -e ARCH_LINUX=${ARCH_L} -e ARCH_RUST=${ARCH_R} --name fabinfra_deb_${ARCH_L} --platform linux/${ARCH_D} localhost/fabinfra/debianpackage_${ARCH_D}
#test the container
sudo podman exec -u 0 --tty --interactive fabinfra_deb_${ARCH_L} bash -c "echo"
if [ $? -ne 0 ]; then
echo -e "Error creating or attaching to container 'fabinfra_deb_"${ARCH_L}"'. You might need to re-run 'install-requirements.sh'."
sudo podman logs fabinfra_deb_${ARCH_L}
exit 1
fi
# now attach to that container and start building the packages
#sudo podman exec -u 0 --tty --interactive fabinfra_deb_${ARCH_L} bash
sudo podman exec -u 0 --tty --interactive fabinfra_deb_${ARCH_L} bash -c "

View File

@ -12,22 +12,24 @@ sudo systemctl daemon-reload
# Please note: we need to install these images as root user!
pack="fabinfra/debianpackage"
arch="arm64/v8"
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 $pack. This may take a while ..."
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
arch="arm/v7"
echo -e "\n+++++++++++++++++++++++++++++++++++++++++++"
echo -e "creating local podman container registry $pack. This may take a while ..."
echo -e "+++++++++++++++++++++++++++++++++++++++++++\n"
sudo time podman build --platform=linux/${arch} -f Dockerfile -t ${pack}_${arch} #this should get alpine:latest
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"
sudo podman images | grep localhost/fabinfra/
# note: unrequired images can be removed again by:
# sudo su && podman image rm localhost/fabinfra/<name>
PACK=${pack} sudo podman images | grep localhost/$PACK
fi