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

Bootc switch issues #1024

Open
ericcurtin opened this issue Jan 14, 2025 · 9 comments
Open

Bootc switch issues #1024

ericcurtin opened this issue Jan 14, 2025 · 9 comments
Labels
area/client Related to the client/CLI bug Something isn't working needinfo Needs information from the issue reporter

Comments

@ericcurtin
Copy link
Contributor

ericcurtin commented Jan 14, 2025

At the bottom is a wrapper script I use to do podman build and bootc switch. Bug 1 is known I think, we have to do chcon to solve an selinux issue. Bug 2 is if you try and bootc switch to a container with the same name as the current one, it does nothing (even though one may have made an edit to the container image since, etc.). I workaround this by getting the sha from podman images -q, but it should be able to recognise it's not the same image as currently booted.

#!/bin/bash

main() {
  set -exu -o pipefail

  if [ "$EUID" -ne 0 ]; then
    echo "Please run as root"
    return 1
  fi

  podman build -t bootc -f Containerfile-bootc

  # Bug 1, selinux issue, need to chcon
  bootc usr-overlay || true
  chcon --reference /usr/bin/rpm-ostree /usr/bin/bootc

  # Bug 2, if you try a bootc switch to a new image with the same name
  # nothing happens, use the sha from "podman images -q" to workaround it
  local id="$(podman images -q localhost/bootc)"
  bootc switch --transport containers-storage "$id"
}

main "$@"
@cgwalters
Copy link
Collaborator

Once you've done the switch, you can use bootc upgrade.

@ericcurtin
Copy link
Contributor Author

bootc upgrade doesn't have a --transport option

@ericcurtin
Copy link
Contributor Author

ericcurtin commented Jan 14, 2025

Maybe I have a funny workflow, but I kinda like it, I just rebuild a locally maintained Containerfile when I want to update or add more software, means I can use dnf or any other install technique I want (within reason)

@cgwalters
Copy link
Collaborator

cgwalters commented Jan 14, 2025

Once you have done a switch, you don't need to re-specify the transport each time for upgrade.

@ericcurtin
Copy link
Contributor Author

Ah ok interesting, I'll try that

@cgwalters
Copy link
Collaborator

Bug 1, selinux issue, need to chcon

Are you overriding the bootc binary in the container build somehow? What host version is this? Is it specific to having usroverlay on for you? More info please.

@ericcurtin
Copy link
Contributor Author

ericcurtin commented Jan 14, 2025

It's this Containerfile specifically:

FROM quay.io/fedora/fedora-kinoite:41

RUN dnf install -y alacritty black clang cmake codespell distrobox dnf4 \
      fedora-workstation-repositories gcc hyperfine keepassxc libcurl-devel \
      make nvtop podman python3-tqdm qemu-kvm the_silver_searcher vim \
      python3-flake8 bats httpd-tools docker

chcon fails without doing bootc usr-overlay first

@cgwalters
Copy link
Collaborator

Can you paste the output of env RUST_LOG=debug bootc upgrade say without the chcon? Also paste the output of ls -Z /usr/bin/ostree.

@cgwalters cgwalters added bug Something isn't working area/client Related to the client/CLI needinfo Needs information from the issue reporter labels Jan 17, 2025
@ericcurtin
Copy link
Contributor Author

I'm off now but I'll do it Monday, just for the record this is an rpm-ostree Kinoite system converted to bootc via "bootc switch". That's the easiest way to install a Silverblue/Kinoite bare metal machine that I know of, start with an rpm-ostree .iso .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/client Related to the client/CLI bug Something isn't working needinfo Needs information from the issue reporter
Projects
None yet
Development

No branches or pull requests

2 participants