Skip to content

Building image fails w/ build-docker.sh #224

@89sundown

Description

@89sundown

I've been trying to build the image using podman and have substituted all the commands in the build-docker.sh where necessary. This seems to run through fine but am failing at bootstrap because of a key trust issue. I have attempted to edit the docker file and install keys but i cannot get it to work. The error is coming from the bootstrap stage. What do you recommend?

Issue running kuiper-stages.sh

[username@domain kuiper-volume]$ cat build.log 
[Nov 04 23:31:53] Building Kuiper with Debian bookworm for architecture armhf
[Nov 04 23:31:53] Start stage 01.bootstrap
[Nov 04 23:31:53] update-binfmts: warning: qemu-arm already enabled in kernel.
[Nov 04 23:31:53] I: Retrieving InRelease 
[Nov 04 23:31:54] I: Checking Release signature
[Nov 04 23:31:54] E: Release signed by unknown key (key id 78DBA3BC47EF2265)
[Nov 04 23:31:54]    The specified keyring /usr/share/keyrings/debian-archive-bookworm-stable.gpg may be incorrect or out of date.
[Nov 04 23:31:54]    You can find the latest Debian release key at https://ftp-master.debian.org/keys.html

build-docker.sh updated w/ podman

#!/bin/bash -e
# SPDX-License-Identifier: BSD-3-Clause
#
# kuiper2.0 - Embedded Linux for Analog Devices Products
#
# Copyright (c) 2024 Analog Devices, Inc.
# Author: Larisa Radu <[email protected]>

source config

DEBIAN_VERSION=${DEBIAN_VERSION:-bookworm}
BASE_IMAGE="debian:${DEBIAN_VERSION}"
IMAGE_NAME="debian_${DEBIAN_VERSION}_rootfs"
CONTAINER_NAME=${CONTAINER_NAME:-"${IMAGE_NAME}_container"}
PRESERVE_CONTAINER=${PRESERVE_CONTAINER:-n}

cleanup() {
	podman rm -fv ${CONTAINER_NAME}
	exit 1
}

# Remove container if build was interrupted or cancelled
trap cleanup SIGINT SIGTERM

# Check if the script is run as root
if [ "$(id -u)" != "0" ] ; then
	echo "This script must be run as root"
	exit 1
fi

# Check if Debian version is supported
if [[ ! ${DEBIAN_VERSION} = bookworm && ! ${DEBIAN_VERSION} = bullseye ]]; then
	echo "Unsupported Debian version ${DEBIAN_VERSION}"
	exit 1
fi

# Build podman image
podman build --build-arg BASE_IMAGE="${BASE_IMAGE}" -t ${IMAGE_NAME} .

# Run podman container
# -t: pseudo-TTY allowing interaction with container's shell
# --privileged: elevanted privileges required by the chroot command
# -v: mounts volumes allowing the container to access files on the host or work with kernel modules
# -e: sets environment variables
# Inside the container kuiper-stages.sh will run building the Kuiper image
podman run -t --privileged \
			-v /dev:/dev \
			-v /lib/modules:/lib/modules \
			-v ./kuiper-volume:/kuiper-volume \
			-e "DEBIAN_VERSION="${DEBIAN_VERSION}"" \
			--name ${CONTAINER_NAME} ${IMAGE_NAME} \
			/bin/bash -o pipefail -c "bash kuiper-stages.sh"

if [ $PRESERVE_CONTAINER = n ]; then
	# Remove image, container and corresponding volume
	podman rm -v ${CONTAINER_NAME}
fi

podman image rm -f ${IMAGE_NAME}

# Detach loops
LOOP_DEVICES=$(losetup --list | grep "$(basename "ADI-Kuiper-Linux.*.img")" | cut -f1 -d' ')
for LOOP_DEV in ${LOOP_DEVICES}; do
	losetup -d ${LOOP_DEV}
done


# Save info about adi-kuiper-gen repository in log file
echo -e "\nADI Kuiper Linux:" >> "kuiper-volume/ADI_repos_git_info.txt"
echo "Repo   : $(git remote get-url origin)" >> "kuiper-volume/ADI_repos_git_info.txt"
echo "Branch : $(git branch | cut -d' ' -f2)" >> "kuiper-volume/ADI_repos_git_info.txt"
echo -e "Git_sha: $(git rev-parse --short HEAD)\n\n" >> "kuiper-volume/ADI_repos_git_info.txt"

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions