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

Port the Yocto labs to Scarthgap #255

Merged
merged 22 commits into from
Nov 26, 2024

Conversation

antznin
Copy link
Contributor

@antznin antznin commented Oct 29, 2024

Overall the lab content and flow is the same. Any notable change is described below, so trainers can prepare and take the changes into account when updating their setup.

Slides

  • Change the kirkstone references to scarthgap.
  • Update to the classes-global/classes-recipe naming in the intro on classes.

Labs

  • Common to all boards:

    • Image names now contain .rootfs (e.g. bootlinlabs-image-minimal-bootlinlabs.rootfs.tar.xz).
    • Update the list of host dependencies by extracting from the YP documentation.
    • When creating a recipe with devtool, only sha256 sums of SRC_URI are generated, so remove the suggestions to delete others sums (md5, etc.).
    • SDK file names are slightly different for each board.
  • Beagleplay/Beaglebone: the kernels in use were swapped! Now:

    • The Beagleplay uses linux-ti-staging.
    • The Beaglebone uses linux-bb.org.
    • The meta-ti layer is by default overriding the DEPLOY_DIR variable to make point to a directory next to TMPDIR, which is unusual. Override this behavior as it is non-standard (apply patch on meta-ti).
  • Beaglebone:

    • When creating a new machine configuration file, two new steps are required:
      • Need to add a custom MACHINEOVERRIDES in the machine configuration, because the kernel and bootloader recipes are using COMPATIBLE_MACHINE to match against beagle.* (instruct to add the override beaglebone).
      • Need to explicitly add tar.xz to IMAGE_FSTYPES, it's not implied by default anymore.
  • Beagleplay:

    • Add patches that simplify the meta-ti repository:
      • Remove their DEPLOY_DIR customization that does not follow the standards. Also remove a TMPDIR customization that depends on the former DEPLOY_DIR customization.
      • Update the default defconfig file and remove the override directories, to make it simpler to override the defconfig with Joystick support enabled later in lab5.
      • Update the patch for extlinux support, instead of the default Grub boot.
      • Add support for saving the environment to the boot partition.
    • Stopping U-boot and setting boot_targets is not needed anymore, but booting with bootflow scan -b is necessary for U-boot to boot with extlinux.
    • The instructions to create a new machine are the same, but the content of the machine configuration file have changed quite a lot (based on the default beagleplay configuration file).
    • Fix 32-bit 🡒 64-bit architecture instruction when running file against ctris.
  • STM32:

    • Uses scarthgap 5.0.1, not the latest 5.0.4, because at the time of running the labs, meta-st-stm32 was not compatible with the latest version of poky.
    • The extlinux configuration now has multiple entries, so specify which one has to be modified.
    • defconfig update for kernel 6.1 (NFS and joystick/nunchuk support).
    • Custom MACHINE: some variable names have been changed, update them in the instructions.

Copy link
Contributor

github-actions bot commented Oct 29, 2024

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@Tropicao
Copy link
Contributor

Hello @antznin, as a side note, as a Bootlin employee you don't have to sign the CAA,. This issue has been fixed recently, if you want the bot to correctly detect that it's ok for you, I suggest to rebase your PR on top of current master and force-push it (unfortunately, if anyone has started reviewing your work, the force push will mark everything as "new", but I have no other way of updating the bot status since the PR has been opened before the CAA fix)

@antznin antznin force-pushed the agdrd/lab-yocto-scarthgap branch from 4fa6c45 to ade86a5 Compare November 4, 2024 14:03
Copy link
Contributor

@lucaceresoli lucaceresoli left a comment

Choose a reason for hiding this comment

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

Thanks for the very accurate work!
It looks very good to me overall. I just added a few minor notes for clarifications or additional improvements.

Luca

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd update the "kirkstone or honister" below to "kirkstone or scarthgap" as well.

slides/yocto-overview/yocto-overview.tex Outdated Show resolved Hide resolved
@lucaceresoli
Copy link
Contributor

An additional note that came to mind just now: we should also update all or most of the places where the classes directory is mentioned and convert that to classes-recipe and classes-global.

This includes changing slides "Introduction to classes" and "Common classes" to mention the new directory organization, and possibly keeping the old classes-dir-only used until Kirkstone as a historical note just like now we have the "note about the future" mentioning the post-Langdale note.

It also includes all or most of the slides reachable by git grep "classes/", e.g. classes/mirrors.bbclass should now be classes-global/mirrors.bbclass.

There might be other places to update in the slides but none came to mind after the training I gave last week, and definitely they can be fixed later on if/when we notice them.

@antznin
Copy link
Contributor Author

antznin commented Nov 13, 2024

@lucaceresoli:

An additional note that came to mind just now: we should also update all or most of the places where the classes directory is mentioned and convert that to classes-recipe and classes-global.

This includes changing slides "Introduction to classes" and "Common classes" to mention the new directory organization, and possibly keeping the old classes-dir-only used until Kirkstone as a historical note just like now we have the "note about the future" mentioning the post-Langdale note.

The classes/ directory is still in use, though! Example: https://git.openembedded.org/openembedded-core/tree/meta/classes/useradd.bbclass?h=scarthgap.

This is how it's documented at the moment: classes/ - classes whose usage context is not clearly defined. So I think the best it to introduce classes-recipe, classes-global, and note that the classes/ directory exists for classes with an unclear usage context. What do you think?

It also includes all or most of the slides reachable by git grep "classes/", e.g. classes/mirrors.bbclass should now be classes-global/mirrors.bbclass.

There might be other places to update in the slides but none came to mind after the training I gave last week, and definitely they can be fixed later on if/when we notice them.

Will change all of that in this PR.

Edit: see 818a55f.

@antznin antznin force-pushed the agdrd/lab-yocto-scarthgap branch from ade86a5 to c961d7a Compare November 13, 2024 13:04
@lucaceresoli lucaceresoli added the yocto Yocto training label Nov 25, 2024
@lucaceresoli
Copy link
Contributor

Whole series:
Reviewed-by: Luca Ceresoli [email protected]

* Update revisions for scarthgap.
* Update commands for creating flash images and for updating.

Signed-off-by: Antonin Godard <[email protected]>
* Specify that you need to set the default entry OpenSTLinux (new with
  scarthgap).

Signed-off-by: Antonin Godard <[email protected]>
* Update the kernel version.

Signed-off-by: Antonin Godard <[email protected]>
Taken from the default configuration, still supports NFS and configured
for lab5.

Signed-off-by: Antonin Godard <[email protected]>
* Just a change of variable name.

Signed-off-by: Antonin Godard <[email protected]>
* Just a change of sdk version.

Signed-off-by: Antonin Godard <[email protected]>
* On Scarthgap, devtool now only generates the sha256sum flag for the
  SRC_URI variable.

* Also fix a typo (anymore).

Signed-off-by: Antonin Godard <[email protected]>
* Adjust the requirements (extract from the Yocto documentation).

* Adjust some filenames/tags.

* Add a patch to prevent meta-ti for modifying the deploy directory, and
  that adjusts the machine configuration file as a consequence.

* Stopping U-boot and setting boot_targets is not needed anymore,
  but booting with `bootflow scan -b` is necessary for U-boot to boot
  with extlinux.

* Add patch to simplify meta-ti layer that does different things:

  - Use extlinux.conf booting flow

    Switch from the default EFI-based boot process to a well-known
    extlinux.conf boot flow.

    This change is coherent with our other supported boards and simplifies
    the labs significantly (which are therefore very similar to those for
    the other boards). Moreover, I had trouble establishing a stable
    Ethernet connection through the EFI-based flow.

  - Don't use a custom deployment directory

    Using custom deployment directory is not following the standards.
    Revert this change by meta-ti to give the good example to trainees.

    Keep the definition of TI_COMMON_DEPLOY as it may be used by other
    recipes.

    Also, remove the change to TMPDIR done in the machine configuration,
    to keep the temporary directory unified and avoid an error caused by
    the change above.

  - Simplify linux-ti-staging recipe for the Bootlin labs

    Using an override to apply another defconfig is annoying for the lab5.
    Instead, just use a single defconfig (extract from the original one)
    that will be overriden later in lab5.

Signed-off-by: Antonin Godard <[email protected]>
* linux-ti-staging used instead of linux-bb.org
* filenames adjusments
* add baudrate to command line

Signed-off-by: Antonin Godard <[email protected]>
* The beagleplay now uses linux-ti-staging instead of linux-bb.org, and
  the beaglebone uses linux-bb.org instead of linux-ti-staging, so swap
  them.

* Update the defconfig file. It's the default defconfig from
  linux-ti-staging + nunchuk support, for lab5. Note that the default
  config has NFS enabled already.

* Update the nunchuk driver patch: probe_new -> probe in kernel 6.6 now.

* Update the device tree patch: not the same implementation as in
  linux-bb.org, just need to change the clock-frequency and add the i2c
  node for the joystick.

Signed-off-by: Antonin Godard <[email protected]>
* Update the machine configuration files to align with the ones from
  scarthgap.

Signed-off-by: Antonin Godard <[email protected]>
* Update the SDK script filename.
* Update the env setup script name.
* Add a conditional on the architecture of the binary, it's 64-bit for
  the beagleplay, not 32.

Signed-off-by: Antonin Godard <[email protected]>
* Add two patches to apply to the meta-ti repo:
  * One for removing the custom deployment directory customization by
    TI. This is a misleading for trainees and does not follow the Yocto
    standards.
  * Replace the default defconfig by one that enables additional options
    for NFS booting.

* Update versions, filenames and dependencies in yocto-first-build.tex.

Signed-off-by: Antonin Godard <[email protected]>
meta-ti on scarthgap uses linux-bb.org for the kernel, not
linux-ti-staging.

Signed-off-by: Antonin Godard <[email protected]>
* Update the kernel name from linux-ti-staging to linux-bb.org.
* Update the driver using the one from stm32 (the stm32 is also on 6.1).
* Refresh the patch that configures the device tree.

Signed-off-by: Antonin Godard <[email protected]>
* Switch from linux-ti-staging to linux-bb.org. Same for U-boot.
* The linux-bb.org and u-boot-bb.org recipes are setting the
  COMPATIBLE_MACHINE variable, so we need a way to also be compatible
  with these recipes. For that, add a custom override to
  MACHINEOVERRIDES.
* The default config does not generate tar.xz rootfs by default, add an
  instruction to do that.

Signed-off-by: Antonin Godard <[email protected]>
* Update the SDK script filename.
* Update the env setup script name.

Signed-off-by: Antonin Godard <[email protected]>
* Update the references when relevant.
* The linux4sam link is valid and still has an anonymous function.

Signed-off-by: Antonin Godard <[email protected]>
* Fix the directory name for classes that are part of classes-global or
  classes-recipe.
* In the intro to classes, introduce the classes-* directories.
* In the "common classes" slide, add a note on why classes/ still
  exists and add the classes directory to the examples.

Signed-off-by: Antonin Godard <[email protected]>
This is not enabled by default on the Beagleplay. Actually, CMD_SAVEENV
is defined but we only have ENV_IS_NOWHERE set so U-boot disables
saveenv. So this patch does the following:

- Set CONFIG_ENV_IS_IN_FAT and related variables.
- Unset CONFIG_ENV_IS_NOWHERE so that when U-boot fails to read the
  file uboot.env on initial boot (the file is not present yet), it
  doesn't fail to "save to nowhere" and save the env to uboot.env
  instead.

Signed-off-by: Antonin Godard <[email protected]>
It seems that the openocd build is failing without this for some reason
(it shouldn't in theory, the git fetcher is supposed to set that...).

Reported-by: Alexandre Belloni <[email protected]>
Signed-off-by: Antonin Godard <[email protected]>
@antznin antznin force-pushed the agdrd/lab-yocto-scarthgap branch from 35b71e1 to 78b94fb Compare November 25, 2024 13:32
@jmarcoscosta jmarcoscosta self-requested a review November 26, 2024 09:17
@antznin antznin merged commit c5f899d into bootlin:master Nov 26, 2024
11 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
yocto Yocto training
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants