systemd / mkosi

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

incremental build of btrfs images fails #317

Closed dud225 closed 4 years ago

dud225 commented 5 years ago

Hello

Running incremental build of a btfs-based image fails :

# mkosi -t subvolume -o debian-test -r testing -d debian -i
[...]
‣ Installing Debian complete.
‣ Assigning hostname...
‣ Assigning hostname complete.
‣ Unmounting Package Cache...
‣ Unmounting Package Cache complete.
‣ Removing random seed...
‣ Removing random seed complete.
‣ Setting up basic OS tree...
ERROR: target path already exists: /var/lib/machines/.mkosi-12_4ti0t/root
Traceback (most recent call last):
  File "/usr/local/bin/mkosi", line 4494, in <module>
    main()
  File "/usr/local/bin/mkosi", line 4490, in main
    run_verb(args)
  File "/usr/local/bin/mkosi", line 4460, in run_verb
    build_stuff(args)
  File "/usr/local/bin/mkosi", line 4289, in build_stuff
    raw, tar, root_hash = build_image(args, workspace, run_build_script=False, cleanup=True)
  File "/usr/local/bin/mkosi", line 4105, in build_image
    prepare_tree(args, workspace.name, run_build_script, cached)
  File "/usr/lib/python3.7/contextlib.py", line 74, in inner
    return func(*args, **kwds)
  File "/usr/local/bin/mkosi", line 1022, in prepare_tree
    btrfs_subvol_create(os.path.join(workspace, "root"))
  File "/usr/local/bin/mkosi", line 431, in btrfs_subvol_create
    run(["btrfs", "subvol", "create", path], check=True)
  File "/usr/local/bin/mkosi", line 69, in run
    return subprocess.run(cmdline, **kwargs)
  File "/usr/lib/python3.7/subprocess.py", line 487, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['btrfs', 'subvol', 'create', '/var/lib/machines/.mkosi-12_4ti0t/root']' returned non-zero exit status 1.

Removing the incremental option makes the build successful.

I'm not sure whether the incremental feature is intended if using btrfs.

dud225 commented 4 years ago

Only gpt_ext4, gpt_xfs and gpt_btrfs are currently supported.