systemd / mkosi

💽 Build Bespoke OS Images
https://mkosi.systemd.io/
1.18k stars 319 forks source link

AttributeError: 'CommandLineArguments' object has no attribute 'xbootldr_partno' #388

Closed fedelibre closed 4 years ago

fedelibre commented 4 years ago

I thought that this issue was fixed, see issue #333 fixed by #336 . But maybe this is something else or I'm probably missing something.

I've tried mkosi 5 from Fedora 31 repository, mkosi 5 from v5 git tag and mkosi master. All versions produce the same error. The image I'm testing is the following:

git clone git@github.com:fedelibre/LilyDev.git
cd mkosi
make debian

This is the error:

$ make debian
Build Debian container.
cd debian && sudo mkosi -f --default mkosi.container --password="" -o /home/fede/src/LilyDev/mkosi/LilyDev-1-debian
[sudo] password di fede: 
‣ Removing output files...
‣ Removing output files complete.
DISTRIBUTION:
          Distribution: debian
               Release: stretch
                Mirror: http://deb.debian.org/debian

OUTPUT:
         Output Format: directory
                Output: /home/fede/src/LilyDev/mkosi/LilyDev-1-debian
       Output Checksum: n/a
      Output Signature: n/a
           Output Bmap: n/a
Output nspawn Settings: n/a
           Incremental: no
             Read-only: no
        FS Compression: no
        XZ Compression: no
            Encryption: no
                Verity: no

PACKAGES:
  [...]
         Package Cache: /home/fede/src/LilyDev/mkosi/debian/mkosi.cache/debian~stretch
           Extra Trees: /home/fede/src/LilyDev/mkosi/debian/mkosi.extra
        Skeleton Trees: none
          Build Script: none
         Build Sources: /home/fede/src/LilyDev/mkosi/debian
  Source File Transfer: none
       Build Directory: none
        Build Packages: none
    Postinstall Script: /home/fede/src/LilyDev/mkosi/debian/mkosi.postinst
       Finalize Script: none
  Scripts with network: yes
       nspawn Settings: none

HOST CONFIGURATION:
    Extra search paths: none
‣ Detaching namespace...
‣ Detaching namespace complete.
‣ Setting up package cache...
‣ Setting up package cache /home/fede/src/LilyDev/mkosi/debian/mkosi.cache/debian~stretch complete.
‣ Setting up temporary workspace.
‣ Temporary workspace in /home/fede/src/LilyDev/mkosi/.mkosi-wkc3a92r is now set up.
‣ Mounting image...
Traceback (most recent call last):
  File "/usr/bin/mkosi", line 4539, in <module>
    main()
  File "/usr/bin/mkosi", line 4535, in main
    run_verb(args)
  File "/usr/bin/mkosi", line 4507, in run_verb
    build_stuff(args)
  File "/usr/bin/mkosi", line 4333, in build_stuff
    raw, tar, root_hash = build_image(args, workspace, do_run_build_script=False, cleanup=True)
  File "/usr/bin/mkosi", line 4147, in build_image
    with mount_image(args, workspace.name, loopdev, encrypted_root, encrypted_home, encrypted_srv):
  File "/usr/lib64/python3.7/contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "/usr/bin/mkosi", line 961, in mount_image
    if args.xbootldr_partno is not None:
AttributeError: 'CommandLineArguments' object has no attribute 'xbootldr_partno'
Traceback (most recent call last):
  File "/usr/lib64/python3.7/weakref.py", line 648, in _exitfunc
    f()
  File "/usr/lib64/python3.7/weakref.py", line 572, in __call__
    return info.func(*info.args, **(info.kwargs or {}))
  File "/usr/lib64/python3.7/tempfile.py", line 795, in _cleanup
    _shutil.rmtree(name)
  File "/usr/lib64/python3.7/shutil.py", line 494, in rmtree
    _rmtree_safe_fd(fd, path, onerror)
  File "/usr/lib64/python3.7/shutil.py", line 436, in _rmtree_safe_fd
    onerror(os.rmdir, fullname, sys.exc_info())
  File "/usr/lib64/python3.7/shutil.py", line 434, in _rmtree_safe_fd
    os.rmdir(entry.name, dir_fd=topfd)
OSError: [Errno 16] Device or resource busy: 'root'
behrmann commented 4 years ago

Looking at the backtrace, I see that it breaks in /usr/bin/mkosi. Assuming that you haven't installed the git master globally, I guess your sudo mkosi might pick up the wrong mkosi from PATH then. The mkosi 5 release (and git tag) are definitely broken regarding this functionality, but master should work, I've been using it lately.

fedelibre commented 4 years ago

Sure, you are right! I must install it in /usr/local instead of ~/.local

Indeed, v5 tag doesn't contain that commit. I'll use master.