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

dhd: Fix Android 6 <= based builds #260

Merged
merged 1 commit into from
May 28, 2020

Conversation

AndreySV
Copy link
Contributor

this problem happens if Android version is <= 6 and there is file
hybris_extras.rc in system/etc/init. It is introduced by commit
1fb8758 ("dhd: add support for one extra init rc, which can be
used to provide info from the adaptation to sfos")

In this case build_packages.sh fails with following error:

$ rpm/dhd/helpers/build_packages.sh

  • '[' 4 -ge 7 ']'
  • echo ''
  • '[' -f ./out/target/product/hammerhead/system/etc/init/hybris_extras.rc ']'
  • cp -a ./out/target/product/hammerhead/system/etc/init/hybris_extras.rc /media/data/port/android/installroot/usr/libexec/droid-hybris/system/etc/init/
    cp: cannot create regular file `/media/data/port/android/installroot/usr/libexec/droid-hybris/system/etc/init/': No such file or directory
    error: Bad exit status from /var/tmp/rpm-tmp.SrHvD1 (%install)

@@ -538,6 +538,7 @@ echo "" > tmp/droid-hal.files
fi

if [ -f %{android_root}/out/target/product/%{device}/system/etc/init/hybris_extras.rc ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

If .../etc/init should never exist in Android 6 (or earlier) adaptations, why not move this part into the if block just above and re-use the mkdir? ^

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I worked through HADK and built hybris-hal for hammerhead (CyanogenMod 11.0 / Android 4.4). ./out/target/product/hammerhead/system/etc/init/hybris_extras.rc was created.

Copy link
Contributor

Choose a reason for hiding this comment

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

@krnlyng, @mlehtima, could you please tell us if there is any part in hybris Android 6 (and earlier) adaptations which would read and/or run the .rc files under /usr/libexec//droid-hybris/system/etc/init/?

Copy link
Contributor

@mlehtima mlehtima Dec 22, 2019

Choose a reason for hiding this comment

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

Nothing reads from that folder in Android 6 or older bases. Hybris version of Android 7 base i.e. hybris-14.1 is the first one to use that folder, correct place for fixing the issue is in hybris-boot repo which seems to create the file on all Android base versions. The file is being created after this commit in hybris-boot mer-hybris/hybris-boot@46095a4 .

Even if the actual fix would be added to hybris-boot the copying of hybris-extras.rc in this code should be limited to android 7 and above and could be moved inside the earlier if block just as @sledges mentioned.

Copy link
Contributor Author

@AndreySV AndreySV Jan 12, 2020

Choose a reason for hiding this comment

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

@sledges, @mlehtima I've updated this PR as you recommended and made PR to fix original source of the problem in hybris-boot (mer-hybris/hybris-boot#184)

this problem happens if Android version is <= 6 and there is file
hybris_extras.rc in system/etc/init. It is introduced by commit
1fb8758 ("dhd: add support for one extra init rc, which can be
used to provide info from the adaptation to sfos")

In this case build_packages.sh fails with following error:

$ rpm/dhd/helpers/build_packages.sh

+ '[' 4 -ge 7 ']'
+ echo ''
+ '[' -f ./out/target/product/hammerhead/system/etc/init/hybris_extras.rc ']'
+ cp -a ./out/target/product/hammerhead/system/etc/init/hybris_extras.rc /media/data/port/android/installroot/usr/libexec/droid-hybris/system/etc/init/
cp: cannot create regular file `/media/data/port/android/installroot/usr/libexec/droid-hybris/system/etc/init/': No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.SrHvD1 (%install)
@sledges sledges merged commit ae1c5ea into mer-hybris:master May 28, 2020
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.

3 participants