how to flash kernel & system compile error - Google Pixel Questions & Answers

I got a pixel recently, I want to flash kernel, but I met some problems
pc os : ubuntu 14.04
pixel android version: NDE63H
pixel kernel version: 3.18.31-g19caf23
1. I have unlocked the bootloader
2. make defconfig
cause pixel and pixel XL use the marlin_defconfig, so
$ make marlin_defconfig
$ make
$ cp arch/arm64/boot/Image.gz /device/google/marlin-kernel
$ source build/envsetup.sh
$ lunch (choose the sailfish)
3. FLash bootimage into the phone
but the phone reboot about 3 times and enter in the recovery
Question:
1. do I miss something or do someting wrong? why can't boot the system
2. Is there some relation bewteen android version and kernel version?
-------------------------------------------------
I also met a compile error , here is the error log, bad CRC ???
HTML:
[ 0% 7/35152] Docs droiddoc: out/target/common/docs/api-stubs
DroidDoc took 9 sec. to write docs to out/target/common/docs/api-stubs
[ 0% 10/35152] Docs droiddoc: out/target/common/docs/system-api-stubs
DroidDoc took 10 sec. to write docs to out/target/common/docs/system-api-stubs
[ 0% 13/35152] Docs droiddoc: out/target/common/docs/test-api-stubs
DroidDoc took 7 sec. to write docs to out/target/common/docs/test-api-stubs
[ 0% 51/35152] Ensure Jack server is installed and started
Jack server already installed in "/home/local/xxx/.jack-server"
Server is already running
[ 0% 59/35136] target R.java/Manifest.java: Bluetooth (out/target/common/obj/APPS/Bluetooth_intermediates/src/R.stamp)
warning: string 'map_acceptance_timeout_message' has no default translation.
warning: string 'map_auth_notif_message' has no default translation.
warning: string 'map_auth_notif_ticker' has no default translation.
warning: string 'map_auth_notif_title' has no default translation.
warning: string 'map_authentication_timeout_message' has no default translation.
warning: string 'map_defaultname' has no default translation.
warning: string 'map_defaultnumber' has no default translation.
warning: string 'map_localPhoneName' has no default translation.
warning: string 'map_session_key_dialog_header' has no default translation.
warning: string 'map_session_key_dialog_title' has no default translation.
warning: string 'map_unknownName' has no default translation.
[ 0% 60/35136] Compiling SDK Stubs: out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/classes.jar
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
[ 0% 64/35136] build out/target/common/obj/JAVA_LIBRARIES/sdk_v13_intermediates/classes.jack
FAILED: /bin/bash -c "(mkdir -p out/target/common/obj/JAVA_LIBRARIES/sdk_v13_intermediates/classes.jack.tmpjill.res ) && (unzip -qo prebuilts/sdk/13/android.jar -d out/target/common/obj/JAVA_LIBRARIES/sdk_v13_intermediates/classes.jack.tmpjill.res ) && (find out/target/common/obj/JAVA_LIBRARIES/sdk_v13_intermediates/classes.jack.tmpjill.res -iname \"*.class\" -delete ) && (JACK_VERSION=3.36.CANDIDATE out/host/linux-x86/bin/jack [user=252872]@build[/user]/core/jack-default.args --verbose error -D jack.import.resource.policy=keep-first -D jack.import.type.policy=keep-first -D jack.android.min-api-level=1 --import prebuilts/sdk/13/android.jar --import-resource out/target/common/obj/JAVA_LIBRARIES/sdk_v13_intermediates/classes.jack.tmpjill.res --output-jack out/target/common/obj/JAVA_LIBRARIES/sdk_v13_intermediates/classes.jack ) && (rm -rf out/target/common/obj/JAVA_LIBRARIES/sdk_v13_intermediates/classes.jack.tmpjill.res )"
out/target/common/obj/JAVA_LIBRARIES/sdk_v13_intermediates/classes.jack.tmpjill.res/res/drawable-large-nodpi/default_wallpaper.jpg bad CRC a27dfad3 (should be 8f07f03c)
ninja: build stopped: subcommand failed.
make: *** [ninja_wrapper] Error 1
#### make failed to build some targets (05:51 (mm:ss)) ####
thx a lot

nobody reply, I just want to know how to flash a modified boot image.
thx a lot
I change nothing and compiled a boot image, flash into the pixel, it can't bootup

Related

compiling problems, at a loss and been googling for days.

this is the error i come accross when trying to compile from source.
i'm running ubunut 8.0.4 LTS Hardy Heron
these are the steps i use when settign it up:
http://source.android.com/download (for downloading and compiling the source)
'make' is ran once for the purposes of gettign ready to edit with eclipse
i git cloned housh's vendor tree from http://github.com/koush
SDK is installed in ~/android-sdk
sourcecode is in ~/android-source/android-2.1_r1
the files from koush's vendor tree are in ~/android-source/android-2.1_r1/vendor/motorola/sholes-open
proprietary files are from a 2.0.1 rom and located in ~/android-source/android-2.1_r1/proprietary
Code:
. build/envsetup.sh
lunch sholes-eng
make
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.1
TARGET_PRODUCT=sholes
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=ERD79
============================================
build/core/copy_headers.mk:15: warning: overriding commands for target `out/target/product/sholes-open/obj/include/libpv/getactualaacconfig.h'
build/core/copy_headers.mk:15: warning: ignoring old commands for target `out/target/product/sholes-open/obj/include/libpv/getactualaacconfig.h'
/bin/bash: line 0: cd: sdk/layoutopt/app/src/resources: No such file or directory
No private recovery resources for TARGET_DEVICE sholes-open
Install: out/host/linux-x86/bin/vm-tests
Install: out/target/product/sholes-open/system/app/Mms.apk
target Executable: app_process (out/target/product/sholes-open/obj/EXECUTABLES/app_process_intermediates/LINKED/app_process)
/home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/../lib/gcc/arm-eabi/4.4.0/../../../../arm-eabi/bin/ld: warning: libril_rds.so, needed by out/target/product/sholes-open/obj/lib/libmoto_gps.so, not found (try using -rpath or -rpath-link)
/home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/../lib/gcc/arm-eabi/4.4.0/../../../../arm-eabi/bin/ld: warning: libnmea.so, needed by out/target/product/sholes-open/obj/lib/libmoto_gps.so, not found (try using -rpath or -rpath-link)
out/target/product/sholes-open/obj/lib/libmoto_gps.so: undefined reference to `RdsSetupRemoteConnection'
out/target/product/sholes-open/obj/lib/libmoto_gps.so: undefined reference to `RdsUtilCreateMsg'
out/target/product/sholes-open/obj/lib/libmoto_gps.so: undefined reference to `nmea_parse_sentence'
out/target/product/sholes-open/obj/lib/libmoto_gps.so: undefined reference to `RdsUtilSendMsg'
out/target/product/sholes-open/obj/lib/libmoto_gps.so: undefined reference to `nmea_parse_error_string'
out/target/product/sholes-open/obj/lib/libmoto_gps.so: undefined reference to `RdsReadServerRsp'
collect2: ld returned 1 exit status
make: *** [out/target/product/sholes-open/obj/EXECUTABLES/app_process_intermediates/LINKED/app_process] Error 1
i tried using -rpath-link as you can see these were my results.
Code:
*****@lap:~/android-source/android-2.1_r1$ make -rpath-link=/home/tourach23/android-source/proprietary
make: invalid option -- a
Usage: make [options] [target] ...
Options:
-b, -m Ignored for compatibility.
-B, --always-make Unconditionally make all targets.
-C DIRECTORY, --directory=DIRECTORY
Change to DIRECTORY before doing anything.
-d Print lots of debugging information.
--debug[=FLAGS] Print various types of debugging information.
-e, --environment-overrides
Environment variables override makefiles.
-f FILE, --file=FILE, --makefile=FILE
Read FILE as a makefile.
-h, --help Print this message and exit.
-i, --ignore-errors Ignore errors from commands.
-I DIRECTORY, --include-dir=DIRECTORY
Search DIRECTORY for included makefiles.
-j [N], --jobs[=N] Allow N jobs at once; infinite jobs with no arg.
-k, --keep-going Keep going when some targets can't be made.
-l [N], --load-average[=N], --max-load[=N]
Don't start multiple jobs unless load is below N.
-L, --check-symlink-times Use the latest mtime between symlinks and target.
-n, --just-print, --dry-run, --recon
Don't actually run any commands; just print them.
-o FILE, --old-file=FILE, --assume-old=FILE
Consider FILE to be very old and don't remake it.
-p, --print-data-base Print make's internal database.
-q, --question Run no commands; exit status says if up to date.
-r, --no-builtin-rules Disable the built-in implicit rules.
-R, --no-builtin-variables Disable the built-in variable settings.
-s, --silent, --quiet Don't echo commands.
-S, --no-keep-going, --stop
Turns off -k.
-t, --touch Touch targets instead of remaking them.
-v, --version Print the version number of make and exit.
-w, --print-directory Print the current directory.
--no-print-directory Turn off -w, even if it was turned on implicitly.
-W FILE, --what-if=FILE, --new-file=FILE, --assume-new=FILE
Consider FILE to be infinitely new.
--warn-undefined-variables Warn when an undefined variable is referenced.
This program built for i486-pc-linux-gnu
Report bugs to <[email protected]>
# Make data base, printed on Mon Mar 1 17:14:13 2010
# Variables
# environment
DESKTOP_SESSION = default
# environment
ANDROID_EABI_TOOLCHAIN = /home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin
# environment
GTK_RC_FILES = /etc/gtk/gtkrc:/home/tourach23/.gtkrc-1.2-gnome2
# environment
DESKTOP_STARTUP_ID =
# environment
XAUTHORITY = /home/tourach23/.Xauthority
# environment
GDMSESSION = default
# environment
SHELL = /bin/bash
# environment
GDM_LANG = en_US.UTF-8
# environment
_ = /usr/bin/make
# environment
BUILD_ENV_SEQUENCE_NUMBER = 9
# environment
HISTCONTROL = ignoreboth
# environment
USERNAME = tourach23
# environment
ANDROID_BUILD_PATHS = :/home/tourach23/android-source/android-2.1_r1/out/host/linux-x86/bin:/home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin:/home/tourach23/android-source/android-2.1_r1/development/emulator/qtools:/home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin:/home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin
# environment
XDG_DATA_DIRS = /usr/local/share/:/usr/share/:/usr/share/gdm/
# environment
TARGET_SIMULATOR = false
# environment
DBUS_SESSION_BUS_ADDRESS = unix:abstract=/tmp/dbus-3sPGG4tkYw,guid=7738ab73bff2808fff67e4da4b8a9d2c
# environment
GNOME_KEYRING_SOCKET = /tmp/keyring-x3cTQA/socket
# environment
LESSOPEN = | /usr/bin/lesspipe %s
# environment
TARGET_BUILD_TYPE = release
# environment
PATH = /home/tourach23/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/tourach23/android-source/android-2.1_r1/out/host/linux-x86/bin:/home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin:/home/tourach23/android-source/android-2.1_r1/development/emulator/qtools:/home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin:/home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin
# environment
ANDROID_QTOOLS = /home/tourach23/android-source/android-2.1_r1/development/emulator/qtools
# environment
GPG_AGENT_INFO = /tmp/seahorse-ssh3T0/S.gpg-agent:5563:1
# environment
SESSION_MANAGER = local/lap:/tmp/.ICE-unix/5448
# environment
WINDOWID = 56623197
# environment
GDM_XSERVER_LOCATION = local
# default
.FEATURES := target-specific order-only second-expansion else-if archives jobserver check-symlink
# environment
LS_COLORS = no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.svgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:
# environment
SSH_AUTH_SOCK = /tmp/keyring-x3cTQA/ssh
# environment
DISPLAY = :0.0
# environment
OPROFILE_EVENTS_DIR = /home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/oprofile
# environment
PWD = /home/tourach23/android-source/android-2.1_r1
# environment
HOME = /home/tourach23
# environment
ANDROID_PRODUCT_OUT = /home/tourach23/android-source/android-2.1_r1/out/target/product/sholes-open
# environment
XDG_SESSION_COOKIE = c6a232a9259e01cec5dca10f4b8a3c01-1267375402.490755-69030679
# environment
LOGNAME = tourach23
# environment
TARGET_PRODUCT = sholes
# environment
LESSCLOSE = /usr/bin/lesspipe %s %s
# environment
GNOME_DESKTOP_SESSION_ID = Default
# environment
COLORTERM = gnome-terminal
# environment
SHLVL = 1
# environment
DISABLE_DEXPREOPT = true
# environment
USER = tourach23
# environment
GNOME_KEYRING_PID = 5447
# environment
ANDROID_TOOLCHAIN = /home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin
# environment
OLDPWD = /home/tourach23/android-source
# default
.VARIABLES :=
# environment
PROMPT_COMMAND = echo -ne "\033]0;[sholes-eng] [email protected]: /home/tourach23/android-source/android-2.1_r1\007"
# environment
OUT = /home/tourach23/android-source/android-2.1_r1/out/target/product/sholes-open
# environment
ANDROID_BUILD_TOP = /home/tourach23/android-source/android-2.1_r1
# environment
TARGET_BUILD_VARIANT = eng
# environment
WINDOWPATH = 7
# environment
LANG = en_US.UTF-8
# environment
TERM = xterm
# variable set hash-table stats:
# Load=53/1024=5%, Rehash=0, Collisions=2/60=3%
# Pattern-specific Variable Values
# No pattern-specific variable values.
# Directories
# No files, no impossibilities in 0 directories.
# Implicit Rules
# No implicit rules.
# Files
# files hash-table stats:
# Load=0/1024=0%, Rehash=0, Collisions=0/0=0%
# VPATH Search Paths
# No `vpath' search paths.
# No general (`VPATH' variable) search path.
# # of strings in strcache: 0
# # of strcache buffers: 0
# strcache size: total = 0 / max = 0 / min = 4096 / avg = 0
# strcache free: total = 0 / max = 0 / min = 4096 / avg = 0
# Finished Make data base on Mon Mar 1 17:14:13 2010
as the post says i ahve been googling this for days trying to figure something out. any help even if it's a point in the right direction would be greatly appreciated.
You are posting in the HTC passion group, but the procedure should be the same as far as building using koush's vendor packages.
I myself am trying to find instructions on building AOSP with vendor overlay just as you describe. I am looking for the equivalent of "building for dream" on source.android.com, for the nexus one. The same instructions would probably mostly apply to the motorola sholes you are asking for.
help!
yeah i debated between the G1 forum and the N1 forum since there isn't a sholes forum.
i've got everything setup as far as i know, but i am obviously missing something. i can compile individual system apk's like Launcher2.apk but if i go for a full system build it crashes out.
sniffle said:
yeah i debated between the G1 forum and the N1 forum since there isn't a sholes forum.
i've got everything setup as far as i know, but i am obviously missing something. i can compile individual system apk's like Launcher2.apk but if i go for a full system build it crashes out.
Click to expand...
Click to collapse
Did you remember to extract the proprietary files by using the extract-files.sh in koush's vendor dir?
I ran the extraction file in both the sholes-open directory as well as the root directory of the source files since I wasn't sure if the files needed to be placed in the source directory or the vendor directory.
Proprietary firles are locate in the following locations
Android-2.1_r1>proprietary
And
Android-2.1_r1>vendor>motorola>sholes-open>proprietary
sniffle said:
this is the error i come accross when trying to compile from source.
Code:
. build/envsetup.sh
lunch sholes-eng
make
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.1
TARGET_PRODUCT=sholes
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=ERD79
============================================
build/core/copy_headers.mk:15: warning: overriding commands for target `out/target/product/sholes-open/obj/include/libpv/getactualaacconfig.h'
build/core/copy_headers.mk:15: warning: ignoring old commands for target `out/target/product/sholes-open/obj/include/libpv/getactualaacconfig.h'
/bin/bash: line 0: cd: sdk/layoutopt/app/src/resources: No such file or directory
Click to expand...
Click to collapse
Hi there, I've been looking for a while, ... and twice !
This error comes from your java version. You should use jdk-1.5.0.19
That you can find there
Code:
https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/[email protected]_Developer
Cheers,
Shaiton
drop by cyanogenmod IRC for live help, someone or the other will be able to help, according to me it might be some lib error. try repo sync again and make clean. then try building again

[Q] Just started building AOSP... A little help...

Hey guys. I have a few questions about building AOSP. I have just started "ROM developing" if you want to call it, and need help. First off, how do I change the Device Name, Model Number, etc. in the AOSP source code? I am not using a kitchen to do this, as I am building 5.0. Also, how do I make a flashable zip instead if fastboot flashable .img's. And last question: how do I include pre-built apps (APKs) into a build? Thanks!
1st - iirc, this can be done with build prop overrides. 2nd - 'make otapackage'. 3rd, argh, can't remember.
Sent from my Nexus 5 using Tapatalk
More help...
The first time I ran make with otapackage, it made a zip file, that I'm assuming was flashable. I also downloaded a SlimRom zip to compare them. I noticed that in the SlimROM Zip, it has a system folder, not .img files. This allows for greater control of what is on the ROM I think, such as editing build.prop. How do I implement this into my flashable zip? So essentialy, I would like my flashable zip to have a /system folder, not system.img , patch, dat , etc. Thanks!
When I build slim, i use "make bacon" (or rather "mka bacon")
Have a look on their github at how their make files etc work.
I've rebuilt my system from scratch so I can't really figure it out for you. I need to get it back into a build environment first.
rootSU said:
When I build slim, i use "make bacon" (or rather "mka bacon")
Have a look on their github at how their make files etc work.
I've rebuilt my system from scratch so I can't really figure it out for you. I need to get it back into a build environment first.
Click to expand...
Click to collapse
Thanks for replying. I'll have a look.
Code:
including ./vendor/qcom/hammerhead/proprietary/Android.mk ...
PRODUCT_COPY_FILES device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml ignored.
PRODUCT_COPY_FILES frameworks/native/data/etc/handheld_core_hardware.xml:system/etc/permissions/handheld_core_hardware.xml ignored.
build/core/Makefile:33: warning: overriding commands for target `out/target/product/hammerhead/system/lib/hw/gps.msm8974.so'
build/core/base_rules.mk:550: warning: ignoring old commands for target `out/target/product/hammerhead/system/lib/hw/gps.msm8974.so'
build/core/Makefile:33: warning: overriding commands for target `out/target/product/hammerhead/system/lib/libgps.utils.so'
build/core/base_rules.mk:550: warning: ignoring old commands for target `out/target/product/hammerhead/system/lib/libgps.utils.so'
build/core/Makefile:33: warning: overriding commands for target `out/target/product/hammerhead/system/lib/libloc_core.so'
build/core/base_rules.mk:550: warning: ignoring old commands for target `out/target/product/hammerhead/system/lib/libloc_core.so'
build/core/Makefile:33: warning: overriding commands for target `out/target/product/hammerhead/system/lib/libloc_eng.so'
build/core/base_rules.mk:550: warning: ignoring old commands for target `out/target/product/hammerhead/system/lib/libloc_eng.so'
find: `bootable/recovery/res': No such file or directory
No private recovery resources for TARGET_DEVICE hammerhead
----- Making recovery filesystem ------
build/tools/generate-notice-files.py out/target/product/hammerhead/obj/NOTICE.txt out/target/product/hammerhead/obj/NOTICE.html "Notices for files contained in the filesystem images in this directory:" out/target/product/hammerhead/obj/NOTICE_FILES/src
make: *** No rule to make target `out/host/linux-x86/bin/unpackbootimg', needed by `out/target/product/hammerhead/aosp_hammerhead-ota-eng.austin.zip'. Stop.
make: *** Waiting for unfinished jobs....
Copying baseline ramdisk...
Modifying ramdisk contents...
cp: cannot stat ‘out/target/product/hammerhead/root/init.recovery.*.rc’: No such file or directory
make: [out/target/product/hammerhead/recovery/root.ts] Error 1 (ignored)
rm -f /init.*.rc
mkdir -p out/target/product/hammerhead/recovery/root/system/bin
cp: cannot stat ‘bootable/recovery/res’: No such file or directory
make: *** [out/target/product/hammerhead/recovery/root.ts] Error 1
Combining NOTICE files into HTML
Combining NOTICE files into text
#### make failed to build some targets (38 seconds) ####
This happened after using SlimRoms makefile instead of aosp. I still have AOSP's back uped though.
Yeah you won't be able to use it. You should be able to look at it and work out what it does though.
Thanks again for helping me, never had a bad experience on XDA. I am a big noob at this, but during a quick skimdown of the Slim Makefile, I found this:
Code:
bacon: otapackage
ifneq ($(TARGET_CUSTOM_RELEASETOOL),)
@echo -e ${CL_YLW}"Running custom releasetool..."${CL_RST}
$(hide) OTAPACKAGE=$(INTERNAL_OTA_PACKAGE_TARGET) APKCERTS=$(APKCERTS_FILE) $(TARGET_CUSTOM_RELEASETOOL)
else
@echo -e ${CL_YLW}"Running releasetool..."${CL_RST}
$(hide) OTAPACKAGE=$(INTERNAL_OTA_PACKAGE_TARGET) APKCERTS=$(APKCERTS_FILE) ./vendor/slim/tools/squisher
endif
Could this mean something? I'm not sure.

Build Android error. Help me,plz!

Code:
FAILED: /home/jack/Mokee/O/out/target/common/docs/mokee-api-stubs-timestamp
/bin/bash -c "(mkdir -p /home/jack/Mokee/O/out/target/common/obj/JAVA_LIBRARIES/mokee-api-stubs_intermediates/ ) && (rm -f /home/jack/Mokee/O/out/target/common/obj/JAVA_LIBRARIES/mokee-api-stubs_intermediates/droiddoc-src-list ) && (touch /home/jack/Mokee/O/out/target/common/obj/JAVA_LIBRARIES/mokee-api-stubs_intermediates/droiddoc-src-list ) && (echo -n 'mokee-sdk/sdk/src/java/mokee/alarmclock/ClockContract.java mokee-sdk/sdk/src/java/mokee/alarmclock/MoKeeAlarmClock.java mokee-sdk/sdk/src/java/mokee/app/CustomTile.java mokee-sdk/sdk/src/java/mokee/app/CustomTileListenerService.java mokee-sdk/sdk/src/java/mokee/app/MKContextConstants.java mokee-sdk/sdk/src/java/mokee/app/MKStatusBarManager.java mokee-sdk/sdk/src/java/mokee/app/MKTelephonyManager.java mokee-sdk/sdk/src/java/mokee/app/Profile.java mokee-sdk/sdk/src/java/mokee/app/ProfileGroup.java mokee-sdk/sdk/src/java/mokee/app/ProfileManager.java mokee-sdk/sdk/src/java/mokee/app/StatusBarPanelCustomTile.java mokee-sdk/sdk/src/java/mokee/content/Intent.java mokee-sdk/sdk/src/java/mokee/externalviews/ExternalView.java mokee-sdk/sdk/src/java/mokee/externalviews/ExternalViewProperties.java mokee-sdk/sdk/src/java/mokee/externalviews/ExternalViewProviderService.java mokee-sdk/sdk/src/java/mokee/hardware/DisplayMode.java mokee-sdk/sdk/src/java/mokee/hardware/HSIC.java mokee-sdk/sdk/src/java/mokee/hardware/LiveDisplayConfig.java mokee-sdk/sdk/src/java/mokee/hardware/LiveDisplayManager.java mokee-sdk/sdk/src/java/mokee/hardware/MKHardwareManager.java mokee-sdk/sdk/src/java/mokee/hardware/ThermalListenerCallback.java mokee-sdk/sdk/src/java/mokee/hardware/TouchscreenGesture.java mokee-sdk/sdk/src/java/mokee/media/AudioSessionInfo.java mokee-sdk/sdk/src/java/mokee/media/MKAudioManager.java mokee-sdk/sdk/src/java/mokee/media/MediaRecorder.java mokee-sdk/sdk/src/java/mokee/os/Build.java mokee-sdk/sdk/src/java/mokee/os/Concierge.java mokee-sdk/sdk/src/java/mokee/power/PerformanceManager.java mokee-sdk/sdk/src/java/mokee/power/PerformanceManagerInternal.java mokee-sdk/sdk/src/java/mokee/power/PerformanceProfile.java mokee-sdk/sdk/src/java/mokee/preference/ConstraintsHelper.java mokee-sdk/sdk/src/java/mokee/preference/GlobalSettingSwitchPreference.java mokee-sdk/sdk/src/java/mokee/preference/MKGlobalSettingSwitchPreference.java mokee-sdk/sdk/src/java/mokee/preference/MKSecureSettingListPreference.java mokee-sdk/sdk/src/java/mokee/preference/MKSecureSettingSwitchPreference.java mokee-sdk/sdk/src/java/mokee/preference/MKSystemSettingDropDownPreference.java mokee-sdk/sdk/src/java/mokee/preference/MKSystemSettingListPreference.java mokee-sdk/sdk/src/java/mokee/preference/MKSystemSettingSwitchPreference.java mokee-sdk/sdk/src/java/mokee/preference/RemotePreference.java mokee-sdk/sdk/src/java/mokee/preference/RemotePreferenceManager.java mokee-sdk/sdk/src/java/mokee/preference/RemotePreferenceUpdater.java mokee-sdk/sdk/src/java/mokee/preference/SecureSettingSwitchPreference.java mokee-sdk/sdk/src/java/mokee/preference/SelfRemovingDropDownPreference.java mokee-sdk/sdk/src/java/mokee/preference/SelfRemovingListPreference.java mokee-sdk/sdk/src/java/mokee/preference/SelfRemovingPreference.java mokee-sdk/sdk/src/java/mokee/preference/SelfRemovingSwitchPreference.java mokee-sdk/sdk/src/java/mokee/preference/SettingsHelper.java mokee-sdk/sdk/src/java/mokee/preference/SystemSettingSwitchPreference.java mokee-sdk/sdk/src/java/mokee/profiles/AirplaneModeSettings.java mokee-sdk/sdk/src/java/mokee/profiles/BrightnessSettings.java mokee-sdk/sdk/src/java/mokee/profiles/ConnectionSettings.java mokee-sdk/sdk/src/java/mokee/profiles/LockSettings.java mokee-sdk/sdk/src/java/mokee/profiles/RingModeSettings.java mokee-sdk/sdk/src/java/mokee/profiles/StreamSettings.java mokee-sdk/sdk/src/java/mokee/providers/DataUsageContract.java mokee-sdk/sdk/src/java/mokee/providers/MKSettings.java mokee-sdk/sdk/src/java/mokee/providers/WeatherContract.java mokee-sdk/sdk/src/java/mokee/util/ColorUtils.java mokee-sdk/sdk/src/java/mokee/util/palette/ColorCutQuantizer.java mokee-sdk/sdk/src/java/mokee/util/palette/ColorUtils.java mokee-sdk/sdk/src/java/mokee/util/palette/DefaultGenerator.java mokee-sdk/sdk/src/java/mokee/util/palette/Palette.java mokee-sdk/sdk/src/java/mokee/weather/MKWeatherManager.java mokee-sdk/sdk/src/java/mokee/weather/RequestInfo.java mokee-sdk/sdk/src/java/mokee/weather/WeatherInfo.java mokee-sdk/sdk/src/java/mokee/weather/WeatherLocation.java mokee-sdk/sdk/src/java/mokee/weather/util/WeatherUtils.java mokee-sdk/sdk/src/java/mokee/weatherservice/ServiceRequest.java mokee-sdk/sdk/src/java/mokee/weatherservice/ServiceRequestResult.java mokee-sdk/sdk/src/java/mokee/weatherservice/WeatherProviderService.java /home/jack/Mokee/O/out/target/common/obj/APPS/org.mokee.platform-res_intermediates/src/mokee/platform/R.java /home/jack/Mokee/O/out/target/common/obj/APPS/org.mokee.platform-res_intermediates/src/mokee/platform/Manifest.java /home/jack/Mokee/O/out/target/common/obj/APPS/org.mokee.platform-res_intermediates/src/org/mokee/platform/internal/R.java ' >> /home/jack/Mokee/O/out/target/common/obj/JAVA_LIBRARIES/mokee-api-stubs_intermediates/droiddoc-src-list ) && (for d in /home/jack/Mokee/O/out/target/common/obj/JAVA_LIBRARIES/mokee-api-stubs_intermediates/src /home/jack/Mokee/O/out/target/common/obj/JAVA_LIBRARIES/org.mokee.platform.sdk_intermediates/src ; do find \$d -name '*.java' -and -not -name '.*' >> /home/jack/Mokee/O/out/target/common/obj/JAVA_LIBRARIES/mokee-api-stubs_intermediates/droiddoc-src-list 2> /dev/null ; done ; true ) && (( javadoc -encoding UTF-8 \\@/home/jack/Mokee/O/out/target/common/obj/JAVA_LIBRARIES/mokee-api-stubs_intermediates/droiddoc-src-list -J-Xmx1600m -J-XX:-OmitStackTraceInFastThrow -XDignore.symbol.file -quiet -doclet com.google.doclava.Doclava -docletpath /home/jack/Mokee/O/out/host/linux-x86/framework/jsilver.jar:/home/jack/Mokee/O/out/host/linux-x86/framework/doclava.jar -templatedir build/tools/droiddoc/templates-sdk -bootclasspath /home/jack/Mokee/O/out/target/common/obj/JAVA_LIBRARIES/core-oj_intermediates/classes.jar:/home/jack/Mokee/O/out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes.jar -classpath /home/jack/Mokee/O/out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes.jar:/home/jack/Mokee/O/out/target/common/obj/JAVA_LIBRARIES/core-oj_intermediates/classes.jar:/home/jack/Mokee/O/out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes.jar:/home/jack/Mokee/O/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar:/home/jack/Mokee/O/out/target/common/obj/JAVA_LIBRARIES/org.mokee.platform.sdk_intermediates/classes.jar: -sourcepath sdk/src/java/mokee/alarmclock/ClockContract.java:sdk/src/java/mokee/alarmclock/MoKeeAlarmClock.java:sdk/src/java/mokee/app/CustomTile.java:sdk/src/java/mokee/app/CustomTileListenerService.java:sdk/src/java/mokee/app/MKContextConstants.java:sdk/src/java/mokee/app/MKStatusBarManager.java:sdk/src/java/mokee/app/MKTelephonyManager.java:sdk/src/java/mokee/app/Profile.java:sdk/src/java/mokee/app/ProfileGroup.java:sdk/src/java/mokee/app/ProfileManager.java:sdk/src/java/mokee/app/StatusBarPanelCustomTile.java:sdk/src/java/mokee/content/Intent.java:sdk/src/java/mokee/externalviews/ExternalView.java:sdk/src/java/mokee/externalviews/ExternalViewProperties.java:sdk/src/java/mokee/externalviews/ExternalViewProviderService.java:sdk/src/java/mokee/hardware/DisplayMode.java:sdk/src/java/mokee/hardware/HSIC.java:sdk/src/java/mokee/hardware/LiveDisplayConfig.java:sdk/src/java/mokee/hardware/LiveDisplayManager.java:sdk/src/java/mokee/hardware/MKHardwareManager.java:sdk/src/java/mokee/hardware/ThermalListenerCallback.java:sdk/src/java/mokee/hardware/TouchscreenGesture.java:sdk/src/java/mokee/media/AudioSessionInfo.java:sdk/src/java/mokee/media/MKAudioManager.java:sdk/src/java/mokee/media/MediaRecorder.java:sdk/src/java/mokee/os/Build.java:sdk/src/java/mokee/os/Concierge.java:sdk/src/java/mokee/power/PerformanceManager.java:sdk/src/java/mokee/power/PerformanceManagerInternal.java:sdk/src/java/mokee/power/PerformanceProfile.java:sdk/src/java/mokee/preference/ConstraintsHelper.java:sdk/src/java/mokee/preference/GlobalSettingSwitchPreference.java:sdk/src/java/mokee/preference/MKGlobalSettingSwitchPreference.java:sdk/src/java/mokee/preference/MKSecureSettingListPreference.java:sdk/src/java/mokee/preference/MKSecureSettingSwitchPreference.java:sdk/src/java/mokee/preference/MKSystemSettingDropDownPreference.java:sdk/src/java/mokee/preference/MKSystemSettingListPreference.java:sdk/src/java/mokee/preference/MKSystemSettingSwitchPreference.java:sdk/src/java/mokee/preference/RemotePreference.java:sdk/src/java/mokee/preference/RemotePreferenceManager.java:sdk/src/java/mokee/preference/RemotePreferenceUpdater.java:sdk/src/java/mokee/preference/SecureSettingSwitchPreference.java:sdk/src/java/mokee/preference/SelfRemovingDropDownPreference.java:sdk/src/java/mokee/preference/SelfRemovingListPreference.java:sdk/src/java/mokee/preference/SelfRemovingPreference.java:sdk/src/java/mokee/preference/SelfRemovingSwitchPreference.java:sdk/src/java/mokee/preference/SettingsHelper.java:sdk/src/java/mokee/preference/SystemSettingSwitchPreference.java:sdk/src/java/mokee/profiles/AirplaneModeSettings.java:sdk/src/java/mokee/profiles/BrightnessSettings.java:sdk/src/java/mokee/profiles/ConnectionSettings.java:sdk/src/java/mokee/profiles/LockSettings.java:sdk/src/java/mokee/profiles/RingModeSettings.java:sdk/src/java/mokee/profiles/StreamSettings.java:sdk/src/java/mokee/providers/DataUsageContract.java:sdk/src/java/mokee/providers/MKSettings.java:sdk/src/java/mokee/providers/WeatherContract.java:sdk/src/java/mokee/util/ColorUtils.java:sdk/src/java/mokee/util/palette/ColorCutQuantizer.java:sdk/src/java/mokee/util/palette/ColorUtils.java:sdk/src/java/mokee/util/palette/DefaultGenerator.java:sdk/src/java/mokee/util/palette/Palette.java:sdk/src/java/mokee/weather/MKWeatherManager.java:sdk/src/java/mokee/weather/RequestInfo.java:sdk/src/java/mokee/weather/WeatherInfo.java:sdk/src/java/mokee/weather/WeatherLocation.java:sdk/src/java/mokee/weather/util/WeatherUtils.java:sdk/src/java/mokee/weatherservice/ServiceRequest.java:sdk/src/java/mokee/weatherservice/ServiceRequestResult.java:sdk/src/java/mokee/weatherservice/WeatherProviderService.java:/home/jack/Mokee/O/out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes.jar:/home/jack/Mokee/O/out/target/common/obj/JAVA_LIBRARIES/core-oj_intermediates/classes.jar:/home/jack/Mokee/O/out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes.jar:/home/jack/Mokee/O/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar:/home/jack/Mokee/O/out/target/common/obj/JAVA_LIBRARIES/org.mokee.platform.sdk_intermediates/classes.jar: -d /home/jack/Mokee/O/out/target/common/docs/mokee-api-stubs -hdf page.build OPR3.170623.013-\$(cat /home/jack/Mokee/O/out/build_number.txt) -hdf page.now \"\$(date -d @\$(cat /home/jack/Mokee/O/out/build_date.txt) \"+%d %b %Y %k:%M\")\" -stubs /home/jack/Mokee/O/out/target/common/obj/JAVA_LIBRARIES/mokee-sdk_stubs_current_intermediates/src -stubpackages mokee.alarmclock:mokee.app:mokee.content:mokee.externalviews:mokee.hardware:mokee.media:mokee.os:mokee.preference:mokee.profiles:mokee.providers:mokee.platform:mokee.power:mokee.util:mokee.weather:mokee.weatherservice -exclude org.mokee.platform.internal -api /home/jack/Mokee/O/out/target/common/obj/PACKAGING/mk_public_api.txt -removedApi /home/jack/Mokee/O/out/target/common/obj/PACKAGING/mk_removed.txt -nodocs && touch -f /home/jack/Mokee/O/out/target/common/docs/mokee-api-stubs-timestamp ) || (rm -rf /home/jack/Mokee/O/out/target/common/docs/mokee-api-stubs /home/jack/Mokee/O/out/target/common/obj/JAVA_LIBRARIES/mokee-api-stubs_intermediates/droiddoc-src-list; exit 45) )"
mokee-sdk/sdk/src/java/mokee/preference/ConstraintsHelper.java:27: error:package android.support.v7.preference does not exist
import android.support.v7.preference.Preference;
^
mokee-sdk/sdk/src/java/mokee/preference/ConstraintsHelper.java:28: error: package android.support.v7.preference does not exist
import android.support.v7.preference.PreferenceGroup;
^
mokee-sdk/sdk/src/java/mokee/preference/ConstraintsHelper.java:29: error: package android.support.v7.preference does not exist
import android.support.v7.preference.PreferenceManager;
^
mokee-sdk/sdk/src/java/mokee/preference/SelfRemovingDropDownPreference.java:28: error:
public class SelfRemovingDropDownPreference extends DropDownPreference {
^
mokee-sdk/sdk/src/java/mokee/preference/SelfRemovingDropDownPreference.java:48: error: cannot find symbol
public void onBindViewHolder(PreferenceViewHolder holder) {
^
mokee-sdk/sdk/src/java/mokee/preference/SelfRemovingPreference.java:53: error: cannot find symbol
public void onBindViewHolder(PreferenceViewHolder holder) {
^
symbol: class PreferenceViewHolder
location: class SelfRemovingPreference
javadoc: error - In doclet class
In com.google.doclava.Doclava, method start had thrown an exception java.lang.reflect.InvocationTargetException
java.lang.IllegalArgumentException: Unable to find IThermalListenerCallback.java. This is usually because doclava has been asked to generate stubs for a file that isn't present in the list of input source files but exists in the input classpath.
at com.google.doclava.Stubs.parseLicenseHeader(Stubs.java:494)
at com.google.doclava.Stubs.writeClassFile(Stubs.java:478)
at com.google.doclava.Stubs.writeClassFile(Stubs.java:465)
at com.google.doclava.Stubs.writeStubsAndApi(Stubs.java:193)
at com.google.doclava.Doclava.start(Doclava.java:511)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:310)
at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:189)
at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:366)
at com.sun.tools.javadoc.Start.begin(Start.java:219)
at com.sun.tools.javadoc.Start.begin(Start.java:205)
at com.sun.tools.javadoc.Main.execute(Main.java:64)
at com.sun.tools.javadoc.Main.main(Main.java:54)
1 error
39 warning
ninja: build stopped: subcommand failed.
11:45:41 ninja failed with: exit status 1
build/core/main.mk:21: recipe for target 'run_soong_ui' failed
make: *** [run_soong_ui] Error 1

[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!

Issues with building a kernel

I'm trying to build a kernel with the CONFIG_USB_SERIAL_CH341 driver for my Xiaomi Redmi 6 running LOS, but I'm having troubles doing so. My best guess would be that I have the wrong toolchain? I would like to ask for help, any pointers, guides, reading material, etc. If you have any questions, requests for logs, ask and I'll try to hastily respond.
Linux 5.15.7
gcc (GCC) 11.1.0
arm-none-eabi-gcc (Arch Repository) 11.2.0
Target kernel
cd android_kernel_xiaomi_mt6765/
export ARCH=arm & export SUBARCH=arm
echo 'CONFIG_USB_SERIAL_CH341=y' >> arch/arm/configs/cereus_defconfig
make clean
make mrproper
make cereus_defconfig
make -j$(nproc)
Returns: 'Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler'.
After commenting out the stackprotector from the defconfig and making again... returns:
'/usr/bin/ld: scripts/dtc/dtc-parser.tab.o:(.bss+0x10): multiple definition of `yylloc'; scripts/dtc/dtc-lexer.lex.o:(.bss+0x0): first defined here
HOSTLD scripts/genksyms/genksyms
collect2: error: ld returned 1 exit status
make[2]: *** [scripts/Makefile.host:110: scripts/dtc/dtc] Error 1
make[1]: *** [scripts/Makefile.build:648: scripts/dtc] Error 2
make: *** [Makefile:560: scripts] Error 2'
I tried removing the yylloc lines from the dtc related files, but only to watch even more bizarre errors being thrown at me... From what I searched prepending the line with the 'extern' modifier was a common fix, but in the source code it was already defined as extern YYLTYPE yylloc;
I would be very grateful for any help.

Categories

Resources