Skip to content
This repository has been archived by the owner on Aug 2, 2019. It is now read-only.

Commit

Permalink
init: linkerfix
Browse files Browse the repository at this point in the history
  • Loading branch information
simonsmh committed Aug 29, 2018
1 parent a84731a commit f857e29
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 0 deletions.
54 changes: 54 additions & 0 deletions META-INF/com/google/android/update-binary
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/sbin/sh
FD=$2

ui_print() {
echo -n -e "ui_print $1\n" > /proc/self/fd/$FD
echo -n -e "ui_print\n" > /proc/self/fd/$FD
}

copy_linker()
{
if [ -f /vendor/bin/linker ]; then
ui_print "- Copying linker from vendor"
cp -f /vendor/bin/linker /system/bin/linker
else
ui_print "- Copying linker from zip"
cp -f /tmp/bin/linker /system/bin/linker
fi
ui_print "- Fixing linker permision"
chown -h root.shell /system/bin/linker
}

fix_libs()
{
ui_print "- Fixing missing $1"
cp -f /system/lib/$1 /vendor/lib/$1
cp -f /system/lib64/$1 /vendor/lib64/$1
}

ui_print "************************************"
ui_print "** GSI Linker Fix by simonsmh **"
ui_print "Link: github.com/OP3Treble/linkerfix"
ui_print "************************************"

# Mount partition
mount system
mount vendor

# Self Function
copy_linker

### TODO: Not working in 9.0 GSI, we need to compile linker under LOS 16
# # Needed by 9.0 GSI vndksupport
# fix_libs libcameraservice.so
# fix_libs [email protected]
# fix_libs libutilscallstack.so
# fix_libs [email protected]

# Unmount partition
umount system
umount vendor

ui_print "Succeed."

exit 0
1 change: 1 addition & 0 deletions META-INF/com/google/android/updater-script
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#SIMONSMH
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
# linkerfix
This repo contains a linker (32-bit) binary with shim libs support compiled in.

This linker supports unofficial OP3Treble Project:

```Makefile
TARGET_LD_SHIM_LIBS := \
/vendor/lib/hw/camera.msm8996.so|libcamera_shim.so
```

Reference: https://review.lineageos.org/c/LineageOS/android_bionic/+/223065/2
Binary file added bin/linker
Binary file not shown.

0 comments on commit f857e29

Please sign in to comment.