Several .o files not found during build process while compiling a kernel for my SAMSUNG GALAXY J7 (SM-J700F) - Samsung Galaxy J7 Questions & Answers

I am trying to build a kernel for SM-J700F from the source at https://opensource.samsung.com/.
I got a toolchain from android-ndk that is with the help of following command:
Bash:
$NDK/build/tools/make_standalone_toolchain.py \
--arch arm64 --api 21 --install-dir /tmp/my-android-toolchain
and has put the toolchains where the Makefile searches for it.
Now at kernel source root directory I did the following:
Bash:
make ARCH=arm64 j7elte_00_defconfig
OUTPUT:
Bash:
[[email protected] kernel]$ make ARCH=arm64 j7elte_00_defconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/zconf.tab.o
In file included from scripts/kconfig/zconf.tab.c:2503:
scripts/kconfig/menu.c: In function ‘get_symbol_str’:
scripts/kconfig/menu.c:567:18: warning: ‘jump’ may be used uninitialized in this function [-Wmaybe-uninitialized]
567 | jump->offset = r->len - 1;
| ~~~~~~~~~~~~~^~~~~~~~~~~~
scripts/kconfig/menu.c:528:19: note: ‘jump’ was declared here
528 | struct jump_key *jump;
| ^~~~
HOSTLD scripts/kconfig/conf
#
# configuration written to .config
#
After that I did the following:
Bash:
make ARCH=arm64 -j64 -no-integreted-as
OUTPUT
Bash:
...
set -e; echo ' LINK vmlinux'; /bin/sh scripts/link-vmlinux.sh ../PLATFORM/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-ld -EL -p --no-undefined -X --build-id; echo 'cmd_vmlinux := /bin/sh scripts/link-vmlinux.sh ../PLATFORM/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-ld -EL -p --no-undefined -X --build-id' > ./.vmlinux.cmd
LINK vmlinux
LD vmlinux.o
aarch64-linux-android-ld: error: cannot open arch/arm64/kernel/head.o: No such file or directory
aarch64-linux-android-ld: error: cannot open init/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open usr/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open arch/arm64/kernel/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open arch/arm64/mm/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open arch/arm64/crypto/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open arch/arm64/mach-exynos/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open arch/arm64/plat-samsung/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open kernel/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open mm/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open fs/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open ipc/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open security/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open crypto/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open block/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open arch/arm64/lib/lib.a: No such file or directory
aarch64-linux-android-ld: error: cannot open lib/lib.a: No such file or directory
aarch64-linux-android-ld: error: cannot open arch/arm64/lib/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open lib/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open drivers/built-in.o: No such file or directory
aarch64-linux-android-ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
make: *** [Makefile:805: vmlinux] Error 1
I can see some of the source file like head.S but head.o is not there. I assume missing .o file should be build before it is required. I tried to figure out whats wrong but had no luck.
Please shed some light.
@Eliminator79
@Albe96
@LahKeda
@The flash
@MZO
@krasCGQ
@flar2
@jazba

Related

[Guide][Compile][Patching]A Kernel From Source For Newbies[Any Device]

Hey Guys,
With All the awesome development going on in the Android world. There Are Many newbies who want to strat development but they exactly Dont Know How To begin with or from where to strat with. So I will Write a guide on how to compile your own kernel from source
=================
What Is A Kernel???
=================
The operating system of a device is the part of the device responsible for basic use and administration. This includes the kernel and device drivers, boot loader, command shell or other user interface, and basic file and system utilities. Whereas the user interface is the outermost portition of the operating system, kernel is the innermost. It is the core internals, the software that provides basic services for all other parts of the system, manages hardware and distributes system resources.
============================
Prerequisites To Compile A kernel
============================
1.A Unix Based Os(Ubuntu Recommended Both 32-bit and 64-bit are good to compile a kernel)
2.A few packages, to let the system know that we are compiling a kernel
3. The Source Code of kernel for your Device
Ok, So Now Lets Begin
==================
Packages Required:
==================
Ok So Now Open The Terminal And Copy Paste This Code:
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386 git
Okay SO Now If You Are using Ubuntu12.04 , you need to create links of certain files
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Okay now we are done with installing packages
SO Now we need java
Open a terminal and Run This Code:
sudo add-apt-repository ppa:ferramroberto/java
Click to expand...
Click to collapse
Then Run This:
sudo apt-get update
Click to expand...
Click to collapse
Then Type This:
sudo apt-get-install sun-java6-jdk
Click to expand...
Click to collapse
So Now You Have all the needed packages to compile a kernel
Next you need the bootimagetools,source code of kernel and Androidtoolchainsto compile a kernel
Bootimagetools:https://github.com/SaumitraYadav/Boot-Image-tools
AndroidToolchains:https://github.com/SaumitraYadav/Android_Toolchains
Okay once you have Downloaded everything ... now Lets Start Compiling A Kernel
Ok So Fireup A Terminal :
Code:
mkdir kernel
This Will Create a Directory named kernel in your Home Folder
Now extract your kernel Source in this directory
Then Run This:
Code:
cd kernel
Now You Have To Edit the Make File:
Code:
gedit Makefile
The Make file will open.........look out for this and change CROSS_COMPILE= "your toolchain path"
EXAMPLE:
Code:
CROSS_COMPILE?= /home/saumitra/Downloads/Toolchains/arm-eabi-4.4.3/bin/arm-eabi-
this will open up Makefile in gedit, now set the path where youn have downloaded and extracted the toolchains
Now, make the kernel config
Code:
make pico_defconfig
Note: I have a Htc Explorer and my device codename is pico. So i run pico_defconfig
Now Other device users have to look for codename or config names in arch/arm/configs
This Will Make a working kernel config according to the source
Now, if You Wanna Make Some Changes In Your Source Do so , and run this command to start compiling:
Code:
make -jX
The X can be replaced by the maximum number of jobs your computer can handle simultaneously.. The higher this number, the faster the compiling will get.. But do not enter a number too high, your computer may explode due to overheating.
Okay if all goes well your kernel will be compiled in 15mins
The resulting kernel will be in Kernel/arch/arm/boot/zImage
Now We also need modules for wifi and BT to work. So,
cd kernel
Click to expand...
Click to collapse
mkdir modules
Click to expand...
Click to collapse
find . -name '*ko' -exec cp '{}' modules \;
Click to expand...
Click to collapse
Okay So Now The Moules will be in kernel/modules
So Now We will pack the kernel to be flashed on the target Device
-Okay So Now Get A Working Boot.img Of THe Rom on which Wanna Test Your Kernel
-Download and extract The Bootimagetools From The Link Given Above
-place the boot.img in source_img folder inside the boot.img-tools
-enter the bootimagetools Directory
-unpack(This Will extract the boot.img)
$ mkdir -p unpack
$ tools/unpackbootimg -i source_img/boot.img -o unpack
Click to expand...
Click to collapse
-Extracting boot.img-ramdisk.gz(This Will Extract The ramdisk From the boot.img)
$ mkdir -p boot
$ cd boot
$ gzip -dc ../unpack/boot.img-ramdisk.gz | cpio -i
$ cd ../
Click to expand...
Click to collapse
-Packing a new ramdisk(This Will Pack A new ramdisk which will be used in your kernel)
$ tools/mkbootfs boot | gzip > unpack/boot.img-ramdisk-new.gz
Click to expand...
Click to collapse
Now As we want to create a boot.img from the zImage you made so copy the zImage from arch/arm/boot
Then goto the folder unpack in bootimagetools directory and delete boot.img-zImage
now paste the zImage You copied from arch/arm/boot and paste it in unpack folder and rename it to boot.img-zImage
-Create a new boot.img:
$ mkdir -p target_img
$ tools/mkbootimg --kernel unpack/boot.img-zImage --ramdisk unpack/boot.img-ramdisk-new.gz -o target_img/boot.img --base `cat unpack/boot.img-base`
Click to expand...
Click to collapse
Done
Now Take The boot.img for target_img folder and flash it via fastboot and dont forget to push modules else wifi will not work
=============================
Patching The kernel[The Easy Way]
=============================
This will Show You How to Patch your kernel to the latest version.
All The Patches are Available on kernel.org.
So If you apply the patches manually, then your source code will be messed up and you will face compiling errors+ it's time consuming to allow every patch as yes
So I am going to use a program called interdiff to
generate a patch representing the differences between two patches and then
apply the result.
Download:
Code:
http://cyberelk.net/tim/data/patchutils/stable/patchutils-0.3.3.tar.xz
SO Now Setting up the program to work :
1. Download the given file and extract it somewhere ,you swill get a folder named patchutils-0.3.3
2. First Install these Two Packages:
Code:
sudo apt-get install gcc
sudo apt-get install g++
3. Now cd to the folder patchutils-0.3.3
4. Now Type this in terminal
Code:
./configure
5.Now type this
Code:
make
6. Then this
Code:
sudo make install
Now You have setup the program 'interdiff' for applying the patches
To Apply The patches:
Code:
interdiff -z patch-xy patch-yx | patch -p1
Code:
patch-xy: The current kernel version ( for example= patch-3.0.97)
patch-yx: The version to be patched ( for example=patch-3.0.98)
Note: Both the patches should be in your kernel source directory
Credits:
@Red Devil (For Teaching me how to compile a kernel)
Awesome
Markyzz said:
Awesome
Click to expand...
Click to collapse
Thanks
Please Unquote The Post
Great Guide For Noobs Like Me
Speaking Frankly There is a guide by @legen_dary which is really good.
I Don't think this is actually needed.
Thank you.
Brother.. At least change it a little eh??
Or if you want, I can have the original guide thread handed over to you..
ғг๏๓ ҭђє ғเรђ!
Very very useful i'll take a closer look at it later tonight! :good:
Corrected the grammatical errors Happy compiling
Sent from my HTC Explorer using Tapatalk 4 Beta
Added Guide on How to Patch the Kernel Happy compiling
Saumitra Yadav said:
Added Guide on How to Patch the Kernel Happy compiling
Click to expand...
Click to collapse
i need a easy way for patching kernel ...thnxx man u helped a lot ..>!!:laugh:
How to solve this?
Code:
LD drivers/hid/built-in.o
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1408: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1408: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1409: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1409: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1410: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1410: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1415: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1415: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1416: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1416: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1417: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1417: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1418: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1418: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1419: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1419: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1423: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1423: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1424: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1424: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1425: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1425: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1426: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1426: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1427: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1427: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1431: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1431: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1432: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1432: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1433: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1433: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1434: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1434: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1435: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-tamsui-jlo.c:1435: error: (near initialization for 'ion_pdata.heaps')
make[3]: *** [arch/arm/mach-msm/board-tamsui-jlo.o] Błąd 1
make[3]: *** Oczekiwanie na niezakończone zadania....
CC net/core/utils.o
CC drivers/hwmon/hwmon.o
CC fs/fat/fatent.o
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:862: error: 'KGSL_3D0_REG_MEMORY' undeclared here (not in a function)
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:868: error: 'KGSL_3D0_IRQ' undeclared here (not in a function)
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:875: error: variable 'kgsl_3d0_pdata' has initializer but incomplete type
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:876: error: unknown field 'pwrlevel' specified in initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:876: error: extra brace group at end of initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:876: error: (near initialization for 'kgsl_3d0_pdata')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:877: error: extra brace group at end of initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:877: error: (near initialization for 'kgsl_3d0_pdata')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:881: error: extra brace group at end of initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:881: error: (near initialization for 'kgsl_3d0_pdata')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:885: error: extra brace group at end of initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:885: error: (near initialization for 'kgsl_3d0_pdata')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:890: error: unknown field 'init_level' specified in initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:891: error: unknown field 'num_levels' specified in initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:892: error: unknown field 'set_grp_async' specified in initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:893: error: unknown field 'idle_timeout' specified in initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:894: error: unknown field 'strtstp_sleepwake' specified in initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:895: error: unknown field 'nap_allowed' specified in initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:896: error: unknown field 'clk_map' specified in initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c: In function 'msm7x25a_kgsl_3d0_init':
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:912: error: invalid use of undefined type 'struct kgsl_device_platform_data'
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:913: error: invalid use of undefined type 'struct kgsl_device_platform_data'
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:913: error: 'struct resource' has no member named 'gpu_freq'
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:914: error: invalid use of undefined type 'struct kgsl_device_platform_data'
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:914: error: 'struct resource' has no member named 'bus_freq'
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:915: error: invalid use of undefined type 'struct kgsl_device_platform_data'
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:915: error: 'struct resource' has no member named 'gpu_freq'
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:916: error: invalid use of undefined type 'struct kgsl_device_platform_data'
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:916: error: 'struct resource' has no member named 'bus_freq'
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c: In function 'msm8x25_kgsl_3d0_init':
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:923: error: invalid use of undefined type 'struct kgsl_device_platform_data'
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:924: error: invalid use of undefined type 'struct kgsl_device_platform_data'
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:928: error: invalid use of undefined type 'struct kgsl_device_platform_data'
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:928: error: 'struct resource' has no member named 'gpu_freq'
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:930: error: invalid use of undefined type 'struct kgsl_device_platform_data'
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:930: error: 'struct resource' has no member named 'gpu_freq'
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:932: error: invalid use of undefined type 'struct kgsl_device_platform_data'
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:932: error: 'struct resource' has no member named 'bus_freq'
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c: At top level:
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:1581: error: initializer element is not constant
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:1581: error: (near initialization for 'msm8625_kgsl_3d0_resources[0].name')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:1587: error: initializer element is not constant
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/devices-tamsui-jlo.c:1587: error: (near initialization for 'msm8625_kgsl_3d0_resources[1].name')
make[3]: *** [arch/arm/mach-msm/devices-tamsui-jlo.o] Błąd 1
CC fs/fat/file.o
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:664: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:664: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:665: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:665: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:666: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:666: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:671: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:671: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:672: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:672: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:673: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:673: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:674: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:674: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:675: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:675: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:679: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:679: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:680: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:680: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:681: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:681: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:682: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:682: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:683: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:683: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:687: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:687: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:688: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:688: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:689: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:689: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:690: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:690: error: (near initialization for 'ion_pdata.heaps')
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:691: error: field name not in record or union initializer
/home/lozohcum/CM/kernel/sony/msm7x27a-3.4/arch/arm/mach-msm/board-qrd7627a.c:691: error: (near initialization for 'ion_pdata.heaps')
make[3]: *** [arch/arm/mach-msm/board-qrd7627a.o] Błąd 1
make[2]: *** [arch/arm/mach-msm] Błąd 2
make[2]: *** Oczekiwanie na niezakończone zadania....
do I have to add -w to more flags?
This is part of my makefile
Code:
CFLAGS_MODULE = -w
AFLAGS_MODULE = -w
LDFLAGS_MODULE =
CFLAGS_KERNEL = -w
AFLAGS_KERNEL = -w
CFLAGS_GCOV = -fprofile-arcs -ftest-coverage
hey bro @Saumitra Yadav , can you help me to fix this? thx
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
ocoot said:
hey bro @Saumitra Yadav , can you help me to fix this? thx
Click to expand...
Click to collapse
Some Package Is Missing Please Give me A pastie of full error
Saumitra Yadav said:
Some Package Is Missing Please Give me A pastie of full error
Click to expand...
Click to collapse
now it's fixed. just install lzop from terminal
mmm can you make a tutorial how to add gov,i/o or freq? coz i added some gov on my kernel when i flash it, it not showing on no frillis, but on command "make menuconfig" its showing the gov i am added before -_-
@Saumitra Yadav can you help me with this?
stuck because of this from 2 days.
Xperia mini | Stock GB kernel Source | ndk 9b
Code:
SYSMAP System.map
SYSMAP .tmp_System.map
OBJCOPY arch/arm/boot/Image
Kernel: arch/arm/boot/Image is ready
AS arch/arm/boot/compressed/head.o
arch/arm/boot/compressed/head.S: Assembler messages:
arch/arm/boot/compressed/head.S:363: Warning: (null)
arch/arm/boot/compressed/head.S:444: Warning: (null)
arch/arm/boot/compressed/head.S:465: Warning: (null)
arch/arm/boot/compressed/head.S:484: Warning: (null)
arch/arm/boot/compressed/head.S:492: Warning: (null)
arch/arm/boot/compressed/head.S:783: Warning: (null)
arch/arm/boot/compressed/head.S:822: Warning: (null)
arch/arm/boot/compressed/head.S:823: Warning: (null)
arch/arm/boot/compressed/head.S:870: Warning: (null)
arch/arm/boot/compressed/head.S:877: Warning: (null)
arch/arm/boot/compressed/head.S:885: Warning: (null)
arch/arm/boot/compressed/head.S:896: Warning: (null)
arch/arm/boot/compressed/head.S:910: Warning: (null)
arch/arm/boot/compressed/head.S:942: Warning: (null)
arch/arm/boot/compressed/head.S:944: Warning: (null)
arch/arm/boot/compressed/head.S:945: Warning: (null)
arch/arm/boot/compressed/head.S:952: Warning: (null)
arch/arm/boot/compressed/head.S:984: Warning: (null)
GZIP arch/arm/boot/compressed/piggy.gz
AS arch/arm/boot/compressed/piggy.o
CC arch/arm/boot/compressed/misc.o
LD arch/arm/boot/compressed/vmlinux
arm-linux-androideabi-ld: error: arch/arm/boot/compressed/piggy.o: unknown CPU architecture
make[2]: *** [arch/arm/boot/compressed/vmlinux] Error 1
make[1]: *** [arch/arm/boot/compressed/vmlinux] Error 2
make: *** [zImage] Error 2
[email protected]:~/android/kernel/4.0.2.A.0.84/kernel$
piousheart said:
@Saumitra Yadav can you help me with this?
stuck because of this from 2 days.
Xperia mini | Stock GB kernel Source | ndk 9b
Code:
SYSMAP System.map
SYSMAP .tmp_System.map
OBJCOPY arch/arm/boot/Image
Kernel: arch/arm/boot/Image is ready
AS arch/arm/boot/compressed/head.o
arch/arm/boot/compressed/head.S: Assembler messages:
arch/arm/boot/compressed/head.S:363: Warning: (null)
arch/arm/boot/compressed/head.S:444: Warning: (null)
arch/arm/boot/compressed/head.S:465: Warning: (null)
arch/arm/boot/compressed/head.S:484: Warning: (null)
arch/arm/boot/compressed/head.S:492: Warning: (null)
arch/arm/boot/compressed/head.S:783: Warning: (null)
arch/arm/boot/compressed/head.S:822: Warning: (null)
arch/arm/boot/compressed/head.S:823: Warning: (null)
arch/arm/boot/compressed/head.S:870: Warning: (null)
arch/arm/boot/compressed/head.S:877: Warning: (null)
arch/arm/boot/compressed/head.S:885: Warning: (null)
arch/arm/boot/compressed/head.S:896: Warning: (null)
arch/arm/boot/compressed/head.S:910: Warning: (null)
arch/arm/boot/compressed/head.S:942: Warning: (null)
arch/arm/boot/compressed/head.S:944: Warning: (null)
arch/arm/boot/compressed/head.S:945: Warning: (null)
arch/arm/boot/compressed/head.S:952: Warning: (null)
arch/arm/boot/compressed/head.S:984: Warning: (null)
GZIP arch/arm/boot/compressed/piggy.gz
AS arch/arm/boot/compressed/piggy.o
CC arch/arm/boot/compressed/misc.o
LD arch/arm/boot/compressed/vmlinux
arm-linux-androideabi-ld: error: arch/arm/boot/compressed/piggy.o: unknown CPU architecture
make[2]: *** [arch/arm/boot/compressed/vmlinux] Error 1
make[1]: *** [arch/arm/boot/compressed/vmlinux] Error 2
make: *** [zImage] Error 2
[email protected]:~/android/kernel/4.0.2.A.0.84/kernel$
Click to expand...
Click to collapse
Wrong Toolchain Try This Toolchain
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7
Saumitra Yadav said:
Wrong Toolchain Try This Toolchain
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7
Click to expand...
Click to collapse
I don't know how to use git.
where to download that toolchain
Any idea how much time would it take to download all the neccesary things except the packages used for setting up build envi?
Sent from my GT-I9100 using xda premium
Doesn't take me long to download in Ubuntu.
Samsung open source will probably take you longest
engloa said:
Doesn't take me long to download in Ubuntu.
Samsung open source will probably take you longest
Click to expand...
Click to collapse
Hey buddy..
Haha..nice to see u everywhere.
Thank u..
Sent from my GT-I9100 using xda premium

Compiling ROM/Kernel, Mission Failed, help please

I am trying to build from source BlissStalk to Galaxy Tab S T700.
after about 30 minutes, whenever the kernel is building it spits out errors as follows:
ls: cannot access drivers/gud//MobiCoreDriver/platforms: No such file or directory
CC drivers/gud/MobiCoreDriver/logging.o
In file included from <command-line>:0:0:
/home/mtp/Development/Porting/kernel/samsung/exynos5420/include/linux/kconfig.h:46:1: fatal error: drivers/gud//build_tag.h: No such file or directory
compilation terminated.
make[4]: *** [drivers/gud/MobiCoreDriver/logging.o] Error 1
make[3]: *** [drivers/gud] Error 2
make[3]: *** Waiting for unfinished jobs....
....
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/home/mtp/Development/Porting/kernel/samsung/exynos5420'
make: *** [TARGET_KERNEL_BINARIES] Error 2
make: *** Waiting for unfinished jobs....
Click to expand...
Click to collapse
Anybody have any idea where I am going wrong?
jewnersey said:
I am trying to build from source BlissStalk to Galaxy Tab S T700.
after about 30 minutes, whenever the kernel is building it spits out errors as follows:
Anybody have any idea where I am going wrong?
Click to expand...
Click to collapse
Are you solve the problem?
I myself got the same error, if I want to build kernel 3.4.0 for Sony Xperia M2 Aqua (18.6.A.0.175).
ls: cannot access /drivers/gud/MobiCoreDriver/platforms: No such file or directory
LD drivers/gud/built-in.o
CC [M] drivers/gud/MobiCoreDriver/logging.o
drivers/gud/MobiCoreDriver/logging.c:21:18: fatal error: main.h: No such file or directory
#include <main.h>
Click to expand...
Click to collapse
but folder /drivers/gud/MobiCoreDriver/platforms exist and inside is folder MSM8960_SURF_STD and in this folder is file platform.h.
even if I write sudo make clean, it's appear the same error?
sudo make cleanls: cannot access /drivers/gud/MobiCoreDriver/platforms: No such file or directory
/bin/sh: /scripts/gcc-version.sh: No such file or directory
/bin/sh: /scripts/gcc-version.sh: No such file or directory
CLEAN .tmp_versions
Click to expand...
Click to collapse
Does anyone know how to solve this issue?
lp SaX15
Has this been fixed?
I am trying to compile a 3.41 kernel
sudo make clean
ls: cannot access '/drivers/gud/mobicore_driver/platforms': No such file or directory
/bin/bash: /scripts/gcc-version.sh: No such file or directory
/bin/bash: /scripts/gcc-version.sh: No such file or directory
/bin/bash: /scripts/gcc-version.sh: No such file or directory
/bin/bash: /scripts/gcc-version.sh: No such file or directory
/bin/bash: /scripts/gcc-version.sh: No such file or directory
/bin/bash: /scripts/gcc-version.sh: No such file or directory
sudo make flo_defconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/zconf.lex.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
In file included from scripts/kconfig/zconf.tab.c:2500:
scripts/kconfig/confdata.c: In function ‘conf_write’:
scripts/kconfig/confdata.c:705:19: warning: ‘%s’ directive writing likely 7 or more bytes into a region of size between 1 and 4097 [-Wformat-overflow=]
705 | sprintf(newname, "%s%s", dirname, basename);
| ^~~~~~
scripts/kconfig/confdata.c:705:19: note: assuming directive output of 7 bytes
scripts/kconfig/confdata.c:705:2: note: ‘sprintf’ output 1 or more bytes (assuming 4104) into a destination of size 4097 705 | sprintf(newname, "%s%s", dirname, basename);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/kconfig/confdata.c:708:20: warning: ‘.tmpconfig.’ directive writing 11 bytes into a region of size between 1 and 4097 [-Wformat-overflow=]
708 | sprintf(tmpname, "%s.tmpconfig.%d", dirname, (int)getpid());
| ^~~~~~~~~~~~~~~~~
scripts/kconfig/confdata.c:708:3: note: ‘sprintf’ output between 13 and 4119 bytes into a destination of size 4097
708 | sprintf(tmpname, "%s.tmpconfig.%d", dirname, (int)getpid());
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HOSTLD scripts/kconfig/conf
***
*** Can't find default configuration "arch/x86/configs/flo_defconfig"!
***
make[1]: *** [/home/jseitz/android/unlegacy/android_kernel_qcom_msm8960/scripts/kconfig/Makefile:96: flo_defconfig] Error 1
make: *** [Makefile:497: flo_defconfig] Error 2
Click to expand...
Click to collapse

How to create Device tree for Android Rom building

How to create Device tree for Android Rom building
I assume you already downloaded source code
before we start please do following
1. Install unpackbootimg
Go to https://github.com/jsharma44/bootimg-tools and download as a zip or use git clone command.
extract files
cd directory
make
now you will find unpackbootimg and mkbootimg in this directory
2. copy unpackbootimg and mkbootimg to /usr/bin
sudo cp unpackbootimg /usr/bin
sudo cp mkbootimg /usr/bin
Note this is necessary if you are getting error
” “unpackbootimg not found. Is your android build environment set up and have the host tools been built?
3. Extracting boot.img from your device
What we need
1. A rooted phone
2. Enable Usb Debugging in Developer Mode
3. ADB command knowldge
connect your phone via usb cable ensure that usb debugging is enabled
open terminal and type adb devices
if it is showing your device’s serial no than we are ready to go
C. type
adb shell
su
ls -l /dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name
please note this command may vary by device to device. What we are doing here we want to know partition scheme of your device.
note down block name of /boot partition
example it will be like boot -> /dev/block/mmcblk0p7
d. type this
dd if=/dev/block/mmcblk0p7 of=/sdcard/boot.img
now boot.img succesfully transfered to your SD card Copy it to your Desktop
now path should be /home/user/Desktop/boot.img or similar but remeber path name alternatively you can type pwd in terminal to know this
creating device/Vendor-Name/Device-codename
cd to your working directory
Syntex: ./build/tools/device/mkvendor.sh Vendor-Name Device-CodeName ~/Path to your/boot.img
Example:
./build/tools/device/mkvendor.sh GIONEE GIONEE_WBL7511 ~/Desktop/boot.img
Now it will create following file in /device/Vender-Name/Device_CodeName
AndroidBoard.mk
cm.mk
recovery.fstab
AndroidProducts.mk
device_GIONEE_WBL7511.mk
system.prop
BoardConfig.mk
kernel
Note1: Please creater vendorsetup.mk file in this directory manualy. To use source build/envsetup.sh
Note2: Please double check BoardConfig.mk file and ensure every partition size is correct in this file. Also check recovery.fstab showing correct mount point
Note3: Here kernel is prebuilt kernel. If you want to compile kernel as well as download your kernel source in /kernel/Vender-Name/Device_CodeName dirtectory. You will find kernel related config in BoardConfig.mk
Please note it will not create vendorsetup.sh file and following Directory
1./vendor/Vender-Name/Device_CodeName
2. /kernel/Vender-Name/Device_CodeName
Wait for next post for more info
Thank You
Thank you very much for the tutorial I will try to do it
Enviado desde mi A7010a48 mediante Tapatalk
Also here http://azodik.com/how-to-create-device-tree-for-android-rom-building/
Are you ready with the post about creating the vendor tree?
thanks mate, but there's more than this, for example different flags for build for mtk device and different flags for qualcomm devices
Thank you for this great tut, but I have a noob error that I couldn't found "mkbootimg" and "unpackbootimg" in "/bootimg-tools-master" folder
But in "/bootimg-tools-master/mkbootimg" I found "bootimg.h, mkbootimg, mkbootimg.c, mkbootimg.o, unmkbootimg, unmkbootimg.c, unmkbootimg.o"
Also, I have read your note:
Note this is necessary if you are getting error
” “unpackbootimg not found. Is your android build environment set up and have the host tools been built?
but I couldn't figure out what to do to check that
Additional info. : I am doing that to build a LineageOS Rom
Tree and API dependance
Amazing tutorial yet a small query - are the device (and vendor) trees android version dependant?
Could I use the boot.img of say Android 6.0 for building a 7.0 Nougat based ROM?
i am getting errors !
[/QUOTE][/QUOTE]
jai44 said:
How to create Device tree for Android Rom building
I assume you already downloaded source code
before we start please do following
1. Install unpackbootimg
Go to https://github.com/jsharma44/bootimg-tools and download as a zip or use git clone command.
extract files
cd directory
make
now you will find unpackbootimg and mkbootimg in this directory
2. copy unpackbootimg and mkbootimg to /usr/bin
sudo cp unpackbootimg /usr/bin
sudo cp mkbootimg /usr/bin
Note this is necessary if you are getting error
” “unpackbootimg not found. Is your android build environment set up and have the host tools been built?
3. Extracting boot.img from your device
What we need
1. A rooted phone
2. Enable Usb Debugging in Developer Mode
3. ADB command knowldge
connect your phone via usb cable ensure that usb debugging is enabled
open terminal and type adb devices
if it is showing your device’s serial no than we are ready to go
C. type
adb shell
su
ls -l /dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name
please note this command may vary by device to device. What we are doing here we want to know partition scheme of your device.
note down block name of /boot partition
example it will be like boot -> /dev/block/mmcblk0p7
d. type this
dd if=/dev/block/mmcblk0p7 of=/sdcard/boot.img
now boot.img succesfully transfered to your SD card Copy it to your Desktop
now path should be /home/user/Desktop/boot.img or similar but remeber path name alternatively you can type pwd in terminal to know this
creating device/Vendor-Name/Device-codename
cd to your working directory
Syntex: ./build/tools/device/mkvendor.sh Vendor-Name Device-CodeName ~/Path to your/boot.img
Example:
./build/tools/device/mkvendor.sh GIONEE GIONEE_WBL7511 ~/Desktop/boot.img
Now it will create following file in /device/Vender-Name/Device_CodeName
AndroidBoard.mk
cm.mk
recovery.fstab
AndroidProducts.mk
device_GIONEE_WBL7511.mk
system.prop
BoardConfig.mk
kernel
Note1: Please creater vendorsetup.mk file in this directory manualy. To use source build/envsetup.sh
Note2: Please double check BoardConfig.mk file and ensure every partition size is correct in this file. Also check recovery.fstab showing correct mount point
Note3: Here kernel is prebuilt kernel. If you want to compile kernel as well as download your kernel source in /kernel/Vender-Name/Device_CodeName dirtectory. You will find kernel related config in BoardConfig.mk
Please note it will not create vendorsetup.sh file and following Directory
1./vendor/Vender-Name/Device_CodeName
2. /kernel/Vender-Name/Device_CodeName
Wait for next post for more info
Thank You
Click to expand...
Click to collapse
Adityas-Mac-Pro:android aditya$ . build/tools/device/mkvendor.sh htc m8et /Users/aditya/Desktop/boot.img
Arguments: htc m8et /Users/aditya/Desktop/boot.img
dirname: illegal option -- b
usage: dirname path
dirname: illegal option -- b
usage: dirname path
-bash: pushd: no other directory
-bash: popd: directory stack empty
Output will be in //device/htc/m8et
mkdir: //device/htc/m8et: Permission denied
mkdir: /tmp/aditya/bootimg: Permission denied
cp: /tmp/aditya/bootimg: No such file or directory
-bash: pushd: /tmp/aditya/bootimg: No such file or directory
error: could not load image 'boot.img'
mkdir: ramdisk: File exists
gunzip: can't stat: ../boot.img-ramdisk.gz (../boot.img-ramdisk.gz.gz): No such file or directory
0 blocks
cat: /tmp/aditya/bootimg/boot.img-base: No such file or directory
cat: /tmp/aditya/bootimg/boot.img-cmdline: No such file or directory
cat: /tmp/aditya/bootimg/boot.img-pagesize: No such file or directory
-bash: /tmp/aditya/bootimg/sedcommand: No such file or directory
cp: /tmp/aditya/bootimg/boot.img-zImage: No such file or directory
-bash: popd: directory stack empty
find: /Volumes/android/.DocumentRevisions-V100: Permission denied
find: /Volumes/android/.TemporaryItems: Permission denied
find: /Volumes/android/.Trashes: Permission denied
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/AndroidManifest: No such file or directory
-bash: //device/htc/m8et/AndroidManifest.tests: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/java_file: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/java_tests_file: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/layout: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/strings: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/FrameworkDatabase: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/build_rule: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/target: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/tools_def: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/click_events: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/stylus.prop: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/temp.arg: No such file or directory
cat: /Volumes/android/external/clang/test/CXX/temp/temp.arg/temp.arg.template: Is a directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/index.html: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/testResults.php: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/customTest.xml: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/testing.properties: No such file or directory
-bash: //device/htc/m8et/plugin.xml: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/Common.pl: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/build-local.properties: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
cat: /Volumes/android/external/icu/icu4j/eclipse-build/features.template: Is a directory
-bash: //device/htc/m8et/features: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/plugins: No such file or directory
cat: /Volumes/android/external/icu/icu4j/eclipse-build/plugins.template: Is a directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/Version.java: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/string.view: No such file or directory
cat: /Volumes/android/external/libcxx/test/std/experimental/string.view/string.view.template: Is a directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/string.view: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
cat: /Volumes/android/external/libcxx/test/std/strings/string.view/string.view.template: Is a directory
-bash: //device/htc/m8et/NativeLibraries: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/ar_event_cpp: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/ar_event_h: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/ar_eventhandler_h: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/ar_eventhandlerfile_h: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/knobs: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/README: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/compile_commands.json: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/DriverRS.java: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/DriverView.java: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/ACTIVITY.java: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/DriverRS.java: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/ACTIVITY.java: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/ACTIVITY.java: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/jmxremote.password: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/snmp.acl: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/jmxremote.password: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/snmp.acl: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/string.view: No such file or directory
cat: /Volumes/android/prebuilts/ndk/r13/sources/cxx-stl/llvm-libc++/test/std/experimental/string.view/string.view.template: Is a directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/revision: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/AndroidManifest: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/activity: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/java_file: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/launcher_intent_filter: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/layout: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/preference_intent_filter: No such file or directory
-bash: //device/htc/m8et/string: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/strings: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/test_instrumentation: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/test_uses-library: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/uses-sdk: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/prefs: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/build: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/build_gradle: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/uibuild: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
-bash: //device/htc/m8et/asan.options.off: No such file or directory
sed: /tmp/aditya/bootimg/sedcommand: No such file or directory
mv: rename //device/htc/m8et/device.mk to //device/htc/m8et/device_m8et.mk: No such file or directory
Creating initial git repository.
-bash: pushd: //device/htc/m8et: No such file or directory
Reinitialized existing Git repository in /Volumes/android/.git/
Click to expand...
Click to collapse
I tried to search but cannot get anything I'm using mac os x 10.12.6
thumbs up
Scripts to extract device vendor files and generate AOSP makefiles.
https://github.com/pdsouza/android-generate-vendor
Set of scripts to automate AOSP compatible vendor blobs generation from factory images
https://github.com/anestisb/android-prepare-vendor
Will these scripts work on MTK devices?
jai44 said:
How to create Device tree for Android Rom building
I assume you already downloaded source code
before we start please do following
1. Install unpackbootimg
Go to https://github.com/jsharma44/bootimg-tools and download as a zip or use git clone command.
extract files
cd directory
make
now you will find unpackbootimg and mkbootimg in this directory
2. copy unpackbootimg and mkbootimg to /usr/bin
sudo cp unpackbootimg /usr/bin
sudo cp mkbootimg /usr/bin
Note this is necessary if you are getting error
” “unpackbootimg not found. Is your android build environment set up and have the host tools been built?
Click to expand...
Click to collapse
Did not get what you meant by host tools been built
Sparker0i said:
Did not get what you meant by host tools been built
Click to expand...
Click to collapse
Same question from me.
You are supposed to get two files in step two. I only got one - unpackbootimg is missing.
How to set up android build environment and install host tools? Is there a guide somewhere around?
jai44 said:
How to create Device tree for Android Rom building
I assume you already downloaded source code
before we start please do following
Thank You
Click to expand...
Click to collapse
Is this thread dead or any hope of further guidance.
What fo you mean source code
does this work for MTK devices?
adityaparmar07 said:
i am getting errors !
Click to expand...
Click to collapse
[/QUOTE]
I tried to search but cannot get anything I'm using mac os x 10.12.6
[/QUOTE]
several years late, but you had a space between . and build instead of a /
FeyoMx said:
Thank you very much for the tutorial I will try to do it
Enviado desde mi A7010a48 mediante Tapatalk
Click to expand...
Click to collapse
what source are you talking about sir?

Help building Dirty Unicorns [solved]

I'm trying to build Dirty Unicorns custom rom for the gtaxlwifi. When I do a brunch gtaxlwifi I get the following error.
mkdir: cannot create directory '/out': Permission denied
Click to expand...
Click to collapse
Am I mistaken in thinking it should be creating the directory "out" and not "/out". The permissions for the build directory are set to 755 so there shouldn't be an issue. Not sure how to fix this.
Here is a full dump:
Code:
brunch gtaxlwifi
including vendor/du/vendorsetup.sh
File "<string>", line 1
import os,sys; print os.path.realpath(sys.argv[1])
^
SyntaxError: invalid syntax
mkdir: cannot create directory '/out': Permission denied
File "build/tools/roomservice.py", line 39
print "Device %s not found. Attempting to retrieve device repository from DU Github (http://github.com/DirtyUnicorns)." % device
^
SyntaxError: invalid syntax
File "<string>", line 1
import os,sys; print os.path.realpath(sys.argv[1])
^
SyntaxError: invalid syntax
mkdir: cannot create directory '/out': Permission denied
mkdir: cannot create directory '/out': Permission denied
============================================
DU_VERSION=du_gtaxlwifi-v11.7.2-20180625-0153-UNOFFICIAL
TARGET_BUILD_VARIANT=userdebug
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=cortex-a53
BUILD_ID=NZH54D
OUT_DIR=/out
============================================
File "<string>", line 1
import os,sys; print os.path.realpath(sys.argv[1])
^
SyntaxError: invalid syntax
mkdir: cannot create directory '/out': Permission denied
============================================
DU_VERSION=du_gtaxlwifi-v11.7.2-20180625-0153-UNOFFICIAL
TARGET_BUILD_VARIANT=userdebug
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=cortex-a53
BUILD_ID=NZH54D
OUT_DIR=/out
============================================
mkdir: cannot create directory '/out': Permission denied
Using '/usr/bin/ninja' binary on 'linux-x86'
mkdir: cannot create directory '/out': Permission denied
mkdir: cannot create directory '/out': Permission denied
mkdir: cannot create directory '/out'make: *** [build/kati/Makefile.ckati:89: /out/host/linux-x86/obj/EXECUTABLES/ckati_intermediates/affinity.o] Error 1
: Permission denied
make: *** Waiting for unfinished jobs....
make: *** [build/kati/Makefile.ckati:89: /out/host/linux-x86/obj/EXECUTABLES/ckati_intermediates/command.o] Error 1
make: *** [build/kati/Makefile.ckati:89: /out/host/linux-x86/obj/EXECUTABLES/ckati_intermediates/dep.o] Error 1
mkdir: cannot create directory '/out': Permission denied
make: *** [build/kati/Makefile.ckati:89: /out/host/linux-x86/obj/EXECUTABLES/ckati_intermediates/eval.o] Error 1
mkdir: cannot create directory '/out': Permission denied
make: *** [build/kati/Makefile.ckati:89: /out/host/linux-x86/obj/EXECUTABLES/ckati_intermediates/exec.o] Error 1
mkdir: cannot create directory '/out': Permission denied
make: *** [build/kati/Makefile.ckati:89: /out/host/linux-x86/obj/EXECUTABLES/ckati_intermediates/expr.o] Error 1
#### make failed to build some targets ####
Thanks for any help given.
srgrusso said:
I'm trying to build Dirty Unicorns custom rom for the gtaxlwifi. When I do a brunch gtaxlwifi I get the following error.
Am I mistaken in thinking it should be creating the directory "out" and not "/out". The permissions for the build directory are set to 755 so there shouldn't be an issue. Not sure how to fix this.
Here is a full dump:
Code:
brunch gtaxlwifi
including vendor/du/vendorsetup.sh
File "<string>", line 1
import os,sys; print os.path.realpath(sys.argv[1])
^
SyntaxError: invalid syntax
mkdir: cannot create directory '/out': Permission denied
File "build/tools/roomservice.py", line 39
print "Device %s not found. Attempting to retrieve device repository from DU Github (http://github.com/DirtyUnicorns)." % device
^
SyntaxError: invalid syntax
File "<string>", line 1
import os,sys; print os.path.realpath(sys.argv[1])
^
SyntaxError: invalid syntax
mkdir: cannot create directory '/out': Permission denied
mkdir: cannot create directory '/out': Permission denied
============================================
DU_VERSION=du_gtaxlwifi-v11.7.2-20180625-0153-UNOFFICIAL
TARGET_BUILD_VARIANT=userdebug
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=cortex-a53
BUILD_ID=NZH54D
OUT_DIR=/out
============================================
File "<string>", line 1
import os,sys; print os.path.realpath(sys.argv[1])
^
SyntaxError: invalid syntax
mkdir: cannot create directory '/out': Permission denied
============================================
DU_VERSION=du_gtaxlwifi-v11.7.2-20180625-0153-UNOFFICIAL
TARGET_BUILD_VARIANT=userdebug
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=cortex-a53
BUILD_ID=NZH54D
OUT_DIR=/out
============================================
mkdir: cannot create directory '/out': Permission denied
Using '/usr/bin/ninja' binary on 'linux-x86'
mkdir: cannot create directory '/out': Permission denied
mkdir: cannot create directory '/out': Permission denied
mkdir: cannot create directory '/out'make: *** [build/kati/Makefile.ckati:89: /out/host/linux-x86/obj/EXECUTABLES/ckati_intermediates/affinity.o] Error 1
: Permission denied
make: *** Waiting for unfinished jobs....
make: *** [build/kati/Makefile.ckati:89: /out/host/linux-x86/obj/EXECUTABLES/ckati_intermediates/command.o] Error 1
make: *** [build/kati/Makefile.ckati:89: /out/host/linux-x86/obj/EXECUTABLES/ckati_intermediates/dep.o] Error 1
mkdir: cannot create directory '/out': Permission denied
make: *** [build/kati/Makefile.ckati:89: /out/host/linux-x86/obj/EXECUTABLES/ckati_intermediates/eval.o] Error 1
mkdir: cannot create directory '/out': Permission denied
make: *** [build/kati/Makefile.ckati:89: /out/host/linux-x86/obj/EXECUTABLES/ckati_intermediates/exec.o] Error 1
mkdir: cannot create directory '/out': Permission denied
make: *** [build/kati/Makefile.ckati:89: /out/host/linux-x86/obj/EXECUTABLES/ckati_intermediates/expr.o] Error 1
#### make failed to build some targets ####
Thanks for any help given.
Click to expand...
Click to collapse
It's not the correct forum for this question but anyway you can use sudo before commands or run build commands into a root terminal
messi2050 said:
It's not the correct forum for this question but anyway you can use sudo before commands or run build commands into a root terminal
Click to expand...
Click to collapse
Thanks for your response, but can you please point me to the correct forum. Also looking at it a little more it doesn't seem to be a permission problem. It looks like it's not sourcing the out directory correctly.
It should be
Code:
OUT_DIR=/mnt/UserData/Projects/Android-Source/DU-n7x/out
Not
Code:
OUT_DIR=/out
Thanks
srgrusso said:
Thanks for your response, but can you please point me to the correct forum. Also looking at it a little more it doesn't seem to be a permission problem. It looks like it's not sourcing the out directory correctly.
It should be
Code:
OUT_DIR=/mnt/UserData/Projects/Android-Source/DU-n7x/out
Not
Code:
OUT_DIR=/out
Thanks
Click to expand...
Click to collapse
Here is the correct forum
https://forum.xda-developers.com/android/help?nocache=1&z=1119390680732286
No it's a permission problem, yw
I feel stupid. I was using python 3 not python 2 which caused build/tools/roomservice.py to error out and not find the source directory.

[GUIDE][Build|Mod|Update][kernel-ranchu][goldfish][5.4][5.10][GKI][ramdisk.img][modules][rootAVD][Android 11(R) 12(S)][AVD][Google Play Store API]

Hello Fellows,
with this Guide I would like to show you a much more easier and reliable way,
on how to build, mod and update your AVDs Kernel with its modules.
By using the official AOSP Build ENV.
The "classic" guide will remain at the end of this thread within a spoiler.
The Development Environment:
Apple Macbook Pro 2015 Dualboot
Linux Mint 19
Android Studio 4.1.3 (Mac OS/Darwin)
Android emulator version 30.5.4.0 (build_id 7243153)
Android SDK Platform-Tools (revision: 31.0.2)
AVDs:
Android 10 (Q) API 29 Google Apis Play Store x86_64 r08 Darwin/MacOS Production Build
Kernel 4.14.112+ -> 4.14.175
Android 11 (R) API 30 Google Apis Play Store x86_64 r10 Darwin/MacOS Production Build
Kernel 5.4.61 -> 5.4.113
Android 12 (S) API 30 Google Apis Play Store x86_64 r02 Darwin/MacOS Production Build
Kernel 5.10.15 -> 5.10.31
rootAVD - To install Magisk and the Kernels Modules into the ramdisk.img
Spoiler: dependencies and repo
Bash:
#############################################|#############################################
###### Build an AVD Kernel and its Ramdisk Modules ######
###### with the official AOSP Build ENV ######
#############################################|#############################################
#############################################|#############################################
###### Install build dependencies, libs and tools ######
#############################################|#############################################
sudo apt-get install -y build-essential libssl-dev kernel-package libncurses5-dev bzip2 \
lib32z1 bison flex libelf-dev qt5-default qttools5-dev-tools qttools5-dev meld geany \
gtk+-2.0 libgtk-3-dev libwebkit2gtk-4.0-dev autogen libgtk2.0-dev libglade2-dev
#############################################|#############################################
###### Get the AOSP repo bin ######
#############################################|#############################################
sudo wget https://storage.googleapis.com/git-repo-downloads/repo -O /usr/bin/repo
sudo chmod a+x /usr/bin/repo
Spoiler: Android 10 (Q) Kernel 4.14
Bash:
#############################################|#############################################
##### Android 10 (Q) Kernel 4.14 #####
##### BRANCH=q-goldfish-android-goldfish-4.14-dev #####
#############################################|#############################################
#############################################|#############################################
### Download Sources, Toolchain, Buildtools etc. (approx. 17GB) ###
#############################################|#############################################
BRANCH=q-goldfish-android-goldfish-4.14-dev
ROOTDIR=AVD-kernel-$BRANCH
mkdir $ROOTDIR && cd $ROOTDIR
repo init --depth=1 -u https://android.googlesource.com/kernel/manifest -b $BRANCH
repo sync --force-sync --no-clone-bundle --no-tags -j$(nproc)
#############################################|#############################################
### Make changes and enable features via the Menuconfig ###
### changes will be saved into the gki_defconfig ###
### i.e. USB 3.0, UHCI HCD for USB-Serial Adapters ###
### or USB Block Devices like /dev/block/sda1 ###
### Device Drivers -> USB support -> <*> xHCI HCD (USB 3.0) support ###
### -*- Generic xHCI driver for a platform device ###
### <*> UHCI HCD (most Intel and VIA) support ###
### <*> USB Mass Storage support ###
### <*> USB Attached SCSI ###
#############################################|#############################################
BUILD_CONFIG=goldfish/build.config.goldfish.x86_64 \
build/config.sh
#############################################|#############################################
### 1st run ###
### Building the Kernel (bzImage) ###
#############################################|#############################################
BUILD_CONFIG=goldfish/build.config.goldfish.x86_64 \
SKIP_CP_KERNEL_HDR=1 \
build/build.sh -j$(nproc)
Files copied to /home/newbit/workdir/AVD-kernel-q-goldfish-android-goldfish-4.14-dev/out/x86_64/dist
#############################################|#############################################
### (1+n)th Build run ###
### Building only changes, not everything ###
#############################################|#############################################
BUILD_CONFIG=goldfish/build.config.goldfish.x86_64 \
SKIP_CP_KERNEL_HDR=1 \
SKIP_MRPROPER=1 \
build/build.sh -j$(nproc)
#############################################|#############################################
### Copy bzImage as kernel-ranchu into the AVDs directory ###
#############################################|#############################################
mv ~/path-to-avd-system-images/android-29/kernel-ranchu ~/path-to-avd-system-images/android-29/kernel-ranchu.backup
cp out/x86_64/dist/bzImage ~/path-to-avd-system-images/android-29/kernel-ranchu
#############################################|#############################################
### Install Magisk with the rootAVD script, ###
### download the USB HOST Permissions Module Zip ###
### patch the fstab.ranchu to automount Block Devices like /dev/block/sda1 ###
#############################################|#############################################
./rootAVD.sh ~/Android/Sdk/system-images/android-29/google_apis_playstore/x86_64/ramdisk.img GetUSBHPmodZ PATCHFSTAB
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Spoiler: Android 11 (R) Kernel 5.4
Bash:
#############################################|#############################################
##### Android 11 (R) Kernel 5.4 #####
##### BRANCH=common-android11-5.4-lts #####
#############################################|#############################################
#############################################|#############################################
### Download Sources, Toolchain, Buildtools etc. (approx. 22GB) ###
#############################################|#############################################
BRANCH=common-android11-5.4-lts
ROOTDIR=AVD-kernel-$BRANCH
mkdir $ROOTDIR && cd $ROOTDIR
repo init --depth=1 -u https://android.googlesource.com/kernel/manifest -b $BRANCH
repo sync --force-sync --no-clone-bundle --no-tags -j$(nproc)
#############################################|#############################################
### Preparing and modding the build.config ###
### add these lines to the BUILD_CONFIG file ###
### common-modules/virtual-device/build.config.goldfish.x86_64 ###
#############################################|#############################################
BUILD_INITRAMFS=1
LZ4_RAMDISK=1
SKIP_CP_KERNEL_HDR=1
#############################################|#############################################
### Make changes and enable features via the Menuconfig ###
### changes will be saved into the gki_defconfig ###
### i.e. USB 3.0 or UHCI HCD for USB-Serial Adapters ###
### Device Drivers -> USB support -> <*> xHCI HCD (USB 3.0) support ###
### -*- Generic xHCI driver for a platform device ###
### <*> UHCI HCD (most Intel and VIA) support ###
#############################################|#############################################
BUILD_CONFIG=common-modules/virtual-device/build.config.goldfish.x86_64 \
FRAGMENT_CONFIG=common/arch/x86/configs/gki_defconfig \
build/config.sh
#############################################|#############################################
### 1st run ###
### Building the Modules and Kernel ###
#############################################|#############################################
BUILD_CONFIG=common-modules/virtual-device/build.config.goldfish.x86_64 \
build/build.sh -j$(nproc)
Files copied to ~/workdir/AVD-kernel-common-android11-5.4-lts/out/android11-5.4/dist
#############################################|#############################################
### Copy bzImage & initramfs.img into the rootAVD directory ###
### and run rootAVD ###
#############################################|#############################################
cp out/android11-5.4/dist/initramfs.img ~/rootAVD/
cp out/android11-5.4/dist/bzImage ~/rootAVD/
./rootAVD.sh ~/path-to-avd-system-images/android-30/ramdisk.img InstallKernelModules
[!] Installing new Kernel Modules
[*] Copy initramfs.img /data/data/com.android.shell/Magisk/tmp/initramfs
[-] Extracting Modules from initramfs.img
Detected format: [lz4_legacy]
Decompressing to [initramfs.cpio]
[*] Removing Stock Modules from ramdisk.img
[!] 5.4.61-android11-2-00064-g4271ad6e8ade-ab6991359
[!] Android (6443078 based on r383902)
[-] Installing new Modules into ramdisk.img
[!] 5.4.113-android11-2-g926c4200b8fc-dirty
[!] Android (7211189, based on r416183)
[*] Adjusting modules.load and modules.dep
[*] Repacking ramdisk ..
#############################################|#############################################
### (1+n)th Build run ###
### Building only changes, not everything ###
#############################################|#############################################
BUILD_CONFIG=common-modules/virtual-device/build.config.goldfish.x86_64 \
SKIP_MRPROPER=1 \
build/build.sh -j$(nproc)
#############################################|#############################################
### Copy bzImage as kernel-ranchu into the AVDs directory ###
### Once the modules are installed, just the kernel is needed ###
#############################################|#############################################
cp out/android11-5.4/dist/bzImage ~/path-to-avd-system-images/android-30/kernel-ranchu
Spoiler: Android 12 (S) Kernel 5.10
Bash:
#############################################|#############################################
##### Android 12 (S) Kernel 5.10 #####
##### BRANCH=common-android12-5.10-lts #####
#############################################|#############################################
#############################################|#############################################
### Download Sources, Toolchain, Buildtools etc. (approx. 22GB) ###
#############################################|#############################################
BRANCH=common-android12-5.10-lts
ROOTDIR=AVD-kernel-$BRANCH
mkdir $ROOTDIR && cd $ROOTDIR
repo init --depth=1 -u https://android.googlesource.com/kernel/manifest -b $BRANCH
repo sync --force-sync --no-clone-bundle --no-tags -j$(nproc)
#############################################|#############################################
### Preparing and modding the build.config ###
### add these lines to the BUILD_CONFIG file ###
### common-modules/virtual-device/build.config.virtual_device.x86_64 ###
#############################################|#############################################
SKIP_CP_KERNEL_HDR=1
FILES="
arch/x86/boot/bzImage
vmlinux
System.map
"
MAKE_GOALS="
bzImage
modules
"
#############################################|#############################################
### Open the Menuconfig, make changes and enable features ###
### changes will be saved into the gki_defconfig ###
### i.e. UHCI HCD for USB-Serial Adapters ###
### USB 3.0 is finally standard built in the ranchu-kernel since Android 12 (S) ###
### Device Drivers -> USB support -> <*> UHCI HCD (most Intel and VIA) support ###
#############################################|#############################################
BUILD_CONFIG=common-modules/virtual-device/build.config.virtual_device.x86_64 \
FRAGMENT_CONFIG=common/arch/x86/configs/gki_defconfig \
build/config.sh
#############################################|#############################################
### 1st Build run ###
### Building the modules and kernel ###
#############################################|#############################################
time BUILD_CONFIG=common-modules/virtual-device/build.config.virtual_device.x86_64 \
build/build.sh -j$(nproc)
Files copied to ~/workdir/AVD-kernel-common-android12-5.10-lts/out/android12-5.10/dist
real 33m16,742s
user 79m12,894s
sys 11m33,474s
#############################################|#############################################
### Copy bzImage & initramfs.img into the rootAVD directory ###
### and run rootAVD ###
### the AVD is running with the new Kernel and Modules ###
### complete the Magisk installation with EnvFixTask ###
#############################################|#############################################
cp out/android12-5.10/dist/initramfs.img ~/rootAVD/
cp out/android12-5.10/dist/bzImage ~/rootAVD/
./rootAVD.sh ~/path-to-avd-system-images/android-S/ramdisk.img InstallKernelModules
[!] Installing new Kernel Modules
[*] Copy initramfs.img /data/data/com.android.shell/Magisk/tmp/initramfs
[-] Extracting Modules from initramfs.img
Detected format: [lz4_legacy]
Decompressing to [initramfs.cpio]
[*] Removing Stock Modules from ramdisk.img
[!] 5.10.15-android12-0-00490-gfca78df78ef2-ab7137072
[!] Android (7037181, based on r407598)
[-] Installing new Modules into ramdisk.img
[!] 5.10.31-android12-1-gb0c3c31639b2-dirty
[!] Android (7211189, based on r416183)
[*] Adjusting modules.load and modules.dep
[*] Repacking ramdisk ..
./rootAVD.sh EnvFixTask
#############################################|#############################################
### (1+n)th Build run ###
### Building only changes, not everything ###
#############################################|#############################################
time BUILD_CONFIG=common-modules/virtual-device/build.config.virtual_device.x86_64 \
SKIP_MRPROPER=1 \
build/build.sh -j$(nproc)
#############################################|#############################################
### Copy bzImage as kernel-ranchu into the AVDs directory ###
### Once the modules are installed, just the kernel is needed ###
#############################################|#############################################
cp out/android12-5.10/dist/bzImage ~/path-to-avd-system-images/android-S/kernel-ranchu
Spoiler: "classic" Guide
with this Guide I would like to show some steps on how to build your own Kernel for an Android Studio Device with CLANG.
The Development Environment:
Apple Macbook Pro 2011 Dualboot
Linux Mint 20 Ulyana
Android Studio 4.1.1 (Software Manager)
KVM -> Cosmic (18.10) or later
Android emulator version 30.3.5.0 (build_id 7033400)
Android SDK Platform-Tools (revision: 30.0.5)
AVD: Android 11 (R) API 30 Google Apis Play Store x86_64 Linux Production Build (revision: 10)
Target: Kernel 5.4.61
### Install the following tools to work with and to build the kernel
Bash:
sudo apt-get install -y build-essential libssl-dev kernel-package libncurses5-dev bzip2 lib32z1 bison flex
sudo apt-get install -y libelf-dev libelf-devel or elfutils-libelf-dev
sudo apt-get install -y qt5-default qttools5-dev-tools qttools5-dev
sudo apt-get install -y geany git
### Gathering Informations about the Target Kernel
By starting the AVD over the command line, we can append some kernel and verbose options:
emulator -netdelay none -netspeed full -no-snapstorage -avd Pixel_4_API_30 -show-kernel -verbose
The terminal will show the kernel information which are important:
Code:
[ 0.000000] Linux version 5.4.61-android11-2-00064-g4271ad6e8ade-ab6991359 ([email protected]) (Android (6443078 based on r383902) clang version 11.0.1 (https://android.googlesource.com/toolchain/llvm-project b397f81060ce6d701042b782172ed13bee898b79), LLD 11.0.1 (/buildbot/tmp/tmp6_m7QH b397f81060ce6d701042b782172ed13bee898b79)) #1 SMP PREEMPT Mon Nov 23 17:45:44 UTC 2020
ValueMeaningLinux version 5.4.61​Kernel VERSION.PATCHLEVEL.SUBLEVEL​android11-2​retagged Kernel branch and KMI generation number -> android11-5.4​-g4271ad6e8ade​Local Version String (very important to avoid: disagrees about version of symbol module_layout)​-ab6991359​Automatically append version information to the version string​build-user​KBUILD_BUILD_USER​build-host​KBUILD_BUILD_HOST​Android (6443078 based on r383902) clang version 11.0.1​Android Clang/LLVM Prebuilt Version r383902​
### Gathering more Informations about what is needed to build the kernel
To figure out what we need to build the kernel, one just needs to look into the build.config file inside the kernel source.
https://android.googlesource.com/kernel/common/+/refs/heads/android11-5.4
build.config.gki.x86_64
build.config.common
build.config.x86_64
build.config.gki
Inside the three build.config files we will find what we need to know.
Makefile:
BRANCH=android11-5.4
KMI_GENERATION=2
CC=clang
LD=ld.lld
NM=llvm-nm
OBJCOPY=llvm-objcopy
DEPMOD=depmod
CLANG_PREBUILT_BIN=prebuilts-master/clang/host/linux-x86/clang-r383902/bin
BUILDTOOLS_PREBUILT_BIN=build/build-tools/path/linux-x86
EXTRA_CMDS=''
STOP_SHIP_TRACEPRINTK=1
IN_KERNEL_MODULES=1
DO_NOT_STRIP_MODULES=1
Makefile:
ARCH=x86_64
CLANG_TRIPLE=x86_64-linux-gnu-
CROSS_COMPILE=x86_64-linux-androidkernel-
LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN=prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/bin
FILES="arch/x86/boot/bzImage
vmlinux
System.map"
Makefile:
DEFCONFIG=gki_defconfig
POST_DEFCONFIG_CMDS="check_defconfig"
Apparently we don't need the build.config.gki
Without further ado, the gathered informations from above will eventually lead up to:
### Download the kernel source, CLANG toolchain, Buildtools and GCC
Bash:
mkdir avdkernel5.4compile && cd avdkernel5.4compile
git clone -b android11-5.4 --single-branch https://android.googlesource.com/kernel/common
mkdir clang-r383902 && cd clang-r383902
wget https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86/+archive/android-11.0.0_r28/clang-r383902.tar.gz
tar -xzf clang-r383902.tar.gz && cd ..
git clone https://android.googlesource.com/kernel/prebuilts/build-tools
git clone \
-b android-11.0.0_r28 \
--single-branch https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9
### Pull the Kernel .config from the AVD
Bash:
adb pull /proc/config.gz
gunzip -k config.gz
### Exports: (must be done in kernel-source directory)
Bash:
cd common
export ARCH=x86_64
export CLANG_TRIPLE=x86_64-linux-gnu-
export CROSS_COMPILE=x86_64-linux-androidkernel-
export LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN=$(pwd)/../x86_64-linux-android-4.9/bin
export CLANG_PREBUILT_BIN=$(pwd)/../clang-r383902/bin
export BUILDTOOLS_PREBUILT_BIN=$(pwd)/../build-tools/linux-x86/bin
DEVEXPS="CC=clang LD=ld.lld NM=llvm-nm OBJCOPY=llvm-objcopy DEPMOD=depmod EXTRA_CMDS='' STOP_SHIP_TRACEPRINTK=1 DO_NOT_STRIP_MODULES=1"
export KBUILD_BUILD_USER=build-user
export KBUILD_BUILD_HOST=build-host
export PATH=$LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN:$CLANG_PREBUILT_BIN:$BUILDTOOLS_PREBUILT_BIN:$PATH
make $DEVEXPS mrproper
cp ../config .config
### add -g4271ad6e8ade to LOCALVERSION -> otherwise modules won't load => module xy disagrees about version of symbol module_layout
Bash:
make $DEVEXPS xconfig
If you come back here later, this is the right place to mod your kernel.
I like the GUI Interface because you have a better overview and a search function.
### build it
Bash:
time make $DEVEXPS -j$(nproc)
### Boot the AVD ...
#### ... from the command line
Bash:
emulator -netdelay none -netspeed full -no-snapstorage -avd Pixel_4_API_30 \
-no-snapshot-load \
-show-kernel \
-verbose \
-ranchu \
-kernel ~/avdkernel5.4compile/common/arch/x86/boot/bzImage
#### ... by replacing the stock kernel-ranchu
Code:
mv ~/Android/Sdk/system-images/android-30/google_apis_playstore/x86_64/kernel-ranchu \
~/Android/Sdk/system-images/android-30/google_apis_playstore/x86_64/kernel-ranchu-backup
cp ~/avdkernel5.4compile/common/arch/x86/boot/bzImage \
~/Android/Sdk/system-images/android-30/google_apis_playstore/x86_64/kernel-ranchu
### Compare the Kernel Verbose Messages
Code:
[ 0.000000] Linux version 5.4.61-g4271ad6e8ade-00014-g158eae717346 ([email protected]) (Android (6443078 based on r383902) clang version 11.0.1 (https://android.googlesource.com/toolchain/llvm-project b397f81060ce6d701042b782172ed13bee898b79), LLD 11.0.1 (/buildbot/tmp/tmp6_m7QH b397f81060ce6d701042b782172ed13bee898b79)) #1 SMP PREEMPT Mon Jan 11 12:58:18 CET 2021
Thanks for reading
Cheers NewBit
Thanks and Credits to @nathanchance, for his wonderful
[REFERENCE] How to compile an Android kernel
brought me a lot of ideas and inspirations
Hello newbit,
I am currently following your guide but when I try to run
Bash:
make $DEVEXPS xconfig
and it resulted in the following error
Bash:
clang: error: no such file or directory: 'LD=ld.lld'
clang: error: no such file or directory: 'NM=llvm-nm'
clang: error: no such file or directory: 'OBJCOPY=llvm-objcopy'
clang: error: no such file or directory: 'DEPMOD=depmod'
clang: error: no such file or directory: 'EXTRA_CMDS='
clang: error: no such file or directory: 'STOP_SHIP_TRACEPRINTK=1'
clang: error: no such file or directory: 'DO_NOT_STRIP_MODULES=1'
clang: error: no such file or directory: 'LD=ld.lld'
clang: error: no such file or directory: 'NM=llvm-nm'
clang: error: no such file or directory: 'OBJCOPY=llvm-objcopy'
clang: error: no such file or directory: 'DEPMOD=depmod'
clang: error: no such file or directory: 'EXTRA_CMDS='
clang: error: no such file or directory: 'STOP_SHIP_TRACEPRINTK=1'
clang: error: no such file or directory: 'DO_NOT_STRIP_MODULES=1'
clang: error: no such file or directory: 'LD=ld.lld'
clang: error: no such file or directory: 'NM=llvm-nm'
clang: error: no such file or directory: 'OBJCOPY=llvm-objcopy'
clang: error: no such file or directory: 'DEPMOD=depmod'
clang: error: no such file or directory: 'EXTRA_CMDS='
clang: error: no such file or directory: 'STOP_SHIP_TRACEPRINTK=1'
clang: error: no such file or directory: 'DO_NOT_STRIP_MODULES=1'
clang: error: no such file or directory: 'LD=ld.lld'
clang: error: no such file or directory: 'NM=llvm-nm'
clang: error: no such file or directory: 'OBJCOPY=llvm-objcopy'
clang: error: no such file or directory: 'DEPMOD=depmod'
clang: error: no such file or directory: 'EXTRA_CMDS='
clang: error: no such file or directory: 'STOP_SHIP_TRACEPRINTK=1'
clang: error: no such file or directory: 'DO_NOT_STRIP_MODULES=1'
clang: error: no such file or directory: 'LD=ld.lld'
clang: error: no such file or directory: 'NM=llvm-nm'
clang: error: no such file or directory: 'OBJCOPY=llvm-objcopy'
clang: error: no such file or directory: 'DEPMOD=depmod'
clang: error: no such file or directory: 'EXTRA_CMDS='
clang: error: no such file or directory: 'STOP_SHIP_TRACEPRINTK=1'
clang: error: no such file or directory: 'DO_NOT_STRIP_MODULES=1'
clang: error: no such file or directory: 'LD=ld.lld'
clang: error: no such file or directory: 'NM=llvm-nm'
clang: error: no such file or directory: 'OBJCOPY=llvm-objcopy'
clang: error: no such file or directory: 'DEPMOD=depmod'
clang: error: no such file or directory: 'EXTRA_CMDS='
clang: error: no such file or directory: 'STOP_SHIP_TRACEPRINTK=1'
clang: error: no such file or directory: 'DO_NOT_STRIP_MODULES=1'
clang: error: no such file or directory: 'LD=ld.lld'
clang: error: no such file or directory: 'NM=llvm-nm'
clang: error: no such file or directory: 'OBJCOPY=llvm-objcopy'
clang: error: no such file or directory: 'DEPMOD=depmod'
clang: error: no such file or directory: 'EXTRA_CMDS='
clang: error: no such file or directory: 'STOP_SHIP_TRACEPRINTK=1'
clang: error: no such file or directory: 'DO_NOT_STRIP_MODULES=1'
clang: error: no such file or directory: 'LD=ld.lld'
clang: error: no such file or directory: 'NM=llvm-nm'
clang: error: no such file or directory: 'OBJCOPY=llvm-objcopy'
clang: error: no such file or directory: 'DEPMOD=depmod'
clang: error: no such file or directory: 'EXTRA_CMDS='
clang: error: no such file or directory: 'STOP_SHIP_TRACEPRINTK=1'
clang: error: no such file or directory: 'DO_NOT_STRIP_MODULES=1'
clang: error: no such file or directory: 'LD=ld.lld'
clang: error: no such file or directory: 'NM=llvm-nm'
clang: error: no such file or directory: 'OBJCOPY=llvm-objcopy'
clang: error: no such file or directory: 'DEPMOD=depmod'
clang: error: no such file or directory: 'EXTRA_CMDS='
clang: error: no such file or directory: 'STOP_SHIP_TRACEPRINTK=1'
clang: error: no such file or directory: 'DO_NOT_STRIP_MODULES=1'
init/Kconfig:34:warning: 'GCC_VERSION': number is invalid
init/Kconfig:45:warning: 'CLANG_VERSION': number is invalid
did you encounter this?
reeferman said:
Hello newbit,
I am currently following your guide but when I try to run
Bash:
make $DEVEXPS xconfig
and it resulted in the following error
Bash:
clang: error: no such file or directory: 'LD=ld.lld'
clang: error: no such file or directory: 'NM=llvm-nm'
clang: error: no such file or directory: 'OBJCOPY=llvm-objcopy'
clang: error: no such file or directory: 'DEPMOD=depmod'
clang: error: no such file or directory: 'EXTRA_CMDS='
clang: error: no such file or directory: 'STOP_SHIP_TRACEPRINTK=1'
clang: error: no such file or directory: 'DO_NOT_STRIP_MODULES=1'
...
init/Kconfig:34:warning: 'GCC_VERSION': number is invalid
init/Kconfig:45:warning: 'CLANG_VERSION': number is invalid
did you encounter this?
Click to expand...
Click to collapse
Hmm, looks weird. No I didn't. Also it is a bit taken out of context. It seems that your $DEVEXPS content gets repeated many times.
Do you have more background infos for me? Like your development environment and If you did change little things? Maybe a typo in the $PATH?
Pretty weird, but I was using kali to do it before and when I switched Linux Mint eveerything worked!
Hi newbit!
Thanks for some great tutorials, unfortunately for me I can't get it to work properly. Hopefully, you're able to help me
I'm trying to build and install a custom kernel in an AOSP built emulator. I've been trying out the "official" guide at https://source.android.com/setup/build/building-kernels#customize-build, your rootAVD guide for Android 11 and the "classic" guide for Android 11. All of the guides give me the same result:
Code:
[ 0.610588] Run /init as init process
[ 0.611985] init: init first stage started!
[ 0.612930] init: Loading module /lib/modules/dummy-cpufreq.ko with args ""
[ 0.613579] dummy_cpufreq: disagrees about version of symbol module_layout
[ 0.614170] init: Failed to insmod '/lib/modules/dummy-cpufreq.ko' with args ''
[ 0.614793] init: LoadWithAliases was unable to load dummy_cpufreq
[ 0.615366] init: [libfs_mgr]ReadFstabFromDt(): failed to read fstab from dt
[ 0.616164] init: Using Android DT directory /proc/device-tree/firmware/android/
[ 0.629196] init: bool android::init::BlockDevInitializer::InitDevices(std::set<std::string>): partition(s) not found in /sys, waiting for their uevent(s): metadata, super, vbmeta
After that, the emulator hangs for a short while and the it reboots to try again..
In your "classic" guide, you're warning about this:
### add -g4271ad6e8ade to LOCALVERSION -> otherwise modules won't load => module xy disagrees about version of symbol module_layout
Click to expand...
Click to collapse
When I checked the version of my running emulator i got this:
Code:
Linux version 5.4.50-01145-g056684c0d252-ab6656030 ([email protected]) (Android (6443078 based on r383902) clang version 11.0.1 (https://android.googlesource.com/toolchain/llvm-project b397f81060ce6d701042b782172ed13bee898b79), LLD 11.0.1 (/buildbot/tmp/tmp6_m7QH b397f81060ce6d701042b782172ed13bee898b79)) #1 SMP PREEMPT Mon Jul 6 18:09:10 UTC 2020
So I used xconfig to add the "-g056684c0d252" string and also made sure to use the r383902 clang toolchain to compile, but no luck.. After compilation and running with the new kernel, I get this version print:
Code:
[ 0.000000] Linux version 5.4.162-g056684c0d252-android11-2-00102-gfe0ed45e42fe-dirty ([email protected]) (Android (6443078 based on r383902) clang version 11.0.1 (https://android.googlesource.com/toolchain/llvm-project b397f81060ce6d701042b782172ed13bee898b79), LLD 11.0.1 (/buildbot/tmp/tmp6_m7QH b397f81060ce6d701042b782172ed13bee898b79)) #1 SMP PREEMPT Fri Nov 26 10:38:38 UTC 2021
Can you see anything obvious from that?
When I tried with rootAVD, I'm getting this output when running the script:
Code:
./rootAVD.sh /aosp/out/target/product/myproduct/ramdisk.img InstallKernelModules
[!] and we are NOT in an emulator shell
[*] Set Directorys
[-] Test if ADB SHELL is working
[-] In any AVD via ADB, you can execute code without root in /data/data/com.android.shell
[-] Magisk installer Zip exists already
[*] Cleaning up the ADB working space
[*] Creating the ADB working space
[*] Push Magisk.zip into /data/data/com.android.shell/Magisk
[-] ./Magisk.zip: 1 file pushed, 0 skipped. 254.4 MB/s (6874374 bytes in 0.026s)
[*] create Backup File of ramdisk.img
[*] Push ramdisk.img into /data/data/com.android.shell/Magisk
[-] /ramdisk.img: 1 file pushed, 0 skipped. 1006.6 MB/s (903723 bytes in 0.001s)
[*] Push initramfs.img into /data/data/com.android.shell/Magisk
[-] ./initramfs.img: 1 file pushed, 0 skipped. 299.9 MB/s (2256062 bytes in 0.007s)
[*] Push rootAVD.sh into /data/data/com.android.shell/Magisk
[-] rootAVD.sh: 1 file pushed, 0 skipped. 243.4 MB/s (7826127 bytes in 0.031s)
[-] run the actually Boot/Ramdisk/Kernel Image Patch Script
[*] from Magisk by topjohnwu and modded by NewBit XDA
[!] We are in an emulator shell
[-] Api Level Arch Detect
[-] Device Platform: x64
[-] ARCH32 x86
[-] Device SDK API: 30
[-] First API Level: 28
[-] Switch to the location of the script file
[*] Extracting busybox and Magisk.zip ...
[-] Checking AVDs Internet connection...
[!] AVD is offline
[*] Re-Run rootAVD in Magisk Busybox STANDALONE (D)ASH
[!] We are in an emulator shell
[-] We are now in Magisk Busybox STANDALONE (D)ASH
[*] rootAVD with Magisk '23.0' Installer
[-] Get Flags
[*] System-as-root, keep dm/avb-verity
[-] Encrypted data, keep forceencrypt
[*] RECOVERYMODE=false
[-] KEEPVERITY=true
[*] KEEPFORCEENCRYPT=true
[*] No 64-Bit Binarys found, please consider Magisk Alpha
[-] copy all x86 files from /data/data/com.android.shell/Magisk/lib/x86 to /data/data/com.android.shell/Magisk
[*] Detecting ramdisk.img compression
[!] Ramdisk.img uses gzip compression
[-] taken from shakalaca's MagiskOnEmulator/process.sh
[*] executing ramdisk splitting / extraction / repacking
[-] API level greater then 30
[*] Check if we need to repack ramdisk before patching ..
[*] After decompressing ramdisk.img, magiskboot will work
Detected format: [gzip]
[-] Test patch status and do restore
[-] Checking ramdisk status
[-] STATUS=0
[-] Stock boot image detected
[-] Patching ramdisk
[*] adding overlay.d/sbin folders to ramdisk
Loading cpio: [ramdisk.cpio]
Create directory [overlay.d] (0750)
Create directory [overlay.d/sbin] (0750)
Dump cpio: [ramdisk.cpio]
[!] PATCHFSTAB=false
[!] Skipping fstab.ranchu patch with /dev/block/sda
[?] If you want fstab.ranchu patched, Call rootAVD with PATCHFSTAB
[!] AddRCscripts=false
[!] Skip adding *.rc scripts into ramdisk.img/sbin/*.rc
[?] If you want *.rc scripts added into ramdisk.img/sbin/*.rc, Call rootAVD with AddRCscripts
[!] patching the ramdisk with Magisk Init
Loading cpio: [ramdisk.cpio]
Add entry [init] (0750)
Add entry [overlay.d/sbin/magisk32.xz] (0644)
Add entry [overlay.d/sbin/magisk64.xz] (0644)
Patch with flag KEEPVERITY=[true] KEEPFORCEENCRYPT=[true]
Loading cpio: [ramdisk.cpio.orig]
Backup mismatch entry: [init] -> [.backup/init]
Record new entry: [overlay.d] -> [.backup/.rmlist]
Record new entry: [overlay.d/sbin] -> [.backup/.rmlist]
Record new entry: [overlay.d/sbin/magisk32.xz] -> [.backup/.rmlist]
Record new entry: [overlay.d/sbin/magisk64.xz] -> [.backup/.rmlist]
Create directory [.backup] (0000)
Add entry [.backup/.magisk] (0000)
Dump cpio: [ramdisk.cpio]
[*] repacking back to ramdisk.img format
[!] Rename Magisk.zip to Magisk.apk
[*] Pull ramdiskpatched4AVD.img into ramdisk.img
[-] /data/data/com.android.shell/Magisk/ramdiskpatched4AVD.img: 1 file pulled, 0 skipped. 294.3 MB/s (1270228 bytes in 0.004s)
[*] Pull Magisk.apk into
[-] /data/data/com.android.shell/Magisk/Magisk.apk: 1 file pulled, 0 skipped. 358.8 MB/s (6342346 bytes in 0.017s)
[*] create Backup File of kernel-ranchu
[*] Copy ./bzImage (Kernel) into kernel-ranchu
[-] Clean up the ADB working space
[-] Install all APKs placed in the Apps folder
[*] Trying to install Apps/Magisk.apk
[*] Performing Streamed Install
[*] Success
[-] Shut-Down & Reboot (Cold Boot Now) the AVD and see if it worked
[-] Root and Su with Magisk for Android Studio AVDs
[-] Modded by NewBit XDA - Jan. 2021
[!] Huge Credits and big Thanks to topjohnwu, shakalaca and vvb2060
[-] Trying to shut down the AVD
[!] If the AVD doesn't shut down, try it manually!
Which is not the same as the one you're showing in the rootAVD guide. Is it anything I'm doing incorrect here or has the prints just changed?
Would be really awesome if you're able to help in any way let me know if you need more info!
I was a little quick on asking questions Got it working! It was the Linux version that was off, the one running in the emulator was 5.4.50 while I was compiling 5.4.162.
When I checked out the commit that had 5.4.50, it all worked like a charm doing it with your "classic" guide!
Thanks again for the awesome guides!
rkull said:
I was a little quick on asking questions Got it working! It was the Linux version that was off, the one running in the emulator was 5.4.50 while I was compiling 5.4.162.
When I checked out the commit that had 5.4.50, it all worked like a charm doing it with your "classic" guide!
Thanks again for the awesome guides!
Click to expand...
Click to collapse
I am glade it worked for you. Sometimes you need some luck. I had quite some issues with the module versions, even If I added the local version right. So the best solutions so far is, to build the modules as well.
I see that your AVD is offline, make sure the Magisk Version is compatible with your AVD API Level.
Occasionally, even with the module versions right, the AVD boot looped, and I had to wipe the AVD and then
it worked. I don't have an explanation for this, just my observations.
Yeah I'm building/installing a custom kernel for an AOSP build, so I'm not using an AVD. Just running the AOSP emulator build:
Code:
source build/envsetup.sh
lunch
emulator
Not packing the build into an AVD but maybe we'll do that in the future
When you say
So the best solutions so far is, to build the modules as well.
Click to expand...
Click to collapse
How's that done exactly? Do I need to do something more that just running
Code:
make $DEVEXPS -j$(nproc)
Or am I still stuck with version 5.4.50 of the kernel?
Not that I see the need for me to update the version, but it would be fun to know how it could be done
rkull said:
Yeah I'm building/installing a custom kernel for an AOSP build, so I'm not using an AVD. Just running the AOSP emulator build:
Click to expand...
Click to collapse
rkull said:
When you say
How's that done exactly? Do I need to do something more that just running
Code:
make $DEVEXPS -j$(nproc)
Or am I still stuck with version 5.4.50 of the kernel?
Not that I see the need for me to update the version, but it would be fun to know how it could be done
Click to expand...
Click to collapse
With the AOSP Build ENV I had to set
Code:
BUILD_INITRAMFS=1
to get the modules build and packed. Don't know how this is done the classical way. Checkout your output directory if you can find
any modules or initramfs.img
rootAVD provides you an option to download prebuild kernels and its modules from AOSP.
You can try this to get a higher Kernel version.
Thank you very much!good job!

Categories

Resources