Giter Club home page Giter Club logo

Comments (6)

DaanDeMeyer avatar DaanDeMeyer commented on July 28, 2024

Can you add a gist or so with the full logs when running with --debug?

from mkosi.

DaanDeMeyer avatar DaanDeMeyer commented on July 28, 2024

Do you have any mkosi scripts that are used with your configuration? I cannot reproduce this error locally with the information you've provided. I'm assuming that /boot is not a directory in which case mkdir() is documented to fail with FileExistsError.

You can verify this by adding run(["bash"], stdin=sys.stdin, cwd=context.root) just before boot_binary.parent.mkdir(parents=True, exist_ok=True) is called and checking the boot/ path

from mkosi.

zjackwang avatar zjackwang commented on July 28, 2024

So I added run(["bash"], stdin=sys.stdin, cwd=context.root) and checked out /boot.

It is a symlink: /boot -> /srv/boot. I verified in our postinstall script that we create this symlink since /srv will be mutable while / is immutable. During build time, this symlink is valid.

However, at install_uki, this symlink is broken. The symlink is now pointing at the host filesystem root srv path, which doesn't exist. Is this because the env is not chroot'd? I encounter the same problem when mounting a built image onto a random path. When I chroot <build_root>, the symlinks become whole again. Is there a reason to not do this in install_uki?

from mkosi.

DaanDeMeyer avatar DaanDeMeyer commented on July 28, 2024

@zjackwang Please realize that I lost a lot of time investigating this because you omitted this information. Next time you should add crucial information like this in your original report.

To fix this, don't use absolute symlinks, use relative symlinks.

from mkosi.

DaanDeMeyer avatar DaanDeMeyer commented on July 28, 2024

So we should probably add a chase() helper function that we use to resolve paths whenever we operate on the image root directory. This helper would open an fd to "/", then chroot and chdir into the image root directory, resolve the symlink and finally chroot and chdir back to "/". That way absolute symlinks would be resolved correctly.

from mkosi.

zjackwang avatar zjackwang commented on July 28, 2024

@zjackwang Please realize that I lost a lot of time investigating this because you omitted this information. Next time you should add crucial information like this in your original report.

To fix this, don't use absolute symlinks, use relative symlinks.

Apologies for the omitted information. Confirmed relative symlinks allowed the build to succeed.

from mkosi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.