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

support mmdebstrap's --format option #4

Closed
Infinoid opened this issue Nov 5, 2022 · 5 comments
Closed

support mmdebstrap's --format option #4

Infinoid opened this issue Nov 5, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@Infinoid
Copy link

Infinoid commented Nov 5, 2022

Hi,

I like the idea of bdebstrap, so I tried it out today. However, it doesn't seem to capture my usage of mmdebstrap.

I tried to put my mmdebstrap parameters into a yaml format and run it with bdebstrap, and found that the --format parameter is not supported as a yaml key. I tried this input:

---
mmdebstrap:
  architectures:
    - arm64
  suite: bookworm
  target: tmp/root.ext2
  format: ext2
  variant: minbase
  mode: unshare
  packages:
    - openssh-server
    - netplan.io
    - libpam-systemd

And I got this output:

2022-11-05 14:29:14,223 bdebstrap WARNING: Ignoring unknown mmdebstrap option 'format'.

The parameter exists, and it works when I run mmdebstrap directly. Here's the mmdebstrap documentation. Is it possible for bdebstrap to pass it through somehow?

I was expecting it to run something similar to this:

mmdebstrap --architectures=arm64 --variant=minbase --format=ext2 --mode=unshare --include=openssh-server,netplan.io,libpam-systemd bookworm tmp/root.ext2

Thanks!

@Infinoid
Copy link
Author

Infinoid commented Nov 5, 2022

For context, the reason I wanted to specify the format was because my goal was ext4, not ext2.

When I run mmdebstrap, I have it create an ext2 file named root.ext4, and then upgrade it to ext4 with tune2fs as described in the mmdebstrap docs.

That filename doesn't end in ".ext2", so it only works when specifying the format manually.

Also, that tune2fs command would work nicely as a post-imaging hook, if such things existed. (cleanup-hooks won't work, as those run prior to the tempdir being packed into a squashfs/ext2 image.)

@bdrung bdrung added the bug Something isn't working label Nov 5, 2022
bdrung added a commit that referenced this issue Nov 6, 2022
@bdrung
Copy link
Owner

bdrung commented Nov 6, 2022

Thanks for reporting this bug. I have pushed a fix in the format branch. Please test.

Sadly the getext2fs does not support extended attributes (see bestouff/genext2fs#9).

Have you filed a bug for mmdebstrap to add a post-imaging hook?

@Infinoid
Copy link
Author

Infinoid commented Nov 6, 2022

Have you filed a bug for mmdebstrap to add a post-imaging hook?

No. I was just thinking out loud.

I'm not even sure it would be within the scope of mmdebstrap. It's easy enough to put it in a script that runs after mmdebstrap/bdebstrap finishes, after all.

@Infinoid
Copy link
Author

Infinoid commented Nov 6, 2022

Thanks for reporting this bug. I have pushed a fix in the format branch. Please test.

I tested the format branch, and it worked as expected. I updated my config to say:

  format: ext2
  target: rootfs

Then ran: ./bdebstrap -c conf/test.yaml -n build/rootfs

and the result worked perfectly.

% ls -l build/rootfs
total 413896
-rw-r--r-- 1 infinoid infinoid      1217 Nov  5 21:35 config.yaml
-rw-r--r-- 1 infinoid infinoid      3621 Nov  5 21:35 manifest
-rw-r--r-- 1 infinoid infinoid 463244288 Nov  5 21:35 rootfs
% file build/rootfs/rootfs
build/rootfs/rootfs: Linux rev 1.0 ext2 filesystem data, UUID=00000000-0000-0000-0000-000000000000

Thanks for the quick fix!

bdrung added a commit that referenced this issue Nov 10, 2022
@bdrung
Copy link
Owner

bdrung commented Nov 10, 2022

Merged the fix to main and released bdebstrap 0.5.0.

@bdrung bdrung closed this as completed Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants