android x86 固件定制 续集

编译脚本:

#!/bin/bash

FIRMWARE_VERSION="1.0.0"

export EVIDEO_PRODUCT=TY

# 修改版本

sed -i "s/ro.product.version=.*/ro.product.version=$FIRMWARE_VERSION"/g"
     build/make/tools/buildinfo.sh

ROOT_DIR=$(pwd)

# 替换平台签名密钥

echo "cp platform signature"
cp -a $ROOT_DIR/vendor/evideo/emt100t/security/platform.* $ROOT_DIR/build/target/product/security/

#删除不同平台特定的apk, 加快编译,要不要make clean
rm -f out/target/product/x86_64/system/priv-app/*.apk

#update bootanimation
BOOT_ANIMATION="out/target/product/x86_64/system/media/bootanimation.zip"
if [ -f $BOOT_ANIMATION ]; then
     echo "$BOOT_ANIMATION is exist"
     rm -rf $BOOT_ANIMATION
fi
. build/envsetup.sh
lunch android_x86_64-userdebug
make -j32 iso_img

#重命名
mv out/target/product/x86_64/android_x86_64.iso out/target/product/x86_64/ty_android_x86_64_"`date +%Y%m%d`".iso


修改默认分辨率

device/generic/common/init.sh

从自定义文件vga里面读取分辨率信息,如果没有,则用一个720p的默认分辨率

function init_evideo()
{
     case "$(cat /sys/class/net/wifi_eth/address)" in
         64:00:6a:00:29:ac|a4:1f:72:5f:6b:07|a4:1f:72:5f:6f:0e)
             ;;
         *)
         #   reboot
             ;;
     esac
     mac=$(cat /sys/class/net/wifi_eth/address)
     echo -n "evideo123456$mac" | sha256sum > /system/etc/id
     chmod a+r /system/etc/id
     touch /system/etc/vga && chmod a+rw /system/etc/vga
     vga=$(cat /system/etc/vga)
     if [ -n "$vga" ] ;then
         setprop debug.drm.mode.force "$vga"
     else
         setprop debug.drm.mode.force "1280x720"
     fi
}

在最后调用

function do_init()
{
     init_misc
     init_hal_audio
     init_hal_bluetooth
     init_hal_camera
     init_hal_gps
     init_hal_gralloc
     init_hal_hwcomposer
     init_hal_vulkan
     init_hal_lights
     init_hal_power
     init_hal_sensors
     init_tscal
     init_ril
     post_init
     init_evideo
}

原文地址:https://www.cnblogs.com/cute/p/14202352.html