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

Update for BusyBox 1.36.1 #9

Merged
merged 1 commit into from Sep 2, 2023
Merged

Update for BusyBox 1.36.1 #9

merged 1 commit into from Sep 2, 2023

Conversation

osm0sis
Copy link
Collaborator

@osm0sis osm0sis commented May 23, 2023

  • remove upstreamed/resolved patches
  • rebase patches over released stable 1.36.1
  • fix KBuild parsing of .S files for Android.mk
  • add new patch to fix direct loopback mount and losetup next loop
  • switch to recommending the Magisk SELinux fork to ensure Android compatibility

@osm0sis

This comment was marked as outdated.

@osm0sis osm0sis force-pushed the update/1_36_1 branch 4 times, most recently from c84064a to cfcd237 Compare May 25, 2023 13:17
@osm0sis

This comment was marked as outdated.

@osm0sis osm0sis marked this pull request as ready for review May 25, 2023 13:20
@osm0sis osm0sis requested a review from topjohnwu May 25, 2023 13:20
@osm0sis
Copy link
Collaborator Author

osm0sis commented May 25, 2023

One final force-push to fix loop mounts on kernels < 5.x; the new TRY_LOOP_CONFIGURE is supposed to fallback gracefully, but something doesn't work correctly, even with my new patch, so update config options to revert to old behavior.

@liwenjie119
Copy link

when build with the newest Sources in README.md, it report some error :

[armeabi-v7a] StaticLibrary  : libpcre2.a
[armeabi-v7a] Executable     : busybox
ld: error: undefined symbol: hashtab_create
>>> referenced by label_file.c:114 (jni/selinux/libselinux/src/label_file.c:114)
>>>               lto.tmp:(mkswap_main)

ld: error: undefined symbol: hashtab_insert
>>> referenced by label_file.c:130 (jni/selinux/libselinux/src/label_file.c:130)
>>>               lto.tmp:(mkswap_main)

ld: error: undefined symbol: hashtab_search
>>> referenced by label_file.c:135 (jni/selinux/libselinux/src/label_file.c:135)
>>>               lto.tmp:(mkswap_main)

ld: error: undefined symbol: hashtab_destroy_key
>>> referenced by label_file.c:164 (jni/selinux/libselinux/src/label_file.c:164)
>>>               lto.tmp:(mkswap_main)
>>> referenced by label_file.c:124 (jni/selinux/libselinux/src/label_file.c:124)
>>>               lto.tmp:(mkswap_main)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/home/user/android-ndk-r25c/build/core/build-binary.mk:670: obj/local/armeabi-v7a/busybox] Error 1

@osm0sis
Copy link
Collaborator Author

osm0sis commented Jul 23, 2023

Built back when I did it; will need to try it again.

I've just gotten a report today that there may be an issue with the SELinux applets not working even though they built correctly, so maybe some build fixes for the upstream libselinux stuff to look into in general... 🤔

Edit: For starters, likely ndk-box-kitchen will now need to switch to using the Magisk SELinux fork, and that may resolve things: https://github.com/topjohnwu/selinux

@osm0sis
Copy link
Collaborator Author

osm0sis commented Sep 2, 2023

Yep, https://github.com/topjohnwu/selinux got things building again. Makes more sense to keep it in sync with that than constantly hoping upstream works. I'll update the README. 👍

- remove upstreamed/resolved patches
- rebase patches over released stable 1.36.1
- fix KBuild parsing of .S files for Android.mk
- add new patch to fix direct loopback mount and losetup next loop
- switch to recommending the Magisk SELinux fork to ensure Android compatibility
@topjohnwu topjohnwu merged commit ce046d0 into master Sep 2, 2023
@osm0sis
Copy link
Collaborator Author

osm0sis commented Sep 2, 2023

Oh, @topjohnwu, I didn't expect the merge just yet... there's still some issue with the SELinux applets not working correctly which I'm trying to track down.

E.g. ls -alZ doesn't show the contexts like it should, the column is just empty.

@osm0sis
Copy link
Collaborator Author

osm0sis commented Sep 2, 2023

I've tried rolling my NDK back to r23c and SELinux back to 3.3 which were out when we built 1.34.1, and I've tried building 1.34.1 using the latest SELinux and pcre, but none of that gets ls -alZ working, so I think it might be pcre at fault.

Edit: Hmm, rolling back to the Magisk submodule commit pcre @ 8e12681 didn't get it working either. I'm at a loss here. 😕

Edit 2: Could it be my switch to a WSL2 env? Hopefully that's the case, and Magisk's busybox will build fine... 🤞

@osm0sis osm0sis deleted the update/1_36_1 branch September 2, 2023 12:38
@topjohnwu
Copy link
Owner

@osm0sis I've built the source code along with the Magisk tree and everything is working just fine

@osm0sis
Copy link
Collaborator Author

osm0sis commented Sep 2, 2023

Hmm, weird. The only thing I can think of is that it must be my WSL2 or something. No idea how to debug that, but I'll figure something out. Glad it's working with Magisk at least!

@osm0sis
Copy link
Collaborator Author

osm0sis commented Sep 11, 2023

@osm0sis I've built the source code along with the Magisk tree and everything is working just fine

@topjohnwu, turns out that was the clue I needed! lto_fix.lds is missing over here so SELinux was broken in anything directly built from ndk-box-kitchen. PR incoming. 🙂

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