Android目前以 88% 左右的移动操作系统市场份额领先。其余大部分股份归苹果的 iOS 所有。Android作为开源操作系统,允许开发人员调整操作系统并构建新的自定义操作系统。人们称它们为 自定义 ROM (Custom ROMs)。 这些定制ROM(ROMs)在全球各地的社区中都很有名。随着自定义 ROM(Custom ROMs)的推出,用户现在甚至可以在OEM(OEMs)推出特定设备的更新之前获得Google必须提供的最新和最强大的(Google)Android 。这也有助于恢复不受支持的设备以运行自定义(Custom)OEM从未推送或开发的Android版本。LineageOS就是 这样一种流行的自定义 ROM 。(Custom ROM)
LineageOS
LineageOS 以前称为CynogenMod OS。LineageOS 16 版(Version 16)是最新版本,基于Google的Android 9 Pie。它目前支持许多设备。人们倾向于安装LineageOS的主要原因是因为它提供了没有任何自定义皮肤的Stock Android体验。(Stock Android)这是很多人喜欢和欣赏的。这就是为什么三星(Samsung)或小米设备上的许多(Xiaomi)超级(Power)用户继续安装LineagoOS只是为了摆脱三星体验(Samsung Experience)等自定义皮肤和 MIUI分别。我可以确认,因为我的小米(Xiaomi)手机上有自定义操作系统。
无论如何,让我们深入研究这里的主要内容。
(Build LineageOS 16.0)使用适用于Linux的(Linux)Windows 子系统(Windows Subsystem)在 Windows 10 上构建 LineageOS 16.0
首先(First),我们将检查此任务的系统要求。
系统要求(System Requirements)
您的计算机上至少应该有 16 GB(Gigabytes)的RAM。它应该运行Windows 10(仅限 64 位)。对于存储,建议您拥有 256 GB(Gigabytes)或更多可用空间,其中首选SSD 。
需要注意的一些事项(Some things to take care of)
正如原始开发人员所提到的,以下是您在执行此任务时需要牢记的主要事项。
- Do NOT add/edit your Linux files from Windows. The files will most likely be broken in bash.
Instead, add/edit the files from within the Linux subsystem - Using mnt to download the source code to other drives and then attempting to follow this guide will probably result in failures. Download the source to folders only within the subsystem
构建 LineageOS 16(Building LineageOS 16)
应逐步采取以下步骤来完成此任务。
- 在适用于Linux的(Linux)Windows 子系统(Windows Subsystem)下安装和设置Ubuntu。
- 获取BASH shell 所需的文件。
- 创建一个目录来存储Github存储库中的所有文件。
- 初始化LineageOS 存储库。
- 同步资源。
- 运行脚本。
- 准备设备特定代码。
- 添加项目清单。
- 再次同步资源。
- 开始为创建的文件构建。
首先,首先从Microsoft Store下载 WSL 和 Ubuntu 18.04 LTS(downloading WSL & Ubuntu 18.04 LTS)并进行设置。
现在,让我们获取BASH shell 所需的最新文件。
为此,在 shell 中输入以下命令,
sudo apt update && sudo apt full-upgrade -y && sudo apt install -y bc build-essential ccache curl g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop m4 openjdk-8-jdk pngcrush repo rsync schedtool squashfs-tools xsltproc zip zlib1g-dev
下载所需文件需要一些时间。所以在那之前,你可以高枕无忧。
您现在应该创建一个自定义目录来存储从LineageOS Github存储库下载的所有文件。
为此,输入此命令,
mkdir -p ~/android/lineage && cd android/lineage
让我们开始使用LineageOS的(LineageOS)Github存储库。
为此,输入此命令,
repo init -u https://github.com/LineageOS/android.git -b lineage-16.0
最后,同步存储库。
repo sync
您可以采取一个可选但推荐的步骤来加快该过程。你可以在这里(here)阅读更多关于它的信息。
然后您需要运行脚本文件以准备构建项目。
为此,输入此命令,
source build/envsetup.sh
然后为特定设备准备代码。为此,您需要知道该设备的代号。您可以通过在任何搜索引擎上输入<YOUR DEVICE MARKETING NAME> Codename来搜索互联网。
准备设备特定代码的命令是,
breakfast your device codename
现在,您需要在清单文件中添加一行。您可以查找它,如果它不存在,请在以下路径 中创建一个名为roomservice.xml 的清单文件: (roomservice.xml ).repo/local_manifests/.
您需要添加的行是,
<project name="TheMuppets/proprietary_vendor_your device brand" path="vendor/your device brand" remote="github" />
再次与存储库同步。使用这个命令,
repo sync
我们现在完成了繁琐的部分,剩下的只是(Just)开始构建。
要开始构建,请输入以下代码,
brunch your device codename
如果您希望构建LineageOS的更新版本,您只需同步存储库,运行脚本,然后直接启动构建。
它将为您节省大量时间和Internet 数据(Internet Data)。
您可以在 XDA Developers 上阅读有关此任务和基于 Google 的 Android Oreo 8.1 构建LineageOS(here) 15.1 的更多(Android Oreo 8.1)信息。(LineageOS 15.1)
Build LineageOS on Windows 10 using Windows Subsystem for Linux
Android is currently leading the mobile OS market share at around 88%. The majority of the rest of the share is owned by Apple’s iOS. Android being an open source operating system, allows developers to tweak the OS and build a new custom operating system. People call them Custom ROMs. These custom ROMs are famous in communities around the globe. With the availability of Custom ROMs, users can now get the latest and greats of Android that Google has to offer even sometimes before the OEMs push out an update for a particular device. This also helps to revive an unsupported device to run the Custom version of Android that the OEM never pushed or developed. One such popular Custom ROM is LineageOS.
LineageOS
LineageOS was formerly called as CynogenMod OS. Version 16 of LineageOS is the latest release and is based on Android 9 Pie from Google. Many devices are currently supported by it. The main reason that people tend to install LineageOS is because it provides a Stock Android experience without any custom skin. This is liked and admired by a lot of people. This is the reason many Power users on Samsung or Xiaomi devices go-ahead to install LineagoOS just to get rid of the custom skin like Samsung Experience and MIUI respectively. I can confirm that because I have a custom operating system on my Xiaomi phone.
Anyway, let dig into the main thing here.
Build LineageOS 16.0 on Windows 10 using Windows Subsystem for Linux
First of all, we will check out the system requirements for this task.
System Requirements
You should at least have 16 Gigabytes of RAM on your computer. It should be running Windows 10 (64-bit only). And for storage, it is recommended for you to have 256 Gigabytes or more space free where having an SSD is preferred.
Some things to take care of
As mentioned by the original developer, here are the main things that you need to keep in mind while carrying out this task.
- Do NOT add/edit your Linux files from Windows. The files will most likely be broken in bash.
Instead, add/edit the files from within the Linux subsystem - Using mnt to download the source code to other drives and then attempting to follow this guide will probably result in failures. Download the source to folders only within the subsystem
Building LineageOS 16
The following steps should be taken one by one to get this task working.
- Installing and setting up Ubuntu under Windows Subsystem for Linux.
- Getting the required files for the BASH shell.
- Creating a directory to store all the files from the Github repository.
- Initializing the LineageOS repository.
- Syncing the resources.
- Running the script.
- Preparing device specific code.
- Adding the project manifest.
- Syncing the resources again.
- Start the build for the created files.
First of all, start by downloading WSL & Ubuntu 18.04 LTS from the Microsoft Store and setting it up.
Now, let us get the latest required files for our BASH shell.
For that, enter the following command in the shell,
sudo apt update && sudo apt full-upgrade -y && sudo apt install -y bc build-essential ccache curl g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop m4 openjdk-8-jdk pngcrush repo rsync schedtool squashfs-tools xsltproc zip zlib1g-dev
It will take some time to download the required files. So until then, you can just sit back and relax.
You should now create a custom directory to store all the downloaded files from the LineageOS Github repository.
For that, enter this command,
mkdir -p ~/android/lineage && cd android/lineage
Let us start working with the Github repository for LineageOS.
For that, enter this command,
repo init -u https://github.com/LineageOS/android.git -b lineage-16.0
Finally, sync the repository.
repo sync
There is an optional yet recommended step that you can take to speed up the process. You can read more about it here.
Then you need to run the script file to prepare to build the project.
For that, enter this command,
source build/envsetup.sh
Then prepare the code for a specific device. To do that, you need to know the codename of that device. You can search the internet by entering <YOUR DEVICE MARKETING NAME> Codename on any search engines.
The command for preparing the device-specific code is,
breakfast your device codename
Now, you need to add a line to the manifest file. You can look for it and if it does not exists, create a manifest file named roomservice.xml inside this path: .repo/local_manifests/.
The line that you need to add is,
<project name="TheMuppets/proprietary_vendor_your device brand" path="vendor/your device brand" remote="github" />
Sync with the repository again. Use this command,
repo sync
We are now done with the tedious part, Just starting the build is left.
To start the build, enter the following code,
brunch your device codename
In case you wish to build a newer build of LineageOS, you need to just sync the repository, run the script and then directly start the build.
It will save you a lot of time and Internet Data.
You can read more about this task and building LineageOS 15.1 based on Google’s Android Oreo 8.1 here on XDA Developers.