Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

base: lmp: enable sstate hash equivalence #1230

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions meta-lmp-base/classes/lmp-staging.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ LMPSTAGING_LOCK_TO_AVOID_OOM = "clang-native rust-native rust-llvm-native"
python __anonymous() {
pn = d.getVar('PN')

if d.getVar('RM_WORK_EXCLUDE_ALL') != "":
d.delVarFlag('rm_work_rootfs', 'cleandirs')
d.delVarFlag('rm_work_populatesdk', 'cleandirs')

if bb.data.inherits_class('module', d):
d.appendVar('DEPENDS', ' virtual/kernel')
if 'modsign' in d.getVar('DISTRO_FEATURES'):
Expand All @@ -33,6 +37,14 @@ python __anonymous() {

inherit ${LMPSTAGING_INHERIT_KERNEL_MODSIGN}

RM_WORK_EXCLUDE_ALL ?= ""
do_rm_work:prepend () {
if [ "${RM_WORK_EXCLUDE_ALL}" != "" ]; then
bbnote "rm_work: Skipping as RM_WORK_EXCLUDE_ALL is defined"
exit 0
fi
}

BB_HASHCHECK_FUNCTION:lmp = "lmp_sstate_checkhashes"
def lmp_sstate_checkhashes(sq_data, d, **kwargs):
if 'summary' not in kwargs or kwargs.get('summary'):
Expand Down
4 changes: 4 additions & 0 deletions meta-lmp-base/conf/distro/include/lmp.inc
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ INHERIT += "lmp"
INHERIT += "lmp-staging"
INHERIT += "uninative"

# OEEquivHash
BB_SIGNATURE_HANDLER ?= "OEEquivHash"
BB_HASHSERVE ??= "auto"

# Clang toolchain
TOOLCHAIN ?= "clang"
RUNTIME = "llvm"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Only initramfs-module-install-efi is supported
INITRAMFS_SCRIPTS:remove = "initramfs-module-install"

SSTATE_SKIP_CREATION:task-image-qa = "0"
SSTATE_SKIP_CREATION:task-image-complete = "0"

inherit nopackages
require recipes-samples/images/lmp-feature-initramfs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ IMAGE_CLASSES:remove = "image_repo_manifest"
# avoid circular dependencies
EXTRA_IMAGEDEPENDS = ""

inherit core-image nopackages
inherit core-image

IMAGE_ROOTFS_SIZE = "8192"

Expand All @@ -45,5 +45,4 @@ IMAGE_OVERHEAD_FACTOR = "1.0"

BAD_RECOMMENDATIONS += "busybox-syslog"

SSTATE_SKIP_CREATION:task-image-qa = "0"
SSTATE_SKIP_CREATION:task-image-complete = "0"
require recipes-samples/images/lmp-feature-initramfs.inc
20 changes: 20 additions & 0 deletions meta-lmp-base/recipes-samples/images/lmp-feature-initramfs.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# this file is required to store the initramfs on the sstate cache
# oe-core patch not accepted
# https://patchwork.yoctoproject.org/project/oe-core/patch/[email protected]/

# override sstate.bbclass sstate_report_unihash
python sstate_report_unihash() {
report_unihash = getattr(bb.parse.siggen, 'report_unihash', None)

if report_unihash:
ss = sstate_state_fromvars(d)
if ss['task'] == 'image_complete':
os.environ['PSEUDO_DISABLED'] = '1'
report_unihash(os.getcwd(), ss['task'], d)
}

SSTATE_SKIP_CREATION:task-image-qa = "0"
# this needs the sstate_report_unihash override
SSTATE_SKIP_CREATION:task-image-complete = "0"

inherit nopackages