Skip to content

Commit

Permalink
Merge pull request #2259 from lluiscampos/scarthgap-update-v2025.02
Browse files Browse the repository at this point in the history
scarthgap: updates for v2025.02
  • Loading branch information
lluiscampos authored Feb 13, 2025
2 parents 04533ec + dd42742 commit 1e93f22
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
def mender_closed_source_srcrev_from_src_uri(d, src_uri, repo_name):
pref_version = d.getVar("PREFERRED_VERSION")
if pref_version is None or pref_version == "":
pref_version = d.getVar("PREFERRED_VERSION_%s" % d.getVar('PN'))
pref_version = d.getVar("PREFERRED_VERSION:%s" % d.getVar('PN'))
if pref_version and pref_version.find("-build") >= 0:
# If "-build" is in the version, SRCREV won't be used for defining PV
return ""
Expand Down Expand Up @@ -44,7 +44,7 @@ def mender_closed_source_srcrev_from_src_uri(d, src_uri, repo_name):
def mender_closed_source_pv_from_preferred_version(d, srcrev):
pref_version = d.getVar("PREFERRED_VERSION")
if pref_version is None or pref_version == "":
pref_version = d.getVar("PREFERRED_VERSION_%s" % d.getVar('PN'))
pref_version = d.getVar("PREFERRED_VERSION:%s" % d.getVar('PN'))
if pref_version is not None and pref_version.find("-build") >= 0:
# If "-build" is in the version, use the version as is. This means that
# we can build tags with "-build" in them from this recipe, but not
Expand Down
1 change: 1 addition & 0 deletions meta-mender-core/conf/mender-vars.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
"MENDER_UBOOT_CONFIG_SYS_MMC_ENV_PART": "",
"MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET": "",
"MENDER_UBOOT_MMC_ENV_LINUX_DEVICE_PATH": "",
"MENDER_UBOOT_MMC_ENV_LINUX_DEVICE_PATH_REDUND": "",
"MENDER_UBOOT_POST_SETUP_COMMANDS": "",
"MENDER_UBOOT_POST_SETUP_COMMANDS_DEFAULT": "",
"MENDER_UBOOT_PRE_SETUP_COMMANDS": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def mender_get_uboot_env_mmc_linux_device_path(d):
return storage_device + env_part_append

MENDER_UBOOT_MMC_ENV_LINUX_DEVICE_PATH ?= "${@mender_get_uboot_env_mmc_linux_device_path(d)}"
MENDER_UBOOT_MMC_ENV_LINUX_DEVICE_PATH_REDUND ?= "${MENDER_UBOOT_MMC_ENV_LINUX_DEVICE_PATH}"

# This should evaluate to the same as MENDER_RESERVED_SPACE_BOOTLOADER_DATA.
# The only reason it's not evaluated the same way is that we don't have the
Expand Down Expand Up @@ -52,7 +53,7 @@ mender_create_fw_env_config_file() {
# create fw_env.config file
cat > $1 <<EOF
${MENDER_UBOOT_MMC_ENV_LINUX_DEVICE_PATH} ${MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET_1} $HEX_BOOTENV_SIZE
${MENDER_UBOOT_MMC_ENV_LINUX_DEVICE_PATH} ${MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET_2} $HEX_BOOTENV_SIZE
${MENDER_UBOOT_MMC_ENV_LINUX_DEVICE_PATH_REDUND} ${MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET_2} $HEX_BOOTENV_SIZE
EOF
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RDEPENDS:${PN} = "openssl"
def mender_artifact_autorev_if_git_version(d):
version = d.getVar("PREFERRED_VERSION")
if version is None or version == "":
version = d.getVar("PREFERRED_VERSION_%s" % d.getVar('PN'))
version = d.getVar("PREFERRED_VERSION:%s" % d.getVar('PN'))
if not d.getVar("EXTERNALSRC") and version is not None and "git" in version:
return d.getVar("AUTOREV")
else:
Expand All @@ -21,7 +21,7 @@ def mender_branch_from_preferred_version(d):
import re
version = d.getVar("PREFERRED_VERSION")
if version is None or version == "":
version = d.getVar("PREFERRED_VERSION_%s" % d.getVar('PN'))
version = d.getVar("PREFERRED_VERSION:%s" % d.getVar('PN'))
if version is None:
version = ""
match = re.match(r"^[0-9]+\.[0-9]+\.", version)
Expand All @@ -40,7 +40,7 @@ def mender_version_from_preferred_version(d):
pref_version = d.getVar("PREFERRED_VERSION")
srcpv = d.getVar("SRCPV")
if pref_version is None:
pref_version = d.getVar("PREFERRED_VERSION_%s" % d.getVar("PN"))
pref_version = d.getVar("PREFERRED_VERSION:%s" % d.getVar("PN"))
if pref_version is not None and pref_version.find("-git") >= 0:
# If "-git" is in the version, remove it along with any suffix it has,
# and then readd it with commit SHA.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ FILES:mender-update += "\
${datadir}/mender/inventory/mender-inventory-os \
${datadir}/mender/inventory/mender-inventory-rootfs-type \
${sysconfdir}/mender/artifact-verify-key.pem \
${sysconfdir}/udev/mount.blacklist.d/mender \
${sysconfdir}/udev/mount.ignorelist.d/mender \
"
FILES:mender-update:append = "${@bb.utils.contains('PACKAGECONFIG', 'modules', ' ${datadir}/mender/modules', '', d)}"

Expand Down Expand Up @@ -274,10 +274,10 @@ do_install:append() {
install -m 0444 "${MENDER_ARTIFACT_VERIFY_KEY}" ${D}${sysconfdir}/mender/artifact-verify-key.pem
fi

# Setup blacklist to ensure udev does not automatically mount Mender managed partitions
install -d ${D}${sysconfdir}/udev/mount.blacklist.d
echo ${MENDER_ROOTFS_PART_A} > ${D}${sysconfdir}/udev/mount.blacklist.d/mender
echo ${MENDER_ROOTFS_PART_B} >> ${D}${sysconfdir}/udev/mount.blacklist.d/mender
# Setup ignorelist to ensure udev does not automatically mount Mender managed partitions
install -d ${D}${sysconfdir}/udev/mount.ignorelist.d
echo ${MENDER_ROOTFS_PART_A} > ${D}${sysconfdir}/udev/mount.ignorelist.d/mender
echo ${MENDER_ROOTFS_PART_B} >> ${D}${sysconfdir}/udev/mount.ignorelist.d/mender
}

do_install:append:class-target:mender-image:mender-systemd() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ DEFAULT_PREFERENCE = "-1"
def mender_autorev_if_git_version(d):
version = d.getVar("PREFERRED_VERSION")
if version is None or version == "":
version = d.getVar("PREFERRED_VERSION_%s" % d.getVar('PN'))
version = d.getVar("PREFERRED_VERSION:%s" % d.getVar('PN'))
if not d.getVar("EXTERNALSRC") and version is not None and "git" in version:
return d.getVar("AUTOREV")
else:
Expand All @@ -32,7 +32,7 @@ def mender_branch_from_preferred_version(d):
import re
version = d.getVar("PREFERRED_VERSION")
if version is None or version == "":
version = d.getVar("PREFERRED_VERSION_%s" % d.getVar('PN'))
version = d.getVar("PREFERRED_VERSION:%s" % d.getVar('PN'))
if version is None:
version = ""
match = re.match(r"^[0-9]+\.[0-9]+\.", version)
Expand All @@ -50,7 +50,7 @@ def mender_version_from_preferred_version(d):
pref_version = d.getVar("PREFERRED_VERSION")
srcpv = d.getVar("SRCPV")
if pref_version is None:
pref_version = d.getVar("PREFERRED_VERSION_%s" % d.getVar("PN"))
pref_version = d.getVar("PREFERRED_VERSION:%s" % d.getVar("PN"))
if pref_version is not None and pref_version.find("-git") >= 0:
# If "-git" is in the version, remove it along with any suffix it has,
# and then readd it with commit SHA.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require mender-configure.inc
def mender_configure_autorev_if_git_version(d):
version = d.getVar("PREFERRED_VERSION")
if version is None or version == "":
version = d.getVar("PREFERRED_VERSION_%s" % d.getVar('PN'))
version = d.getVar("PREFERRED_VERSION:%s" % d.getVar('PN'))
if not d.getVar("EXTERNALSRC") and version is not None and "git" in version:
return d.getVar("AUTOREV")
else:
Expand All @@ -18,7 +18,7 @@ def mender_configure_branch_from_preferred_version(d):
import re
version = d.getVar("PREFERRED_VERSION")
if version is None or version == "":
version = d.getVar("PREFERRED_VERSION_%s" % d.getVar('PN'))
version = d.getVar("PREFERRED_VERSION:%s" % d.getVar('PN'))
if version is None:
version = ""
match = re.match(r"^[0-9]+\.[0-9]+\.", version)
Expand All @@ -37,7 +37,7 @@ def mender_configure_version_from_preferred_version(d):
pref_version = d.getVar("PREFERRED_VERSION")
srcpv = d.getVar("SRCPV")
if pref_version is None:
pref_version = d.getVar("PREFERRED_VERSION_%s" % d.getVar("PN"))
pref_version = d.getVar("PREFERRED_VERSION:%s" % d.getVar("PN"))
if pref_version is not None and pref_version.find("-git") >= 0:
# If "-git" is in the version, remove it along with any suffix it has,
# and then readd it with commit SHA.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require mender-connect.inc
def mender_connect_autorev_if_git_version(d):
version = d.getVar("PREFERRED_VERSION")
if version is None or version == "":
version = d.getVar("PREFERRED_VERSION_%s" % d.getVar('PN'))
version = d.getVar("PREFERRED_VERSION:%s" % d.getVar('PN'))
if not d.getVar("EXTERNALSRC") and version is not None and "git" in version:
return d.getVar("AUTOREV")
else:
Expand All @@ -18,7 +18,7 @@ def mender_connect_branch_from_preferred_version(d):
import re
version = d.getVar("PREFERRED_VERSION")
if version is None or version == "":
version = d.getVar("PREFERRED_VERSION_%s" % d.getVar('PN'))
version = d.getVar("PREFERRED_VERSION:%s" % d.getVar('PN'))
if version is None:
version = ""
match = re.match(r"^[0-9]+\.[0-9]+\.", version)
Expand All @@ -37,7 +37,7 @@ def mender_connect_version_from_preferred_version(d):
pref_version = d.getVar("PREFERRED_VERSION")
srcpv = d.getVar("SRCPV")
if pref_version is None:
pref_version = d.getVar("PREFERRED_VERSION_%s" % d.getVar("PN"))
pref_version = d.getVar("PREFERRED_VERSION:%s" % d.getVar("PN"))
if pref_version is not None and pref_version.find("-git") >= 0:
# If "-git" is in the version, remove it along with any suffix it has,
# and then readd it with commit SHA.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require mender-flash.inc
def mender_flash_autorev_if_git_version(d):
version = d.getVar("PREFERRED_VERSION")
if version is None or version == "":
version = d.getVar("PREFERRED_VERSION_%s" % d.getVar('PN'))
version = d.getVar("PREFERRED_VERSION:%s" % d.getVar('PN'))
if not d.getVar("EXTERNALSRC") and version is not None and "git" in version:
return d.getVar("AUTOREV")
else:
Expand All @@ -18,7 +18,7 @@ def mender_flash_branch_from_preferred_version(d):
import re
version = d.getVar("PREFERRED_VERSION")
if version is None or version == "":
version = d.getVar("PREFERRED_VERSION_%s" % d.getVar('PN'))
version = d.getVar("PREFERRED_VERSION:%s" % d.getVar('PN'))
if version is None:
version = ""
match = re.match(r"^[0-9]+\.[0-9]+\.", version)
Expand All @@ -37,7 +37,7 @@ def mender_flash_version_from_preferred_version(d):
pref_version = d.getVar("PREFERRED_VERSION")
srcpv = d.getVar("SRCPV")
if pref_version is None:
pref_version = d.getVar("PREFERRED_VERSION_%s" % d.getVar("PN"))
pref_version = d.getVar("PREFERRED_VERSION:%s" % d.getVar("PN"))
if pref_version is not None and pref_version.find("-git") >= 0:
# If "-git" is in the version, remove it along with any suffix it has,
# and then readd it with commit SHA.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require mender-snapshot.inc
def mender_snapshot_autorev_if_git_version(d):
version = d.getVar("PREFERRED_VERSION")
if not version:
version = d.getVar("PREFERRED_VERSION_%s" % d.getVar('PN'))
version = d.getVar("PREFERRED_VERSION:%s" % d.getVar('PN'))
if not d.getVar("EXTERNALSRC") and version is not None and "git" in version:
return d.getVar("AUTOREV")
else:
Expand All @@ -34,7 +34,7 @@ MENDER_SNAPSHOT_BRANCH = "${@mender_snapshot_branch_from_preferred_version(d)}"
def mender_snapshot_version_from_preferred_version(d, srcpv):
pref_version = d.getVar("PREFERRED_VERSION")
if pref_version is None:
pref_version = d.getVar("PREFERRED_VERSION_%s" % d.getVar("PN"))
pref_version = d.getVar("PREFERRED_VERSION:%s" % d.getVar("PN"))
if pref_version is not None and pref_version.find("-git") >= 0:
# If "-git" is in the version, remove it along with any suffix it has,
# and then readd it with commit SHA.
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/image-tests
Submodule image-tests updated 1 files
+49 −27 tests/test_update.py

0 comments on commit 1e93f22

Please sign in to comment.