红米5Plus 构建SailfishOSV4.2.0.21镜像过程记录
-
红米5Plus 构建SailfishOSV4.2.0.21镜像过程记录
参考文档
首先阅读:SailfishOS移植到Redmi 5Plus的一些记录
刷机参考: https://forum.xda-developers.com/t/sailfish-os-for-the-xiaomi-redmi-note-5-5-plus-vince.3789021/
其他参考:- https://sailfishos.org/develop/hadk/
- https://github.com/mer-hybris/hadk-faq/
- http://collabedit.com/kr9xx
- https://blog.yoitsu.moe/category/sailfish.html
- google: message site:https://irclogs.sailfishos.org/
安装SDK
参考脚本:vince_set_HADK.sh
#!/bin/bash export DEVICE="vince" export PATH=$HOME/bin:$HOME/.local/bin:$PATH #这里都放在了家目录,请自行修改 export ANDROID_ROOT="$HOME/Sailfish/$DEVICE/src" export PLATFORM_SDK_ROOT="$HOME/Sailfish/$DEVICE/mer" #export AOSP_MIRROR="10.20.15.143" #error: RPC failed; curl 56 GnuTLS recv error (-110): The TLS connection was non-properly terminated. #解决方法 sudo apt install -y git gnutls-bin git config --global core.compression -1 git config --global http.postBuffer 1048576000 git config --global color.ui "auto" git config --global user.name "Your Name" git config --global user.email "[email protected]" mkdir -p ~/bin echo Installing repo if ! curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo; then curl -sSL 'https://gerrit-googlesource.proxy.ustclug.org/git-repo/+/master/repo?format=TEXT' | base64 -d > ~/bin/repo fi sed -ri 's:#!/usr/bin/env python$:#!/usr/bin/env python3:' ~/bin/repo #使用内网镜像 #sed -ri "s;[ ]+REPO_URL =.*$;\ \ REPO_URL = \'git://${AOSP_MIRROR}/tools/repo.git\';" ~/bin/repo chmod +x ~/bin/repo #sudo rm -rf "$ANDROID_ROOT" sudo rm -rf "$PLATFORM_SDK_ROOT" sudo mkdir -p "$PLATFORM_SDK_ROOT"/{targets,toolings,sdks/sfossdk} sudo chown $USER:$USER "$PLATFORM_SDK_ROOT" sudo chown $USER:$USER "$HOME/Sailfish/$DEVICE" sudo ln -sf "$PLATFORM_SDK_ROOT"/sdks/sfossdk/"$PLATFORM_SDK_ROOT"/sdks/ubuntu/ "$PLATFORM_SDK_ROOT"/sdks/ubuntu cd && curl -k -O http://releases.sailfishos.org/sdk/installers/latest/Jolla-latest-SailfishOS_Platform_SDK_Chroot-i486.tar.bz2 sync sudo tar --numeric-owner -p -xjf Jolla-latest-SailfishOS_Platform_SDK_Chroot-i486.tar.bz2 -C "$PLATFORM_SDK_ROOT"/sdks/sfossdk mkdir -p "$ANDROID_ROOT" sudo sed -ri 's/4096/65535/' "$PLATFORM_SDK_ROOT"/sdks/sfossdk/etc/security/limits.d/95-nproc-sdk.conf sudo sed -ri 's/2048/65535/' "$PLATFORM_SDK_ROOT"/sdks/sfossdk/etc/security/limits.d/95-nproc-sdk.conf "$PLATFORM_SDK_ROOT"/sdks/sfossdk/mer-sdk-chroot sudo zypper ref -f "$PLATFORM_SDK_ROOT"/sdks/sfossdk/mer-sdk-chroot sudo zypper dup -y "$PLATFORM_SDK_ROOT"/sdks/sfossdk/mer-sdk-chroot sudo zypper --non-interactive in bc pigz atruncate android-tools-hadk kmod zip "$PLATFORM_SDK_ROOT"/sdks/sfossdk/mer-sdk-chroot
配置环境变量dotfile
- HOST:
[HOST]
主机环境 ,配置文件~/.bashrc
- PLATFORM_SDK:
[PLATFORM]
Platform 构建环境 ,配置文件~/.hadk.env
~/.mersdk.profile
- HABUILD_SDK:
[HABUILD]
Ubuntu Chroot 环境,配置文件~/.mersdkubu.profile
参考脚本:vince_init_sdk_dotfile.sh
#!/bin/bash sed -ri '/export PATH\=\$HOME\/bin/d' "$HOME"/.bashrc sed -ri '/export DEVICE=/d' "$HOME"/.bashrc sed -ri '/PLATFORM_SDK_ROOT/d' "$HOME"/.bashrc sed -ri '/ANDROID_ROOT/d' "$HOME"/.bashrc sed -ri '/sfossdk/d' "$HOME"/.bashrc cat << EOF | tee -a "$HOME"/.bashrc export DEVICE="vince" export PATH=\$HOME/bin:\$HOME/.local/bin:\$PATH export ANDROID_ROOT="\$HOME/Sailfish/\$DEVICE/src" export PLATFORM_SDK_ROOT="\$HOME/Sailfish/\$DEVICE/mer" alias sfossdk="\$PLATFORM_SDK_ROOT/sdks/sfossdk/mer-sdk-chroot" EOF cat << 'EOF' | tee "$HOME"/.hadk.env export VENDOR="xiaomi" export DEVICE="vince" export PORT_ARCH="armv7hl" export HYBRIS_BRANCH="hybris-14.1" export UBUNTU_CHROOT=$PLATFORM_SDK_ROOT/sdks/ubuntu export TMPDIR=$UBUNTU_CHROOT/tmp export OBS_ROOT=$MER_ROOT/OBS export HYBRIS_MW_ROOT=$ANDROID_ROOT/hybris/mw/ #export AOSP_MIRROR="10.20.15.143" #privoxy搭建本地http代理,并配置socks5代理,此处懂的都懂 #proxy="http://127.0.0.1:8118" #export http_proxy="$proxy" #export https_proxy="$proxy" export RELEASE=$(grep VERSION_ID /etc/os-release | cut -d"=" -f2) EOF cat << 'EOF' | tee "$HOME"/.mersdkubu.profile function hadk() { source $HOME/.hadk.env; echo "Env setup for $DEVICE"; } export PS1="HABUILD_SDK [${DEVICE}] $PS1" hadk cd $ANDROID_ROOT . build/envsetup.sh breakfast $DEVICE export USE_CCACHE=1 export LC_ALL=C alias hh="mka hybris-hal" alias hb="mka hybris-boot" alias clean="mka clean" EOF cat << 'EOF' | tee "$HOME"/.mersdk.profile alias enter_scratchbox="sb2 -t $VENDOR-$DEVICE-$PORT_ARCH -m sdk-install -R" PS1="PlatformSDK $PS1" alias ubu="ubu-chroot -r $PLATFORM_SDK_ROOT/sdks/ubuntu" alias bp="rpm/dhd/helpers/build_packages.sh" alias build_all_packages="bp" pushd () { command pushd "$@" > /dev/null } popd () { command popd "$@" > /dev/null } die () { if [ -z "$*" ]; then echo "command failed at `date`, dying..." else echo "$*" fi exit 1 } function setup_ubuntuchroot { pushd $HOME TARBALL=ubuntu-trusty-20180613-android-rootfs.tar.bz2 curl -k -O -C - https://releases.sailfishos.org/ubu/$TARBALL || die "Error downloading ubuntu rootfs" sudo rm -rf $UBUNTU_CHROOT sudo mkdir -p $UBUNTU_CHROOT sync sudo tar --numeric-owner -xjf $TARBALL -C $UBUNTU_CHROOT ubu-chroot -r $UBUNTU_CHROOT /bin/bash -c "echo Installing useful tools && sudo apt-get update && sudo apt-get install -y ImageMagick" ubu-chroot -r $UBUNTU_CHROOT /bin/bash -c 'exit' # 1000 是默认你是用的默认用户才进行操作的,这一步是解决账号过期的问题的。 # 执行sudo su 会提示:sudo: account validation failure, is your account locked? sudo chroot $UBUNTU_CHROOT /bin/bash -c "chage -M 999999 $(id -nu 1000)" popd } function fetch_sources { #解决出现fatal: cannot run /usr/bin/gpg: No such file or directory 等之类的错误 rm -rf $HOME/.repoconfig git config --global gpg.program $(which gpg2) #设置repo的同步范围 echo Initializing repo && cd $ANDROID_ROOT && repo init -u git://github.com/mer-hybris/android.git -b $HYBRIS_BRANCH #内网镜像 #sed -ri "s;https://android.googlesource.com;git://${AOSP_MIRROR};" .repo/manifests/default.xml #自定义项目,来自于birdzhang的git仓库 mkdir -p .repo/local_manifests cat <<'FOE' | tee .repo/local_manifests/cancro.xml <?xml version="1.0" encoding="UTF-8"?> <manifest> <project path="device/xiaomi/vince" name="Sailfish-On-Vince/device_xiaomi_vince" revision="master" /> <project path="vendor/xiaomi/vince" name="Sailfish-On-Vince/vendor_xiaomi_vince" revision="master" /> <project path="kernel/xiaomi/msm8953" name="Sailfish-On-Vince/Xiaomi_Kernel_OpenSource" revision="tiffany-n-oss" clone-depth="1"/> <project path="hybris/droid-hal-version-vince" name="Sailfish-On-Vince/droid-hal-version-vince" revision="master" /> <project path="hybris/droid-configs" name="Sailfish-On-Vince/droid-config-vince" revision="master" /> <remove-project name="mer-hybris/hybris-boot" /> <project path="hybris/hybris-boot" name="Sailfish-On-Vince/hybris-boot" revision="master" /> <project path="rpm" name="Sailfish-On-Vince/droid-hal-vince" revision="master" /> </manifest> FOE #获取源代码 echo Syncing sources && cd $ANDROID_ROOT && repo sync --force-sync --fetch-submodules --no-clone-bundle --no-tags # repo sync 的参数: # -j:开启多线程同步操作,会加快sync命令的执行速度。默认情况下,使用4个线程并发进行sync。 # -c, –current-branch:只同步指定的远程分支。默认情况下,sync会同步所有的远程分支,当远程分支比较多的时候,下载的代码量就大。使用该参数,可以缩减下载时间,节省本地磁盘空间。 # -d, –detach:脱离当前的本地分支,切换到manifest.xml中设定的分支。在实际操作中这个参数很有用,当我们第一次sync完代码后,往往会切换到dev分支进行开发。如果不带该参数使用sync, # 则会触发本地的dev分支与manifest设定的远程分支进行合并,这会很可能会导致sync失败。 # -f, –force-broken:当有git库sync失败了,不中断整个同步操作,继续同步其他的git库。 # –no-clone-bundle:在向服务器发起请求时,为了做到尽快的响应速度,会用到内容分发网络(CDN, Content Delivery Network)。同步操作也会通过CDN与就近的服务器建立连接, 使用HTTP/HTTPS的$URL/clone.bundle来初始化本地的git库, # clone.bundle实际上是远程git库的镜像,通过HTTP直接下载,这会更好的利用网络带宽,加快下载速度。 } function setup_scratchbox { pushd $HOME sdk-assistant create $VENDOR-$DEVICE-latest http://releases.sailfishos.org/sdk/targets/Sailfish_OS-$RELEASE-Sailfish_SDK_Tooling-i486.tar.7z sdk-assistant create $VENDOR-$DEVICE-$PORT_ARCH http://releases.sailfishos.org/sdk/targets/Sailfish_OS-$RELEASE-Sailfish_SDK_Target-$PORT_ARCH.tar.7z sdk-assistant create $VENDOR-$DEVICE-i486 http://releases.sailfishos.org/sdk/targets/Sailfish_OS-$RELEASE-Sailfish_SDK_Target-i486.tar.7z sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime sudo sed "s/\tlocalhost/\t$(</parentroot/etc/hostname)/g" -i $UBUNTU_CHROOT/etc/hosts popd } function test_scratchbox { sudo mkdir -p $TMPDIR pushd $TMPDIR cat <<'FOE' | tee main.c #include <stdlib.h> #include <stdio.h> int main(void) { printf("Scratchbox, works!\n"); return EXIT_SUCCESS; } FOE sb2 -t $VENDOR-$DEVICE-$PORT_ARCH gcc main.c -o test sb2 -t $VENDOR-$DEVICE-$PORT_ARCH ./test popd } function modify_config { echo "MINIMEDIA_AUDIOPOLICYSERVICE_ENABLE := 1" > external/droidmedia/env.mk #针对64位的系统 echo 'DROIDMEDIA_32 := true' >> external/droidmedia/env.mk echo 'FORCE_HAL:=1' >> external/droidmedia/env.mk sed "s/Werror/Werror -Wno-unused-parameter/" -i frameworks/av/services/camera/libcameraservice/Android.mk #下面这三个需要更新到最新,以适配最新SDK git -C rpm/dhd/ pull github master git -C rpm/dhd/ checkout master git -C hybris/droid-configs/droid-configs-device pull github master git -C hybris/droid-configs/droid-configs-device checkout master git -C hybris/droid-hal-version-$DEVICE/droid-hal-version pull github master git -C hybris/droid-hal-version-$DEVICE/droid-hal-version checkout master # http://collabedit.com/kr9xx # 4.2.0.21 的SDK,需要指定响应版本、git提交 git -C external/droidmedia/ pull --all git -C external/droidmedia/ fetch github --tags git -C external/droidmedia/ checkout tags/0.20210702.0 -b 0.20210702.0 # 开始这个目录不存在,bp -m之后再执行 # git -C hybris/mw/gst-droid checkout upgrade-4.2.0 git -C external/audioflingerglue checkout master } function build_hybrishal { ubu-chroot -r $PLATFORM_SDK_ROOT/sdks/ubuntu /bin/bash -c "echo Building hybris-hal && cd $ANDROID_ROOT && source build/envsetup.sh && breakfast $DEVICE && make -j8 hybris-hal" ubu-chroot -r $PLATFORM_SDK_ROOT/sdks/ubuntu /bin/bash -c "echo Building hybris-hal && cd $ANDROID_ROOT && source build/envsetup.sh && breakfast $DEVICE && make -j4 libcameraservice_32" ubu-chroot -r $PLATFORM_SDK_ROOT/sdks/ubuntu /bin/bash -c "echo Building hybris-hal && cd $ANDROID_ROOT && source build/envsetup.sh && breakfast $DEVICE && make -j4 libdroidmedia_32 minimediaservice minisfservice libminisf_32" ubu-chroot -r $PLATFORM_SDK_ROOT/sdks/ubuntu /bin/bash -c "echo Building hybris-hal && cd $ANDROID_ROOT && source build/envsetup.sh && breakfast $DEVICE && make -j4 droidmedia audioflingerglue" } function build_packages { pushd $ANDROID_ROOT # rpm/dhd/helpers/build_packages.sh $@ rpm/dhd/helpers/build_packages.sh -d rpm/dhd/helpers/build_packages.sh -c rpm/dhd/helpers/build_packages.sh -m sb2 -t $VENDOR-$DEVICE-$PORT_ARCH -m sdk-install -R zypper in "pkgconfig(audiosystem-passthrough)" sb2 -t $VENDOR-$DEVICE-$PORT_ARCH -m sdk-install -R zypper in "pkgconfig(libdroid-util)" rpm/dhd/helpers/build_packages.sh -m rpm/dhd/helpers/build_packages.sh -g # http://collabedit.com/kr9xx # 4.2.0.21 的SDK,需要指定响应版本、git提交 git -C hybris/mw/gst-droid checkout upgrade-4.2.0 git -C hybris/mw/gmp-droid/ pull origin master git -C hybris/mw/gmp-droid checkout -b 0.2 0.2 # -o 是离线构建,因为切换了tag分支,构建脚本默认会pull到最新,需要使用离线功能 rpm/dhd/helpers/build_packages.sh -o -g sb2 -t $VENDOR-$DEVICE-$PORT_ARCH -m sdk-install -R zypper in droid-config-$DEVICE rpm/dhd/helpers/build_packages.sh -v rpm/dhd/helpers/build_packages.sh -i popd } function mer_man { echo " 1) setup_scratchbox: sets up a cross compilation toolchain to build mer packages" echo " 2) fetch_sources: fetch android/mer sources" echo " 3) setup_ubuntuchroot: set up ubuntu chroot for painless building of android" echo " 4) test_scratchbox: tests the scratchbox toolchain." echo " 5) modify_config: modify some config file; update git submodule." echo " 6) build_hybrishal: builds the hybris-hal needed to boot sailfishos for $DEVICE" echo " 7) build_packages: builds packages needed to build the sailfishos rootfs of $DEVICE" } hadk() { echo source $HOME/.hadk.env echo "Env setup for $DEVICE" cd $ANDROID_ROOT } hadk mer_man EOF
构建
- 终端输入
bash
进入 bash
环境下输入sfossdk
,将进入Platform_SDK的chroot环境,也是构建镜像的环境,此时正常会出现如下菜单:
1) setup_scratchbox: sets up a cross compilation toolchain to build mer packages 2) fetch_sources: fetch android/mer sources 3) setup_ubuntuchroot: set up ubuntu chroot for painless building of android 4) test_scratchbox: tests the scratchbox toolchain. 5) modify_config: modify some config file; update git submodule. 6) build_hybrishal: builds the hybris-hal needed to boot sailfishos for $DEVICE 7) build_packages: builds packages needed to build the sailfishos rootfs of $DEVICE
- 输入
setup_scratchbox
,安装构建用的target和tooling。 - 输入
setup_ubuntuchroot
,安装用于构建内核、hybris-hal所用到的ubuntu chroot环境。 - 输入
fetch_sources
,将拉取源码。 - 输入
modify_config
,将做一些配置,详细看上面脚本或者"$HOME"/.mersdk.profile
文件。 - 输入
build_hybrishal
,将构建hybris-hal/hybris-boot等。 - 输入
build_packages
,将构建SFOS镜像,建议手动分步执行。
注意事项 & 技巧
内核参数修改
内核构建完成后,请检查内核参数:
HABUILD_SDK $ cd $ANDROID_ROOT hybris/mer-kernel-check/mer_verify_kernel_config \ ./out/target/product/$DEVICE/obj/KERNEL_OBJ/.config
build droid-hal-device 时,会自动检查,可能会出现错误,某某参数应该如何如何,日志参考:https://fars.ee/P963
根据提示,修改内核配置:检查$ANDROID_ROOT/device/$VENDOR/*/BoardConfig*.mk
中TARGET_KERNEL_CONFIG
的值。必须修改error项目,修改完成后,重新编译内核。然后修改/补充 对应的内核参数。
如果修改了内核
重新构建内核,请先清理一下
cd system/core && git clean -x -f -d && cd - #重新进入ubu chroot环境: ubu mka hybris-hal
如果修改了droid-configs
需要重新构建 droid-config;并手动安装,命令来自于
rpm/dhd/helpers/build_packages.sh
脚本bp -c sb2 -t $VENDOR-$DEVICE-$PORT_ARCH -m sdk-install -R zypper in droid-config-$DEVICE bp -v 更新一下
如果修改了mw\external
重新编译,需要先清理
cd hybris/mw/gst-droid && git clean -xfd && cd - cd hybris/mw/gmp-droid && git clean -xfd && cd - cd external/droidmedia/ && git clean -xfd && cd - bp -m bp -g
手动装包,处理依赖
PLATFORM_SDK $ #命令来自rpm/dhd/helpers/build_packages.sh脚本 sb2 -t $VENDOR-$DEVICE-$PORT_ARCH -m sdk-install -R zypper in droid-config-$DEVICE sb2 -t $VENDOR-$DEVICE-$PORT_ARCH -m sdk-install -R zypper in "pkgconfig(audiosystem-passthrough)" sb2 -t $VENDOR-$DEVICE-$PORT_ARCH -m sdk-install -R zypper in "pkgconfig(libdroid-util)"
跳过开机教程
左上、右上、右下、左下 四个角挨个点一下
清理 Target
PLATFORM_SDK $ sdk-manage target remove $VENDOR-$DEVICE-$PORT_ARCH sdk-manage tooling remove Sailfish_OS-$RELEASE
repo 同步单个项目
PLATFORM_SDK $ repo sync -c --force-sync --fetch-submodules --no-clone-bundle --no-tags kernel/xiaomi/cancro #kernel/xiaomi/cancro 是 .repo/local_manifests配置中的path。当前同步前如果有存在,请先删除。
repo 同步失败
error: in `sync -d --force-sync --fetch-submodules --no-clone-bundle --no-tags`: revision refs/tags/android-10.0.0_r40 in platform/cts not found # 解决办法:在根目录单独下载 repo sync platform/cts
straggler_files
- 添加
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/sandy/Sailfish/src/installroot error: Installed (but unpackaged) file(s) found: /d /file_contexts.bin /property_contexts /sdcard /vendor RPM build errors: Empty %files file /home/sandy/Sailfish/src/dtbo.files Installed (but unpackaged) file(s) found: /d /file_contexts.bin /property_contexts /sdcard /vendor No journal files were found. Failed to seek to cursor: Invalid argument
这个时候,就需要把相应的文件添加到
rpm/droid-hal-$DEVICE.spec
文件中。- 移除
File not found: /home/sandy/Sailfish/src/installroot/init.class_main.sh File not found: /home/sandy/Sailfish/src/installroot/init.mdm.sh File not found: /home/sandy/Sailfish/src/installroot/init.qcom.class_core.sh File not found: /home/sandy/Sailfish/src/installroot/init.qcom.syspart_fixup.sh
这个时候,就需要把相应的文件从
rpm/droid-hal-$DEVICE.spec
文件中删除。原理参考:rpmbuild
在线构建某一个项目
bp --mw=https://github.com/Sailfish-On-Vince/onyx-camera-settings-plugin
本地构建某一个项目
cd hybris/mw/ git clone https://github.com/sailfishos/mapplauncherd #切到某tag git checkout -b 4.2.2 4.2.2 bp -o -b hybris/mw/mapplauncherd
关闭selinux
修改BoardConfig.mk ( 例如
device/xiaomi/whyred/BoardConfig.mk
)文件中的cmdline:追加selinux=0
;修改kernel参数(例如
kernel/xiaomi/sdm660/arch/arm64/configs/whyred-perf_defconfig
):追加内核参数CONFIG_SECURITY_SELINUX_BOOTPARAM=y
。停用birdzhang自定义源
需要编辑hybris/droid-configs/rpm/droid-config-vince.spec
# OTA via self-hosted repo needs to have all adaptation-community repos removed #Conflicts: community-adaptation-testing #屏蔽掉 #Obsoletes: community-adaptation-testin #屏蔽掉
屏蔽掉这个源
hybris/droid-configs/sparse/usr/share/ssu/repos.d/20-repo.sailfishos.club.ini
Debug(telenet & ssh)
构建程序启用调试
PLATFORM_SDK $ sed -ri 's;#!/bin/bash$;#!/bin/bash -x;g' rpm/dhd/helpers/build_packages.sh sed -ri 's;#!/bin/bash$;#!/bin/bash -x;g' rpm/dhd/helpers/util.sh
telnet
手机连接电脑 usb 后,设置一下对应的 usb 网卡的 IP 地址:
sudo ifconfig enp0s20f0u11 192.168.2.13
然后,连接手机(debug 模式,无法正常启动时):
telnet 192.168.2.15 2323
如果 switch_root 失败,连接端口号使用 23:
telnet 192.168.2.15 23
导出启动日志:
telnet 192.168.2.15 2323|tee init.log dmesg journalctl --no-page exit
清理log脚本
cleanlog.sh
:#!/bin/bash file=$1 perl -i -pe 's/\e[\[\(][0-9;]*[mGKFB]//g' "$file" sed -ri 's/\r$//' "$file" sed -ri 's/^\r//' "$file"
ssh
正常启动时,使用 ssh 连接(密码在 开发者模式 界面):
如果没有 journalcal 日志,需要修改一下配置:
/etc/systemd/journald.conf
:Storage=persistent
ssh 192.168.2.15|tee init.log devel-su dmesg journalctl --no-page /system/bin/logcat
强制保留telnet
刷完Sailfishos后,若能正常进入文件系统,默认关闭telnet服务,但也可以移除关闭telnet服务的脚本:进入twrp,使用
adb shell
连接进入系统:rm data/.stowaways/sailfishos/init_disable_telnet
如果适配新设备
#仅供参考,已知 rpm/dhd hybris-boot libhybris busybox 等都是必要的。 mkdir hybris git clone --recurse-submodules https://github.com/Sailfish-On-Vince/droid-hal-vince rpm git clone --recurse-submodules https://github.com/mer-hybris/hybris-boot hybris/hybris-boot #添加挂载点,参考:https://blog.yoitsu.moe/sailfish/porting_sailfishos_1.html git clone --recurse-submodules https://github.com/Sailfish-On-Vince/droid-config-vince hybris/droid-configs git clone --recurse-submodules https://github.com/Sailfish-On-Vince/droid-hal-version-vince hybris/droid-hal-version-$DEVICE # 在 Platform_SDK环境中,在Android_Root目录,执行 rpm/dhd/helpers/add_new_device.sh 可添加设备,但有些内容 # 需要自行修改, 比如rpm/droid-hal-$DEVICE.spec hybris/droid-configs/rpm/droid-config-$DEVICE.spec # 另外,因参考的项目有个性化仓库定制,需要编辑hybris/droid-configs/rpm/droid-config-vince.spec # OTA via self-hosted repo needs to have all adaptation-community repos removed #Conflicts: community-adaptation-testing 屏蔽掉 #Obsoletes: community-adaptation-testin 屏蔽掉 # 屏蔽掉这个源 hybris/droid-configs/sparse/usr/share/ssu/repos.d/20-repo.sailfishos.club.ini git clone --recurse-submodules https://github.com/sailfishos/droidmedia.git external/droidmedia #git clone --recurse-submodules https://github.com/mer-hybris/audioflingerglue.git external/audioflingerglue git clone --recurse-submodules https://github.com/mer-hybris/libhybris external/libhybris #busybox对于启动很重要,比原厂android构建的功能更强,具体请自行研究 git clone --recurse-submodules https://github.com/mer-hybris/android_external_busybox_prebuilt external/busybox # 屏蔽原有的busybox的内容,可能是 vi vendor/*/common/bin/Android.mk
-
写的挺全的
-
@birdzhang 大佬指导的全面
-
大佬牛掰