Skip to content
This repository has been archived by the owner on Jan 27, 2025. It is now read-only.

Commit

Permalink
Update to r31
Browse files Browse the repository at this point in the history
  • Loading branch information
phhusson committed Mar 2, 2020
1 parent 40314ba commit 3e19185
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 18 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if [ "$1" == "android-9.0" ];then
phh="android-9.0"
elif [ "$1" == "android-10.0" ];then
manifest_url="https://android.googlesource.com/platform/manifest"
aosp="android-10.0.0_r29"
aosp="android-10.0.0_r31"
phh="android-10.0"
fi

Expand Down
9 changes: 9 additions & 0 deletions cloud/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ android_version="$1"
set -ex

cleanup() {
bash
if [ -n "$name" ];then
docker kill "$name"
docker rm "$name"
Expand All @@ -20,6 +21,11 @@ run_script () {
docker exec "$name" sh -c "$1"
}

orig_docker="$(which docker)"
docker() {
$orig_docker --tlsverify=false "$@"
}

trap 'cleanup' ERR
trap 'cleanup' EXIT

Expand Down Expand Up @@ -68,6 +74,8 @@ run_script '
git config --global user.email [email protected] && \
git config --global color.ui auto'

run_script 'curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash ; apt install git-lfs; git lfs install'

run_script 'git clone https://github.com/phhusson/treble_experimentations'

run_script '\
Expand All @@ -79,3 +87,4 @@ run_script '\
run_script "cd build-dir && bash ../treble_experimentations/build.sh $android_version"

docker cp "$name:"/build-dir/release release

9 changes: 7 additions & 2 deletions cloud/scaleway.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash

if [ -z "$SSH_AGENT_PID" ];then
eval $(ssh-agent)
ssh-add
fi

if [ "$#" -ne 1 ];then
echo "Usage: $0 <android-9.0|android-8.1>"
exit 1
Expand All @@ -24,7 +29,7 @@ run_script() {
trap 'cleanup' ERR
trap 'cleanup' EXIT

COMMERCIAL_TYPE="GP1-S"
COMMERCIAL_TYPE="GP1-L"
suffix="$(echo "$RANDOM" |md5sum |cut -c 1-8)"
name="phh-treble-$suffix"

Expand Down Expand Up @@ -78,7 +83,7 @@ run_script 'git clone https://github.com/phhusson/treble_experimentations'

run_script '\
mkdir build-dir && \
sed -E -i "s/(repo sync.*)-j 1/\1-j24/g" treble_experimentations/build.sh && \
sed -E -i "s/(repo sync.*)-j 1/\1-j64/g" treble_experimentations/build.sh && \
sed -E -i "s/(make.*)-j8/\1-j24/g" treble_experimentations/build.sh
'

Expand Down
12 changes: 6 additions & 6 deletions linker-graph/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ parse() {
else
lib=lib
fi
if [ -f "$so" ];then
echo "File already parsed, skipping"
echo -e "\t${2}${1}"
continue
fi
#if [ -f "$so" ];then
#echo "File already parsed, skipping"
#echo -e "\t${2}${1}"
# continue
#fi
found=false
for path in /odm/$lib /vendor/$lib /system/$lib/vndk-sp-26 /system/$lib;do
for path in /odm/$lib /vendor/$lib /system/$lib/vndk-27 /system/$lib/vndk-sp-27 /system/$lib;do
if adb wait-for-device pull "$path"/"$so" > /dev/null 2>/dev/null;then
parse "$path"/"$so" "${2}\t"
found=true
Expand Down
17 changes: 12 additions & 5 deletions overlay/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ if [ "$#" -lt 2 ];then
exit 1
fi

framework_res="$1/framework/framework-res.apk"

framework_res="$1"
if [ ! -f "$1" ];then
framework_res="$1/framework/framework-res.apk"
fi
if [ ! -f "$framework_res" ];then
framework_res="$1/system/framework/framework-res.apk"
fi
Expand All @@ -27,7 +31,10 @@ if [ ! -f "$framework_res" ];then
exit 1
fi

props="$2/build.prop"
props="$2"
if [ ! -f "$props" ];then
props="$2/build.prop"
fi
if [ ! -f "$props" ];then
echo "Wrong vendor folder $2"
exit 1
Expand All @@ -47,9 +54,9 @@ clean_string() {
tr 'A-Z' 'a-z' | tr ' .-' '_'
}

prefix="$(sed -nE 's/ro.vendor.build.fingerprint=(.*)/\1/p' "$props" |cut -d : -f 1)"
brand="$(sed -nE 's/ro.product.vendor.brand=(.*)/\1/p' "$props" |clean_string)"
model="$(sed -nE 's/ro.product.vendor.model=(.*)/\1/p' "$props" |clean_string)"
[ -z "$prefix" ] && prefix="$(sed -nE 's/ro.vendor.build.fingerprint=(.*)/\1/p' "$props" |cut -d : -f 1)"
[ -z "$brand" ] && brand="$(sed -nE 's/ro.product.vendor.brand=(.*)/\1/p' "$props" |clean_string)"
[ -z "$model" ] && model="$(sed -nE 's/ro.product.vendor.model=(.*)/\1/p' "$props" |clean_string)"

cat > rro/AndroidManifest.xml << EOF
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
Expand Down
16 changes: 12 additions & 4 deletions vendor-HAL/reverse-hal.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
#!/bin/bash

if [ ! -d "$1" -o ! -f "$1/manifest.xml" ];then
manifest="$1/manifest.xml"
if [ ! -f "$manifest" ];then
manifest="$1/etc/vintf/manifest.xml"
fi
if [ ! -d "$1" -o ! -f "$manifest" ];then
echo "Usage: $0 <vendor-folder>"
exit 1
fi

rm -f broken
for HAL in $(xmlstarlet sel -t -m '//hal/name' -v . -n "$1/manifest.xml" |grep -vE '^android\.hardware\.');do
for HAL in $(xmlstarlet sel -t -m '//hal/name' -v . -n "$manifest" |grep -vE '^android\.hardware\.');do
interface="$(
xmlstarlet sel \
-t -m '//hal[./name/text()="'"$HAL"'"]' \
-v './interface/name' "$1/manifest.xml")"
-v './interface/name' "$manifest")"
for version in $(xmlstarlet sel \
-t -m '//hal[./name/text()="'"$HAL"'"]' \
-v './version' -n "$1/manifest.xml");do
-v './version' -n "$manifest");do

HAL=vendor.samsung.hardware.camera.device
version=3.3
class="$(echo "$interface" |sed -E 's/^I/BpHw/g')"
class=BpHwSecCameraDeviceSession
namespace="$(echo $HAL |sed -E 's/\./::/g')"
namespace2="$(echo ${namespace}::V"$(echo $version |sed -e 's/\./_/g')")"
prefix="$namespace2::$class"
Expand All @@ -34,6 +41,7 @@ for HAL in $(xmlstarlet sel -t -m '//hal/name' -v . -n "$1/manifest.xml" |grep -
echo "Failed to find ${HAL}@${version}.so" >> broken
continue
fi
echo $prefix
nm -DC $lib |grep -F "T $prefix" | \
sed -E "s/^.*$prefix:://g" | \
grep -vE -e '\bping\b' -e '\binterfaceChain\b' -e '\binterfaceDescriptor\b' \
Expand Down

0 comments on commit 3e19185

Please sign in to comment.