mcpField
L
lineageos

lineageos

github.com/hyperb1iss開発49101 回インストール39 週間前に更新
リポジトリ

lineageos について

lineageosは、LineageOSのカスタムROM開発者向けスキルです。ソース同期、デバイスツリー設定、ビルド、Gerritへの変更提出、トラブルシューティングを、コマンド例とともに扱います。

主な機能

  1. 01ソースツリーの初期化と同期
  2. 02デバイスツリーと依存関係の設定
  3. 03ZIP、カーネル、システムイメージのビルド
  4. 04デバイス固有ファイルの抽出
  5. 05repopickによるGerrit変更の取得
  6. 06ビルドやSELinuxの問題の調査

活用シーン

  1. 01デバイス向けLineageOSビルド環境の準備
  2. 02フラッシュ可能なROM ZIPのビルド
  3. 03デバイスのvendor blobsの抽出
  4. 04Gerritへの変更提出の準備

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/hyperb1iss/hyperdroid-skill --skill lineageos

インストール後、Claude Code で/lineageosを入力して読み込まれたか確認します。

同梱ファイルreferences/gerrit-workflow.md

詳細

LineageOS 開発

このスキルでは、ソースの同期からビルド、コントリビュートまで、LineageOS のカスタム ROM 開発を扱います。

はじめに

ソースを初期化する
mkdir ~/lineage && cd ~/lineage

# Install repo (if needed)
mkdir -p ~/.bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo
chmod a+x ~/.bin/repo
export PATH="$HOME/.bin:$PATH"

# Init LineageOS 21 (Android 14)
repo init -u https://github.com/LineageOS/android.git -b lineage-21.0 --git-lfs

# Sync
repo sync -c -j$(nproc) --force-sync --no-tags --no-clone-bundle
ビルドコマンド
# Setup environment
source build/envsetup.sh

# Setup device (syncs device repos too)
breakfast <device>

# Build flashable ZIP
brunch <device>
# Or separately:
breakfast <device>
mka bacon

# Output: out/target/product/<device>/lineage-21.0-*-UNOFFICIAL-<device>.zip

必須コマンド

コマンド用途
breakfast <device>デバイスのセットアップと依存関係の同期
brunch <device>breakfast と完全なビルド
mka baconフラッシュ可能な ZIP をビルド
mka bootimageカーネルのみをビルド
mka systemimageシステムのみをビルド
repopick <change>Gerrit からチェリーピック

デバイスツリー

必須ファイル
device/<vendor>/<device>/
├── lineage_<device>.mk      # Product makefile
├── lineage.dependencies     # Repo dependencies
├── vendorsetup.sh           # Add to lunch
├── BoardConfig.mk           # Hardware config
├── device.mk                # Packages and configs
└── extract-files.sh         # Vendor blob extraction
lineage_.mk
# Inherit device
$(call inherit-product, device/vendor/device/device.mk)

# Inherit LineageOS common
$(call inherit-product, vendor/lineage/config/common_full_phone.mk)

PRODUCT_NAME := lineage_device
PRODUCT_DEVICE := device
PRODUCT_BRAND := Vendor
PRODUCT_MODEL := Device Name
PRODUCT_MANUFACTURER := Vendor
lineage.dependencies
[
  {
    "repository": "android_kernel_vendor_device",
    "target_path": "kernel/vendor/device"
  },
  {
    "repository": "android_device_vendor_device-common",
    "target_path": "device/vendor/device-common"
  },
  {
    "repository": "proprietary_vendor_device",
    "target_path": "vendor/device"
  }
]

repopick - Gerrit からのチェリーピック

# Single change
repopick 12345

# Multiple changes
repopick 12345 12346 12347

# By topic
repopick -t feature-topic

# With dependencies
repopick -Q 12345

# Force overwrite local changes
repopick -f 12345

# Show what would be picked
repopick -n 12345
変更番号を確認する
  1. https://review.lineageos.org にアクセスします
  2. 変更を検索します
  3. 変更番号は URL に記載されているか、画面に表示されています

ベンダーブロブ

デバイスから抽出する
cd device/vendor/device
./extract-files.sh
OTA/ファクトリーイメージから抽出する
./extract-files.sh ~/Downloads/ota.zip
proprietary-files.txt の形式
# Audio HAL
vendor/lib64/hw/audio.primary.platform.so
vendor/etc/audio_policy_configuration.xml

# With destination path
vendor/lib64/lib.so:vendor/lib64/libfoo.so

# From another device
vendor/lib64/lib.so|other_device

LineageOS の機能

Trust インターフェース

デバイスの整合性を表示するセキュリティダッシュボード:

# device.mk
PRODUCT_PACKAGES += \
    LineageTrust
LiveDisplay

ハードウェアアクセラレーション対応のディスプレイ調整:

PRODUCT_PACKAGES += \
    [email protected]
スタイル/テーマ

システムのテーマ設定をサポートします:

PRODUCT_PACKAGES += \
    ThemePicker

主なディレクトリ

パス用途
vendor/lineage/LineageOS の追加機能
lineage-sdk/LineageOS SDK
device/<vendor>/<device>/デバイスツリー
kernel/<vendor>/<device>/カーネルソース
vendor/<vendor>/プロプライエタリブロブ

コントリビュート

Gerrit アクセスを設定する
git config --global review.review.lineageos.org.username <username>
変更を送信する
# Create branch
repo start my-feature .

# Make changes
git add -A
git commit -m "subsystem: Short description

Detailed explanation.

Change-Id: <auto-generated>"

# Push for review
git push ssh://<username>@review.lineageos.org:29418/<project> HEAD:refs/for/<branch>
コミットメッセージの形式
subsystem: Short description

Longer explanation wrapped at 72 characters.
Explain why, not what.

Change-Id: I1234567890abcdef...

よくある問題

breakfast が失敗する - リポジトリが見つからない
# Re-sync device tree
repo sync device/vendor/device kernel/vendor/device vendor/device
ビルドが失敗する - SELinux
# Find denials
adb shell dmesg | grep "avc: denied"

# Generate policy (on host)
adb shell dmesg | audit2allow -p out/target/product/<device>/root/sepolicy
ブロブが見つからない

次の内容を logcat で確認します:

E linker: cannot find symbol...
E ServiceManager: Could not find service...

不足しているファイルを proprietary-files.txt に追加して、再度抽出します。


クイックリファレンス

# Full workflow
source build/envsetup.sh
breakfast cheeseburger
brunch cheeseburger

# Just kernel
mka bootimage

# Cherry-pick fix
repopick 12345

# Sync everything
repo sync -c -j$(nproc)

# Sync one project
repo sync packages/apps/Settings

# Clean build
m clean && brunch <device>

コメント