-
Notifications
You must be signed in to change notification settings - Fork 19
Building
- Build the kernel.
- Convert the kernel to a mediatek image.
- Replace the ramdisk.
- Test the kernel.
- Recovering from failure
We expect the following directory hierarchy
mtk-tools (from https://github.com/bgcngm/mtk-tools)
alps-fairphone-gpl (from https://github.com/keesj/alps-fairphone-gpl )
|-- bionic
|-- kernel
|-- mediatek
ramdisk (downloaded an unpacked boot.img from fairphone.com)
|-- boot.img-ramdisk
export PATH=~/opt/android-ndk-r9d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin:$PATH
cd kernel
#
# Normal kernel configuration to architecture and compiler to use
#
export CROSS_COMPILE=arm-linux-androideabi-
#
# Mediatek things
#
TARGET_BUILD_VARIANT=user \
TARGET_PRODUCT=ahong89_wet_jb2 \
MTK_ROOT_CUSTOM=../mediatek/custom/ \
make V=1
./mediatek/build/tools/mkimage \
kernel/arch/arm/boot/zImage \
KERNEL > ./zImage.img
You will need some tools to rework the generated image into something that can be flashed get the mtk-tools from https://github.com/bgcngm/mtk-tools
First you need to get hold of the ramdisk this can be done by downloading the published binary image. After downloading it create a directory called ramdisk and copy the boot.img into that directory and unpack the ramdisk unsing the unpack tool.
../mtk-tools/repack-MT65xx.pl \
-boot zImage.img \
../ramdisk/boot.img-ramdisk boot.img
Replacing the modules:
mkdir -p modules
find . -name "*.ko" -exec cp \{\} modules \;
adb push modules /mnt/sdcard/modules/
adb shell
su
mount -o remount,rw /system
cp /mnt/sdcard/modules/* /system/lib/modules/
Using fastboot to replace the kernel/ramdisk:
fastboot flash:raw boot boot.img
fastboot reboot
Using dd:
adb push boot.img /mnt/sdcard/
adb shell
su
dd if=/mnt/sdcard/boot.img of=/dev/bootimg
Download the correct image binary from https://fairphone.zendesk.com/hc/en-us/articles/201189497-Fairphone-OS-multiple-versions-
Download and install the SP Flashtool and SP Flashtool drivers http://forum.xtreamer.net/topic/35487-firmware-recovery-process-for-ban-g-and-q-with-pictures/ and use the flasher to flash your device.
Starting the 1.6 release fastboot is included in the image binary. People upgrading will not have this feature enabled because the updater does not replace the necessary components.
Get boot.img from the download above and flash it to the device
fastboot flash:raw boot boot.img.
sending 'boot' (4778 KB)...
OKAY [ 0.197s]
writing 'boot'...
OKAY [ 2.135s]
finished. total time: 2.333s
keesj@yoga:$ fastboot reboot
rebooting...
finished. total time: 0.003s