]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
classes/lib/scripts: Initial WORKDIR -> UNPACKDIR updates
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 1 May 2024 20:34:02 +0000 (21:34 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 2 May 2024 14:15:26 +0000 (15:15 +0100)
Work through the initial issues I found where we need to change WORKDIR
to UNPACKDIR.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-recipe/kernel-yocto.bbclass
meta/classes-recipe/kernel.bbclass
meta/classes-recipe/ptest.bbclass
meta/lib/oe/patch.py
scripts/lib/recipetool/append.py

index 9a86616dad4066bfdae851c4d8107b6549db7513..6468e8aa903e47ca35f01395d1ed2795b2499b3f 100644 (file)
@@ -63,7 +63,7 @@ def find_sccs(d):
     return sources_list
 
 # check the SRC_URI for "kmeta" type'd git repositories. Return the name of
-# the repository as it will be found in WORKDIR
+# the repository as it will be found in UNPACKDIR
 def find_kernel_feature_dirs(d):
     feature_dirs=[]
     fetch = bb.fetch2.Fetch([], d)
@@ -147,24 +147,24 @@ 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 WORKDIR (from the SRC_URI),
+       # 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 "${WORKDIR}/defconfig" ]; then
+                       if [ -f "${UNPACKDIR}/defconfig" ]; then
                                # If the two defconfig's are different, warn that we overwrote the
-                               # one already placed in WORKDIR
-                               cmp "${WORKDIR}/defconfig" "${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG}"
+                               # one already placed in UNPACKDIR
+                               cmp "${UNPACKDIR}/defconfig" "${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG}"
                                if [ $? -ne 0 ]; then
-                                       bbdebug 1 "detected SRC_URI or unpatched defconfig in WORKDIR. ${KBUILD_DEFCONFIG} copied over it"
+                                       bbdebug 1 "detected SRC_URI or unpatched defconfig in UNPACKDIR. ${KBUILD_DEFCONFIG} copied over it"
                                fi
-                               cp -f ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${WORKDIR}/defconfig
+                               cp -f ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${UNPACKDIR}/defconfig
                        else
-                               cp -f ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${WORKDIR}/defconfig
+                               cp -f ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${UNPACKDIR}/defconfig
                        fi
-                       in_tree_defconfig="${WORKDIR}/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/)"
                fi
@@ -178,7 +178,7 @@ do_kernel_metadata() {
                patches="${@" ".join(find_patches(d,'kernel-meta'))}"
                if [ -n "$patches" ]; then
                    (
-                           cd ${WORKDIR}/kernel-meta
+                           cd ${UNPACKDIR}/kernel-meta
 
                            # take the SRC_URI patches, and create a series file
                            # this is required to support some better processing
@@ -193,11 +193,11 @@ do_kernel_metadata() {
                            # handling the rest of the kernel. This allows us
                            # more flexibility for handling failures or advanced
                            # mergeing functinoality
-                           message=$(kgit-s2q --gen -v --patches ${WORKDIR}/kernel-meta 2>&1)
+                           message=$(kgit-s2q --gen -v --patches ${UNPACKDIR}/kernel-meta 2>&1)
                            if [ $? -ne 0 ]; then
                                # setup to try the patch again
                                kgit-s2q --prev
-                               bberror "Problem applying patches to: ${WORKDIR}/kernel-meta"
+                               bberror "Problem applying patches to: ${UNPACKDIR}/kernel-meta"
                                bbfatal_log "\n($message)"
                            fi
                        )
@@ -232,12 +232,12 @@ do_kernel_metadata() {
        # SRC_URI. If they were supplied, we convert them into include directives
        # for the update part of the process
        for f in ${feat_dirs}; do
-               if [ -d "${WORKDIR}/$f/kernel-meta" ]; then
-                       includes="$includes -I${WORKDIR}/$f/kernel-meta"
-               elif [ -d "${WORKDIR}/../oe-local-files/$f" ]; then
-                       includes="$includes -I${WORKDIR}/../oe-local-files/$f"
-               elif [ -d "${WORKDIR}/$f" ]; then
-                       includes="$includes -I${WORKDIR}/$f"
+               if [ -d "${UNPACKDIR}/$f/kernel-meta" ]; then
+                       includes="$includes -I${UNPACKDIR}/$f/kernel-meta"
+               elif [ -d "${UNPACKDIR}/../oe-local-files/$f" ]; then
+                       includes="$includes -I${UNPACKDIR}/../oe-local-files/$f"
+               elif [ -d "${UNPACKDIR}/$f" ]; then
+                       includes="$includes -I${UNPACKDIR}/$f"
                fi
        done
        for s in ${sccs} ${patches}; do
@@ -460,7 +460,7 @@ do_kernel_configme() {
                        config_flags=""
                        ;;
                *)
-                       if [ -f ${WORKDIR}/defconfig ]; then
+                       if [ -f ${UNPACKDIR}/defconfig ]; then
                                config_flags="-n"
                        fi
                        ;;
index c0a2056fec5e9c0faa4f03f66f97cd6e7210448f..d6eedf942cc139d1bcc3285a1a0d937d46f06ba1 100644 (file)
@@ -679,8 +679,8 @@ kernel_do_configure() {
 
        # Copy defconfig to .config if .config does not exist. This allows
        # recipes to manage the .config themselves in do_configure:prepend().
-       if [ -f "${WORKDIR}/defconfig" ] && [ ! -f "${B}/.config" ]; then
-               cp "${WORKDIR}/defconfig" "${B}/.config"
+       if [ -f "${UNPACKDIR}/defconfig" ] && [ ! -f "${B}/.config" ]; then
+               cp "${UNPACKDIR}/defconfig" "${B}/.config"
        fi
 
        ${KERNEL_CONFIG_COMMAND}
index 348d729aef108d87ec153ef7dd439242de3dd840..0941572f8f3575db7d304cdbddfc4565b94665bf 100644 (file)
@@ -53,8 +53,8 @@ do_install_ptest() {
 }
 
 do_install_ptest_base() {
-    if [ -f ${WORKDIR}/run-ptest ]; then
-        install -D ${WORKDIR}/run-ptest ${D}${PTEST_PATH}/run-ptest
+    if [ -f ${UNPACKDIR}/run-ptest ]; then
+        install -D ${UNPACKDIR}/run-ptest ${D}${PTEST_PATH}/run-ptest
     fi
 
     grep -q install-ptest: Makefile 2>/dev/null && oe_runmake DESTDIR=${D}${PTEST_PATH} install-ptest
index 60a0cc8291423294484e5889a8a14eaa97d39359..58c6e34fe83088bab9c6ac39427bf2a36c8bad6b 100644 (file)
@@ -882,7 +882,7 @@ class UserResolver(Resolver):
             os.chdir(olddir)
 
 
-def patch_path(url, fetch, workdir, expand=True):
+def patch_path(url, fetch, unpackdir, expand=True):
     """Return the local path of a patch, or return nothing if this isn't a patch"""
 
     local = fetch.localpath(url)
@@ -891,7 +891,7 @@ def patch_path(url, fetch, workdir, expand=True):
     base, ext = os.path.splitext(os.path.basename(local))
     if ext in ('.gz', '.bz2', '.xz', '.Z'):
         if expand:
-            local = os.path.join(workdir, base)
+            local = os.path.join(unpackdir, base)
         ext = os.path.splitext(base)[1]
 
     urldata = fetch.ud[url]
@@ -905,12 +905,12 @@ def patch_path(url, fetch, workdir, expand=True):
     return local
 
 def src_patches(d, all=False, expand=True):
-    workdir = d.getVar('WORKDIR')
+    unpackdir = d.getVar('UNPACKDIR')
     fetch = bb.fetch2.Fetch([], d)
     patches = []
     sources = []
     for url in fetch.urls:
-        local = patch_path(url, fetch, workdir, expand)
+        local = patch_path(url, fetch, unpackdir, expand)
         if not local:
             if all:
                 local = fetch.localpath(url)
index 341e8933057b1064e9ed8b3147bdd8515cc4ed7d..10945d60084537320cef785309e8d7a889b7f99a 100644 (file)
@@ -101,7 +101,7 @@ def determine_file_source(targetpath, rd):
     import oe.recipeutils
 
     # See if it's in do_install for the recipe
-    workdir = rd.getVar('WORKDIR')
+    unpackdir = rd.getVar('UNPACKDIR')
     src_uri = rd.getVar('SRC_URI')
     srcfile = ''
     modpatches = []
@@ -113,9 +113,9 @@ def determine_file_source(targetpath, rd):
         if not srcpath.startswith('/'):
             # Handle non-absolute path
             srcpath = os.path.abspath(os.path.join(rd.getVarFlag('do_install', 'dirs').split()[-1], srcpath))
-        if srcpath.startswith(workdir):
+        if srcpath.startswith(unpackdir):
             # OK, now we have the source file name, look for it in SRC_URI
-            workdirfile = os.path.relpath(srcpath, workdir)
+            workdirfile = os.path.relpath(srcpath, unpackdir)
             # FIXME this is where we ought to have some code in the fetcher, because this is naive
             for item in src_uri.split():
                 localpath = bb.fetch2.localpath(item, rd)