• [gentoo-dev] [PATCH 0/4] dist-kernel: Improved kernel version logic, ta

    From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Wed Oct 26 13:40:01 2022
    Hi,

    The previous attempt to improve version handling in dist-kernel eclasses
    turned out not to work for live ebuilds. Let's try a different approach
    that:

    1) uses ${PV}${KV_LOCALVERSION} for /usr/src/linux-* directory
    (i.e. "6.0_rc1-gentoo-dist" or "5.15.9999-dist") because it's
    the simplest approach

    2) grabs the version from the "release" file for /lib/modules directory
    (i.e. "6.0.0-rc1-gentoo-dist" or "5.15.74-dist") because that should
    easily handle all the corner cases, including live ebuilds and custom
    configs

    3) uses the transformed version for the pkg_preinst() version check
    in non-live ebuilds because that should be good enough to verify
    that we did not fail to bump genpatches version


    Michał Górny (4):
    kernel-build.eclass: Revert "Respect KV_FULL"
    kernel-install.eclass: Revert "Add KV_FULL [...]"
    kernel-install.eclass: Account for PV/KV mismatch
    kernel-build.eclass: Account for PV/KV mismatch

    eclass/kernel-build.eclass | 45 ++++++++++-------
    eclass/kernel-install.eclass | 93 ++++++++++++++++++++----------------
    2 files changed, 78 insertions(+), 60 deletions(-)

    --
    2.38.1

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Wed Oct 26 13:40:02 2022
    Reverts: 27eaf5e24de59baadb8f6042085af172cd56de5d
    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/kernel-build.eclass | 6 +++---
    1 file changed, 3 insertions(+), 3 deletions(-)

    diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
    index a77a24534c11..7cada85e79fe 100644
    --- a/eclass/kernel-build.eclass
    +++ b/eclass/kernel-build.eclass
    @@ -150,7 +150,7 @@ kernel-build_src_test() {
    emake O="${WORKDIR}"/build "${MAKEARGS[@]}" \
    INSTALL_MOD_PATH="${T}" "${targets[@]}"

    - local ver="${KV_FULL}${KV_LOCALVERSION}"
    + local ver="${PV}${KV_LOCALVERSION}"
    kernel-install_test "${ver}" \
    "${WORKDIR}/build/$(dist-kernel_get_image_path)" \
    "${T}/lib/modules/${ver}"
    @@ -159,7 +159,7 @@ kernel-build_src_test() {
    # @FUNCTION: kernel-build_src_install
    # @DESCRIPTION:
    # Install the built kernel along with subset of sources
    -# into /usr/src/linux-${KV_FULL}. Install the modules. Save the config.
    +# into /usr/src/linux-${PV}. Install the modules. Save the config.
    kernel-build_src_install() {
    debug-print-function ${FUNCNAME} "${@}"

    @@ -177,7 +177,7 @
  • From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Wed Oct 26 13:40:02 2022
    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/kernel-build.eclass | 43 +++++++++++++++++++++++---------------
    1 file changed, 26 insertions(+), 17 deletions(-)

    diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
    index 7cada85e79fe..5b595048d4d0 100644
    --- a/eclass/kernel-build.eclass
    +++ b/eclass/kernel-build.eclass
    @@ -150,10 +150,14 @@ kernel-build_src_test() {
    emake O="${WORKDIR}"/build "${MAKEARGS[@]}" \
    INSTALL_MOD_PATH="${T}" "${targets[@]}"

    - local ver="${PV}${KV_LOCALVERSION}"
    - kernel-install_test "${ver}" \
    + local dir_ver=${PV}${KV_LOCALVERSION}
    + local relfile=${WORKDIR}/build/include/config/kernel.release
    + local module_ver
    + module_ver=$(<"${relfile}") || die
    +
    + kernel-install_test "${module_ver}" \
    "${WORKDIR}/build/$(dist-kernel_get_image_path)" \
    - "${T}/lib/modules/${ver}"
    + "${T}/lib/modules/${module_ver}"
    }

    # @FUNCTION: kernel-build_src_install
    @@ -177,14 +181,15 @@ kernel-build_src_install() {
    # note: we're using mv rather than doins to save space and time