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

Fix zfs-functions packaging bug #9959

Closed
wants to merge 1 commit into from

Conversation

tonyhutter
Copy link
Contributor

Motivation and Context

Fixes: #9443

Description

This fixes a bug where the generated zfs-functions was being included along with original zfs-functions.in in the make dist tarball. This caused an unfortunate series of events during build/packaging that resulted in the RPM-installed /etc/zfs/zfs-functions listing the paths as:

ZFS="/usr/local/sbin/zfs"
ZED="/usr/local/sbin/zed"
ZPOOL="/usr/local/sbin/zpool"

When they should have been:

ZFS="/sbin/zfs"
ZED="/sbin/zed"
ZPOOL="/sbin/zpool"

This affects init.d (non-systemd) distros like CentOS 6.

How Has This Been Tested?

Manually tested on Centos 6 against the zfs-0.8-release branch, since master no longer supports Centos 6. Verified that /etc/zfs/zfs-functions in the zfs rpm had the right paths.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to man pages or other documentation)

Checklist:

  • My code follows the ZFS on Linux code style requirements.
  • I have updated the documentation accordingly.
  • I have read the contributing document.
  • I have added tests to cover my changes.
  • I have run the ZFS Test Suite with this change applied.
  • All commit messages are properly formatted and contain Signed-off-by.

@gyakovlev
Copy link
Contributor

gyakovlev commented Feb 7, 2020

if applied to 0.8.3 on gentoo (we have a LOT of non-systemd users so we caught this very early) still produces faulty zfs-functions with /usr/local path component.

full configure line

./configure --prefix=/usr --build=powerpc64le-unknown-linux-gnu --host=powerpc64le-unknown-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking --disable-silent-rules --docdir=/usr/share/doc/zfs-0.8.3 --htmldir=/usr/share/doc/zfs-0.8.3/html --libdir=/usr/lib64 --bindir=/bin --enable-shared --enable-systemd --enable-sysvinit --localstatedir=/var --sbindir=/sbin --with-config=user --with-dracutdir=/usr/lib/dracut --with-linux= --with-linux-obj= --with-udevdir=/lib/udev --with-python=python3.6 --with-systemdunitdir=/lib/systemd/system --with-systemdpresetdir=/lib/systemd/system-preset --disable-debug --enable-pyzfs --disable-static

the other patch from PR #9955 does not apply cleanly, I'll rebase and test it now.

@gyakovlev
Copy link
Contributor

nvm comment above, I just had to delete those files before build to get proper files generated.
sorry for confusion, patch clearly works.

This fixes a bug where the generated zfs-functions was being included
along with original zfs-functions.in in the make dist tarball.  This
caused an unfortunate series of events during build/packaging that
resulted in the RPM-installed /etc/zfs/zfs-functions listing the
paths as:

ZFS="/usr/local/sbin/zfs"
ZED="/usr/local/sbin/zed"
ZPOOL="/usr/local/sbin/zpool"

When they should have been:

ZFS="/sbin/zfs"
ZED="/sbin/zed"
ZPOOL="/sbin/zpool"

This affects init.d (non-systemd) distros like CentOS 6.

Fixes: openzfs#9443

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
$(top_srcdir)/contrib/initramfs/conf.d/zfs \
$(top_srcdir)/contrib/initramfs/conf-hooks.d/zfs \
$(top_srcdir)/contrib/initramfs/README.initramfs.markdown

$(top_srcdir)/etc/init.d/zfs $(top_srcdir)/etc/init.d/zfs-functions:
$(MAKE) -C $(top_srcdir)/etc/init.d zfs zfs-functions

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should probably remove one of these blank lines.

@rlaager
Copy link
Member

rlaager commented Feb 8, 2020

I rebased #9955 on this change, with the changes from my review comments addressed. If you are happy with those changes, we have a few options:

  1. Merge Fix makefiles' zfs-functions #9955 as it stands.
  2. Apply those corrections here, I rebase Fix makefiles' zfs-functions #9955 on that, then we merge Fix makefiles' zfs-functions #9955.
  3. Apply those corrections here and merge this. Then I can rebase Fix makefiles' zfs-functions #9955 on that for the other two changes.

I'm guessing we would go with option 3.

@codecov
Copy link

codecov bot commented Feb 8, 2020

Codecov Report

Merging #9959 into master will increase coverage by 0.09%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9959      +/-   ##
==========================================
+ Coverage   79.23%   79.32%   +0.09%     
==========================================
  Files         385      385              
  Lines      121938   121938              
==========================================
+ Hits        96612    96723     +111     
+ Misses      25326    25215     -111     
Flag Coverage Δ
#kernel 79.60% <ø> (-0.03%) ⬇️
#user 66.95% <ø> (+0.46%) ⬆️
Impacted Files Coverage Δ
module/os/linux/spl/spl-kmem-cache.c 75.81% <0.00%> (-9.46%) ⬇️
module/zfs/zil.c 91.33% <0.00%> (-2.43%) ⬇️
module/zfs/spa_log_spacemap.c 93.40% <0.00%> (-1.15%) ⬇️
module/zfs/zfs_rlock.c 95.95% <0.00%> (-0.41%) ⬇️
cmd/zpool/zpool_iter.c 86.69% <0.00%> (-0.36%) ⬇️
module/zfs/dsl_dataset.c 92.53% <0.00%> (-0.34%) ⬇️
module/zfs/vdev_indirect.c 75.00% <0.00%> (-0.34%) ⬇️
module/zfs/metaslab.c 95.82% <0.00%> (-0.33%) ⬇️
cmd/zpool/zpool_main.c 80.45% <0.00%> (-0.28%) ⬇️
module/zfs/btree.c 83.48% <0.00%> (-0.24%) ⬇️
... and 36 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 818d4a8...2cc089a. Read the comment docs.

@tonyhutter
Copy link
Contributor Author

@rlaager actually I'm pretty happy with what you have in #9955, so I'm going to close this in favor of your PR.

@tonyhutter
Copy link
Contributor Author

Closing in favor of #9955

@tonyhutter tonyhutter closed this Feb 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Code Review Needed Ready for review and testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0.8.3: Wrong paths in zfs-functions script
4 participants