Git Large File Storage¶
在 为Pixel 4编译LineageOS 20(Android 13) ,编译LineageOS的文档中提出需要使用 lfs or Large File Storage ,原因是一些repos配置使用了 git-lfs
。
对于每个使用 git-lfs
的用户账号,都需要执行一次:
git lfs install
但是我第一次执行的时候报错:
git: 'lfs' is not a git command. See 'git --help'
当时我以为可以忽略这个问题,在后续的 repo init
时候去掉了 --git-lfs
参数。但是实际上这个参数非常重要,在编译时就遇到了无法同步仓库的报错:
...
[ 11% 7599/63502] Verifying uses-libraries: external/chromium-webview/prebuilt/arm64/webview.apk
FAILED: out/target/common/obj/APPS/webview_intermediates/enforce_uses_libraries.status
/bin/bash -c "(rm -f out/target/common/obj/APPS/webview_intermediates/enforce_uses_libraries.status ) && (build/soong/scripts/manifest_check.py --enforce-uses-libraries --enforce-uses-libraries-status out/target/common/obj/APPS/webview_intermediates/enforce_uses_libraries.status --aapt out/host/linux-x86/bin/aapt --enforce-uses-libraries-relax external/chromium-webview/prebuilt/arm64/webview.apk )"
zipro W 11-03 11:39:22 13171 13171] Error opening archive external/chromium-webview/prebuilt/arm64/webview.apk: Invalid file
ERROR: dump failed because no AndroidManifest.xml found
error: Command '['out/host/linux-x86/bin/aapt', 'dump', 'badging', 'external/chromium-webview/prebuilt/arm64/webview.apk']' returned non-zero exit status 1
[ 12% 7637/63502] Building Kernel Config
make: Entering directory '/home/admin/android/lineage/kernel/google/msm-4.14'
make[1]: Entering directory '/home/admin/android/lineage/out/target/product/flame/obj/KERNEL_OBJ'
GEN ./Makefile
...
DTBOIMG arch/arm64/boot/dtbo.img
create image file: arch/arm64/boot/dtbo.img...
Total 12 entries.
make[1]: Leaving directory '/home/admin/android/lineage/out/target/product/flame/obj/DTBO_OBJ'
make: Leaving directory '/home/admin/android/lineage/kernel/google/msm-4.14'
11:40:32 ninja failed with: exit status 1
#### failed to build some targets (12:04 (mm:ss)) ####
external/chromium-webview/prebuilt/arm64/webview.apk
文件:
version https://git-lfs.github.com/spec/v1
oid sha256:feddb0a30690da03177b9fae71d6acf04ffb94ce778698facef5688937afc4e2
size 210372668
这说明必须支持 git-lfs
安装¶
实际安装非常方便,Ubuntu提供了 git-lfs
软件包:
apt install git-lfs
安装完成后,在用户目录下再次执行:
git lfs install
此时输出信息正常:
Git LFS initialized.