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

Add ubuntu example image #45

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shawn111
Copy link
Contributor

@shawn111 shawn111 commented Dec 4, 2024

This is an example of ubuntu image referred to arch example.

asciicast

Copy link
Collaborator

@allisonkarlitskaya allisonkarlitskaya left a comment

Choose a reason for hiding this comment

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

I think the cfsctl command copied to /usr/bin is going to be broken because there's no mkcomposefs available on Ubuntu. In particular, pulling a new image and preparing it for booting probably won't work.

Can you please look into that? In all of the other examples, we can "install updates", but with mkcomposefs unavailable I'm afraid it won't work for this one.

RUN apt install -y kmod linux-base libelf1t64
RUN apt install -y curl
# The cfsctl mount command depends on (currently pre-release) Linux 6.12 for support for directly mounting erofs images without creating loopback devices.
RUN curl -O https://kernel.ubuntu.com/mainline/v6.12/amd64/linux-headers-6.12.0-061200-generic_6.12.0-061200.202411220723_amd64.deb
Copy link
Collaborator

Choose a reason for hiding this comment

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

You should always give -L to curl to handle redirects and --fail to handle HTTP level errors instead of giving HTML back.

Use --remote-name-all to download mutiple files at once too.

So combined:

RUN curl -Lf --remote-name-all https://kernel.ubuntu.com/mainline/v6.12/amd64/linux-headers-6.12.0-061200-generic_6.12.0-061200.202411220723_amd64.deb \
    https://kernel.ubuntu.com/mainline/v6.12/amd64/linux-headers-6.12.0-061200_6.12.0-061200.202411220723_all.deb \
    https://kernel.ubuntu.com/mainline/v6.12/amd64/linux-image-unsigned-6.12.0-061200-generic_6.12.0-061200.202411220723_amd64.deb \
    https://kernel.ubuntu.com/mainline/v6.12/amd64/linux-modules-6.12.0-061200-generic_6.12.0-061200.202411220723_amd64.deb

It'll also avoid creating 4 separate TCP connections.

(Or of course, add a separate apt repo with these packages)

@allisonkarlitskaya
Copy link
Collaborator

I just merged this: 60ff784#diff-8906835152921ef903f55779586f3a092362f65fca98df94d71801cf974ec95bR42 as a super janky way of getting composefs working on Ubuntu, for the GitHub actions runners, so we can CI the examples.

It might be useful to do something less awful. Ideas:

  • a composefs PPA or something would be awesome... I might look into that today.
  • implement erofs writing in composefs-rs to lose our mkcomposefs dependency
  • ???

@allisonkarlitskaya
Copy link
Collaborator

For the record, the thing that should be possible is that you push your created container image to a registry somewhere, and then inside of the booted system image you can say something like:

cfsctl oci pull docker://quay.io/your/image
cfsctl oci prepare-boot [image id]

and then reboot and see the second image in the systemd-boot menu. It should even work to have separate OS installs (I tested this between the Fedora and Arch images, for example).

@shawn111 shawn111 closed this Dec 5, 2024
@shawn111 shawn111 reopened this Dec 5, 2024
@shawn111
Copy link
Contributor Author

shawn111 commented Dec 5, 2024

I just merged this: 60ff784#diff-8906835152921ef903f55779586f3a092362f65fca98df94d71801cf974ec95bR42 as a super janky way of getting composefs working on Ubuntu, for the GitHub actions runners, so we can CI the examples.

It might be useful to do something less awful. Ideas:

  • a composefs PPA or something would be awesome... I might look into that today.
  • implement erofs writing in composefs-rs to lose our mkcomposefs dependency
  • ???

It is so nice that we have CI to test the example builds.

It been a long time ago, I didn't login launchpad.
I need to find my account out.

@shawn111 shawn111 changed the title Add ubuntu example image WIP: Add ubuntu example image Dec 5, 2024
@shawn111 shawn111 changed the title WIP: Add ubuntu example image Add ubuntu example image Dec 5, 2024
@shawn111 shawn111 force-pushed the ubuntu-example branch 4 times, most recently from 72cbd28 to f403486 Compare December 5, 2024 13:47
@shawn111
Copy link
Contributor Author

shawn111 commented Dec 5, 2024

For the record, the thing that should be possible is that you push your created container image to a registry somewhere, and then inside of the booted system image you can say something like:

cfsctl oci pull docker://quay.io/your/image
cfsctl oci prepare-boot [image id]

and then reboot and see the second image in the systemd-boot menu. It should even work to have separate OS installs (I tested this between the Fedora and Arch images, for example).

Thanks, I pushed to docker.io/shawn111/cfs-images:ubuntu.

./cfsctl --repo tmp/sysroot/composefs/ oci pull docker://docker.io/shawn111/cfs-image:ubuntu
Error: Opening image

Caused by:
    failed to invoke method OpenImage: failed to invoke method OpenImage: reading manifest ubuntu in docker.io/shawn111/cfs-image: manifest unknown

Signed-off-by: Shawn Wang <[email protected]>
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.

3 participants