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

Set default _initconfdir directory #3617

Closed
wants to merge 1 commit into from

Conversation

behlendorf
Copy link
Contributor

The _initconfdir macro is normally provided by global rpm macros
file for use in the spec file. However, older distributions such
as CentOS 6 do not define it. To prevent a build failure in this
case the spec file has been updated to use a reasonable default
when the value is undefined.

Signed-off-by: Brian Behlendorf behlendorf1@llnl.gov

The _initconfdir macro is normally provided by global rpm macros
file for use in the spec file.  However, older distributions such
as CentOS 6 do not define it.  To prevent a build failure in this
case the spec file has been updated to use a reasonable default
when the value is undefined.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
@behlendorf behlendorf added this to the 0.6.5 milestone Jul 20, 2015
@FransUrbo
Copy link
Contributor

The _initconfdir macro is normally provided by global rpm macros
file for use in the spec file.

Actually, it's set in "config/zfs-build.m4":

RPM_DEFINE_UTIL='--define "_dracutdir $(dracutdir)" --define "_udevdir $(udevdir)" --define "_udevruledir $(udevruledir)" --define "_initconfdir $(DEFAULT_INITCONF_DIR)" $(DEFINE_INITRAMFS)'

The DEFAULT_INITCONF_DIR is set in the same file further down:

        case "$VENDOR" in
                gentoo)     DEFAULT_INITCONF_DIR=/etc/conf.d    ;;
                toss)       DEFAULT_INITCONF_DIR=/etc/sysconfig ;;
                redhat)     DEFAULT_INITCONF_DIR=/etc/sysconfig ;;
                fedora)     DEFAULT_INITCONF_DIR=/etc/sysconfig ;;
                sles)       DEFAULT_INITCONF_DIR=/etc/sysconfig ;;
                ubuntu)     DEFAULT_INITCONF_DIR=/etc/default   ;;
                debian)     DEFAULT_INITCONF_DIR=/etc/default   ;;
                *)          DEFAULT_INITCONF_DIR=/etc/default   ;;
        esac
        AC_MSG_RESULT([$DEFAULT_INITCONF_DIR])
        AC_SUBST(DEFAULT_INITCONF_DIR)

And $VENDOR, again in the same file:

        AC_MSG_CHECKING([linux distribution])
        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 ;
        else
                VENDOR= ;
        fi
        AC_MSG_RESULT([$VENDOR])
        AC_SUBST(VENDOR)

the spec file has been updated to use a reasonable default when the value is undefined.

Considering the above, the correct fix would be to figure out the VENDOR for [that] older dist...

@behlendorf
Copy link
Contributor Author

@FransUrbo yes that's true, I should have been clearer in the commit message.

The issue I ran in to was that it is not possible to rebuild the source rpm without explicitly defining _initconfdir when building on CentOS 6. You must pass in some value either through the ZFS build system or manually. Doing the following fails and it should succeed.

rpmbuild --rebuild zfs-x.y.z.src.rpm

Sane defaults should be provided either by the macros file installed on the target build platform or in the spec file itself (which is what this adds). This patch only sets the value when it's otherwise undefined so the logic in config/zfs-build.m4 still works as designed.

kernelOfTruth pushed a commit to kernelOfTruth/zfs that referenced this pull request Jul 23, 2015
The _initconfdir macro is normally provided by global rpm macros
file for use in the spec file.  However, older distributions such
as CentOS 6 do not define it.  To prevent a build failure in this
case the spec file has been updated to use a reasonable default
when the value is undefined.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#3617
janlam7 pushed a commit to janlam7/zfs that referenced this pull request Jul 25, 2015
The _initconfdir macro is normally provided by global rpm macros
file for use in the spec file.  However, older distributions such
as CentOS 6 do not define it.  To prevent a build failure in this
case the spec file has been updated to use a reasonable default
when the value is undefined.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#3617
@behlendorf behlendorf deleted the initconfdir branch April 19, 2021 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants