0

So I have cloned the android kernel source for my motorola mobile, and was in the process of building it.

Android Kernel Info:

Name: Android Kernel Motorola MSM8610

Device(Intended): Moto E

Hardware: MSM8610

Github: Kernel Source Link

Procedure:

First, I made the .config file using

make ARCH=arm msm8610_defconfig

then I tried to build the kernel image by creating a file name startBuild

startBuild:

make ARCH=arm SUBARCH=arm CROSS_COMPILE=/media/mohit/776b997b-f9a1-46c2-92a0-7f438c7b78e3/code/toolchain/arm-eabi-4.6/bin/arm-eabi- -j4

giving it required permissions

chmod +x startBuild

and executing it

./startBuild

But I am getting the following error message:

  CHK     include/linux/version.h
make[1]: Nothing to be done for 'arch/arm/boot/dtbs'.
  CHK     include/generated/utsrelease.h
make[1]: 'include/generated/mach-types.h' is up to date.
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  CHK     kernel/config_data.h
  CC      fs/overlayfs/inode.o
fs/overlayfs/inode.c: In function 'ovl_permission':
fs/overlayfs/inode.c:71:11: error: 'struct dentry' has no member named 'd_alias'
fs/overlayfs/inode.c:71:11: warning: initialization from incompatible pointer type [enabled by default]
error, forbidden warning: inode.c:71
scripts/Makefile.build:307: recipe for target 'fs/overlayfs/inode.o' failed
make[2]: *** [fs/overlayfs/inode.o] Error 1
scripts/Makefile.build:443: recipe for target 'fs/overlayfs' failed
make[1]: *** [fs/overlayfs] Error 2
Makefile:957: recipe for target 'fs' failed
make: *** [fs] Error 2
make: *** Waiting for unfinished jobs..

So how to fix this error?

Thank you.

Community
  • 1
  • 1
Mohit
  • 1,045
  • 4
  • 18
  • 45
  • Googling for error message found [this post](https://github.com/rasa/vmware-tools-patches/issues/29#issuecomment-76707190) which describes solution for another linux component: replacing `d_alias` with `d_u.d_alias`. It should help in your case too. – Tsyvarev Jul 22 '16 at 19:06
  • @Tsyvarev Yean I tried that too, didnt work. As in case of my inode.c file `d_u` and `d_alias` is not defined, maybe thats the case. – Mohit Jul 22 '16 at 19:10
  • So, which branch you are trying to compile? Default on the cite is *cm-12.0*, which definitely does not suffer from that problem (`struct dentry` [has member](https://github.com/CyanogenMod/android_kernel_motorola_msm8610/blob/cm-12.0/include/linux/dcache.h#L116) `d_alias`). In branch *cm-13.0* given struct [has member](https://github.com/CyanogenMod/android_kernel_motorola_msm8610/blob/cm-13.0/include/linux/dcache.h#L116) `d_u`. – Tsyvarev Jul 22 '16 at 19:18
  • I cloned just the cm-13.0 branch with depth 1. I am trying to compile that. – Mohit Jul 22 '16 at 19:19
  • @Tsyvarev wait building it after `make clean && make mrproper` with making config again seems to take care of the problem. I was not cleaning which may have resulted in non compilation. Thank you. Would you mind posting an answer so I can select it as a right one? – Mohit Jul 23 '16 at 06:54
  • So, does the problem disappear after clean rebuild without any fix? Or has replacing `d_alias` with `d_u.d_alias` been helped? – Tsyvarev Jul 23 '16 at 18:03
  • Yeah after appending `d_u` and making clean build of the kernel, that particular error is not showing again. – Mohit Jul 23 '16 at 18:10

1 Answers1

1

Since version 3.19 of Linux kernel d_alias member of struct dentry has been moved to the member's union d_u, see definition of struct dentry in include/linux/dcache.h.

So, replacing reference to d_alias member to d_u.d_alias should help with that compatibility problem.

That replasing may also be performed globally in all files, see e.g. this post about fixing given error in vmware-tools.

Tsyvarev
  • 60,011
  • 17
  • 110
  • 153