Bug 219912 - emulators/linux_base-c6: lacks a package manager
Summary: emulators/linux_base-c6: lacks a package manager
Status: Closed Feedback Timeout
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-emulation (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-10 16:24 UTC by John Smith
Modified: 2018-08-21 22:01 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (emulation)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Smith 2017-06-10 16:24:27 UTC
There should be a package manager preinstalled with this port.

The documentation doesn't give a slightest hint on how to install one and whether it is a correct way to operate with packets installed onto linux inside FreeBSD.

Do you, by any chance, know if 'yum' port in FreeBSD ports will work with linux installed by this port?
Comment 1 Johannes Jost Meixner freebsd_committer freebsd_triage 2017-06-15 08:42:28 UTC
This is intentional. Using yum you have no guarantee over what's installed to /compat/linux (FreeBSD does not use yum) and would not be able to use pkg to cleanly delete packages.

If you have a need for a particular package you should file a PR for this.
Comment 2 John Smith 2017-06-15 09:22:27 UTC
> Using yum you have no guarantee over what's installed to /compat/linux (FreeBSD does not use yum)

Could you expand on this?
IMO, it's yum's job to guarantee what's getting installed into /compat/linux (if it works properly on FreeBSD's linuxulator). Does it fail to guarantee that?

Or did you mean that if I install something using yum - pkg will not know about that (IMO, that'd be absolutely logical and absolutely acceptable).


> If you have a need for a particular package you should file a PR for this.

So linux packages should get installed like all other ones? using pkg (or building from ports)?
If so - then the pkg/ports repository now has a lot of linux packets, right?
Then how to distinguish them from FreeBSD packets? Is there some naming convention maybe?


I might be asking very newbie questions, but man page of linux_base-c6 doesn't cover that and folks on the IRC channel were not absolutely sure of how the system works.
If there's either some FAQ/wiki somewhere - please link it, otherwise - please, describe all that stuff in a man page.
Comment 3 Johannes Jost Meixner freebsd_committer freebsd_triage 2017-06-15 10:44:28 UTC
So, currently the way to install stuff into /compat/linux is using the readily available linux-c6- / linux-c7- modules. They're handled by pkg and libarchive: We take the rpm, extract it, install things to [port]/work/stage/compat/linux, hash files, package it, ship it as .txz.

Now the obvious problem with the status quo is that at no point does it involve yum, so any yum database would have *no idea* which base packages are installed. 

So if we shipped yum with linux_base-[c6/c7/whatever] this'd require:
1. integration of yum and pkg to a degree that doesn't exist nor is currently planned on the pkg side [afair]
2. a rework of the current linux infrastructure to use pkg-yum glue instead of libarchive.

That aside, some documentation can be found in the handbook:

https://www.freebsd.org/doc/handbook/linuxemu.html#linuxemu-synopsis

And we do have metapackages "linux-c6" / "linux-c7" that will pull in any possible linux package that is available, and (most likely) contains what you're looking for.
Comment 4 John Smith 2017-06-15 20:29:08 UTC
(In reply to Johannes Jost Meixner from comment #3)
> currently the way to install stuff into /compat/linux is using the readily available linux-c6- / linux-c7- modules.
> Now the obvious problem with the status quo is that at no point does it involve yum, so any yum database would have *no idea* which base packages are installed.

What if I don't install any linux packages using linux-c6-* pkgs but instead use ONLY yum to manage linux packets? Wouldn't that solve all the problems?
Comment 5 Johannes Jost Meixner freebsd_committer freebsd_triage 2017-06-16 07:47:24 UTC
(In reply to John Smith from comment #4)
In a sense.

For you it'd solve the issue, with the side effect that yum won't apply patches/fixes we've collected over the years to guarantee that things actually work.

Individually we'd have no way of centrally shipping any linux packages, and would rely exclusively on documentation.
Comment 6 Piotr Kubaj freebsd_committer freebsd_triage 2017-06-16 13:17:45 UTC
(In reply to John Smith from comment #4)
The problem is that pkg manages all the packages, including the linux ones. Installing linux compatibility layer base port means putting stuff into /compat/linux.

Adding more stuff with yum means that pkg won't know about this. You're going to have problems when removing the compatibility layer, since pkg will get confused about leftover files in /compat/linux.

When you also install some ports which will require dependencies from ports, there's a possibility there will be a file conflict - binaries installed with yum will conflict with the ones from ports.

All in all, doing what you say would require deorbiting linux compatibility layer from ports and managing it only by yum. That will require some work, which is currently deemed unnecessary.
Comment 7 Piotr Kubaj freebsd_committer freebsd_triage 2017-06-16 13:20:24 UTC
Adding to what I wrote, you would need to invent another way of managing linux compatibility layer, like some script to install it, and another one to remove it. Of course, you're free to do it, just install CentOS in a chroot to /compat/linux and there install yum. You don't have to do it with the ports way, but don't complain when something doesn't work.