openzfs-docs icon indicating copy to clipboard operation
openzfs-docs copied to clipboard

[openzfs/zfs#14611] Fix missing install from source steps.

Open aamkye opened this issue 3 years ago • 14 comments

I was missing this info, so I'm glad to provide them :) Please let me know if certain information is missing.

aamkye avatar Mar 16 '23 17:03 aamkye

This "tutorial" is based on my PoC and HomeLab installation via Ansible tested on ubuntu server 22.10.

aamkye avatar Mar 16 '23 17:03 aamkye

Will need to update docs according to #396

aamkye avatar Mar 18 '23 09:03 aamkye

Why don't we just add part about services (and other small nits) into Building ZFS.rst as additional section? Looks like a duplicate otherwise, we already have 2 instructions about building from source.

gmelikov avatar Mar 18 '23 11:03 gmelikov

So maybe we should merge them into one covering all details?

aamkye avatar Mar 19 '23 12:03 aamkye

@gmelikov I'll prepare something (merged doc) according to the docs and my knowledge.

aamkye avatar Mar 22 '23 00:03 aamkye

@aamkye yes, I've meant that we may just add needed things to existing page.

Side note - while it may be handy, I don't think it would be great to add parts about ansible. We may describe ansible somewhere else and add a link to it (maybe whole playbook example as yaml file? But we'll need to maintain it).

gmelikov avatar Mar 22 '23 18:03 gmelikov

Valid point Sir! So let's stick to bash commands and bash commands only in this repo :)

aamkye avatar Mar 22 '23 18:03 aamkye

Just to be on the same page, we already have:

  • https://openzfs.github.io/openzfs-docs/Developer%20Resources/Custom%20Packages.html
  • https://openzfs.github.io/openzfs-docs/Developer%20Resources/Building%20ZFS.html

I think the best place is https://openzfs.github.io/openzfs-docs/Developer%20Resources/Custom%20Packages.html , because the point is to get working custom packages, not just build modules.

gmelikov avatar Mar 22 '23 19:03 gmelikov

@gmelikov I've also found that besides missing services there are also a missing cron jobs: scrub and trim and scripts:

  • /usr/lib/zfs-linux/trim
  • /usr/lib/zfs-linux/scrub

I think it also should be part of the documentation, shouldn't it?

aamkye avatar Mar 24 '23 10:03 aamkye

@aamkye in fact, there are 2 types of packages in any project:

  • produced by project itself - they are usually don't integrate in every aspect of specific distro
  • produced by distro's package maintainers - these packages may have additional integrations and patches

So, we may describe explicitly about such difference, and that our documentation speaks about first type. That mean is that (for example in Debian) if you want to get 100% identical package to original distro's one - you need to rebuild from distro's source package, not project's one.

If project's package misses something - we may discuss to add missing parts in our packages.

So, any of additions in docs may describe just notes about which functionality may be added, but we should now describe them as "must haves" (because in this case we should add them into packages, not into documentation).

You may be interested to read this thread with Debian's package maintainer https://github.com/openzfs/zfs/pull/13451

gmelikov avatar Mar 24 '23 11:03 gmelikov

@gmelikov, I was investigating the deb package from ubuntu (apt download zfsutils-linux + dpkg-deb -R zfsutils-linux_2.1.5-1ubuntu6_amd64.deb) against what we have in openzfs/zfs/etc/systemd/system, and it differs, What is more, services and crons are handled a bit different. In our package we are not using crontab but we use systemd timers:

user@server:~$ systemctl cat zfs [tab]
zfs-import-cache.service  zfs-load-key.service      [email protected]   zfs-volume-wait.service
zfs-import-scan.service   zfs-mount.service         zfs-share.service         zfs-zed.service
zfs-import.service        [email protected]  zfs.target
zfs-import.target         [email protected]        zfs-volumes.target

And if fact those services and timers are present in the system. Going further, on the ./autogen.sh and ./configure scripts there is a dependency to the 50-zfs.preset which theoretically should enable those services by default but apparently they are not.

Right now I'm trying to determine a common sense, but any clarification would be helpful in favor of future documentation.

Another issue is the fact that native-deb is not working on master, but I assume it will be on ZFS 2.2 release.

aamkye avatar Mar 28 '23 14:03 aamkye

Yep, that's exactly what I'm talking about - every Linux distribution may have it's own package with differences and patches. We even can't describe uniform deb info because Ubuntu, Debian and Proxmox all have their own packages.

gmelikov avatar Mar 30 '23 10:03 gmelikov

So maybe as a ZFS community, we could gather people from different distros and prepare a repository to prepare such packaging for each distribution containing guidelines, tutorials, and scripts to do so not only for the ZFS project but for more. Because it seems I've entered a rabbit hole and it goes waaaaay deeper than I thought.

aamkye avatar Mar 30 '23 10:03 aamkye

It's true that we may gather good and universal parts together in our original packages, but it's normal for major distribution to have alterations in packages.

I can add even more - Debian maintainers want to use their own packages even after native debs were pulled into our master (it's ok to track package build parts separately from upstream project).

So, we can highlight these things in documentation:

  • if someone wants to rebuild package for distributive with their own package - then someone should get source packages from that distributive
  • otherwise, we provide our own packages with minor differences (so here are the docs for them), which should be good for experienced users

gmelikov avatar Mar 31 '23 09:03 gmelikov