SailfishOS移植到Redmi-5-Plus的一些记录(2)

接上 https://birdzhang.xyz/2018/03/30/SailfishOS%E7%A7%BB%E6%A4%8D%E5%88%B0Redmi-5-Plus%E7%9A%84%E4%B8%80%E4%BA%9B%E8%AE%B0%E5%BD%95/

本文章主要针对 hybris 15.1的移植

挑选设备源码

mer-hybris的android hybris-15.1是基于lineageos的,所以我们在没有官方/非官方lineageos用的时候,也要找基于lineage的第三方rom,如国内的Mokee,国外的OmniROM等,只需要稍微改一点devicetree就可以用了

适配hybris-15.1的一些更改

一、Failed to initialize property area

目前的解决方法是注释掉这个, 还有可能是没有关闭selinux或者没有初始化sailfish所需要的android init rc文件有关

system/core/init/property_service.cpp, 将72行的exit(1);注释掉

二、kernel,device部分

  1. 内核部分主要需要注意的是你的设备是否是有 /vendor分区的,project treble的都会有一个单独的/vendor分区,这个需要注意。

    可以通过这个里查看 arch/arm/boot/dts/qcom/msm8953.dtsi (根据你自己cpu来区分,找不到的话就用grep找一下)

    如下,可以看到有vendor跟system分区单独挂载,这个地方可以看谷歌对system-as-root的说明便于理解

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    firmware: firmware {
    android {
    compatible = "android,firmware";
    fstab {
    compatible = "android,fstab";
    vendor {
    compatible = "android,vendor";
    dev = "/dev/block/platform/soc/7824900.sdhci/by-name/cust";
    type = "ext4";
    mnt_flags = "ro,barrier=1,discard";
    fsmgr_flags = "wait";
    status = "ok";
    };
    system {
    compatible = "android,system";
    dev = "/dev/block/platform/soc/7824900.sdhci/by-name/system";
    type = "ext4";
    mnt_flags = "ro,barrier=1,discard";
    fsmgr_flags = "wait";
    status = "ok";
    };

    也可以通过device tree的 fstab.qcom 查看,如果没有,需要加上去(至少在vince上面是这样,因为后面的dhd要靠这个来判断),如我的需要加这两行

    1
    2
    /dev/block/bootdevice/by-name/system            /system                 ext4    ro,barrier=1                                                    wait,recoveryonly
    /dev/block/bootdevice/by-name/cust /vendor ext4 ro,barrier=1 wait,recoveryonly

    有的设备/dev/block/bootdevice/by-name/system挂载到/下面(对应下面的dhd部分的makefstab_skip_entries),而我的设备/vendor是来自/cust(也是迷 @_@

  1. device tree部分注释掉启用full treble的部分

    如我的设备需要把下面这些注释掉,否则selinux的政策文件会安装到/vendor下面,不会在根目录下产生,sfos需要在根下面有。

    扩展阅读: https://source.android.com/security/selinux?hl=zh_cn

    1
    2
    3
    4
    5
    6
    # Treble
    #BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true
    #PRODUCT_FULL_TREBLE_OVERRIDE := true
    #PRODUCT_COMPATIBILITY_MATRIX_LEVEL_OVERRIDE := 27
    #BOARD_VNDK_VERSION := current
    #BOARD_VNDK_RUNTIME_DISABLE := true

三、dhd,dhc部分

https://wiki.merproject.org/wiki/Adaptations/faq-hadk 搜索 15.1也会找到一些需要注意的地方

修改dhd的spec文件,添加

1
2
# On Android 8 the system partition is (intended to be) mounted on /.
%define makefstab_skip_entries / /vendor /dev/stune /dev/cpuset /sys/fs/pstore /dev/cpuctl

也不一定全部要加上,我的设备/system,/vendor就不自动挂载,需要改成这样, 可以先不加然后telnet上去看看这里目录下有没有文件吧

1
%define makefstab_skip_entries /dev/stune /dev/cpuset /sys/fs/pstore /dev/cpuctl

这样会生成system.mountvendor.mount,启动systemd的时候会挂载上

对于有些设备可能提示kgsl kgsl-3d0: |_load_firmware| request_firmware(a530_pm4.fw) failed: -2,需要做一个软链到 /lib/firmware

https://github.com/mer-hybris/droid-config-sony-nile/blob/91c15efb576c29a9d41cc4cd1d40c62ddcce9824/sparse/lib/firmware

调试

暂无很详细的,主要是看dmesg,journalctl等看看把出错的都修了。

通话声音

如果可以打通电话但是没有声音,则需要 pulseaudio-modules-droid-hidl 1.0版本(截止2019-09-24),然后配合新的ril配置文件 https://github.com/mer-hybris/droid-config-sony-nile/tree/master/sparse/etc/ofono

界面crash

看dmesg/logcat/journactl里面是不是有binder的信息,打补丁吧,至于打哪些只能靠猜(大雾

Docker on SailfishOS

How to install Docker on SailfishOS/如何将Docker安装到SailfishOS

This post will show you how to install Docker on SailfishOS, and some hacks need to do.

这篇文章将介绍如何将Docker安装到SailfishOS上,和需要做的一些hack。

Prerequisites/先决条件

https://docs.docker.com/install/linux/docker-ce/binaries/#install-daemon-and-client-binaries-on-linux

  • A 64-bit installation
  • Version 3.10 or higher of the Linux kernel. The latest version of the kernel available for you platform is recommended.
  • iptables version 1.4 or higher
  • git version 1.7 or higher
  • A ps executable, usually provided by procps or a similar package.
  • XZ Utils 4.9 or higher
  • A properly mounted cgroupfs hierarchy; a single, all-encompassing cgroup mount point is not sufficient. See Github issues #2683, #3485, #4568).

  • 64位系统

  • 3.10内核或更高
  • iptable版本至少是1.4
  • git版本至少1.7
  • 可以执行ps
  • xz工具版本至少4.9
  • 正确安装的cgroupfs层次结构; 一个单一的,无所不包的cgroup挂载点是不够的。

Check Kernel support/检查内核支持

Use this script check-config.sh
使用这个脚本 check-config.sh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
[nemo@Sailfish ~]$ ./check-config.sh 
info: reading kernel config from /proc/config.gz ...

Generally Necessary:
- cgroup hierarchy: properly mounted [/sys/fs/cgroup]
- CONFIG_NAMESPACES: enabled
- CONFIG_NET_NS: enabled
- CONFIG_PID_NS: enabled
- CONFIG_IPC_NS: enabled
- CONFIG_UTS_NS: enabled
- CONFIG_CGROUPS: enabled
- CONFIG_CGROUP_CPUACCT: enabled
- CONFIG_CGROUP_DEVICE: enabled
- CONFIG_CGROUP_FREEZER: enabled
- CONFIG_CGROUP_SCHED: enabled
- CONFIG_CPUSETS: enabled
- CONFIG_MEMCG: enabled
- CONFIG_KEYS: enabled
- CONFIG_VETH: enabled
- CONFIG_BRIDGE: enabled
- CONFIG_BRIDGE_NETFILTER: enabled (as module)
- CONFIG_NF_NAT_IPV4: enabled
- CONFIG_IP_NF_FILTER: enabled
- CONFIG_IP_NF_TARGET_MASQUERADE: enabled
- CONFIG_NETFILTER_XT_MATCH_ADDRTYPE: enabled
- CONFIG_NETFILTER_XT_MATCH_CONNTRACK: enabled
- CONFIG_NETFILTER_XT_MATCH_IPVS: enabled
- CONFIG_IP_NF_NAT: enabled
- CONFIG_NF_NAT: enabled
- CONFIG_NF_NAT_NEEDED: enabled
- CONFIG_POSIX_MQUEUE: enabled
- CONFIG_DEVPTS_MULTIPLE_INSTANCES: enabled

Optional Features:
- CONFIG_USER_NS: enabled
- CONFIG_SECCOMP: enabled
- CONFIG_CGROUP_PIDS: missing
- CONFIG_MEMCG_SWAP: enabled
- CONFIG_MEMCG_SWAP_ENABLED: enabled
(cgroup swap accounting is currently enabled)
- CONFIG_MEMCG_KMEM: enabled
- CONFIG_RESOURCE_COUNTERS: enabled
- CONFIG_BLK_CGROUP: enabled
- CONFIG_BLK_DEV_THROTTLING: missing
- CONFIG_IOSCHED_CFQ: enabled
- CONFIG_CFQ_GROUP_IOSCHED: missing
- CONFIG_CGROUP_PERF: enabled
- CONFIG_CGROUP_HUGETLB: missing
- CONFIG_NET_CLS_CGROUP: enabled
- CONFIG_CGROUP_NET_PRIO: enabled
- CONFIG_CFS_BANDWIDTH: missing
- CONFIG_FAIR_GROUP_SCHED: enabled
- CONFIG_RT_GROUP_SCHED: enabled
- CONFIG_IP_VS: enabled
- CONFIG_IP_VS_NFCT: enabled
- CONFIG_IP_VS_RR: enabled
- CONFIG_EXT3_FS: enabled
- CONFIG_EXT3_FS_XATTR: enabled
- CONFIG_EXT3_FS_POSIX_ACL: enabled
- CONFIG_EXT3_FS_SECURITY: enabled
- CONFIG_EXT4_FS: enabled
- CONFIG_EXT4_FS_POSIX_ACL: missing
- CONFIG_EXT4_FS_SECURITY: enabled
enable these ext4 configs if you are using ext4 as backing filesystem
- Network Drivers:
- "overlay":
- CONFIG_VXLAN: enabled
Optional (for encrypted networks):
- CONFIG_CRYPTO: enabled
- CONFIG_CRYPTO_AEAD: enabled
- CONFIG_CRYPTO_GCM: enabled
- CONFIG_CRYPTO_SEQIV: enabled
- CONFIG_CRYPTO_GHASH: enabled
- CONFIG_XFRM: enabled
- CONFIG_XFRM_USER: enabled
- CONFIG_XFRM_ALGO: enabled
- CONFIG_INET_ESP: enabled
- CONFIG_INET_XFRM_MODE_TRANSPORT: enabled
- "ipvlan":
- CONFIG_IPVLAN: missing
- "macvlan":
- CONFIG_MACVLAN: enabled
- CONFIG_DUMMY: missing
- "ftp,tftp client in container":
- CONFIG_NF_NAT_FTP: enabled
- CONFIG_NF_CONNTRACK_FTP: enabled
- CONFIG_NF_NAT_TFTP: enabled
- CONFIG_NF_CONNTRACK_TFTP: enabled
- Storage Drivers:
- "aufs":
- CONFIG_AUFS_FS: missing
- "btrfs":
- CONFIG_BTRFS_FS: enabled
- CONFIG_BTRFS_FS_POSIX_ACL: enabled
- "devicemapper":
- CONFIG_BLK_DEV_DM: enabled
- CONFIG_DM_THIN_PROVISIONING: missing
- "overlay":
- CONFIG_OVERLAY_FS: enabled
- "zfs":
- /dev/zfs: missing
- zfs command: missing
- zpool command: missing

Limits:
- /proc/sys/kernel/keys/root_maxkeys: 1000000

[nemo@Sailfish ~]$

Generally Necessary must be all enabled, if not enabled, you must enable it in your kernel defconfig, and rebuild kernel.
Generally Necessary 部分必须全部是enabled, 如果没有启用,必须启用然后重启编译内核。

Download the static binary archive/下载静态二进制文件

https://download.docker.com/linux/static/stable/aarch64/

Extract the archive and put them to /usr/bin/, 18.06 is a working version.

Add nemo to docker group/将nemo用户添加到docker组

1
2
groupadd docker
usermod -a -G docker nemo

Run Docker/启动Docker

Start docker daemon/ 启动docker守护进程
devel-su /usr/bin/dockerd

Or use systemd/ 或者使用systemd

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target

[Service]
Type=notify
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
TimeoutStartSec=0
KillMode=process
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s

[Install]
WantedBy=multi-user.target

Check version/检查版本

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[root@Sailfish nemo]# docker version

Client:
Version: 18.06.1-ce
API version: 1.38
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:20:38 2018
OS/Arch: linux/arm64
Experimental: false

Server:
Engine:
Version: 18.06.1-ce
API version: 1.38 (minimum version 1.12)
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:27:20 2018
OS/Arch: linux/arm64
Experimental: false

Test/测试
devel-su docker run hello-world

This command downloads a test image and runs it in a container. When the container runs, it prints an informational message and exits. / 这个命令会下载一个测试镜像,如果执行成功会打印如下信息

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[root@Sailfish nemo]# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
255483503861: Pull complete
Digest: sha256:4b8ff392a12ed9ea17784bd3c9a8b1fa3299cac44aca35a85c90c5e3c7afacdc
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(arm64v8)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/

For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/

Test network mapping /测试网络映射

On one terminal/在一个终端中执行

1
2
3
[root@Sailfish nemo]# docker run -it --rm -p 6080:80 nginx:latest        
172.17.0.1 - - [05/Sep/2018:08:54:52 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.58.0-DEV" "-"
172.17.0.1 - - [05/Sep/2018:08:55:51 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.58.0-DEV" "-"

Vist on another terminal/在另一个终端中访问

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[nemo@Sailfish ~]$ curl -s 127.0.0.1:6080
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>
</body>
</html>
[nemo@Sailfish ~]$

TODO

Wayland forward /wayland转发

Reference/参考:

Have fun ;)

SailfishOS移植到Redmi 5 Plus的一些记录

移植旗鱼系统到红米5p的过程记录

!!!可以去ホロ 🐺的博客看看更详细的!!!

https://blog.yoitsu.moe/category/sailfish.html

准备工作

搭建环境

Android编译环境(HADK 第4章)

需要先配置一下hadk的环境变量,一共三个文件,可以参考这里: https://github.com/CancroSailors/sailfish-build-environment

然后source ~/.hadk.env一下

1. 安装git等

sudo apt-get install git

2. 同步CM的代码

配置git的用户名跟邮箱,填自己的就行,随便填也行
1
2
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
创建检出代码的目录,所在的盘空间要足够
1
2
3
4
sudo mkdir -p $ANDROID_ROOT
sudo chown -R $USER $ANDROID_ROOT
cd $ANDROID_ROOT
repo init -u git://github.com/mer-hybris/android.git -b hybris-14.1
配置你的设备的仓库,这里是vince
1
2
3
4
5
6
7
8
9
10
11
12
mkdir $ANDROID_ROOT/.repo/local_manifests
cat <<'EOF' >> $ANDROID_ROOT/.repo/local_manifests/vince.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project path="device/xiaomi/vince" name="Sailfish-On-Vince/device_xiaomi_vince" revision="cm-14.1" />
<project path="vendor/xiaomi/vince" name="Sailfish-On-Vince/vendor_xiaomi_vince" revision="cm-14.1" />
<project path="kernel/xiaomi/vince" name="Sailfish-On-Vince/kernel_xiaomi_msm8953" revision="cm-14.1" />
<project path="hybris/droid-hal-version-vince" name="Sailfish-On-Vince/droid-hal-version-vince" revision="master" />
<project path="hybris/droid-config-vince" name="Sailfish-On-Vince/droid-config-vince" revision="master" />
<project path="rpm" name="Sailfish-On-Vince/droid-hal-vince" revision="master" />
</manifest>
EOF
同步代码

repo sync --fetch-submodules

如果你要求快,可以用 repo sync --fetch-submodules -c --no-tags --no-clone-bundle,这样只会拉取当前要用的代码,但是不方便后面的修改提交

出错就多同步几次

Mer编译环境

参见官方教程: https://sailfishos.org/wiki/Platform_SDK_Installation

安装Platform SDK

1
2
3
4
5
6
7
8
9
export PLATFORM_SDK_ROOT=/srv/mer
curl -k -O http://releases.sailfishos.org/sdk/installers/latest/Jolla-latest-SailfishOS_Platform_SDK_Chroot-i486.tar.bz2 ;
sudo mkdir -p $PLATFORM_SDK_ROOT/sdks/sfossdk ;
sudo tar --numeric-owner -p -xjf Jolla-latest-SailfishOS_Platform_SDK_Chroot-i486.tar.bz2 -C $PLATFORM_SDK_ROOT/sdks/sfossdk ;
echo "export PLATFORM_SDK_ROOT=$PLATFORM_SDK_ROOT" >> ~/.bashrc
echo 'alias sfossdk=$PLATFORM_SDK_ROOT/sdks/sfossdk/mer-sdk-chroot' >> ~/.bashrc ; exec bash ;
echo 'PS1="PlatformSDK $PS1"' > ~/.mersdk.profile ;
echo '[ -d /etc/bash_completion.d ] && for i in /etc/bash_completion.d/*;do . $i;done' >> ~/.mersdk.profile ;
sfossdk

另开一个终端,输入sfossdk,进入mer下

安装targets,官方教程:https://sailfishos.org/wiki/Platform_SDK_Target_Installation

其实就是执行下面的命令,要下载这两个包,过程有些慢

(2019-06-13更新,修复链接地址为最新的)

1
2
sdk-assistant create xiaomi-vince-latest http://releases.sailfishos.org/sdk/targets/Sailfish_OS-latest-Sailfish_SDK_Tooling-i486.tar.7z
sdk-assistant create xiaomi-vince-armv7hl http://releases.sailfishos.org/sdk/targets/Sailfish_OS-latest-Sailfish_SDK_Target-armv7hl.tar.7z

更新到最新(Update to latest)

1
2
3
sudo ssu re x.y.z.ab
sudo zypper ref
sudo zypper dup

安装打包的工具

1
sudo zypper in android-tools createrepo_c

修改fixup-mountpoints

文件在hybris/hybris-boot/fixup-mountpoints,添加你的设备的,这里是vince。
adb到手机上,输入ls -l /dev/block/platform/*/by-name/, 获取分区信息,或者其他路径的,HADK里面有写

Camera支持

1
2
3
4
5
6
7
8
cd $ANDROID_ROOT/external/droidmedia
echo 'DROIDMEDIA_32 := true' >> env.mk
echo 'FORCE_HAL:=1' >> env.mk

# For video recorder
# https://github.com/sailfishos/droidmedia/pull/11
echo 'MINIMEDIA_AUDIOPOLICYSERVICE_ENABLE:=1' >> env.mk
echo 'AUDIOPOLICYSERVICE_ENABLE:=1' >> env.mk

编译hybris-hal

1
2
3
4
5
cd $ANDROID_ROOT
source build/envsetup.sh
export USE_CCACHE=1
breakfast $DEVICE
make -j8 hybris-hal

期间可能会报错,谷歌搜一下

验证Kernel

1
2
cd $ANDROID_ROOT
hybris/mer-kernel-check/mer_verify_kernel_config ./out/target/product/$DEVICE/obj/KERNEL_OBJ/.config

出现WARNING或者ERROR,将提示的加入到你的defconfig中,我的在kernel/xiaomi/vince/arch/arm64/configs/vince_defconfig
然后执行make hybris-root后重新验证。没有出现ERROR后可以执行make hybris-recovery

打包dhd(HADK 第7章)

再开一个终端(我们这里称终端2),输入sfossdk,进入mer打包环境下

1
2
cd $ANDROID_ROOT
rpm/dhd/helpers/build_packages.sh -d

打包droidmedia与audioflingerglue

> 如果你的机器是32位的话那么下面的命令去掉_32,下面的也一样

在终端1中

1
make -j$(nproc --all) $(external/droidmedia/detect_build_targets.sh $PORT_ARCH $(gettargetarch))

在终端2中

1
2
3
4
5
6
7
8
9
10
11
DROIDMEDIA_VERSION=$(git --git-dir external/droidmedia/.git describe --tags | sed \
-r "s/\-/\+/g")
rpm/dhd/helpers/pack_source_droidmedia-localbuild.sh $DROIDMEDIA_VERSION
mkdir -p hybris/mw/droidmedia-localbuild/rpm
cp rpm/dhd/helpers/droidmedia-localbuild.spec \
hybris/mw/droidmedia-localbuild/rpm/droidmedia.spec
sed -ie "s/0.0.0/$DROIDMEDIA_VERSION/" \
hybris/mw/droidmedia-localbuild/rpm/droidmedia.spec
mv hybris/mw/droidmedia-$DROIDMEDIA_VERSION.tgz hybris/mw/droidmedia-localbuild
rpm/dhd/helpers/build_packages.sh --build=hybris/mw/droidmedia-localbuild

在终端1中

1
make -j$(nproc --all) $(external/audioflingerglue/detect_build_targets.sh $PORT_ARCH $(gettargetarch))

在终端2中

1
2
3
4
5
6
7
8
9
10
AUDIOFLINGERGLUE_VERSION=$(git --git-dir external/audioflingerglue/.git describe --tags | sed \
-r "s/\-/\+/g")
rpm/dhd/helpers/pack_source_audioflingerglue-localbuild.sh $AUDIOFLINGERGLUE_VERSION
mkdir -p hybris/mw/audioflingerglue-localbuild/rpm
cp rpm/dhd/helpers/audioflingerglue-localbuild.spec \
hybris/mw/audioflingerglue-localbuild/rpm/audioflingerglue.spec
sed -ie "s/0.0.0/$AUDIOFLINGERGLUE_VERSION/" \
hybris/mw/audioflingerglue-localbuild/rpm/audioflingerglue.spec
mv hybris/mw/audioflingerglue-$AUDIOFLINGERGLUE_VERSION.tgz hybris/mw/audioflingerglue-localbuild
rpm/dhd/helpers/build_packages.sh --build=hybris/mw/audioflingerglue-localbuild

然后重新打包dhd

1
rpm/dhd/helpers/build_packages.sh --droid-hal

打包其他中间件包(mw)

注意到 https://wiki.merproject.org/wiki/Adaptations/faq-hadk 搜索当前版本需要对应的mw版本号,不一定用最新的

执行 rpm/dhd/helpers/build_packages.sh --mw ,然后选择 all 即可

【进阶】上传到obs打包

将droid-local-repo/vince下 droid-hal-vince/.rpm 跟audioflingerglue.rpm 、 droidmedia*.rpm 上传到obs的droid-hal-vince下

例如这些包:https://build.merproject.org/package/show/nemo:devel:hw:xiaomi:vince/droid-hal-vince

obs打包还需要dhc,dhv等等几个包,此处不详细说明了,可以到 https://github.com/mer-hybris 看其他机型的

打包dhv

也就是 droid-hal-$DEVICE-version

rpm/dhd/helpers/build_packages.sh -v

如果提示 droid-configs 之类的找不到,需要手动安装

1
sb2 -t $VENDOR-$DEVICE-$PORT_ARCH -R -msdk-install zypper -n install droid-config-$DEVICE

Jolla-@RELEASE@-$DEVICE-@[email protected]

~obs打包完之后,将droid-config-vince-kickstart-configuration-0.2.4*.armv7hl.rpm 下载下来,解压获得Jolla-@RELEASE@-$DEVICE-@[email protected]放到$ANDROID_ROOT下面~

1
2
3
4
5
6
7
8
cd $ANDROID_ROOT
HA_REPO="repo --name=adaptation-community-common-$DEVICE-@RELEASE@"
HA_DEV="repo --name=adaptation-community-$DEVICE-@RELEASE@"
KS="Jolla-@RELEASE@-$DEVICE-@[email protected]"
sed \
"/$HA_REPO/i$HA_DEV --baseurl=file:\/\/$ANDROID_ROOT\/droid-local-repo\/$DEVICE" \
$ANDROID_ROOT/hybris/droid-configs/installroot/usr/share/kickstarts/$KS \
> $KS

镜像制作

1
2
3
4
5
6
7
8
9
10
cd $ANDROID_ROOT
RELEASE=2.1.4.14
EXTRA_NAME=-alpha1
hybris/droid-configs/droid-configs-device/helpers/process_patterns.sh
sudo mic create fs --arch=$PORT_ARCH \
--tokenmap=ARCH:$PORT_ARCH,RELEASE:$RELEASE,EXTRA_NAME:$EXTRA_NAME \
--record-pkgs=name,url \
--outdir=sfe-$DEVICE-$RELEASE$EXTRA_NAME \
--pack-to=sfe-$DEVICE-$RELEASE$EXTRA_NAME.tar.bz2 \
$ANDROID_ROOT/Jolla-@RELEASE@-$DEVICE-@[email protected]

在当前目录下会有一个 sfe-$DEVICE-$RELEASE$EXTRA_NAME目录,下面的 sailfishos-$DEVICE-$RELEASE$EXTRA_NAME.zip就是要使用的刷机包

刷机

刷入 lineageos-14.1的包,刷入上面的sailfishos-$DEVICE-$RELEASE$EXTRA_NAME.zip的包,重启

可以参考 https://wiki.merproject.org/wiki/Adaptations/libhybris/Install_SailfishOS_for_Vince

调试

欢迎加入 IRC #jolla-cn #sailfishos-porters (只限英文交流) 或 https://t.me/joinchat/GTqoL1HLIYXWNf-JeijTAg 讨论

相关文档