Skip to content

Commit

Permalink
webos_ls2_conf_validate.bbclass: Skip do_validate_ls2_acg if sysbus d…
Browse files Browse the repository at this point in the history
…irectories don't exist

:Release Notes:
Skip running do_validate_ls2_acg if any of sysbus directories needed
does not exist.

:Detailed Notes:
Sysbus directories are essential but we need this check for some variant
like core-boot in Apollo.

:Testing Performed:
Set up a core-boot profile in build-apollo and ran
bitbake <image> -c do_validate_ls2_acg

:QA Notes:

:Issues Addressed:
[WRQ-2420] CCC: Skip do_validate_ls2_acg if sysbus directories don't
           exist
[WRQ-1154] Check ACG groups used but not defined at buildtime

Cherry-picked-from-commit: 2fc07b8
Cherry-picked-from-branch:
  • Loading branch information
jaeyoonjung authored and ywbyun0815 committed Nov 27, 2023
1 parent 4494bc1 commit bfd6ed8
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions meta-webos/classes/webos_ls2_conf_validate.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,28 @@ fakeroot python do_validate_ls2_acg() {
import os
import json

rootfs_groups_d = d.getVar("IMAGE_ROOTFS") + d.getVar("webos_sysbus_groupsdir")
rootfs_api_perms_d = d.getVar("IMAGE_ROOTFS") + d.getVar("webos_sysbus_apipermissionsdir")
rootfs_clientperms_dir = d.getVar("IMAGE_ROOTFS") + d.getVar("webos_sysbus_permissionsdir")

# There can be no sysbus directories in a tiny image
if not os.path.isdir(rootfs_groups_d):
bb.note("Directory '%s' is missing, skipping validation." % rootfs_groups_d)
return
if not os.path.isdir(rootfs_api_perms_d):
bb.note("Directory '%s' is missing, skipping validation." % rootfs_api_perms_d)
return
if not os.path.isdir(rootfs_clientperms_dir):
bb.note("Directory '%s' is missing, skipping validation." % rootfs_clientperms_dir)
return

# List of group names to skip checking
skip_group = d.getVar("WEBOS_LS2_CONF_VALIDATE_SKIP_GROUP").split()
if len(skip_group) > 0:
bb.debug(1, "WEBOS_LS2_CONF_VALIDATE_SKIP_GROUP:")
for group in skip_group:
bb.debug(1, " %s" % group)

rootfs_groups_d = d.getVar("IMAGE_ROOTFS") + d.getVar("webos_sysbus_groupsdir")
rootfs_api_perms_d = d.getVar("IMAGE_ROOTFS") + d.getVar("webos_sysbus_apipermissionsdir")
rootfs_clientperms_dir = d.getVar("IMAGE_ROOTFS") + d.getVar("webos_sysbus_permissionsdir")

# Returns a set of group names defined in 'dir'.
# Json files in 'dir' are expected to have groups as keys.
def read_groups(dir):
Expand Down

0 comments on commit bfd6ed8

Please sign in to comment.