Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for building with sony_aosp_11 #335

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

moralrecordings
Copy link

@moralrecordings moralrecordings commented Jun 10, 2023

  • By default, Sony's msm-4.14 kernel will output temporary files to out/clang.sh/kernel-tmp-(device). These are required by rpm/dhd/helpers/build_packages.sh --droid-hal. As the existing wildcard couldn't be modified easily to include such a different location, I replaced it with some conditionals and an exit statement on failure. The code now stores it in a shell variable KERNEL_PATH; I wasn't able to find a way to persist this between %build and %install, so I had to duplicate it. I'm not an RPM expert, so I'd welcome any advice.

# Find the kernel build directory.
# AOSP seems to use .../obj/kernel/.config not obj/KERNEL_OBJ/.config like CM.
# Sony AOSP 11 uses a separate storage area.
if [[ -f %{android_root}/out/target/product/%{device}/obj/KERNEL_OBJ/.config ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use [ instead.

# AOSP seems to use .../obj/kernel/.config not obj/KERNEL_OBJ/.config like CM.
# Sony AOSP 11 uses a separate storage area.
if [[ -f %{android_root}/out/target/product/%{device}/obj/KERNEL_OBJ/.config ]]; then
KERNEL_PATH=%{android_root}/out/target/product/%{device}/obj/KERNEL_OBJ/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't caps the variable unless it is a environment variable.

@@ -535,6 +546,20 @@ android_version_major=$(awk '/PLATFORM_VERSION([A-Z0-9.]*|_LAST_STABLE) := ([0-9
< %{android_root}/build/core/version_defaults.mk \
| awk -F'.' '{print $1}')

# Find the kernel build directory.
# AOSP seems to use .../obj/kernel/.config not obj/KERNEL_OBJ/.config like CM.
# Sony AOSP 11 uses a separate storage area.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There isn't really a standard for these as you are not supposed to be build the kernel inside the Android build system.

Also the comment about CM is out of date as there's no CM anymore

Copy link
Contributor

@Thaodan Thaodan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if it is good to look for the path of the kernel config this way.
Something else would work better.

@Thaodan
Copy link
Contributor

Thaodan commented Jun 11, 2023

@moralrecordings Please try #336 instead.

@moralrecordings
Copy link
Author

moralrecordings commented Jun 12, 2023

#336 is definitely the better approach, but is missing the check for %{android_root}/out/clang.sh/kernel-tmp-%{device}/ as a potential path.

The cheap option would be to move the search up to %{android_root}/out, which gives a 24 second wait on a magnetic hard disk. As you pointed out, we're rummaging around in the build artifacts so there isn't a standard location for anything.

@Thaodan
Copy link
Contributor

Thaodan commented Jun 12, 2023

#336 is definitely the better approach, but is missing the check for %{android_root}/out/clang.sh/kernel-tmp-%{device}/ as a potential path.

That's the default path you should use -O

to the regular path or create a PR to change the default.

You can do so like this:
https://github.com/SailfishOS-SonyXperia/hadk_tools/blob/master/templates/sfos.hybris.hal.sony.kernel.hadk#LL13C1-L13C1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants