Android AOSP 编译并烧录到Google Pixel4XL

news2024/10/6 1:46:32

在这里插入图片描述

简介

AOSP(Android Open Source Project)是Android系统的开源版本,任何人都可以下载、编译和修改。手头上有一台Pixel 4XL,尝试编译AOSP并将其烧录到的设备上。

准备工作

在开始之前,您需要确保您的电脑满足以下条件:

  • 足够的存储空间:编译AOSP需要大量的存储空间,建议至少预留200GB的空间。
  • 足够的RAM:编译AOSP也需要大量的RAM,建议至少16GB的RAM。
  • 一台运行Linux或macOS的电脑:Windows系统不适用于编译AOSP。
  • TYPEC线一条,
  • 一部快废了的pixel手机

救砖: 烧录变砖的风险很高.
https://developers.google.cn/android/images这里下载对应版本的固件,并进行解压

虽然找得到固件, 但是并不能正常下载下来
We’re sorry…
… but your computer or network may be sending automated queries. To protect our users, we can’t process your request right now.

See Google Help for more information.

进入引导程序界面,连接电脑,直接打开**flach-all.bat**,等待完成后你的手机就能开机
pixel4XL进入引导界面的步骤:

1. 首先,确保您的设备已关闭。(按住 Pixel 4 XL 的电源按钮约 30 秒钟来强制关机)
2. 按住音量下按钮和电源按钮同时长达30秒钟,直到设备重新启动。
3. 在Pixel徽标出现时松开电源按钮,但继续按住音量下按钮,直到您看到“启动器锁定状态”选项。
4. 使用音量按钮导航到“启动器锁定状态”,然后按电源按钮确认。

https://flash.android.com/release/13.0.0 界面如下
在这里插入图片描述
在这里插入图片描述
后续确认并下载固件:
在这里插入图片描述
下载完后, 会自动烧录到手机中, 等待烧录完成即可!
小插曲: 由于前面已经解锁过bootloader, 烧录的最后会提示重新锁定.

为PIXEL4XL编译AOSP[使用清华镜像]

AOSP的下载和编译过程可参考:Ubuntu 20.04编译AOSP 并启动模拟器

1. 编译Pixel4XL的固件, 还需要获取对应失败的驱动程序二进制文件
Nexus 和 Pixel 设备的驱动程序二进制文件
在这里插入图片描述

很明显, Pixel4XL 最新支持到 Android 13.0.0

下载下来的两个文件, 放到AOSP源码的目录下执行后再编译系统, 执行过程会提示一些LICENCE之类的问题, 同意即可
在这里插入图片描述

2. 确定Pixel4XL支持的系统版本并切换到制定分支

//https://blog.csdn.net/weixue9/article/details/100572970
# 查看所有分支
aosp/.repo/manifests$ git branch -a | cut -d / -f 3 | grep android-13
# 切换分支
repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest -b android-13.0.0_r31
repo sync

如果没有切换到对应的分支, 根本找不到对应的Pixel 4XL 的项目配置

3. 编译

source build/envsetup.sh
lunch aosp_coral-userdebug
make -j12

可能编译失败: 内存问题, 增加虚拟内存解决

make
20:43:39 ************************************************************
20:43:39 You are building on a machine with 15.4GB of RAM
20:43:39 
20:43:39 The minimum required amount of free memory is around 16GB,
20:43:39 and even with that, some configurations may not work.
20:43:39 
20:43:39 If you run into segfaults or other errors, try reducing your
20:43:39 -j value.
20:43:39 ************************************************************
build/make/core/soong_config.mk:209: warning: BOARD_PLAT_PUBLIC_SEPOLICY_DIR has been deprecated
. Use SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS instead.
build/make/core/soong_config.mk:210: warning: BOARD_PLAT_PRIVATE_SEPOLICY_DIR has been deprecate
d. Use SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS instead.
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=13
TARGET_PRODUCT=aosp_coral
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-6.5.0-27-generic-x86_64-Ubuntu-22.04.4-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=TP1A.221005.002.B2
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=hardware/google/av hardware/google/camera hardware/google/interfaces ha
rdware/google/pixel device/google/coral hardware/qcom/sm8150/display hardware/qcom/sm8150/data/i
pacfg-mgr hardware/qcom/sm8150/gps vendor/google/airbrush/floral vendor/google/biometrics/face/f
lorence vendor/google/camera vendor/google/darwinn vendor/google_devices/common/proprietary/conf
irmatioui_hal vendor/google_nos/host/android vendor/qcom/sm8150 vendor/qcom/sm8150/proprietary/c
ommonsys/telephony-apps/DataStatusNotification vendor/qcom/sm8150/proprietary/gps vendor/qcom/sm
8150/proprietary/qmi vendor/qcom/sm8150/codeaurora/location vendor/google/interfaces vendor/goog
le_nos/test/system-test-harness vendor/qcom/sensors vendor/google/tools/sensors vendor/qcom/sm72
50/codeaurora/commonsys/telephony/ims/ims-ext-common vendor/qcom/sm7250/codeaurora/dataservices/
rmnetctl vendor/qcom/sm7250/proprietary/commonsys/qcrilOemHook vendor/qcom/sm7250/proprietary/co
mmonsys/telephony-apps/ims vendor/qcom/sm7250/proprietary/commonsys/telephony-apps/QtiTelephonyS
ervice vendor/qcom/sm7250/proprietary/commonsys/telephony-apps/xdivert vendor/qcom/sm7250/propri
etary/qcril-data-hal vendor/qcom/sm7250/proprietary/qcril-hal vendor/qcom/sm7250/proprietary/dat
a vendor/qcom/proprietary/bluetooth/hidl_client vendor/qcom/coral/proprietary
============================================
[100% 1/1] analyzing Android.bp files and generating ninja file at out/soong/build.ninja
FAILED: out/soong/build.ninja
cd "$(dirname "out/host/linux-x86/bin/soong_build")" && BUILDER="$PWD/$(basename "out/host/linux
-x86/bin/soong_build")" && cd / && env -i  "$BUILDER"     --top "$TOP"     --soong_out "out/soon
g"     --out "out"     -o out/soong/build.ninja --globListDir build --globFile out/soong/globs-b
uild.ninja -t -l out/.module_paths/Android.bp.list --available_env out/soong/soong.environment.a
vailable --used_env out/soong/soong.environment.used.build Android.bp
Killed
20:45:07 soong bootstrap failed with: exit status 1
ninja: build stopped: subcommand failed.

#### failed to build some targets (01:31 (mm:ss)) ####

烧录

  1. 打开两个调试开关
    “Settings”/”System”/”Advanced”/”Developer options”/”USB debugging
    “Settings”/”System”/”Advanced”/”Developer options”/”OEM unlocking
  2. 开始烧录
cd out/target/product/coral/
adb reboot bootloader
fastboot flashing unlock
fastboot flashall -w

注意
如果是bootloader未解锁, 需要通过配合音量键和电源键解锁, 解锁后可以进入fastbootd模式
烧录过程会重启几次

android@MR26:/aosp/out/target/product/coral$ fastboot flashall -w
< waiting for any device >
--------------------------------------------
Bootloader Version...: c2f2-0.5-8906123
Baseband Version.....: g8150-00123-220708-B-8810441
Serial Number........: 9B051FFBA00E7C
--------------------------------------------
Checking 'product'                                 OKAY [  0.070s]
Setting current slot to 'b'                        OKAY [  0.079s]
Sending 'boot_b' (65536 KB)                        OKAY [  2.350s]
Writing 'boot_b'                                   OKAY [  0.425s]
Sending 'dtbo_b' (8192 KB)                         OKAY [  0.410s]
Writing 'dtbo_b'                                   OKAY [  0.124s]
Sending 'vbmeta_b' (4 KB)                          OKAY [  0.140s]
Writing 'vbmeta_b'                                 OKAY [  0.078s]
Sending 'vbmeta_system_b' (4 KB)                   OKAY [  0.140s]
Writing 'vbmeta_system_b'                          OKAY [  0.077s]
Rebooting into fastboot                            OKAY [  0.070s]
< waiting for any device >
Sending 'super' (4 KB)                             OKAY [  0.045s]
Updating super partition                           OKAY [  1.015s]
Resizing 'product_b'                               OKAY [  0.005s]
Resizing 'system_b'                                OKAY [  0.005s]
Resizing 'system_ext_b'                            OKAY [  0.005s]
Resizing 'system_a'                                OKAY [  0.006s]
Resizing 'vendor_b'                                OKAY [  0.005s]
Resizing 'vendor_a'                                OKAY [  0.006s]
Invalid sparse file format at header magic
Resizing 'product_b'                               OKAY [  0.006s]
Sending sparse 'product_b' 1/2 (262140 KB)         OKAY [  8.997s]
Writing 'product_b'                                OKAY [  2.498s]
Sending sparse 'product_b' 2/2 (19320 KB)          OKAY [  0.753s]
Writing 'product_b'                                OKAY [  0.147s]
Invalid sparse file format at header magic
Resizing 'system_b'                                OKAY [  0.006s]
Sending sparse 'system_b' 1/4 (262116 KB)          OKAY [  9.101s]
Writing 'system_b'                                 OKAY [  2.500s]
Sending sparse 'system_b' 2/4 (262116 KB)          OKAY [  9.269s]
Writing 'system_b'                                 OKAY [  1.459s]
Sending sparse 'system_b' 3/4 (262140 KB)          OKAY [  9.488s]
Writing 'system_b'                                 OKAY [  1.471s]
Sending sparse 'system_b' 4/4 (70868 KB)           OKAY [  2.458s]
Writing 'system_b'                                 OKAY [  0.442s]
Resizing 'system_ext_b'                            OKAY [  0.005s]
Sending 'system_ext_b' (163524 KB)                 OKAY [  5.689s]
Writing 'system_ext_b'                             OKAY [  1.936s]
Resizing 'system_a'                                OKAY [  0.008s]
Sending 'system_a' (24708 KB)                      OKAY [  0.996s]
Writing 'system_a'                                 OKAY [  0.199s]
Invalid sparse file format at header magic
Resizing 'vendor_b'                                OKAY [  0.010s]
Sending sparse 'vendor_b' 1/4 (262116 KB)          OKAY [  8.423s]
Writing 'vendor_b'                                 OKAY [  2.476s]
Sending sparse 'vendor_b' 2/4 (262096 KB)          OKAY [  8.982s]
Writing 'vendor_b'                                 OKAY [  1.549s]
Sending sparse 'vendor_b' 3/4 (262140 KB)          OKAY [  9.284s]
Writing 'vendor_b'                                 OKAY [  1.436s]
Sending sparse 'vendor_b' 4/4 (67856 KB)           OKAY [  2.437s]
Writing 'vendor_b'                                 OKAY [  0.430s]
Erasing 'userdata'                                 OKAY [  4.547s]
Erase successful, but not automatically formatting.
File system type raw not supported.
Erasing 'metadata'                                 OKAY [  0.004s]
Erase successful, but not automatically formatting.
File system type raw not supported.
Rebooting                                          OKAY [  0.000s]
Finished. Total time: 123.496s

在这里插入图片描述

参考

Android 12源码编译报错:FAILED: out/soong/build.ninja
使用Google Pixel5手机调试AOSP(代码下载、编译、刷机、调试)详细攻略
aosp-刷入到pixel4XL设备
Build, Flash and Un-Flash AOSP Image on Pixel Phones

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1859687.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

文旅景区科技馆增加5D影院项目VR游乐场

王屋山风景名胜区增加20座5D影院设备&#xff0c;5D影院不像普通电影院&#xff0c;5D影院座椅可以根据影片播放内容&#xff0c;进行实时摆动和各种特效&#xff0c;闪电&#xff0c;振臀振臂&#xff0c;泡泡等个种特效。影片内容可以进行定制&#xff0c;根据景区文化风光&a…

OnlyOffice-8.1版本深度测评

2024年6月19日&#xff0c;ONLYOFFICE 发布了最新版本 8.1&#xff0c;带来了超过30项新功能和432个 bug 修复。本文将详细评测该版本的新功能和改进&#xff0c;帮助用户全面了解这一升级带来的实际体验提升。 一、功能全面的 PDF 编辑器 PDF 是日常工作中不可或缺的文件格式…

Waiting for table flush故障处理

故障排查 1 找到正处于open状态的表 show open tables where in_use >1; 2 找到引发故障的慢查询 ① 找到阻塞flush tables的慢查询 SELECT * FROM information_schema.PROCESSLIST WHERE info IS NOT NULL AND state NOT LIKE ‘Waiting for table flush’ AND info …

CentOS7.6安装RabbitMQ

前言&#xff1a;因为RabbitMQ是ERlang语言编写所以要先安装ERlang再安装RabbitMQ 安装ERlang 借鉴前辈原文地址&#xff1a;https://www.cnblogs.com/fengyumeng/p/11133924.html 第一步&#xff1a;安装依赖 yum -y install gcc glibc-devel make ncurses-devel open…

Linux-CentOs7 基础配置

目录 一、安装ifconfig二、配置静态IP 一、安装ifconfig 查找ifconfig存在哪个包下 yum search ifconfig下载对应的资源包 yum install net-tools.x86_64检查是否安装成功 ifconfig二、配置静态IP 点击编辑 — 虚拟网络编辑器&#xff0c;选择VMnet8&#xff0c;点击NET设置&am…

【C++题解】1711. 输出满足条件的整数1

问题&#xff1a;1711. 输出满足条件的整数1 类型&#xff1a;简单循环 题目描述&#xff1a; 有这样的两位数&#xff0c;其十位上的数字比个位上的数字要大&#xff0c;且十位和个位上的数字之和为偶数&#xff0c;请找出所有的满足条件的 2 位数。 输入&#xff1a; 无。…

Hive基础知识(十九):Hive 自定义函数

1. 自定义函数 1&#xff09;Hive 自带了一些函数&#xff0c;比如&#xff1a;max/min 等&#xff0c;但是数量有限&#xff0c;自己可以通过自定义 UDF 来方便的扩展。 2&#xff09;当 Hive 提供的内置函数无法满足你的业务处理需要时&#xff0c;此时就可以考虑使用用户自…

山寨币大额解锁抛压拖累比特币:10X Research 深度剖析市场动荡

加密货币市场大幅下跌&#xff0c;山寨币损失惨重 在经历了几个月的强劲表现后&#xff0c;加密货币市场最近经历了一轮大幅下跌&#xff0c;特别是山寨币损失惨重。10X Research 最近在其Newsletter中发表了观点&#xff0c;认为山寨币大额解锁所带来的抛压正在拖累比特币。本…

win11安装VMware虚拟机,启动系统后蓝屏,安装虚拟机卡在虚拟网卡界面的解决办法

机缘和遇到的问题 由于最近618换了台新笔记本电脑&#xff0c;然后系统自带的操作系统是windows 11 家庭版本&#xff0c;由于工作需要用到window10的环境&#xff0c;不得不安装一个虚拟机来解决问题&#xff0c;然后就把这次安装VMware虚拟机遇到的坑给大家分享一下&#xf…

AI视频模型Sora核心功能以及应用场景

随着人工智能技术的飞速发展&#xff0c;AI在视频处理和生成领域的应用正变得越来越广泛。Sora&#xff0c;作为新一代AI视频模型&#xff0c;展示了前所未有的潜力和创新能力。本文将深入探讨Sora的功能、应用场景以及它所带来的革命性变化。 一、Sora的核心功能 1.1 视频生…

cpu scheduling cpu调度

soft real-time Vs hard real-time scheduling Real-Time CPU Scheduling Can present obvious challengesSoft real-time systems – Critical real-time tasks have the highest priority, but no guarantee as to when tasks will be scheduledHard real-time systems – …

ONLYOFFICE 桌面编辑器 8.1 发布:全新 PDF 编辑器、幻灯片版式、增强 RTL 支持及更多本地化选项

目录 什么是ONLYOFFICE&#xff1f; ONLYOFFICE 主要特点包括&#xff1a; 官网信息&#xff1a; 1. 功能齐全的 PDF 编辑器 1.1 编辑 PDF 文本 1.2 插入和修改对象 1.3 创建和填写表单 2. 幻灯片版式功能 2.1 快速应用幻灯片版式 2.2 动画窗格的改进 3. 文档编辑、…

交通 | 机器学习 + 大规模TSP/VRP求解

封面图来源&#xff1a;https://xkcd.com/399/ 推文作者&#xff1a;丁建辉&#xff0c;陈泰劼&#xff0c;张云天 本文针对旅行商问题&#xff08;Travelling salesman problem, TSP&#xff09;和车辆路径规划问题&#xff08;Vehicle routing problem, VRP&#xff09;这一类…

数据库精选题(五)(事务、并行控制与恢复系统)

&#x1f308; 个人主页&#xff1a;十二月的猫-CSDN博客 &#x1f525; 系列专栏&#xff1a; &#x1f3c0;数据库 &#x1f4aa;&#x1f3fb; 十二月的寒冬阻挡不了春天的脚步&#xff0c;十二点的黑夜遮蔽不住黎明的曙光 目录 前言 概论 事务 并发控制 恢复系统 三…

Python | Leetcode Python题解之第190题颠倒二进制位

题目&#xff1a; 题解&#xff1a; class Solution:# param n, an integer# return an integerdef reverseBits(self, n):n (n >> 16) | (n << 16);n ((n & 0xff00ff00) >> 8) | ((n & 0x00ff00ff) << 8);n ((n & 0xf0f0f0f0) >&g…

198.回溯算法:子集(力扣)

代码解决 class Solution { public:// 用于存储当前子集的临时向量vector<int> res;// 用于存储所有子集的结果向量vector<vector<int>> result;// 回溯函数void backtracing(vector<int>& nums, int index) {// 每次递归调用都将当前子集添加到结…

CBSD创建和管理bhyve容器Ubuntu@FreeBSD

首先&#xff0c;创建bhyve cbsd bconstruct-tui 然后启动 cbsd bstart bub22 启动后提示 init_systap: waiting for link: igb0 Looks like /usr/jails/vm/bub22/dsk1.vhd is empty. May be you want to boot from CD? [yes(1) or no(0)] yes确认 然后使用cbsd blogi…

“Cannot resolve ch.qos.logback:logback-classic:1.2.3”问题解决办法

当我们添加依赖配置时&#xff0c;通常会遇见如下错误&#xff1a; 这个问题是由于项目中使用了 logback-classic 版本1.2.3&#xff0c;但是无法从当前所配置的仓库中解析到这个特定的版本。可以尝试检查依赖配置&#xff0c;确保指定的仓库中包含了 logback-classic 版本1.2.…

数据中心 250KW 水冷负载组概述

该负载专为数据中心冷水机组调试和测试应用而设计, 是一款紧凑的便携式产品&#xff0c;具有无限功率和水流控制功能&#xff0c;可实现精确的温升设置与施加的功率。鹦鹉螺是完全可联网的&#xff0c;可以从远程站控制单个或多个单元。 使用带有触摸屏 HMI 的 PLC&#xff0c;…

内网使用nexus3搭建npm私库方法

内网使用nexus3搭建npm私库大致分为下载tgz和批量上传两个步骤。如下。 第一步&#xff0c;批量下载tgz依赖。 新建一个文件夹&#xff0c;比如download&#xff1b;拷贝出项目中package.json或者package-lock.json。放进download文件夹中&#xff1b;确保电脑本地已经安装好n…