sfjro / aufs-standalone

27 stars 14 forks source link

build error: fs/aufs/Makefile:5: fs/aufs/conf.mk: No such file or directory #43

Open JKDingwall opened 1 month ago

JKDingwall commented 1 month ago

Hi,

I'm patching aufs-standalone aufs6.8 branch on to the Ubuntu 6.8-hwe tree for Ubuntu jammy. During the build of the 'binary-arch' target I encountered this error:

/build/slowfs/build/ubuntu/fs/aufs/Makefile:5: fs/aufs/conf.mk: No such file or directory
make[6]: *** No rule to make target 'fs/aufs/conf.mk'.  Stop.
make[5]: *** [/build/slowfs/build/ubuntu/scripts/Makefile.build:481: fs/aufs] Error 2
make[4]: *** [/build/slowfs/build/ubuntu/scripts/Makefile.build:481: fs] Error 2
make[4]: *** Waiting for unfinished jobs....

Applying this change to the fs/aufs/Makefile appears to have resolved the problem but I don't know if it is the correct solution.

diff --git a/fs/aufs/Makefile b/fs/aufs/Makefile
index 4af8ecde3e3fa..9111fe31039c6 100644
--- a/fs/aufs/Makefile
+++ b/fs/aufs/Makefile
@@ -1,10 +1,10 @@
 # SPDX-License-Identifier: GPL-2.0

-include ${src}/magic.mk
+include $(srctree)/$(src)/magic.mk
 ifeq (${CONFIG_AUFS_FS},m)
-include ${src}/conf.mk
+include $(srctree)/$(src)/conf.mk
 endif
--include ${src}/priv_def.mk
+-include $(srctree)/$(src)/priv_def.mk

 # cf. include/linux/kernel.h
 # enable pr_debug
@@ -13,7 +13,7 @@ ccflags-y += -DDEBUG
 ifdef M
 ccflags-y += -include ${M}/../../include/uapi/linux/aufs_type.h
 else
-ccflags-y += -include ${srctree}/include/uapi/linux/aufs_type.h
+ccflags-y += -include $(srctree)/include/uapi/linux/aufs_type.h
 endif

 obj-$(CONFIG_AUFS_FS) += aufs.o
sfjro commented 1 month ago

Hello,

JKDingwall:

I'm patching aufs-standalone aufs6.8 branch on to the Ubuntu 6.8-hwe tree for Ubuntu jammy. During the build of the 'binary-arch' target I encountered this error:

I'm afraid your kernel has added some unknown changes from plain linux v6.8. Could you try digging the log by git-log or something, especially for linux/Makefile and linux/scripts?

Is your kernel from https://git.launchpad.net/~canonical-kernel/ubuntu/+source/linux-nvidia-hwe/+git/noble ?

J. R. Okajima

JKDingwall commented 1 month ago

Hi,

Thank you for the quick response:) I'm working with tag Ubuntu-hwe-6.8-6.8.0-40.40_22.04.1 from https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy. I was unfamiliar with the ${...} variable syntax in Makefiles but I see in the documentation that is equivalent to $(...).

git diff v6.8..Ubuntu-hwe-6.8-6.8.0-40.40_22.04.1 -- Makefile scripts does show some differences but nothing obviously stands out. I think the main difference is that the Debian build scripts use a separate build path rather than the root of the source tree. This git ls-files | grep /Makefile$ | xargs git grep "^include " shows that many include statements are prefixed $(srctree).

sfjro commented 1 month ago

JKDingwall:

I'm patching aufs-standalone aufs6.8 branch on to the Ubuntu 6.8-hwe tree for Ubuntu jammy. During the build of the 'binary-arch' target I encountered this error:

Compiling aufs-standalone.git is expected to use its own Makefile. And Makefile sets KDIR variable (generally you can set KDIR manually on the command line). Currently I guess the cause of your error is related to this KDIR variable. But if your build system doesn't support setting a make-variable, it may not be effective.

Instead of aufs-standalone.git, using aufs-linux.git may be better for your system, such as

(from aufs README file)

Or You may want to directly git-pull aufs into your linux GIT tree, and leave the patch-work to GIT. $ cd /your/linux/git/tree $ git remote add aufs git://github.com/sfjro/aufs-linux.git $ git fetch aufs $ git checkout -b my6.0 v6.0 $ (add your local change...) $ git pull aufs aufs6.0

This git work may look rather big to you since you already have a simple solution adding ${srctree}. Yes, I think it a good solution for your system.

J. R. Okajima