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

config/zfs-build.m4: add --with-vendor flag #10835

Merged
merged 1 commit into from
Aug 28, 2020

Conversation

gyakovlev
Copy link
Contributor

@gyakovlev gyakovlev commented Aug 27, 2020

Motivation and Context

This will allow to override autodetection of distribution, which
is based on checking presense of /etc/*-release files.

Build systems makes a lot of file location assumptions based on
detected distribution.

Some distributions (like gentoo) may prefer explicitly
setting --with-vendor=gentoo to avoid autodetection.

Since autodetection checks all files in order, current script may
misdetect even on gentoo system if /etc/redhat-release file is present

Default behavior is unchanged and default is --with-vendor=check

Description

here's resulting ./configure snippet this change generates

# Check whether --with-vendor was given.                                                                                                                                                                           
if test "${with_vendor+set}" = set; then :                                                                                                                                                                         
  withval=$with_vendor; with_vendor=$withval                                                                                                                                                                       
else                                                                                                                                                                                                               
  with_vendor=check                                                                                                                                                                                                
fi                                                                                                                                                                                                                                                                                                                                                                                                                       
        if test "x$with_vendor" = "xcheck"; then :                                                                                                                                                                 
                                                                                                                                                                                                                   
                if test -f /etc/toss-release ; then                                                                                                                                                                
                        VENDOR=toss ;                                                                                                                                                                              
                elif test -f /etc/fedora-release ; then                                                                                                                                                            
                        VENDOR=fedora ;                                                                                                                                                                            
                elif test -f /etc/redhat-release ; then                                                                                                                                                            
                        VENDOR=redhat ;                                                                                                                                                                            
                elif test -f /etc/gentoo-release ; then                                                                                                                                                            
                        VENDOR=gentoo ;                                                                                                                                                                            
                elif test -f /etc/arch-release ; then                                                                                                                                                              
                        VENDOR=arch ;                                                                                                                                                                              
                elif test -f /etc/SuSE-release ; then                                                                                                                                                              
                        VENDOR=sles ;                                                                                                                                                                              
                elif test -f /etc/slackware-version ; then                                                                                                                                                         
                        VENDOR=slackware ;                                                                                                                                                                         
                elif test -f /etc/lunar.release ; then                                                                                                                                                             
                        VENDOR=lunar ;                                                                                                                                                                             
                elif test -f /etc/lsb-release ; then                                                                                                                                                               
                        VENDOR=ubuntu ;                                                                                                                                                                            
                elif test -f /etc/debian_version ; then                                                                                                                                                            
                        VENDOR=debian ;                                                                                                                                                                            
                elif test -f /etc/alpine-release ; then                                                                                                                                                            
                        VENDOR=alpine ;                                                                                                                                                                            
                elif test -f /bin/freebsd-version ; then                                                                                                                                                           
                        VENDOR=freebsd ;                                                                                                                                                                           
                else                                                                                                                                                                                               
                        VENDOR= ;                                                                                                                                                                                  
                fi                                                                                                                                                                                                 
elif  test "x${with_vendor}" != x; then :                                                                                                                                                                                                                                                                                                                                                               
                        VENDOR="$with_vendor"                                                                                                                                                                      
else                                                                                                                                                                                                               
   VENDOR= ;                                                                                                                                                                                                       
                                                                                                                                                                                                                   
                                                                                                                                                                                                                   
fi 

How Has This Been Tested?

built with --with-config=user --with-vendor=VAL passing different VAL, both autodetection and explicit value work fine. Empty or undefined values handled as well.

formatting may need some work.

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.

this will allow to override autodetection of distribution, which
is based on checking presense of /etc/*-release files.

Build systems makes a lot of file location assumptions based on
detected distribution.

Some distributions (like gentoo) may prefer explicitly
setting --with-vendor=gentoo to avoid autodetection.

Since autodetection checks all files in order, current script may
misdetect even on gentoo system if /etc/redhat-release file is present

Default behavior is unchanged and default is --with-vendor=check

Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
@gyakovlev
Copy link
Contributor Author

just to clarify, we had couple of users who had both /etc/gentoo-release and /etc/redhat-release files present, redhat file was installed to satisfy some kind of closed-source software which expects this file. and as a side-effect it broke zfs builds, because files were placed into wrong directories (/etc/sysconfig instead of /etc/conf.d).

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Aug 27, 2020
@codecov
Copy link

codecov bot commented Aug 28, 2020

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10835      +/-   ##
==========================================
+ Coverage   79.64%   79.67%   +0.03%     
==========================================
  Files         395      395              
  Lines      125066   125066              
==========================================
+ Hits        99609    99649      +40     
+ Misses      25457    25417      -40     
Flag Coverage Δ
#kernel 80.44% <ø> (+0.04%) ⬆️
#user 65.64% <ø> (+0.90%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cmd/zdb/zdb_il.c 30.86% <0.00%> (-24.08%) ⬇️
cmd/zvol_id/zvol_id_main.c 76.31% <0.00%> (-5.27%) ⬇️
module/zstd/zfs_zstd.c 80.74% <0.00%> (-4.28%) ⬇️
module/zfs/vdev_raidz.c 89.11% <0.00%> (-4.25%) ⬇️
lib/libzfs/libzfs_changelist.c 85.01% <0.00%> (-1.13%) ⬇️
module/os/linux/zfs/vdev_disk.c 78.85% <0.00%> (-1.08%) ⬇️
module/zcommon/zfs_uio.c 87.75% <0.00%> (-1.03%) ⬇️
module/zfs/zio.c 87.50% <0.00%> (-0.97%) ⬇️
module/zfs/ddt.c 87.81% <0.00%> (-0.78%) ⬇️
module/icp/api/kcf_mac.c 38.28% <0.00%> (-0.58%) ⬇️
... and 56 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 770269e...4b73cc7. Read the comment docs.

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Aug 28, 2020
@behlendorf behlendorf merged commit 7ddcfe7 into openzfs:master Aug 28, 2020
@behlendorf behlendorf added this to Backport for OpenZFS 2.0 in OpenZFS 2.0 Aug 28, 2020
@gyakovlev gyakovlev deleted the explicit_vendor branch August 28, 2020 19:14
gentoo-bot pushed a commit to gentoo/gentoo that referenced this pull request Aug 28, 2020
Upstream PR: openzfs/zfs#10835
Bug: https://bugs.gentoo.org/712902
Bug: https://bugs.gentoo.org/739234
Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
NeddySeagoon pushed a commit to NeddySeagoon/gentoo-arm64 that referenced this pull request Aug 30, 2020
Upstream PR: openzfs/zfs#10835
Bug: https://bugs.gentoo.org/712902
Bug: https://bugs.gentoo.org/739234
Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
behlendorf pushed a commit that referenced this pull request Aug 30, 2020
This will allow an override of auto-detection of distribution, which
is based on checking presence of /etc/*-release files.

Build systems makes a lot of file location assumptions based on
detected distribution.

Some distributions (like gentoo) may prefer explicitly
setting --with-vendor=gentoo to avoid auto-detection.

Since auto-detection checks all files in order, current script may
misdetect even on gentoo system if /etc/redhat-release file is present

Default behavior is unchanged and default is --with-vendor=check

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Closes #10835
@behlendorf behlendorf moved this from Backport for OpenZFS 2.0 to FreeBSD Features (In Progress) in OpenZFS 2.0 Aug 30, 2020
@behlendorf behlendorf moved this from FreeBSD Features (In Progress) to Done in OpenZFS 2.0 Aug 30, 2020
gentoo-repo-qa-bot pushed a commit to gentoo-mirror/linux-be that referenced this pull request Jan 12, 2021
Upstream PR: openzfs/zfs#10835
Bug: https://bugs.gentoo.org/712902
Bug: https://bugs.gentoo.org/739234
Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
jsai20 pushed a commit to jsai20/zfs that referenced this pull request Mar 30, 2021
This will allow an override of auto-detection of distribution, which
is based on checking presence of /etc/*-release files.

Build systems makes a lot of file location assumptions based on
detected distribution.

Some distributions (like gentoo) may prefer explicitly
setting --with-vendor=gentoo to avoid auto-detection.

Since auto-detection checks all files in order, current script may
misdetect even on gentoo system if /etc/redhat-release file is present

Default behavior is unchanged and default is --with-vendor=check

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Closes openzfs#10835
sempervictus pushed a commit to sempervictus/zfs that referenced this pull request May 31, 2021
This will allow an override of auto-detection of distribution, which
is based on checking presence of /etc/*-release files.

Build systems makes a lot of file location assumptions based on
detected distribution.

Some distributions (like gentoo) may prefer explicitly
setting --with-vendor=gentoo to avoid auto-detection.

Since auto-detection checks all files in order, current script may
misdetect even on gentoo system if /etc/redhat-release file is present

Default behavior is unchanged and default is --with-vendor=check

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Closes openzfs#10835
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
No open projects
OpenZFS 2.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants