Skip to content

Commit

Permalink
Update isar and isar-cip core
Browse files Browse the repository at this point in the history
This allows to drop our own snapshot mechanism in favor of
ISAR_USE_APT_SNAPSHOT.

Signed-off-by: Jan Kiszka <[email protected]>
  • Loading branch information
jan-kiszka committed Aug 20, 2024
1 parent 01b8845 commit 9bf4dac
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 67 deletions.
8 changes: 0 additions & 8 deletions conf/distro/debian-snapshot.list

This file was deleted.

15 changes: 0 additions & 15 deletions conf/distro/iot2050-debian.conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,6 @@ KERNEL_NAME ?= "cip"
PREFERRED_VERSION_customizations ?= "0.1-iot2050-debian"
PREFERRED_VERSION_customizations-debug ?= "0.1-iot2050-debian"

OVERRIDES .= ':${PACKAGES_SELECTION}'

# packages-mainline: Use the mainline debian packages
# packages-snapshot: Use the snapshot debian packages
PACKAGES_SELECTION ?= "packages-mainline"

DISTRO_APT_SOURCES_MAINLINE_LIST := "${DISTRO_APT_SOURCES}"
DISTRO_APT_SOURCES_SNAPSHOT_LIST ?= "conf/distro/debian-snapshot.list"

DISTRO_APT_SOURCES:append:packages-snapshot = " ${DISTRO_APT_SOURCES_SNAPSHOT_LIST}"
DISTRO_APT_SOURCES:remove:packages-snapshot = "${DISTRO_APT_SOURCES_MAINLINE_LIST}"

HOST_DISTRO_APT_SOURCES:append:packages-snapshot = " ${DISTRO_APT_SOURCES_SNAPSHOT_LIST}"
HOST_DISTRO_APT_SOURCES:remove:packages-snapshot = "${DISTRO_APT_SOURCES_MAINLINE_LIST}"

SDK_INSTALL += "linux-headers-${KERNEL_NAME} mraa"
SDK_PREINSTALL += "zlib1g-dev:${DISTRO_ARCH} libjson-c-dev:${DISTRO_ARCH}"

Expand Down
6 changes: 3 additions & 3 deletions kas/iot2050.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) Siemens AG, 2019-2023
# Copyright (c) Siemens AG, 2019-2024
#
# Authors:
# Le Jin <[email protected]>
Expand Down Expand Up @@ -27,13 +27,13 @@ repos:

isar:
url: https://github.com/ilbers/isar
commit: 9dc362cd7115074c0f60843e687ed89db5c9339a
commit: a2a997b66daf3d684a7ad29108971a463cfac522
layers:
meta:

cip-core:
url: https://gitlab.com/cip-project/cip-core/isar-cip-core.git
commit: 704353612238cb2ac1c16f29db6f314b60cd83b0
commit: bafd102601ae21c2b2643d536d62fb7cc5f98767

local_conf_header:
standard: |
Expand Down
6 changes: 4 additions & 2 deletions kas/opt/package-lock.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) Siemens AG, 2019
# Copyright (c) Siemens AG, 2019-2024
#
# Authors:
# Su Bao Cheng <[email protected]>
Expand All @@ -13,4 +13,6 @@ header:

local_conf_header:
package-lock: |
PACKAGES_SELECTION := "packages-snapshot"
# 2023-10-23 15:16:30 UTC
ISAR_APT_SNAPSHOT_TIMESTAMP = "1698074190"
ISAR_USE_APT_SNAPSHOT = "1"
39 changes: 0 additions & 39 deletions recipes-core/images/iot2050-image-base.bb
Original file line number Diff line number Diff line change
Expand Up @@ -18,45 +18,6 @@ IMAGE_INSTALL += "customizations-base"

IMAGE_PREINSTALL += "libubootenv-tool"

python aggregate_mainline_apt_sources () {
import shutil

aggregated_sources_fp = '%s/bootstrap.list' % d.getVar("WORKDIR", True)
raw_apt_sources_list = d.getVar("DISTRO_APT_SOURCES_MAINLINE_LIST", True) or ""
apt_sources_list = raw_apt_sources_list.strip().split()

if len(apt_sources_list) == 0:
bb.fatal("Cannot parse DISTRO_APT_SOURCES_MAINLINE_LIST: %s" %
raw_apt_sources_list)

with open(aggregated_sources_fp, "wb") as out_fd:
for entry in apt_sources_list:
entry_real = bb.parse.resolve_file(entry, d)
with open(entry_real, "rb") as in_fd:
shutil.copyfileobj(in_fd, out_fd, 1024*1024*10)
out_fd.write("\n".encode())
}

install_mainline_sources_list () {
sudo rm -f '${IMAGE_ROOTFS}/etc/apt/sources-list'
sudo install -m 644 '${WORKDIR}/bootstrap.list' '${IMAGE_ROOTFS}/etc/apt/sources-list'
sudo rm -f '${WORKDIR}/bootstrap.list'
}

# For rootfs build using debian snapshot packages, restore the source list file
# with the mainline sources list, so that users can update packages via
# `apt update`.
# TODO: this code should be merged to ISAR.
ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_restore_sources_list"
python image_postprocess_restore_sources_list () {
pkg_selection = d.getVar("PACKAGES_SELECTION", True) or ""
if pkg_selection == 'packages-snapshot':
bb.build.exec_func("aggregate_mainline_apt_sources", d)
bb.build.exec_func("install_mainline_sources_list", d)
else:
bb.note('No need to restore sources for mainline packages')
}

# Make the .wic.img symlink to the .wic file for better backward compatibility
do_deploy() {
echo "Linking wic img"
Expand Down

0 comments on commit 9bf4dac

Please sign in to comment.