Results 1 to 13 of 13

Thread: Something seems wonky with NetHunter Kernel builder

  1. #1
    Join Date
    2019-Nov
    Posts
    149

    Something seems wonky with NetHunter Kernel builder

    So, as I've said in other messages, I'm attempting to compile for LineageOS 16 for a OnePlus 1.

    I have done as instructed for the build process, however, when I build a NetHunter kernel zip file (option 5 in the build.sh menu), there is no zImage-dtb, and very little in the modules folder. When I check out/arch/arm/boot, I see 1 file: msm8974pro-ac-pm8941-a0001.dtb

    If I rename (with mv) that file to zImage-dtb, then that file is included in the zip file. However, when I extract that to the NH kernel device folder for my build (after backing-up and deleting what was there), I notice there are only a few files in the modules folder, and no actual modules!

    I tried creating a kernel-only installer, and installing it anyway. Sure enough, it does not work. Hangs on the OnePlus logo.

    Incidentally, creating an anykernel installer directly from build.sh creates an unusable file - when I go to flash it in TWRP, I am told that the package is for a OnePlus 7 pro!!??

  2. #2
    Join Date
    2019-Nov
    Posts
    149
    Code:
    ls -R modules_out/
    modules_out/:                                                                                                                                                                                      
    lib                                                                                                                                                                                                
                                                                                                                                                                                                       
    modules_out/lib:                                                                                                                                                                                   
    modules                                                                                                                                                                                            
                                                                                                                                                                                                       
    modules_out/lib/modules:
    3.4.113-NetHunter-ga160ed58b3b-dirty
    
    modules_out/lib/modules/3.4.113-NetHunter-ga160ed58b3b-dirty:
    kernel  modules.builtin  modules.order
    
    modules_out/lib/modules/3.4.113-NetHunter-ga160ed58b3b-dirty/kernel:

  3. #3
    Join Date
    2019-Nov
    Posts
    149
    I can't imagine that the problem is due to my build OS being Kali, instead of something more traditional, like Ubuntu or Mint, could it?

  4. #4
    Join Date
    2015-Nov
    Location
    Australia
    Posts
    445
    Kali is perfect. I'm using it for all our builds.
    Looks like the compilation didn't complete.
    Why don't you add the link to your kernel repo to the local.config and post it here? I can give it a go and see where it bombs out.

  5. #5
    Join Date
    2019-Nov
    Posts
    149
    D'oh, I just wiped my build environment to start over. Again...

    Should be straightforward to build, however:
    https://github.com/lineageos/android...l_oppo_msm8974
    the local.config I used is an unaltered copy of the hammerhad example. The kernel config template I used is 69 - LineageOS Bacon.

    build.sh - S - 4-1-1-5-6 - 1 (Made changes from documentation the best I could - many differences between 3.04 and 4.9) - 2 - 5 .

    I believe those are the steps I took, but I am going from memory. Let me know if something doesn't make sense.

  6. #6
    Join Date
    2019-Nov
    Posts
    149
    Oddly enough, despite specifying only 32-bit tool-chains, the S option still wants to download 2 64-bit clang packages.

  7. #7
    Join Date
    2019-Nov
    Posts
    149
    Yeah, I went through everything again. So many of the things in the Docs don't really apply to kernel 3.04, including USB Gadget options, SDR, and some of the USB Ethernet & USB WiFi items.

    How big of a headache would it be to try a newer kernel source?

  8. #8
    Join Date
    2019-Nov
    Posts
    149
    Forgot to mention: You help is greatly appreciated Re4son.

  9. #9
    Join Date
    2019-Nov
    Posts
    149
    @Re4son: Any Luck??

  10. #10
    Join Date
    2015-Nov
    Location
    Australia
    Posts
    445
    Yep, all good. The kernel doesn't play nice with the linaro toolchain. Another one is currently on its way into the official repo but I made it available to you on the build server.
    Just hop into your "kali-nethunter-kernel" directory and do the following
    Code:
    git stash
    git pull
    cp local.config.examples/local.config.example.bacon local.config
    # edit local.config and  replace the "CROSS_COMPILE_ARM32_SRC=" link temporarily with "https://build.nethunter.com/contributors/re4son/toolchains/google_armhf-standalone-4.8.tar.xz"
    ./build.sh
    And then run setup again. That should do the trick.
    Before doing all this I'd fork the kernel source and create a nethunter branch in your github repository.

    My standard workflow is:

    Code:
    - open "https://github.com/lineageos/android_kernel_oppo_msm8974" in web browser
    - Click "Fork"
    - Open terminal, cd to build directory, e.g. ~/android
    - git clone <remote repo> (e.g. https://github.com/Re4son/android_kernel_oppo_msm8974)
    - cd android_kernel_oppo_msm8974
    - git checkout -b nethunter-9.0
    - git clone https://gitlab.com/kalilinux/nethunter/build-scripts/kali-nethunter-kernel
    - cd kali-nethunter-kernel
    - cp local.config.examples/local.config.example.bacon ./local.config
    - vi local.config #If you'de like to customize paths
    - ./build.sh
    - "S"
    - "1"
    - Choose "69) lineageos_bacon_defconfig" as default config
    - Edit kernel config - Only remove "local version", untick "... append version ...", & change hostname to kali
    - "2"; build and rebuild with option #3 adding more and more nethunter config items.
    - Add one patch after another, build every time with "3" and git commit after every successful build.
    - If all configurations and patches applied successfully, do a clean via "0" and a full NetHunter build via "N"
    - Git commit of the nethunter_config and kali-nethunter-kernel/local.config, & push everything to the remote repository

    Before you commit your "local.config", better change the download link back to the permanent one.

  11. #11
    Join Date
    2016-Nov
    Posts
    32
    Quote Originally Posted by aaronouthier View Post
    D'oh, I just wiped my build environment to start over. Again...

    Should be straightforward to build, however:
    https://github.com/lineageos/android...l_oppo_msm8974
    the local.config I used is an unaltered copy of the hammerhad example. The kernel config template I used is 69 - LineageOS Bacon.

    build.sh - S - 4-1-1-5-6 - 1 (Made changes from documentation the best I could - many differences between 3.04 and 4.9) - 2 - 5 .

    I believe those are the steps I took, but I am going from memory. Let me know if something doesn't make sense.

    Hey there, LOS16 for OPO is actually done a while ago. Check the install steps https://gitlab.com/kalilinux/nethunt...note_254273238

    It might not mentioned but build kalifs with kernel using (after getting devices with bootstrap.py):
    Code:
    build.py -p -d oneplus1 -fs full
    It will be also provided as an "Official latest" build effective in 2020.2 release
    Last edited by yesimxev; 2020-04-17 at 15:55.

  12. #12
    Join Date
    2019-Nov
    Posts
    149
    Yes, I was aware that the current NetHunter build was available this way. I am using it now. I wasn't aware it was still being worked on. I am chomping at the bit to try the new USB arsenal feature, but figured it would only be available for the stock OS. Since it will be available with the 2020.2 release, I can wait until then. I don't want to wait, of course, but it'll probably happen sooner than if I try to do it myself. I'll perhaps have more hair that way also...

    Thanks fellas!!

  13. #13
    Join Date
    2016-Nov
    Posts
    32
    USB Arsenal is only for 4.x kernels as it's running without kernel patches, it needs userspace config patches.
    Backporting to 3.x kernels is possible but not necessary. The patches they already have for HID attacks and Drivedroid, are to do the same job that USB arsenal does.

    We are also happy to accept any MR if you are interested in porting https://cateee.net/lkddb/web-lkddb/U...GFS_F_HID.html

Similar Threads

  1. How to get Nethunter Kernel Builder?
    By pravin99 in forum NetHunter Development
    Replies: 8
    Last Post: 2020-07-31, 23:32

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •