This is a cache of https://discuss.96boards.org/t/build-error-when-i-make-ramdisk-img/7703. It is a snapshot of the page at 2024-11-01T12:51:27.647+0000.
Build error when I make ramdisk.img - HiKey970 - 96Boards Forum

Build error when I make ramdisk.img

Hi Supporters,

I’m trying to build kernel using the page Build & Update Linux kernel on HiKey970 - 96Boards

But if I build ramdisk.img, I get error like cannot assign to readonly variable
Could you let me know how I can resolve this problem?

Here is the log :
T3600:~/android/hikey_970$ make -j4 ramdisk
[W][2019-03-29T14:46:32+0900][1] bool caps::initNs(nsjconf_t *)():215 prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_CLEAR_ALL): Invalid argument
build/make/core/board_config.mk:182: warning: Building a 32-bit-app-only product on a 64-bit device. If this is intentional, set TARGET_SUPPORTS_64_BIT_APPS := false

PLATFORM_VERSION_CODENAME=Q
PLATFORM_VERSION=Q
TARGET_PRODUCT=hikey970
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=cortex-a73
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=cortex-a73
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.13.0-168-generic-x86_64-ubuntu-14.04.6-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=PI
OUT_DIR=out

[W][2019-03-29T14:46:34+0900][1] bool caps::initNs(nsjconf_t *)():215 prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_CLEAR_ALL): Invalid argument
[W][2019-03-29T14:46:35+0900][1] bool caps::initNs(nsjconf_t *)():215 prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_CLEAR_ALL): Invalid argument
[W][2019-03-29T14:46:39+0900][1] bool caps::initNs(nsjconf_t *)():215 prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_CLEAR_ALL): Invalid argument
[W][2019-03-29T17:14:14+0900][1] bool caps::initNs(nsjconf_t *)():215 prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_CLEAR_ALL): Invalid argument
build/make/core/version_defaults.mk was modified, regenerating…
build/make/core/board_config.mk:182: warning: Building a 32-bit-app-only product on a 64-bit device. If this is intentional, set TARGET_SUPPORTS_64_BIT_APPS := false
[W][2019-03-29T17:15:45+0900][1] bool caps::initNs(nsjconf_t *)():215 prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_CLEAR_ALL): Invalid argument
[100% 2/2] initializing build system …
build/make/core/board_config.mk:182: warning: Building a 32-bit-app-only product on a 64-bit device. If this is intentional, set TARGET_SUPPORTS_64_BIT_APPS := false
[ 21% 114/537] including device/linaro/hikey/Android.mk …
FAILED:
TARGET_USE_HIAI is true
build/make/core/build_id.mk:21: error: cannot assign to readonly variable: BUILD_ID
17:16:47 ckati failed with: exit status 1

failed to build some targets (02:30:18 (hh:mm:ss))

What toolchain are you using to compile the kernel.
It looks like maybe your using the wrong tool chain.

Everything should be building for 64 bit not 32 bit.
Just a quick guess on my part but i would check it.

Thanks for the response. :slight_smile:

Could you let me know which tool chain I have to use and how to check it?

Thanks.

You are building the kernel for Android right?
I can’t remember if you need to build android first or not.
Are you using the AOSP Source or downloading the kernel tree?

You can check the tool-chain during this process.

Run build_kernel.sh

$ export ARCH=arm64
$ export CROSS_COMPILE=aarch64-linux-android-
$ ./build_kernel.sh

After you export CROSS_COMPILE=aarch64-linux-android- run this command.

[CODE]aarch64-linux-android- --version[/CODE]

I think part of the problem is that you have to build AOSP first.
Then 
[CODE]make -j$(nproc) ramdisk[/CODE]

Hi BigCountry907,

Yes, I’m building the kernel for Android and using AOSP source.
Here is what I did to build kernel. I just followed a guidance of your website and this error happens when I build ramdisk image. It means that I didn’t run build_kernel.sh yet.

$ mkdir <ANDROID_TOP>
$ cd <ANDROID_TOP>
$ repo init -u https://android.googlesource.com/platform/manifest -b master
$ git clone https://github.com/96boards-hikey/android-manifest.git -b hikey970_v1.0 .repo/local_manifests
$ repo sync -j$(nproc) -c
$ source build/envsetup.sh
$ lunch hikey970-userdebug
$ make -j$(nproc) ramdisk

Thanks.

Hi Manhea,

were you able to fix this issue?
I am facing a similar issue, it would be really kind of you if you can help.

Thank you,
Amal