rpm-software-management / dnf

Package manager based on libdnf and libsolv. Replaces YUM.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Please add bootstrap sysroot to DNF Use Cases doc

jaxvanyang opened this issue · comments

Hi, I'm new to Fedora, while reading the doc, I found:

In case you use DNF to achieve a goal which is not documented here, either you found an error in the documentation or you misuse DNF. In either case we would appreciate if you share the case with us so we can help you to use DNF in the correct way or add the case to the list.

So I'm sharing my use case here: bootstrap sysroot for building bootable image and cross compilation. I'm using mmdebstrap/bdebstrap for this use case of Debian/Ubuntu. Things are really easy with these tools. I did some search for similar tool in the Fedora world but no such package manager wrapper found. Anyway, I finally found DNF can do this thing. I wonder if it's a common use case of DNF. If it is, it should be documented. And I want to know the appropriate way of doing this.

I use something like this to create a minimal sysroot:

# chroot/ must has valid repo configs
dnf -y --forcearch=riscv64 --installroot=chroot install '@core'
# I have to disable the default repos as no riscv64 available
chroot chroot dnf config-manager --set-disabled rawhide updates \
  updates-testing fedora fedora-modular fedora-cisco-openh264 \
  updates-modular updates-testing-modular rawhide-modular

I also found some koji and virt-builder stuff for building image, but didn't read too much as I also want a simple chroot. So if DNF is suitable for bootstraping sysroot, could you please document it with some same-arch & cross-arch examples? Thanks.

Some reference links:

Hi, before I'd start diving further into your description, I've stopped at the following point:

I did some search for similar tool in the Fedora world but no such package manager wrapper found.

I've noticed the "bootstrap" and "Fedora" keywords and it immediately brought Mock to my mind. Have you considered it?

I've noticed the "bootstrap" and "Fedora" keywords and it immediately brought Mock to my mind. Have you considered it?

Thanks, I didn't find that in my search result before. Feature bootstrap | Mock looks like what I need. I'll try that. So people seldom use DNF for bootstraping sysroot? If so, this issue can be closed.

Hmm, upon further consideration and research, I agree that this is indeed not an unusual use case, and there should be improved documentation for it. Given our primary focus on the development of DNF5 now, and considering the relevance of this use case, it makes sense to include some examples in the DNF5 documentation. This can then be reused for DNF as well.

That would be great. I have tried Mock, but it is specific for building packages and not very configurable for bootstraping. Haven't get it work for bootstraping RISC-V chroot. It is also just a wrapper of DNF, so I'll continue to use my own script for these things. But Mock's way of bootstraping is a good reference. Thanks for your information again.