Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

refkit layers #147

Merged
merged 48 commits into from
May 31, 2017
Merged

refkit layers #147

merged 48 commits into from
May 31, 2017

Conversation

pohly
Copy link
Contributor

@pohly pohly commented May 8, 2017

The intention is to make it simpler for other projects to use content from
intel-iot-refkit without having to use the entire distro. This first commit
is good enough to keep building the refkit distro and just moves files
around without modifying them. Further work is needed to make the
individual pieces also functional stand-alone.

@okartau
Copy link
Contributor

okartau commented May 10, 2017

CI run (job #954) keeps doing in a loop:
swtpm_setup.sh─┬─sleep 0.1

seems like a case of endless sleep-loop we have had before in early selftest-added times

@pohly
Copy link
Contributor Author

pohly commented May 12, 2017

@mythi, @rpurdie: one question I have is around best practices for deciding between using vs. not using .bbappends. In some cases, a .bbappend has to be used (defining functions or adding files). But when merely changing variables like PACKAGECONFIG, the change can also be in a .inc file with a pn override.

We've not been consistent in refkit regarding that:

$ cat meta-refkit-core/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend
DEPENDS_remove_refkit-config = "gconf"
EXTRA_OECONF_append_refkit-config = " --disable-gconf"

$ grep PACKAGECONFIG_.*pn meta-refkit-core/conf/distro/include/refkit-config.inc
PACKAGECONFIG_pn-python3-pygobject ?= ""
PACKAGECONFIG_remove_pn-gstreamer1.0-plugins-base = "pango"
PACKAGECONFIG_remove_pn-pulseaudio = "avahi"
PACKAGECONFIG_append_pn-ovmf_refkit-config = " secureboot"
PACKAGECONFIG_append_pn-opencv_refkit-config = " opencl"
PACKAGECONFIG_pn-gstreamer1.0-plugins-bad_refkit-config ?= ""

Any preference from you on this? I'm undecided myself.

@rpurdie
Copy link

rpurdie commented May 12, 2017

I think for me it depends what the reason for the change is. We group some things together as .inc files at the distro level if they make sense as a logically grouped set of changes using pn- overrides. I can see cases where something might not fit those includes/groups in which case a bbapend may be more appropriate.

@mythi
Copy link
Contributor

mythi commented May 12, 2017

@pohly I also think that includes are preferred in cases where logical grouping (PACKAGECONFIG, SECURITY_FLAGS, etc.) is possible. Seems like we all agree the principles. I "learnt" to use the PACKAGECONFIG pn-override late so there might be some inconsistencies.

FWIW the pulseaudio .bbappend should be moved to a patch to add a PACKAGECONFIG entry in the .bb and then we can do the right config in refkit-config.inc.

@pohly
Copy link
Contributor Author

pohly commented May 12, 2017

@mythi I think we agree on the basics, but let's be specific. So we do PACKAGECONFIG changes in the .inc file, security flags in refkit_security_flags.inc, and everything else in .bbappends?

@tripzero
Copy link

I pulled pohly/refkit-layers branch and added meta-refkit-core to my bblayers. Builds fine. +1

@tripzero
Copy link

tripzero commented May 17, 2017

The relationship of image-dsk and refkit-image bbclasses is incestuous. image-dsk requires REFKIT_VFAT_MB to be set otherwise you get a json parse error if you don't use refkit-image.bbclass.

@pohly
Copy link
Contributor Author

pohly commented May 18, 2017 via email

@mythi
Copy link
Contributor

mythi commented May 18, 2017 via email

@pohly
Copy link
Contributor Author

pohly commented May 18, 2017 via email

@mythi
Copy link
Contributor

mythi commented May 18, 2017 via email

@pohly
Copy link
Contributor Author

pohly commented May 18, 2017

Rebased, fixed, squashed, all my TODOs addressed -> this could be merged now.

@pohly pohly removed the test-build label May 18, 2017
@pohly pohly changed the title test: refkit layers refkit layers May 18, 2017
@pohly
Copy link
Contributor Author

pohly commented May 18, 2017

test this please

@mythi, @ipuustin: please review

@pohly
Copy link
Contributor Author

pohly commented May 18, 2017

Note that we also agreed to standardize on putting PACKAGECONFIG into the .inc file. Cleaning that up isn't done yet and also is kind of orthogonal to the purpose of the PR, but I can add it.

@pohly pohly force-pushed the refkit-layers branch 2 times, most recently from 9133938 to 4dfae98 Compare May 18, 2017 16:43
@pohly
Copy link
Contributor Author

pohly commented May 18, 2017

test this please

@pohly
Copy link
Contributor Author

pohly commented May 19, 2017

Rebased once more, fixed refkit_image_muted, added build test of refkit-image-computervision. The latter one is potentially slow - let's see how slow. I also don't know yet whether it really passes (local build still running).

@@ -0,0 +1 @@
require python-readline.inc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it's not only readline which is removed... also gdbm and db are not compiled in.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I just rename it to refkit-python.inc?

@@ -33,33 +122,22 @@ PACKAGECONFIG_pn-python3-pygobject_refkit-config = ""
# pango, a graphical text rendering library, is not needed by us.
PACKAGECONFIG_remove_pn-gstreamer1.0-plugins-base_refkit-config = "pango"

# remove readline support from Bluez to reduce GPLv3 dependencies
BAD_RECOMMENDATIONS_append_refkit-config = " bluez5-client"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears not to be recreated anywhere.

@okartau
Copy link
Contributor

okartau commented May 23, 2017

test this please

@pohly
Copy link
Contributor Author

pohly commented May 23, 2017

test this please

KVM was not active in the CI, unrelated to this PR.

@okartau
Copy link
Contributor

okartau commented May 23, 2017

test this please

@refkit-ci
Copy link

Can one of the admins verify this patch?

pohly added 18 commits May 30, 2017 11:19
…E_MODE

Forcing developers to choose between production and development builds
was non-standard (thus tripping up new developers) and inflexible
(couldn't build product and development images at the same time).

The new image-mode.bbclass replaces that with a per-image IMAGE_MODE
variable that can be set as desired in local.conf for existing image
recipes or fixed on a specific value in specific images. It also
customizes /etc/motd in the images, just like the refkit-specific code
did before.

The default (in our local.conf.sample) is to build images in
development mode. This is a bit more relaxed than the approach we
inherited from Ostro OS where a developer was explicitly forced to
choose.

Because setting the Secure Boot signing keys no longer depends on the
.inc files, the default development keys can be moved to
meta-refkit-core, where they are used as default for IMAGE_MODE !=
production.

It is possible that the same build may now need an refkit-initramfs in
development mode (= default dm-verity keys) and one in production
mode. This is solved by providing refkit-initramfs in different variants,
generated automatically using image-mode-variants.bbclass. For this to
work, we have to set valid refkit modes globally.

Extra care is needed to avoid setting IMAGE_MODE and IMAGE_MODE_VALID
themselves globally: the values that are valid for refkit images are
not valid for other images, like core-image-minimal. While that
particular image doesn't do anything with IMAGE_MODE, others might.
Therefore we set REFKIT_IMAGE_MODE[_VALID] globally and copy to the
values checked by the helper classes in the refkit images.

The refkit images use the REFKIT_IMAGE_MODE set in our
local.conf.sample, which may vary in actual builds. Testing continues
to use that because if already built in the right mode, there's no
need to rebuilt an image with a fixed mode.

If someone wants, they now can also built images with a specific
mode that also gets included in the resulting image files (for example,
refkit-image-computervision-development).

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Getting an emergency shell during boot failures is useful during
development but should not be enabled in production. We can use the
image mode to enable it, then developers will have it automatically.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
.rst is more useful as format, because it gets rendered nicely
on Github. Also include some actual information.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
The refkit-conf.inc is now split into distinct sections, with more
general ones at the top and specific recipe changes at the bottom.
PACKAGECONFIG changes are meant to be done in the .inc file, so move
the systemd change there.

More complex changes are meant to be in .bbappends, so recreate the
python .bbappends (but with an .inc file for the common code this
time, and in a simpler way that can be made conditional).

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
refkit-image.bbclass might be used without systemd, so ignore
the situation where the files that we want to edit resp. remove
aren't installed.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Actually trying to build finds issues in our code that does not show
up during the "bitbake -S none" parse and dependency analysis, like
broken code that is based on assumptions about the refkit distro.

For example, refkit_image_muted only worked for images containing
systemd.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
REFKIT_VFAT_MB was already needed by image-dsk.bbclass and not
setting it broke the stand-alone usage of that class.

Setting WKS_FILE in image-dsk.bbclass also has the advantage
that we don't interfere with the defaults when the DSK format
is not active.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
meta-intel sets a WKS_FILE (systemd-bootdisk-uuid.wks) which seems to
assume that the class in EFI_PROVIDER (rmc-boot) gets inherited by the
images.

This used to be done indirectly through the "live" IMAGE_FSTYPES
entry, but doesn't not happen in refkit images because we disable that
type. Instead we need to load that class when our own
image-dsk.bbclass is not active.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
The code used to fail when using refkit-image.bbclass with DISTRO=poky
because the os-release file wasn't installed. Now we check that
instead of failing.

While at it, other copies of that file are also patched. /etc and
${sysconfdir} are both tried, just in case.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
When using the image without systemd we cannot update its
configuration.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Disabling the dependency on syslinux and grub-efi is only valid
for refkit images and (besides saving some resources) necessary
when using refkit.conf because we do not list those components
as supported.

When using other distros, we need to keep these dependencies,
because otherwise non-refkit images built without errors but
then do not boot as no bootx64.efi gets installed.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
The image feature should not be enabled when not using systemd.
Provide a better error message where it previously just failed
due to missing files.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
With several minor problems fixed, we can now build and boot the
common image both with the default Poky
configuration (test_common_poky_config) and with DISTRO=poky +
refkit-config (test_common_refkit_config).

This replaces build-testing of the computer vision image. The problems
found with that test were all in common code, so it makes sense to
keep the test a bit simpler and focus just on that.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
nodejs (meta-oe), IoTivity (meta-oic), and
packagegroup-nodejs-runtime (meta-iot-web) are needed by
refkit-image-gateway. This was not detected earlier because images
were excluded from the world build breakage test.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Not listing them had the effect of excluding them from a world build.
Explicitly building them was possible without triggering warnings.

We want our package groups to be part of a world build to detect
dependency errors. The same goes for images: they are excluded
because of EXCLUDE_FROM_WORLD in image.bbclass, but a test might
want to change that.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
yocto-compat-layer.py did not detect missing dependencies in
meta-refkit-gateway because the refkit-image-gateway was excluded from
world builds. We need to explicitly override that default. However,
this only works for images added by the layer that is getting tested,
because existing images change their signature (unnecessarily?) when
BBLAYERS gets changed.

For this config change to work with self.append_config(),
test_compat_* tests must use the same scaffolding as the rest of the
test, so we might as well move that to setUp/tearDownLocal().

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
The artificial Poky build directory did not have QEMU_USE_KVM set up,
so tests ran without KVM. We need to copy that from the build
configuration in which oe-selftest gets started.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Both package groups have dependencies which are no longer considered
supported in refkit:

packagegroup-core-can -> *can-init-scripts
packagegroup-core-can -> *can-utils
packagegroup-tools-interactive -> *libusb-compat
packagegroup-tools-interactive -> *usbutils -> *libusb-compat

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
@pohly
Copy link
Contributor Author

pohly commented May 30, 2017

test this please

Squashed some fixes into "refkit: replace development/production .inc files with per-image IMAGE_MODE"

  • plain password install test was skipped because the password was not set globally anymore
  • inherit image-mode-variants had been inserted in the middle of some related chunks of settings, now it is above those

Added one new commit: c0ad16a "refkit-image.bbclass: enable emergency shell in development mode"

The project decided at some point to use NodeJS from
meta-iot-web. Therefore that's the layer that we should check for.
meta-oe isn't actually needed for meta-refkit-gateway. Less
dependencies is better for reuse.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
@pohly
Copy link
Contributor Author

pohly commented May 30, 2017

test this please

Previous build failed with a temporary download error:
unable to access 'https://github.com/intel-iot-devkit/upm.git/': Failed to connect to proxy.jf.intel.com port 911: Connection refused

It should have used the DLDIR from the main build, not sure why it wasn't cached. Something to investigate...

@pohly
Copy link
Contributor Author

pohly commented May 30, 2017

retest this please

@mythi
Copy link
Contributor

mythi commented May 30, 2017

test this please

@pohly
Copy link
Contributor Author

pohly commented May 30, 2017

retest this please

@mythi mythi merged commit 1fab28d into intel:master May 31, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants