robherring / generic_device

A generic android device repository
62 stars 29 forks source link

Clarify building information #9

Open montvid opened 7 years ago

montvid commented 7 years ago

This page is very difficult to understand to a newbie: https://github.com/robherring/generic_device/wiki/Building#android-build

As i understand after much suffering:

lunch Select one of linaro_*-userdebug targets

the targets are: x86, arm, and arm64 as in linaro_x86-userdebug etc? What is the target name for Nexus 7 flo - linaro_arm-userdebug?

To change the device configuration, run "target_config" and the device menuconfig will be brought up.

What does this mean? Typing "target_config" output is unknown command! No menu, nothing. Maybe "make target_config"? Or "make x86_config"? But it does not work, no output in the console just lag. So what command should I type?

cd .repo git clone https://github.com/robherring/android_manifest.git -b master local_manifests cd ..

could be just: git clone https://github.com/robherring/android_manifest.git -b master .repo/local_manifests

I am trying to build for nexus 7 2013 flo. Please clarify, thank you.

montvid commented 7 years ago

The build instructions in this link do not work so need to be updated:

build/envsetup.sh

should be ". build/envsetup.sh" or "source build/envsetup.sh"

$ lunch aosp_flo-userdebug

Does not work anymore https://wiki.linaro.org/LMG/Kernel/FormFactorEnablement

robherring commented 7 years ago

Fixed the issues listed.

For flo support, you can revert commit "Remove flo/hikey defconfigs for now".

montvid commented 7 years ago

Thanks a lot. I don't see the updated text, link yet https://github.com/robherring/generic_device/wiki/Building#android-build Are you available on irc #linaro-android for support? :) You see I compiled linaro_arm_userdebug and there is no kernel only ramdisk.img. How do I get the kernel? I need boot.img because now I tried with google kernel and it does not boot nexus 7.

robherring commented 7 years ago

The kernel is not part of the Android build as right now it all different branches for each device. You can add a prebuilt kernel and build the bootimage though.

montvid commented 7 years ago

I see there is a kernel for db410c in the repo "android-db410c-qcomlt-4.9.gz-dtb". Maybe someone could put a 4.9 kernel for flo too. :)

montvid commented 7 years ago

my draft build info you can use :)

download kernel

  1. git clone https://git.linaro.org/people/john.stultz/flo.git
  2. cd flo
  3. git checkout origin/flo-WIP

build kernel

  1. install gcc-6-arm-linux-gnueabihf and dependencies automatically
  2. make a shortcut sudo ln -s /usr/bin/arm-linux-gnueabihf-gcc-6 /usr/bin/arm-linux-gnueabihf-gcc
  3. In kernel build directory enter: export ARCH=arm export CROSS_COMPILE=arm-linux-gnueabihf- make flo_defconfig make zImage qcom-apq8064-asus-nexus7-flo.dtb
  4. find and copy to a seperate folder the zImage and qcom-apq8064-asus-nexus7-flo.dtb
  5. cat zImage qcom-apq8064-asus-nexus7-flo.dtb > zImage.dtb

download android

  1. repo init -u https://android.googlesource.com/platform/manifest -b master
  2. git clone https://github.com/robherring/android_manifest.git -b master .repo/local_manifests
  3. repo sync
  4. put the zImage.dtb in device/linaro/generic-kernels/
  5. download https://raw.githubusercontent.com/robherring/generic_device/fe014961787d198cb9356fa4bfa95cf6822e6c9c/configs/flo_defconfig
  6. edit flo_defconfig path to kernel CONFIG_KERNEL_PATH="device/linaro/generic-kernels/zImage.dtb" and copy it to device/linaro/generic/configs

download blobs and exctract them

  1. https://developers.google.com/android/drivers#flomob30x

  2. copy the files to the android source dir and run

  3. Enter commands ./extract-asus-flo.sh ./extract-broadcom-flo.sh ./extract-qcom-flo.sh

  4. Find the extracted files and copy Adreno firmware files a300_pfp.fw and a300_pm4.fw to device/linaro/generic/

  5. Check if this patch is applied in eglplatform.h, edit the file if necessary: https://github.com/KhronosGroup/EGL-Registry/pull/22/files

Build and install Android

  1. source build/envsetup.sh
  2. lunch flo-userdebug
  3. If you want to change the device configuration, run "target menuconfig" and the device menuconfig will be brought up.
  4. make Wait for some hours...
  5. Install fastboot and as your device is in bootloader mode run : cd out/target/product/flo fastboot flash boot boot.img fastboot flash system system.img fastboot flash userdata userdata.img fastboot flash cache cache.img