Message ID | 20250126133419.1545381-1-sst@poczta.fm |
---|---|
State | Accepted, archived |
Commit | fdd7fec29314b3cd07a98943bbbf6996877e90f4 |
Headers | show |
Series | kernel-yocto: move the cp of ${KBUILD_DEFCONFIG} file outside if body | expand |
On Sun, Jan 26, 2025 at 8:34 AM Slawomir Stepien via lists.openembedded.org <sst=poczta.fm@lists.openembedded.org> wrote: > In both true/false cases, we will cp the file, so move the invocation > after the if body. > > In addition, misleading comment has been removed. > I'm not sure why I didn't remove the else when I was changing that logic to do a compare before the copy, but I agree, we don't need the same line twice! Acked-by: Bruce Ashfield <bruce.ashfield@gmail.com> Bruce > > Signed-off-by: Slawomir Stepien <sst@poczta.fm> > --- > meta/classes-recipe/kernel-yocto.bbclass | 8 +------- > 1 file changed, 1 insertion(+), 7 deletions(-) > > diff --git a/meta/classes-recipe/kernel-yocto.bbclass > b/meta/classes-recipe/kernel-yocto.bbclass > index c45abf6ddc..cef6b9ec3f 100644 > --- a/meta/classes-recipe/kernel-yocto.bbclass > +++ b/meta/classes-recipe/kernel-yocto.bbclass > @@ -150,10 +150,6 @@ do_kernel_metadata() { > # from the source tree, into a common location and normalized > "defconfig" name, > # where the rest of the process will include and incoroporate it > into the build > # > - # If the fetcher has already placed a defconfig in UNPACKDIR (from > the SRC_URI), > - # we don't overwrite it, but instead warn the user that SRC_URI > defconfigs take > - # precendence. > - # > if [ -n "${KBUILD_DEFCONFIG}" ]; then > if [ -f "${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG}" ]; > then > if [ -f "${UNPACKDIR}/defconfig" ]; then > @@ -163,10 +159,8 @@ do_kernel_metadata() { > if [ $? -ne 0 ]; then > bbdebug 1 "detected SRC_URI or > patched defconfig in UNPACKDIR. ${KBUILD_DEFCONFIG} copied over it" > fi > - cp -f > ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${UNPACKDIR}/defconfig > - else > - cp -f > ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${UNPACKDIR}/defconfig > fi > + cp -f > ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${UNPACKDIR}/defconfig > in_tree_defconfig="${UNPACKDIR}/defconfig" > else > bbfatal "A KBUILD_DEFCONFIG '${KBUILD_DEFCONFIG}' > was specified, but not present in the source tree > (${S}/arch/${ARCH}/configs/)" > -- > 2.48.1 > > > -=-=-=-=-=-=-=-=-=-=-=- > Links: You receive all messages sent to this group. > View/Reply Online (#210290): > https://lists.openembedded.org/g/openembedded-core/message/210290 > Mute This Topic: https://lists.openembedded.org/mt/110821351/1050810 > Group Owner: openembedded-core+owner@lists.openembedded.org > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ > bruce.ashfield@gmail.com] > -=-=-=-=-=-=-=-=-=-=-=- > >
diff --git a/meta/classes-recipe/kernel-yocto.bbclass b/meta/classes-recipe/kernel-yocto.bbclass index c45abf6ddc..cef6b9ec3f 100644 --- a/meta/classes-recipe/kernel-yocto.bbclass +++ b/meta/classes-recipe/kernel-yocto.bbclass @@ -150,10 +150,6 @@ do_kernel_metadata() { # from the source tree, into a common location and normalized "defconfig" name, # where the rest of the process will include and incoroporate it into the build # - # If the fetcher has already placed a defconfig in UNPACKDIR (from the SRC_URI), - # we don't overwrite it, but instead warn the user that SRC_URI defconfigs take - # precendence. - # if [ -n "${KBUILD_DEFCONFIG}" ]; then if [ -f "${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG}" ]; then if [ -f "${UNPACKDIR}/defconfig" ]; then @@ -163,10 +159,8 @@ do_kernel_metadata() { if [ $? -ne 0 ]; then bbdebug 1 "detected SRC_URI or patched defconfig in UNPACKDIR. ${KBUILD_DEFCONFIG} copied over it" fi - cp -f ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${UNPACKDIR}/defconfig - else - cp -f ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${UNPACKDIR}/defconfig fi + cp -f ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${UNPACKDIR}/defconfig in_tree_defconfig="${UNPACKDIR}/defconfig" else bbfatal "A KBUILD_DEFCONFIG '${KBUILD_DEFCONFIG}' was specified, but not present in the source tree (${S}/arch/${ARCH}/configs/)"
In both true/false cases, we will cp the file, so move the invocation after the if body. In addition, misleading comment has been removed. Signed-off-by: Slawomir Stepien <sst@poczta.fm> --- meta/classes-recipe/kernel-yocto.bbclass | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)