Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
device_xiaomi_sm8350-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LMODroid-Devices
device_xiaomi_sm8350-common
Commits
33ad9947
Commit
33ad9947
authored
6 months ago
by
Michael Bestas
Committed by
Arian
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
sm8350-common: Sync extract scripts with templates
Change-Id: I98a36854c5a0c0390592911bb2558b34eff77efc
parent
3969a26b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
extract-files.sh
+48
-31
48 additions, 31 deletions
extract-files.sh
setup-makefiles.sh
+8
-8
8 additions, 8 deletions
setup-makefiles.sh
with
56 additions
and
39 deletions
extract-files.sh
+
48
−
31
View file @
33ad9947
#!/bin/bash
#
# Copyright (C) 2016 The CyanogenMod Project
# Copyright (C) 2017-2023 The LineageOS Project
#
# SPDX-FileCopyrightText: 2016 The CyanogenMod Project
# SPDX-FileCopyrightText: 2017-2024 The LineageOS Project
# SPDX-License-Identifier: Apache-2.0
#
...
...
@@ -14,6 +13,10 @@ if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi
ANDROID_ROOT
=
"
${
MY_DIR
}
/../../.."
# If XML files don't have comments before the XML header, use this flag
# Can still be used with broken XML files by using blob_fixup
export
TARGET_DISABLE_XML_FIXING
=
true
HELPER
=
"
${
ANDROID_ROOT
}
/tools/extract-utils/extract_utils.sh"
if
[
!
-f
"
${
HELPER
}
"
]
;
then
echo
"Unable to find helper script at
${
HELPER
}
"
...
...
@@ -32,28 +35,29 @@ SECTION=
while
[
"
${#}
"
-gt
0
]
;
do
case
"
${
1
}
"
in
--only-common
)
ONLY_COMMON
=
true
;;
--only-firmware
)
ONLY_FIRMWARE
=
true
;;
--only-target
)
ONLY_TARGET
=
true
;;
-n
|
--no-cleanup
)
CLEAN_VENDOR
=
false
;;
-k
|
--kang
)
KANG
=
"--kang"
;;
-s
|
--section
)
SECTION
=
"
${
2
}
"
;
shift
CLEAN_VENDOR
=
false
;;
*
)
SRC
=
"
${
1
}
"
;;
--only-common
)
ONLY_COMMON
=
true
;;
--only-firmware
)
ONLY_FIRMWARE
=
true
;;
--only-target
)
ONLY_TARGET
=
true
;;
-n
|
--no-cleanup
)
CLEAN_VENDOR
=
false
;;
-k
|
--kang
)
KANG
=
"--kang"
;;
-s
|
--section
)
SECTION
=
"
${
2
}
"
shift
CLEAN_VENDOR
=
false
;;
*
)
SRC
=
"
${
1
}
"
;;
esac
shift
done
...
...
@@ -65,41 +69,54 @@ fi
function
blob_fixup
()
{
case
"
${
1
}
"
in
system_ext/lib64/libwfdnative.so
)
[
"
$2
"
=
""
]
&&
return
0
"
${
PATCHELF
}
"
--remove-needed
"android.hidl.base@1.0.so"
"
${
2
}
"
;;
vendor/etc/media_lahaina/video_system_specs.json
\
|
vendor/etc/media_shima_v1/video_system_specs.json
\
|
vendor/etc/media_yupik_v1/video_system_specs.json
)
[
"
$2
"
=
""
]
&&
return
0
sed
-i
"/max_retry_alloc_output_timeout/ s/10000/0/"
"
${
2
}
"
;;
vendor/etc/vintf/manifest/c2_manifest_vendor.xml
)
[
"
$2
"
=
""
]
&&
return
0
sed
-ni
'/ozoaudio/!p'
"
${
2
}
"
sed
-ni
'/dolby/!p'
"
${
2
}
"
;;
vendor/lib64/android.hardware.secure_element@1.0-impl.so
)
[
"
$2
"
=
""
]
&&
return
0
"
${
PATCHELF
}
"
--remove-needed
"android.hidl.base@1.0.so"
"
${
2
}
"
;;
*
)
return
1
;;
esac
return
0
}
function
blob_fixup_dry
()
{
blob_fixup
"
$1
"
""
}
if
[
-z
"
${
ONLY_FIRMWARE
}
"
]
&&
[
-z
"
${
ONLY_TARGET
}
"
]
;
then
# Initialize the helper for common device
setup_vendor
"
${
DEVICE_COMMON
}
"
"
${
VENDOR
}
"
"
${
ANDROID_ROOT
}
"
true
"
${
CLEAN_VENDOR
}
"
setup_vendor
"
${
DEVICE_COMMON
}
"
"
${
VENDOR
_COMMON
:-
$VENDOR
}
"
"
${
ANDROID_ROOT
}
"
true
"
${
CLEAN_VENDOR
}
"
extract
"
${
MY_DIR
}
/proprietary-files.txt"
"
${
SRC
}
"
"
${
KANG
}
"
--section
"
${
SECTION
}
"
fi
if
[
-z
"
${
ONLY_COMMON
}
"
]
&&
[
-s
"
${
MY_DIR
}
/../
${
DEVICE
}
/proprietary-files.txt"
]
;
then
if
[
-z
"
${
ONLY_COMMON
}
"
]
&&
[
-s
"
${
MY_DIR
}
/../
../
${
VENDOR
}
/
${
DEVICE
}
/proprietary-files.txt"
]
;
then
# Reinitialize the helper for device
source
"
${
MY_DIR
}
/../
${
DEVICE
}
/extract-files.sh"
source
"
${
MY_DIR
}
/../
../
${
VENDOR
}
/
${
DEVICE
}
/extract-files.sh"
setup_vendor
"
${
DEVICE
}
"
"
${
VENDOR
}
"
"
${
ANDROID_ROOT
}
"
false
"
${
CLEAN_VENDOR
}
"
if
[
-z
"
${
ONLY_FIRMWARE
}
"
]
;
then
extract
"
${
MY_DIR
}
/../
${
DEVICE
}
/proprietary-files.txt"
"
${
SRC
}
"
"
${
KANG
}
"
--section
"
${
SECTION
}
"
extract
"
${
MY_DIR
}
/../
../
${
VENDOR
}
/
${
DEVICE
}
/proprietary-files.txt"
"
${
SRC
}
"
"
${
KANG
}
"
--section
"
${
SECTION
}
"
fi
if
[
-f
"
${
MY_DIR
}
/../
${
DEVICE
}
/proprietary-firmware.txt"
]
;
then
extract_firmware
"
${
MY_DIR
}
/../
${
DEVICE
}
/proprietary-firmware.txt"
"
${
SRC
}
"
if
[
-z
"
${
SECTION
}
"
]
&&
[
-f
"
${
MY_DIR
}
/../
../
${
VENDOR
}
/
${
DEVICE
}
/proprietary-firmware.txt"
]
;
then
extract_firmware
"
${
MY_DIR
}
/../
../
${
VENDOR
}
/
${
DEVICE
}
/proprietary-firmware.txt"
"
${
SRC
}
"
fi
fi
...
...
This diff is collapsed.
Click to expand it.
setup-makefiles.sh
+
8
−
8
View file @
33ad9947
#!/bin/bash
#
# Copyright (C) 2016 The CyanogenMod Project
# Copyright (C) 2017-2023 The LineageOS Project
#
# SPDX-FileCopyrightText: 2016 The CyanogenMod Project
# SPDX-FileCopyrightText: 2017-2024 The LineageOS Project
# SPDX-License-Identifier: Apache-2.0
#
...
...
@@ -22,7 +21,7 @@ fi
source
"
${
HELPER
}
"
# Initialize the helper for common
setup_vendor
"
${
DEVICE_COMMON
}
"
"
${
VENDOR
}
"
"
${
ANDROID_ROOT
}
"
true
setup_vendor
"
${
DEVICE_COMMON
}
"
"
${
VENDOR
_COMMON
:-
$VENDOR
}
"
"
${
ANDROID_ROOT
}
"
true
# Warning headers and guards
write_headers
"haydn lisa mars odin redwood renoir star venus"
...
...
@@ -33,18 +32,19 @@ write_makefiles "${MY_DIR}/proprietary-files.txt" true
# Finish
write_footers
if
[
-s
"
${
MY_DIR
}
/../
${
DEVICE
}
/proprietary-files.txt"
]
;
then
if
[
-s
"
${
MY_DIR
}
/../
../
${
VENDOR
}
/
${
DEVICE
}
/proprietary-files.txt"
]
;
then
# Reinitialize the helper for device
source
"
${
MY_DIR
}
/../../
${
VENDOR
}
/
${
DEVICE
}
/setup-makefiles.sh"
setup_vendor
"
${
DEVICE
}
"
"
${
VENDOR
}
"
"
${
ANDROID_ROOT
}
"
false
# Warning headers and guards
write_headers
# The standard device blobs
write_makefiles
"
${
MY_DIR
}
/../
${
DEVICE
}
/proprietary-files.txt"
true
write_makefiles
"
${
MY_DIR
}
/../
../
${
VENDOR
}
/
${
DEVICE
}
/proprietary-files.txt"
true
if
[
-f
"
${
MY_DIR
}
/../
${
DEVICE
}
/proprietary-firmware.txt"
]
;
then
append_firmware_calls_to_makefiles
"
${
MY_DIR
}
/../
${
DEVICE
}
/proprietary-firmware.txt"
if
[
-f
"
${
MY_DIR
}
/../
../
${
VENDOR
}
/
${
DEVICE
}
/proprietary-firmware.txt"
]
;
then
append_firmware_calls_to_makefiles
"
${
MY_DIR
}
/../
../
${
VENDOR
}
/
${
DEVICE
}
/proprietary-firmware.txt"
fi
# Finish
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment