Skip to content

Fixes for building with sony_aosp_11#335

Open
moralrecordings wants to merge 1 commit into
mer-hybris:masterfrom
moralrecordings:sony_aosp_11_fixes
Open

Fixes for building with sony_aosp_11#335
moralrecordings wants to merge 1 commit into
mer-hybris:masterfrom
moralrecordings:sony_aosp_11_fixes

Conversation

@moralrecordings

@moralrecordings moralrecordings commented Jun 10, 2023

Copy link
Copy Markdown
  • 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.

Comment thread droid-hal-device.inc
# 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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Use [ instead.

Comment thread droid-hal-device.inc
# 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
Copy Markdown
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.

Comment thread droid-hal-device.inc

# 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
Copy Markdown
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

@Thaodan Thaodan left a comment

Copy link
Copy Markdown
Contributor

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

Thaodan commented Jun 11, 2023

Copy link
Copy Markdown
Contributor

@moralrecordings Please try #336 instead.

@moralrecordings

moralrecordings commented Jun 12, 2023

Copy link
Copy Markdown
Author

#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

Thaodan commented Jun 12, 2023

Copy link
Copy Markdown
Contributor

#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