Files

67 lines
2.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# chromiumos_kernel
这里放 **ChromiumOS `third_party/kernel`** 的对照树。Google 源站体积大、链路不稳,因此一旦拉到本机,就尽量**不要反复重拉**。
## 本仓库里的约定(当前选择:入库)
- `v5.15/` 作为**普通文件树**提交到父仓库(不使用子模块指针),便于在同一个仓库里做对照与归档。
- 由于 `v5.15/.git` 属于**嵌套仓库元数据**,提交前应先备份并移除,避免 Git 记录为 “embedded repo / gitlink”。
目录名 `v5.15` 只是习惯命名;**实际内核版本以你 `git checkout` 的分支为准**(例如 `chromeos-6.1`)。不确定当年 ChromeOS 测的是哪一版时,保留一棵树 + 在目录里 `git branch -a` / `git describe` 自己看即可。
## 第一次怎么拉(相对稳)
单分支 + 部分克隆(减小单次传输,仍可能遇 500/TLS需重试
```bash
cd /path/to/chromebox_10th_audio_driver/chromiumos_kernel
rm -rf v5.15-new
git clone --single-branch --branch chromeos-6.1 \
--filter=blob:none --no-tags \
https://chromium.googlesource.com/chromiumos/third_party/kernel.git \
v5.15-new
```
满意后改名为 `v5.15` 或继续用 `v5.15-new`(记得 `.gitignore` 里已有对应目录名时可按需增删)。
需要更多历史时,在克隆目录里**小步**加深,比一次 `fetch --unshallow` 容易成功:
```bash
cd v5.15-new
git config http.version HTTP/1.1
git config remote.origin.tagOpt --no-tags
git fetch --deepen=500 origin chromeos-6.1
# 成功可重复执行,或把 500 调大
```
仍失败时:换时间段/换出口网络;或在能稳定访问的机器上拉完后 **整目录备份**(见下)。
## 想「保留」又不想再从 Google 拉:自建镜像(推荐)
**能稳定访问 googlesource** 的机器上做一次裸镜像,推到你的内网 Git例如 `192.168.2.22`),以后所有机器只拉内网:
```bash
git clone --mirror https://chromium.googlesource.com/chromiumos/third_party/kernel.git
cd kernel.git
git remote add internal http://192.168.2.22:3000/<owner>/chromiumos-kernel-mirror.git
git push --mirror internal
```
本机日常对照:
```bash
git clone http://192.168.2.22:3000/<owner>/chromiumos-kernel-mirror.git chromiumos_kernel/v5.15
cd chromiumos_kernel/v5.15
git checkout chromeos-6.1
```
`<owner>/chromiumos-kernel-mirror.git` 换成你在 Gitea/GitLab 上实际建的**空仓库**地址。
## 备份(强烈建议,在移除 `.git` 前先做)
整目录打包即可(含 `.git`,未来若还想继续 fetch/切分支,可从备份恢复):
```bash
tar -C chromiumos_kernel -cJf chromiumos_kernel_backup.tar.xz v5.15
```