... | @@ -96,19 +96,63 @@ fastboot reboot |
... | @@ -96,19 +96,63 @@ fastboot reboot |
|
|
|
|
|
## Build Kernel Source
|
|
## Build Kernel Source
|
|
|
|
|
|
```
|
|
1. Set `AOSP_TOPDIR`
|
|
export AOSP_TOPDIR=/path/to/your/aosp/source
|
|
```
|
|
mkdir repo-kernel
|
|
export AOSP_TOPDIR=/path/to/your/aosp/source
|
|
cd repo-kernel
|
|
```
|
|
# for building kernel 4.19
|
|
|
|
repo init -u https://gitlab.com/baylibre/amlogic/atv/aosp/kernel/manifest.git -b android-amlogic-bmeson-4.19
|
|
2. Download additional toolchains:
|
|
# for building kernel 5.4
|
|
|
|
repo init -u https://gitlab.com/baylibre/amlogic/atv/aosp/kernel/manifest.git -b android-amlogic-bmeson-5.4
|
|
```
|
|
repo sync -j8 -c
|
|
cd ${AOSP_TOPDIR}
|
|
DIST_DIR=${AOSP_TOPDIR}/device/amlogic/yukawa-kernel/ BUILD_CONFIG=hikey-linaro/build.config.yukawa.aarch64 build/build.sh
|
|
git clone https://android.googlesource.com/platform/prebuilts/gas/linux-x86 prebuilts/gas/linux-x86
|
|
```
|
|
```
|
|
|
|
|
|
|
|
2. Clone the kernel source:
|
|
|
|
|
|
|
|
```
|
|
|
|
# for 4.19
|
|
|
|
git clone https://android.googlesource.com/kernel/hikey-linaro -b android-amlogic-bmeson-4.19
|
|
|
|
# for 5.4
|
|
|
|
git clone https://android.googlesource.com/kernel/hikey-linaro -b android-amlogic-bmeson-5.4
|
|
|
|
```
|
|
|
|
|
|
|
|
3. Export build variables:
|
|
|
|
|
|
|
|
```
|
|
|
|
export PATH=${AOSP_TOPDIR}/prebuilts/clang/host/linux-x86/clang-r399163b/bin:$PATH
|
|
|
|
export PATH=${AOSP_TOPDIR}/prebuilts/gas/linux-x86:$PATH
|
|
|
|
export PATH=${AOSP_TOPDIR}/prebuilts/misc/linux-x86/lz4:$PATH
|
|
|
|
export ARCH=arm64
|
|
|
|
export CROSS_COMPILE=aarch64-linux-gnu-
|
|
|
|
export LLVM=1
|
|
|
|
```
|
|
|
|
|
|
|
|
4. Build the kernel:
|
|
|
|
|
|
|
|
```
|
|
|
|
cd hikey-linaro
|
|
|
|
make meson_defconfig
|
|
|
|
make DTC_FLAGS="-@" -j24
|
|
|
|
```
|
|
|
|
|
|
|
|
5. Compress the kernel and copy build_artifacts to `${AOSP_TOPDIR}/device/amlogic/yukawa-kernel`:
|
|
|
|
|
|
|
|
```
|
|
|
|
lz4c -f arch/arm64/boot/Image arch/arm64/boot/Image.lz4
|
|
|
|
KERN_VER=4.19 # for 4.19 kernel
|
|
|
|
KERN_VER=5.4 # for 5.4 kernel
|
|
|
|
|
|
|
|
for f in arch/arm64/boot/dts/amlogic/*{g12b-a311d,sm1}-khadas-vim3*.dtb; do
|
|
|
|
cp -v -p $f ${AOSP_TOPDIR}/device/amlogic/yukawa-kernel/$(basename $f)-${KERN_VER}
|
|
|
|
done
|
|
|
|
cp -v -p arch/arm64/boot/Image.lz4 ${AOSP_TOPDIR}/device/amlogic/yukawa-kernel/Image.lz4-${KERN_VER}
|
|
|
|
```
|
|
|
|
|
|
|
|
6. [rebuild](https://gitlab.com/baylibre/amlogic/atv/aosp/device/amlogic/yukawa/-/wikis/Khadas_VIM3#android-build-env-instructions-) and [flash your board](https://gitlab.com/baylibre/amlogic/atv/aosp/device/amlogic/yukawa/-/wikis/Khadas_VIM3#flash-android-images)
|
|
|
|
|
|
|
|
Note: for an alternative kernel build using `build.sh`, see [Building kernel using `build.sh`](https://gitlab.com/baylibre/amlogic/atv/aosp/device/amlogic/yukawa/-/wikis/Khadas_VIM3#Building-kernel-using-build.sh-)
|
|
|
|
|
|
* [rebuild](https://gitlab.com/baylibre/amlogic/atv/aosp/device/amlogic/yukawa/-/wikis/Khadas_VIM3#android-build-env-instructions-) and [flash your board](https://gitlab.com/baylibre/amlogic/atv/aosp/device/amlogic/yukawa/-/wikis/Khadas_VIM3#flash-android-images)
|
|
|
|
|
|
|
|
## More links:
|
|
## More links:
|
|
- [GPIO pinout](https://docs.khadas.com/vim3/GPIOPinout.html)
|
|
- [GPIO pinout](https://docs.khadas.com/vim3/GPIOPinout.html)
|
... | @@ -145,4 +189,18 @@ For other methods: https://github.com/superna9999/pyamlboot#installation |
... | @@ -145,4 +189,18 @@ For other methods: https://github.com/superna9999/pyamlboot#installation |
|
```
|
|
```
|
|
cd path/to/aosp/device/amlogic/yukawa/bootloader/
|
|
cd path/to/aosp/device/amlogic/yukawa/bootloader/
|
|
boot-g12.py u-boot_kvim3_noab.bin
|
|
boot-g12.py u-boot_kvim3_noab.bin
|
|
|
|
```
|
|
|
|
|
|
|
|
### Building kernel using `build.sh`
|
|
|
|
|
|
|
|
```
|
|
|
|
export AOSP_TOPDIR=/path/to/your/aosp/source
|
|
|
|
mkdir repo-kernel
|
|
|
|
cd repo-kernel
|
|
|
|
# for building kernel 4.19
|
|
|
|
repo init -u https://gitlab.com/baylibre/amlogic/atv/aosp/kernel/manifest.git -b android-amlogic-bmeson-4.19
|
|
|
|
# for building kernel 5.4
|
|
|
|
repo init -u https://gitlab.com/baylibre/amlogic/atv/aosp/kernel/manifest.git -b android-amlogic-bmeson-5.4
|
|
|
|
repo sync -j8 -c
|
|
|
|
DIST_DIR=${AOSP_TOPDIR}/device/amlogic/yukawa-kernel/ BUILD_CONFIG=hikey-linaro/build.config.yukawa.aarch64 build/build.sh
|
|
``` |
|
``` |
|
|
|
\ No newline at end of file |