• [gentoo-dev] Subject: [PATCH] kernel-2.eclass: Remove < 2.6 support

    From Alice@21:1/5 to Mike Pagano on Wed Sep 8 19:40:02 2021
    To: mpagano@gentoo.org (Mike Pagano)

    This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Undfi01cNHzqpYTSmIvGNcap5GaboJJLT
    Content-Type: multipart/mixed;
    boundary="------------20622A159EC4DB4C1FB7DF6C"
    Content-Language: en-US

    This is a multi-part message in MIME format. --------------20622A159EC4DB4C1FB7DF6C
    Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable

    On 9/9/21 2:20 AM, Mike Pagano wrote:
    kernel-2.eclass: Remove < 2.6 support for kernel headers

    The functionality removed is only to support kernels
    < 2.6  These kernels have long been removed from the tree

    Detail:
    Remove the function compile_headers as it is not called
    for kernels > 2.6.18 because that's when the build target
    headers_install was introduced.
    Remove supporting function compile_headers_tweak_config.
    Additionally, remove 2.6 support from install_headers.

    Signed-off-by: Mike Pagano <mpagano@gentoo.org>
    ---
     eclass/kernel-2.eclass | 112 ++---------------------------------------
     1 file changed, 5 insertions(+), 107 deletions(-)

    diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
    index ef70e250c..983ba9169 100644
    --- a/eclass/kernel-2.eclass
    +++ b/eclass/kernel-2.eclass
    @@ -759,83 +759,6 @@ unpack_fix_install_path() {
         sed -i -e 's:#export\tINSTALL_PATH:export\tINSTALL_PATH:' "${S}"/Makefile || die
     }

    -# Compile Functions
    -
    -# @FUNCTION: compile_headers
    -# @USAGE:
    -# @DESCRIPTION:
    -# header compilation
    -
    -compile_headers() {
    -    env_setup_xmakeopts
    -
    -    # if we couldnt obtain HOSTCFLAGS from the Makefile,
    -    # then set it to something sane
    -    local HOSTCFLAGS=$(getfilevar HOSTCFLAGS "${S}"/Makefile)
    -    HOSTCFLAGS=${HOSTCFLAGS:--Wall -Wstrict-prototypes -O2 -fomit-frame-pointer}
    -
    -    if kernel_is 2 4; then
    -        yes "" | make oldconfig ${xmakeopts}
    -        einfo ">>> make oldconfig complete"
    -        make dep ${xmakeopts}
    -    elif kernel_is 2 6; then
    -        # 2.6.18 introduces headers_install which means we dont need any
    -        # of this crap anymore :D
    -        kernel_is ge 2 6 18 && return 0
    -
    -        # autoconf.h isnt generated unless it already exists. plus, we
    have
    -        # no guarantee that any headers are installed on the system...
    -        [[ -f ${EROOT%/}/usr/include/linux/autoconf.h ]] \ -            || touch include/linux/autoconf.h || die
    -
    -        # if K_DEFCONFIG isn't set, force to "defconfig" -        # needed by mips
    -        if [[ -z ${K_DEFCONFIG} ]]; then
    -            if kernel_is ge 2 6 16; then -                case ${CTARGET} in -                    powerpc64*)    K_DEFCONFIG="ppc64_defconfig";;
    -                    powerpc*)    K_DEFCONFIG="pmac32_defconfig";;
    -                    *)        K_DEFCONFIG="defconfig";;
    -                esac
    -            else
    -                K_DEFCONFIG="defconfig" -            fi
    -        fi
    -
    -        # if there arent any installed headers, then there also isnt an
    asm
    -        # symlink in /usr/include/, and make defconfig will fail, so we
    have
    -        # to force an include path with $S.
    -        HOSTCFLAGS="${HOSTCFLAGS} -I${S}/include/"
    -        ln -sf asm-${KARCH} "${S}"/include/asm || die
    -        cross_pre_c_headers && return 0
    -
    -        make ${K_DEFCONFIG} HOSTCFLAGS="${HOSTCFLAGS}" ${xmakeopts} ||
    die "defconfig failed (${K_DEFCONFIG})"
    -        if compile_headers_tweak_config; then
    -            yes "" | make oldconfig HOSTCFLAGS="${HOSTCFLAGS}" ${xmakeopts} || die "2nd oldconfig failed"
    -        fi
    -        make prepare HOSTCFLAGS="${HOSTCFLAGS}" ${xmakeopts} || die "prepare failed"
    -        make prepare-all HOSTCFLAGS="${HOSTCFLAGS}" ${xmakeopts} || die
    "prepare failed"
    -    fi
    -}
    -
    -# @FUNCTION: compile_headers_tweak_config
    -# @USAGE:
    -# @DESCRIPTION:
    -# some targets can be very very picky, so let's finesse the
    -# .config based upon any info we may have
    -
    -compile_headers_tweak_config() {
    -    case ${CTARGET} in
    -    sh*)
    -        sed -i '/CONFIG_CPU_SH/d' .config || die
    -        echo "CONFIG_CPU_SH${CTARGET:2:1}=y" >> .config -        return 0;;
    -    esac
    -
    -    # no changes, so lets do nothing
    -    return 1
    -}
    -
     # install functions

     # @FUNCTION: install_universal
    @@ -856,36 +779,12 @@ install_universal() {
     install_headers() {
         local ddir=$(kernel_header_destdir)

    -    # 2.6.18 introduces headers_install which means we dont need any -    # of this crap anymore :D
    -    if kernel_is ge 2 6 18; then
    -        env_setup_xmakeopts
    -        emake headers_install INSTALL_HDR_PATH="${ED%/}"${ddir}/.. ${xmakeopts}
    -
    -        # let other packages install some of these headers -        rm -rf "${ED%/}"${ddir}/scsi || die #glibc/uclibc/etc... -        return 0
    -    fi
    -
    -    # Do not use "linux/*" as that can cause problems with very long -    # $S values where the cmdline to cp is too long
    -    pushd "${S}" >/dev/null || die
    -    dodir ${ddir}/linux
    -    cp -pPR "${S}"/include/linux "${ED%/}"${ddir}/ || die
    -    rm -rf "${ED%/}"${ddir}/linux/modules || die
    -
    -    dodir ${ddir}/asm
    -    cp -pPR "${S}"/include/asm/* "${ED%/}"${ddir}/asm || die
    -
    -    if kernel_is 2 6; then
    -        dodir ${ddir}/asm-generic
    -        cp -pPR "${S}"/include/asm-generic/* "${ED%/}"${ddir}/asm-generic || die
    -    fi
    -
    -    # clean up
    -    find "${D}" -name '*.orig' -exec rm -f {} \; || die
    +    env_setup_xmakeopts
    +    emake headers_install INSTALL_HDR_PATH="${ED%/}"${ddir}/.. ${xmakeopts}

    -    popd >/dev/null || die
    +    # let other packages install some of these headers
    +    rm -rf "${ED%/}"${ddir}/scsi || die #glibc/uclibc/etc...
    +    return 0
     }

     # @FUNCTION: install_sources
    @@ -1479,7 +1378,6 @@ kernel-2_src_prepare() {

     kernel-2_src_compile() {
         cd "${S}" || die
    -    [[ ${ETYPE} == headers ]] && compile_headers

         if [[ ${K_DEBLOB_AVAILABLE} == 1 ]] && use deblob; then
             einfo ">>> Running deblob script ..."


    Thanks! looks good to me


    --
    Thanks,
    Alicef

    --------------20622A159EC4DB4C1FB7DF6C
    Content-Type: application/pgp-keys;
    name="OpenPGP_0x1D6802D75C10FEF6.asc"
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment;
    filename="OpenPGP_0x1D6802D75C10FEF6.asc"


    --------------20622A159EC4DB4C1FB7DF6C--

    --Undfi01cNHzqpYTSmIvGNcap5GaboJJLT--

    -----BEGIN PGP SIGNATURE-----

    iQIzBAEBCAAdFiEEKxPnsvZf+7NCDYpgQq+TvR6UnvMFAmE483cACgkQQq+TvR6U nvPW7A/7Bg1/7PQbTOCpdgxiWQicUfEf7SgegdkLF8w1Z4WmaQDqF/IQlF8BHGJq U+uS92M+0o0UyvO4c8I5cOmZMT14DqGSpzeGwakVtDcSOzPleI/MH6dWGb04/kUt muHdKjCegpefAUumO3D2LxbhUBuKzSP+6CunwCVhsTvYENICh5dzji352Mv1Ta4/ vp7C5pbIdBqbEepHYdNIpX28ikFBxVWJt2IjC/gCxRjwC7ViTqDOG0jMrWpa8pC3 f/wcNFJwD3EeBhCt1cgDlARpn20aWUs4eyMiBPjWz1jGxJBhk8AkXMT2LJqnUABu LO/7KoqWBOE+WzP359lAXHn4Aod/wrwwlGNC9WHpaO2u1d0/jUweB99G7J1ldxL9 jbl70MXKFkX/QrsqlQO6ZaVY4JEvwAGMzFoIKc/YRQzZq7CmXSpilsjIt086Wi7+ DCMBBOkVyxNmBABRZUOmdehIIf7mvFX2tMmHBTDeVOTN0YpXrnLtSZbyvuxggfPd St2ZSJJV/brVtl95Tqlw7RAL3f5v6sg7Q/yJzAv7ievWegVGG+DnKP