Skip to content

Instantly share code, notes, and snippets.

View ZenkaBestia's full-sized avatar
🏠
Working from home

Zenka ZenkaBestia

🏠
Working from home
  • Indonesia
  • 13:38 (UTC +08:00)
View GitHub Profile
@ZenkaBestia
ZenkaBestia / sepolicy.md
Created October 22, 2023 22:25 — forked from msfjarvis/sepolicy.md
How to write sepolicy to fix a denial
@ZenkaBestia
ZenkaBestia / extract-git-folder-with-history.md
Created December 3, 2022 02:09 — forked from cyberang3l/extract-git-folder-with-history.md
GIT: How to extract a specific folder from a git repository branch, including the folder's related git history only

GIT: How to extract a specific folder from a git repository branch, including the folder's related git history only

NOTE: If you want to keep the history for a specific folder in the master branch, just skip steps in lines 3,4,5,6,7

git clone <git-repository-url>
cd <git-repository-dir>

git checkout <branch-name>              # line 3; Checkout the branch of interest
git merge --strategy=ours master        # line 4; keep the content of this branch only and record a merge
git checkout master                     # line 5; Go back to the master branch
Make sure the device's and/or commonized device proprietary-files are updated with the same blobs that you want in your proprietary vendor repo.
Next, to use the kang and section mode we need the switches "-k -s". -k tells extract-files to only kang/pull updated blobs without deleting any blobs. -s tells it to only update ones from a commented section of your proprietary-files.
for example, if i have this in my proprietary-files
# ADSP - from oneplus3t - OnePlus/OnePlus3/OnePlus3T:9/PKQ1.181203.001/1911042108 - OOS 9.0.6
vendor/lib/libadsp_hvx_callback_skel.so
vendor/lib/libadsp_hvx_stub.so