Last active
May 10, 2022 18:57
-
-
Save minhng99/2c21663297fb9857ac4ec706993d999e to your computer and use it in GitHub Desktop.
Make vendor tree from dumped /system (without adb) with proprietary-files.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SYSTEMDIR=/system | |
VENDOR=samsung | |
DEVICE=js01lte | |
OUTDIR=vendor/$VENDOR/$DEVICE | |
mkdir -p $OUTDIR/proprietary | |
(cat << EOF) > $OUTDIR/$DEVICE-vendor-blobs.mk | |
# Copyright (C) 2011 The CyanogenMod Project | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
# Prebuilt libraries that are needed to build open-source libraries | |
#PRODUCT_COPY_FILES := \\ | |
# \$(LOCAL_PATH)/proprietary/lib/libcamera.so:obj/lib/libcamera.so \\ | |
# \$(LOCAL_PATH)/proprietary/lib/libaudio.so:obj/lib/libaudio.so \\ | |
# \$(LOCAL_PATH)/proprietary/lib/libaudiopolicy.so:obj/lib/libaudiopolicy.so \\ | |
# \$(LOCAL_PATH)/proprietary/lib/libseccameraadaptor.so:obj/lib/libseccameraadaptor.so | |
PRODUCT_COPY_FILES += \\ | |
EOF | |
LINEEND=" \\" | |
COUNT=`wc -l proprietary-files.txt | awk {'print $1'}` | |
for FILE in `cat proprietary-files.txt`; do | |
COUNT=`expr $COUNT - 1` | |
if [ $COUNT = "0" ]; then | |
LINEEND="" | |
fi | |
if [ -f $SYSTEMDIR/$FILE ]; then | |
if [ ! -d $(dirname $OUTDIR/proprietary/$FILE) ]; then | |
mkdir -p $(dirname $OUTDIR/proprietary/$FILE) | |
fi | |
cp $SYSTEMDIR/$FILE $OUTDIR/proprietary/$FILE | |
echo " \$(LOCAL_PATH)/proprietary/$FILE:system/$FILE$LINEEND" >> $OUTDIR/$DEVICE-vendor-blobs.mk | |
else | |
echo "File not exist: system/$FILE" | |
fi | |
done | |
(cat << EOF) > $OUTDIR/$DEVICE-vendor.mk | |
# Copyright (C) 2011 The CyanogenMod Project | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
# Pick up overlay for features that depend on non-open-source files | |
DEVICE_PACKAGE_OVERLAYS := \$(LOCAL_PATH)/overlay | |
\$(call inherit-product, \$(LOCAL_PATH)/$DEVICE-vendor-blobs.mk) | |
EOF | |
(cat << EOF) > $OUTDIR/BoardConfigVendor.mk | |
# Copyright (C) 2011 The CyanogenMod Project | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
USE_CAMERA_STUB := false | |
EOF | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why it says file not exist ???