Update Android-x86 R Kernel to a Custom Kernel.

557 views
Skip to first unread message

tyler...@gmail.com

unread,
Sep 28, 2022, 11:25:47 PM9/28/22
to Android-x86
I'm trying to compile Android-x86 R with this Kernel https://github.com/tyleraharrison/android-x86-steam-deck-kernel so what I have done is took the original kernel folder and renamed it to kernel_bak and cloned the new the kernel in the android-x86 directory and renamed it to kernel.


TARGET_PRODUCT := android_x86_64
TARGET_BUILD_VARIANT := user
TARGET_BUILD_TYPE := release
TARGET_KERNEL_CONFIG := android-x86_64_defconfig

I then ran 

$ . build/envsetup.sh
$ lunch android_x86_64-user

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=11
TARGET_PRODUCT=android_x86_64
TARGET_BUILD_VARIANT=user
TARGET_BUILD_TYPE=release
TARGET_ARCH=x86_64
TARGET_ARCH_VARIANT=x86_64
TARGET_2ND_ARCH=x86
TARGET_2ND_ARCH_VARIANT=x86_64
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.15.0-48-generic-x86_64-Ubuntu-22.04.1-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=RD2A.211001.002
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/generic/goldfish device/generic/goldfish-opengl
============================================
$ make -j16 iso_img

This is where the issues start.

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=11
TARGET_PRODUCT=android_x86_64
TARGET_BUILD_VARIANT=user
TARGET_BUILD_TYPE=release
TARGET_ARCH=x86_64
TARGET_ARCH_VARIANT=x86_64
TARGET_2ND_ARCH=x86
TARGET_2ND_ARCH_VARIANT=x86_64
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.15.0-48-generic-x86_64-Ubuntu-22.04.1-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=RD2A.211001.002
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/generic/goldfish device/generic/goldfish-opengl
============================================

... Blah Blah Blah stuff compiles normally.

[ 24% 31965/127861] build out/target/product/x86_64/obj/kernel/arch/x86_64/boot/bzImage
FAILED: out/target/product/x86_64/obj/kernel/arch/x86_64/boot/bzImage
/bin/bash -c "(mkdir -p out/.path; ln -sf ../../prebuilts/clang/host/linux-x86/clang-r383902b1/bin/llvm-ar out/.path/ar; ln -sf ../../prebuilts/clang/host/linux-x86/clang-r383902b1/bin/ld.lld out/.path/ld ) && (prebuilts/build-tools/linux-x86/bin/make -j16 -l\$((16+2)) -C k
ernel O=/home/tylerjaacks/android-x86/out/target/product/x86_64/obj/kernel ARCH=x86_64 CROSS_COMPILE=\" /home/tylerjaacks/android-x86/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/bin/x86_64-linux-\"  YACC=/home/tylerjaacks/android-x86/prebuilts/build-tools/linux-
x86/bin/bison LEX=/home/tylerjaacks/android-x86/prebuilts/build-tools/linux-x86/bin/flex M4=/home/tylerjaacks/android-x86/prebuilts/build-tools/linux-x86/bin/m4 DEPMOD=/sbin/depmod HOSTCC=/home/tylerjaacks/android-x86/prebuilts/clang/host/linux-x86/clang-r383902b1/bin/clang
 olddefconfig ) && (prebuilts/build-tools/linux-x86/bin/make -j16 -l\$((16+2)) -C kernel O=/home/tylerjaacks/android-x86/out/target/product/x86_64/obj/kernel ARCH=x86_64 CROSS_COMPILE=\" /home/tylerjaacks/android-x86/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/b
in/x86_64-linux-\"  YACC=/home/tylerjaacks/android-x86/prebuilts/build-tools/linux-x86/bin/bison LEX=/home/tylerjaacks/android-x86/prebuilts/build-tools/linux-x86/bin/flex M4=/home/tylerjaacks/android-x86/prebuilts/build-tools/linux-x86/bin/m4 DEPMOD=/sbin/depmod HOSTCC=/ho
me/tylerjaacks/android-x86/prebuilts/clang/host/linux-x86/clang-r383902b1/bin/clang bzImage modules )"
make: Entering directory '/home/tylerjaacks/android-x86/kernel'
make[1]: Entering directory '/home/tylerjaacks/android-x86/out/target/product/x86_64/obj/kernel'
make[1]: cannot enforce load limits on this operating system
  GEN     Makefile
  HOSTCC  scripts/basic/fixdep
make[2]: cannot enforce load limit: getloadavg: No such file or directory
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  LEX     scripts/kconfig/lexer.lex.c
  YACC    scripts/kconfig/parser.tab.[ch]
  HOSTCC  scripts/kconfig/menu.o
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/util.o
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTLD  scripts/kconfig/conf
***
*** Compiler is too old.
***   Your GCC version:    4.6.0
***   Minimum GCC version: 4.9.0
***
scripts/Kconfig.include:44: Sorry, this compiler is not supported.
make[2]: *** [/home/tylerjaacks/android-x86/kernel/scripts/kconfig/Makefile:77: olddefconfig] Error 1
make[1]: *** [/home/tylerjaacks/android-x86/kernel/Makefile:614: olddefconfig] Error 2
make[1]: Leaving directory '/home/tylerjaacks/android-x86/out/target/product/x86_64/obj/kernel'
make: *** [Makefile:215: __sub-make] Error 2
make: Leaving directory '/home/tylerjaacks/android-x86/kernel'
[ 25% 31979/127861] Downloading hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 2859k  100 2859k    0     0  3237k      0 --:--:-- --:--:-- --:--:-- 3242k
20:11:52 ninja failed with: exit status 1

#### failed to build some targets (04:40 (mm:ss)) ####

So It appears that the version of gcc bundled as a prebuilt is outdated which isn't a surprise this kernel version is really new.

I need help getting this thing built

Message has been deleted

crw

unread,
Sep 29, 2022, 7:48:21 AM9/29/22
to Android-x86
I compile kernel externally / out-of-tree using make, copy over the modules to `/system/lib/modules/` and `arch/x86/boot/bzImage` -> kernel file in Android x86 installation directory.

tyler...@gmail.com

unread,
Sep 29, 2022, 4:43:55 PM9/29/22
to Android-x86
So you build the kernel from in the kernel directory? What do commands do you use to make the bzImage and the modules? I used make bzImage and make modules is that correct?

crw

unread,
Oct 6, 2022, 9:54:18 AM10/6/22
to Android-x86
make bzImage -j8
cp arch/x86/boot/bzImage /android/kernel
make modules_install -j8  INSTALL_MOD_PATH=/tmp

Modules will be in /tmp/lib/modules 

Reply all
Reply to author
Forward
0 new messages