Fork me on GitHub

7. Создание репозитория для нового устройства

Замечание: перед тем как использовать команды нужно заменить слово kaefik на ваш ник в github

MER_SDK $ 
cd $ANDROID_ROOT 
mkdir rpm 
cd rpm 
git init 
git submodule add https://github.com/mer-hybris/droid-hal-device dhd 
# Rename 'Z00L' and other values as appropriate 
cat <<'EOF' >droid-hal-Z00L.spec 
# These and other macros are documented in dhd/droid-hal-device.inc 
%define device Z00L 
%define vendor asus 
%define vendor_pretty ASUS 
%define device_pretty Zenfone 2 
%define installable_zip 1 
%include rpm/dhd/droid-hal-device.inc 
EOF 
git add . 
git commit -m "[dhd] Initial content" 
# Create this repository under your GitHub home 
git remote add kaefik https://github.com/kaefik/droid-hal-Z00L 
git push kaefik master 
cd - 
mkdir hybris/droid-configs 
cd hybris/droid-configs 
git init 
git submodule add https://github.com/mer-hybris/droid-hal-configs droid-configs-device 
mkdir rpm 
cat <<'EOF' >rpm/droid-config-Z00L.spec 
# These and other macros are documented in 
# ../droid-configs-device/droid-configs.inc 
%define device Z00L 
%define vendor asus 
%define vendor_pretty ASUS 
%define device_pretty Zenfone 2 
%define dcd_path ./ 
# Adjust this for your device 
%define pixel_ratio 2.0 
# We assume most devices will 
%define have_modem 1 
%include droid-configs-device/droid-configs.inc 
EOF 
git add . 
git commit -m "[dcd] Initial content" 
# Create this repository under your GitHub home 
git remote add kaefik https://github.com/kaefik/droid-config-Z00L 
git push kaefik master 
cd - 

rpm/dhd/helpers/add_new_device.sh

# On Zenfone 2 the output of the last command is: 
# Creating the following nodes: 
# sparse/ 
# patterns/ 
# patterns/jolla-configuration-Z00L.yaml 
# patterns/jolla-ui-configuration-Z00L.yaml 
# patterns/jolla-hw-adaptation-Z00L.yaml 
cd hybris/droid-configs 
COMPOSITOR_CFGS=sparse/var/lib/environment/compositor 
mkdir -p $COMPOSITOR_CFGS 
cat <<EOF >$COMPOSITOR_CFGS/droid-hal-device.conf 
# Config for $VENDOR/$DEVICE 
EGL_PLATFORM=hwcomposer 
QT_QPA_PLATFORM=hwcomposer 
# Determine which node is your touchscreen by checking /dev/input/event* 
LIPSTICK_OPTIONS=-plugin evdevtouch:/dev/input/event0 -plugin evdevkeyboard:keymap=/usr/share/qt5/keymaps/droid.qmap 
EOF 
git add . 
git commit -m "[dcd] Patterns and compositor config" 
git push kaefik master 
cd - 
mkdir hybris/droid-hal-version-Z00L 
cd hybris/droid-hal-version-Z00L 
git init 
git submodule add https://github.com/mer-hybris/droid-hal-version 
mkdir rpm 
cat <<'EOF' >rpm/droid-hal-version-Z00L.spec 
# rpm_device is the name of the ported device 
%define rpm_device Z00L 
# rpm_vendor is used in the rpm space 
%define rpm_vendor asus 
# Manufacturer and device name to be shown in UI 
%define vendor_pretty ASUS 
%define device_pretty Zenfone 2 
# See ../droid-hal-version/droid-hal-device.inc for similar macros: 
%define have_vibrator 1 
%define have_led 1 
%include droid-hal-version/droid-hal-version.inc 
EOF
git add . 
git commit -m "[dvd] Initial content" 
# Create this repository under your GitHub home 
git remote add kaefik \ 
https://github.com/kaefik/droid-hal-version-Z00L 
git push kaefik master 

Нужно добавить эти строчки в файл манифеста $ANDROID_ROOT/repo/local_manifests/Z00L.xml:

<project path="rpm/" name="kaefik/droid-hal-Z00L" revision="master" />
<project path="hybris/droid-configs" name="kaefik/droid-config-Z00L" revision="master" />
<project path="hybris/droid-hal-version-Z00L" name="kaefik/droid-hal-version-Z00L" revision="master" />

social