Skip to content

Conversation

@benjamin051000
Copy link

@benjamin051000 benjamin051000 commented Dec 12, 2024

The purpose of this tutorial is to replace the current articles that newcomers use to learn how to crank kernels (Turning the Crank, Cranky Tutorial).

This tutorial focuses on one particular kernel for one particular SRU cycle. The goal is to keep it as short and sweet as possible. The target audience is someone cranking their first kernel.

Additional important information about cranking in general will be added into other how-to guides and references in the future.


To Do:

  • Finish adding descriptions for each step of the process
  • Describe the proper output for each step
  • Choose a particular SRU cycle to run this on to make it more consistent
  • Make headers more descriptive
  • Hook file up to the actual docs page (I just created the file, nothing links to it explicitly)
  • add some comments in the code to start more specific discussions.
  • Mark old tutorials with a sign that links to the updated tutorial

@benjamin051000
Copy link
Author

Sometimes cranky chroot create-base has errors when re-running it. Sometimes those errors need to be resolved by entering the chroot and running apt commands to fix it (usually the error recommends the proper command). I need to see how often this happens with fresh chroots.

@benjamin051000 benjamin051000 force-pushed the bwheeler/cranky-tutorial branch from 0edb3f8 to e2e39b7 Compare January 15, 2025 18:29
@benjamin051000 benjamin051000 marked this pull request as ready for review January 16, 2025 13:40

<!-- FEEDBACK: It seems like you MUST run this command from the ~ directory? If yes i guess it should be mentioned somewhere -->
```bash
cranky chroot create-base noble:linux-gke
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a bit messy. I had to delete the chroot environments in /var/llib/schroot/* and destroy-sessions accordingly to get things to work.

But this is just for reference; it shouldn't be part of the tutorial.

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, sometimes the chroot creation process has issues, and from what I can tell, no one is sure how to definitively solve them. If noble has too many issues, I wonder if using something like jammy would be more stable since it's more mature.

Signed-off-by: Benjamin Wheeler <[email protected]>
Now, Sphinx will build and we can see the rendered page.

Signed-off-by: Benjamin Wheeler <[email protected]>
Signed-off-by: Benjamin Wheeler <[email protected]>
Signed-off-by: Benjamin Wheeler <[email protected]>
Signed-off-by: Benjamin Wheeler <[email protected]>
@bjamison8
Copy link

In Crank Your First Kernel I think it's best to make a release-wide base and get specific to the derivative in the session - that way you can reuse the same base with multiple sessions -- at least that's what makes the most sense to me
cranky chroot create-base noble:linux-gke -> cranky chroot create-base noble:linux

@benjamin051000
Copy link
Author

benjamin051000 commented Jan 29, 2025

@bjamison8 My last comment was wrong, so I deleted it.

The package (part of the handle after the :) is used when creating the session (link)... after it gets hard-coded to linux. 🤷🏼‍♂️

What we should really do is update this command to only take the series, and not a useless arg. We will get there in time :D for the mean time, I think most use the command with the whole series:kernel-derivative full name. That last sentence is anecdotal, though.

@bjamison8
Copy link

@benjamin051000 sure, it's not a discrepancy that could cause an issue for anyone so you do what you think is best, just want you to be aware of it

@benjamin051000 benjamin051000 self-assigned this Feb 4, 2025
AnneCYH and others added 3 commits February 11, 2025 10:49
Signed-off-by: AnneCYH <[email protected]>
* update on top of ben's tutorial

Signed-off-by: annecyh <[email protected]>

* Use `cranky rebase -b` instead of manually fetching tag

Signed-off-by: Benjamin Wheeler <[email protected]>

* Add sru cycle to link-tb.

Signed-off-by: Benjamin Wheeler <[email protected]>

---------

Signed-off-by: annecyh <[email protected]>
Signed-off-by: Benjamin Wheeler <[email protected]>
Co-authored-by: annecyh <[email protected]>
@benjamin051000
Copy link
Author

benjamin051000 commented Feb 12, 2025

DCO check is not happy with that squash commit message. Sigh

We can just force it to pass

benjamin051000 and others added 2 commits February 12, 2025 15:22
Signed-off-by: annecyh <[email protected]>
Copy link
Collaborator

@AnneCYH AnneCYH left a comment

Choose a reason for hiding this comment

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

looks good; let's get in the other reviewers!

Once all the architectures return the `BUILD-OK` status, we know the kernel built successfully.

<!--
### Build kernel locally
Copy link
Author

Choose a reason for hiding this comment

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

We were not able to get local builds working. Does anyone know the process for this? Neither the Wiki page nor the kernel docs seemed to work for us :(

Our main issue was getting this:

find: 'dwarfdump': No such file or directory

But I couldn't figure out how to install dwarfdump, or get the build tool to recognize that it was installed. 🤷🏼‍♂️

benjamin051000 and others added 2 commits February 24, 2025 11:01
added 📜 option to make terminal output scrollable

Signed-off-by: AnneCYH <[email protected]>
Cranking an Ubuntu kernel is the process of applying patches and updates to an existing Ubuntu kernel, packaging it, and preparing it for testing.
All this is done using the [cranky](https://kernel.ubuntu.com/gitea/kernel/kteam-tools/src/branch/master/cranky) toolchain.

In this tutorial, we will crank a 24.04 LTS (Noble Numbat) (codename `noble`) Google cloud kernel (codename `linux-gke`) from the "s2024.12.02" cycle.
Copy link
Contributor

Choose a reason for hiding this comment

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

According the link-tb command in this tutorial, is it not “from s2024.12.02 cycle” but “for s2024.12.02 cycle”.

Copy link
Collaborator

Choose a reason for hiding this comment

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

hey @gagath , not really sure about your comment, are you saying the grammar here should be "for" instead of "from"?

Connect to the Canonical VPN and run:

```bash
git remote add cbd cbd.kernel:noble.git
Copy link
Contributor

Choose a reason for hiding this comment

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

This tutorial is aimed at kernel-docs (public), but CBD is not accessible to public users. Please clarify.

Copy link
Collaborator

Choose a reason for hiding this comment

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

thanks for pointing this out @gagath , this is exactly the question @benjamin051000 and I had.

Do you think it is OK to mention CBD in our docs? we thought of addressing this by adding 2 parts for this - one for internal users (using CBD) and one for external users (building locally?)

Copy link
Author

Choose a reason for hiding this comment

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

We wanted to initially have information about building locally, but @AnneCYH weren't able to get it working :(

One option is simply removing this section for now, or linking to another doc that explains various ways on how to build a kernel... 🤷🏼‍♂️

Copy link
Contributor

Choose a reason for hiding this comment

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

We do have a doc in this repo that is specifically for building a kernel. We should be linking to it either way.

Copy link
Author

@benjamin051000 benjamin051000 Mar 11, 2025

Choose a reason for hiding this comment

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

Oh, I forgot about that. I'll find it and link it in. Thanks @ijwhitfield

Copy link
Author

Choose a reason for hiding this comment

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

@AnneCYH should we link to https://canonical-kernel-docs.readthedocs-hosted.com/en/latest/how-to/develop-customize/build-kernel/ at the end of the Build section, or at the bottom of the document in the related links section?

Copy link
Collaborator

Choose a reason for hiding this comment

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

we do have but the current doc doesn't really address what is needed by this tutorial which is why we haven't been able to make it work.

Copy link
Author

Choose a reason for hiding this comment

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

Once outstanding requests have been resolved, we intend on moving this tutorial internal.

AnneCYH and others added 2 commits March 11, 2025 11:06
Co-authored-by: AnneCYH <[email protected]>
Signed-off-by: Benjamin Wheeler <[email protected]>
Signed-off-by: Benjamin Wheeler <[email protected]>
@benjamin051000 benjamin051000 force-pushed the bwheeler/cranky-tutorial branch from 9d9a9d0 to b0aff7e Compare March 11, 2025 12:19
They don't add any useful information.

Now that the sphinx extension is updated, this is cleaner to do.

Signed-off-by: Benjamin Wheeler <[email protected]>
@benjamin051000 benjamin051000 requested a review from gagath March 21, 2025 14:44
@benjamin051000
Copy link
Author

Closed as this document will be moved internally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants