Compare commits

..

1 Commits

Author SHA1 Message Date
Pau Espin 819c17e138 Makefile: run 'bitbake package-index' after bitbake command building packages
It was recently spotted that during a build of 201705-testing where
sysmocom-openvpn-config was being rebuilt, the Packages(.gz) files
(opkg package indexes) were rebuilt before the new .ipk files for
sysmocom-openvpn-config were written to disk. Also then the Packages
file didn't contain a reference to the new sysmocom-openvpn-config
package version. So, it seems there was a race condition where the
package index was built too early.

Yocto documentation provides some hints:
https://docs.yoctoproject.org/dev-manual/packages.html?highlight=bitbake+package+index#build-considerations
"""
Whenever you perform any sort of build step that can potentially generate
a package or modify existing package, it is always a good idea to
re-generate the package index after the build by using the following
command: bitbake package-index
Do not do "$ bitbake some-package package-index" as BitBake does not schedule
the package index for after the completion of the package you are building.
Consequently, you cannot be sure of the package index including
information for the package you just built. Thus, be sure to run the
package update step separately after building any packages.
"""

So far it seems we were relying on the "create filesystem" task
triggered for image creation which would also trigger the package index
recreation, according to
https://yocto.yoctoproject.narkive.com/rjvLrVpW/question-about-rebuilding-rpm-package-index-for-updated-rpms-when-bitbake-completes
"""
The feed is normally indexed (createrepo) either when you manually run the
package-index operation, or when you construct a filesystem. Until you do that,
the feed directories are transient.
"""

Related: SYS#6023
2023-06-22 16:24:09 +02:00
4 changed files with 1 additions and 78 deletions

1
.gitignore vendored
View File

@ -1,4 +1,3 @@
cfg/*/98_nightly_feed
cfg/*/99_do_not_commit
git/
build.*

View File

@ -131,7 +131,7 @@ build.%: | git/poky
# Start a build..
%-build: | build.$(subst -build,,%) git/poky
$(Q)/bin/bash -c "source git/poky/oe-init-build-env build.$(CUR_MACHINE) && bitbake $(BUILD_TARGETS)"
$(Q)/bin/bash -c "source git/poky/oe-init-build-env build.$(CUR_MACHINE) && bitbake $(BUILD_TARGETS) && bitbake package-index"
%-upload: | build.$(subst -upload,,%) git/poky
$(Q)cd build.$(CUR_MACHINE) && ../scripts/upload-build.sh $(CUR_MACHINE) $(FEED_NAME)

View File

@ -1,38 +0,0 @@
ARG REGISTRY=docker.io
FROM ${REGISTRY}/debian/eol:jessie-slim
# Arguments used after FROM must be specified again
ARG UID
RUN ( echo "deb http://archive.debian.org/debian jessie main"; \
echo "deb http://archive.debian.org/debian-security jessie/updates main" ) \
> /etc/apt/sources.list
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
build-essential \
chrpath \
cpio \
diffstat \
file \
gawk \
git \
locales \
make \
python \
python3 \
texinfo \
wget \
&& \
apt-get clean
# Disable DST Root CA X3
# https://letsencrypt.org/docs/dst-root-ca-x3-expiration-september-2021/
RUN sed -i '/^mozilla\/DST_Root_CA_X3.crt$/ s/^/!/' /etc/ca-certificates.conf && \
update-ca-certificates
RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
locale-gen
RUN useradd --uid=${UID} -m user
USER user

View File

@ -1,38 +0,0 @@
#!/bin/sh -e
DOCKER_IMG="sysmocom-system-images-oe"
if [ -z "$SSH_AUTH_SOCK" ]; then
echo "ERROR: SSH_AUTH_SOCK is empty!"
exit 1
fi
set -x
cd "$(dirname "$(realpath "$0")")/.."
docker build \
--build-arg UID=$(id -u) \
-t "$DOCKER_IMG":latest \
contrib
docker run \
-it \
--rm \
-e SSH_AUTH_SOCK=/ssh-agent \
-v "$(readlink -f "$SSH_AUTH_SOCK")":/ssh-agent \
-v "$PWD:/system-images" \
"$DOCKER_IMG" \
sh -e -x -c "
export LC_ALL=en_US.UTF-8
cd /system-images
make clean-all || true
make build-all
make sysmobts-upload FEED_NAME=\"201705-nightly\"
make sysmobts2100-upload FEED_NAME=\"201705-nightly\"
make oc2g-upload FEED_NAME=\"201705-nightly\"
make sysmocom-alix-upload FEED_NAME=\"201705-nightly\"
make sysmocom-apu2-upload FEED_NAME=\"201705-nightly\"
make clean-all
"