Skip to content

Nexus 5 D821(E) 32GB w. stock 6.0.1 or Lineage 14.1 (Nuogat)

Device:

Nexus 5 - D821(E) 32GB

OS version (KitKat/Lollipop/Marshmallow/Nougat):

Nougat, tried both stock; 6.0.1 (M4B30Z, Dec 2016); https://developers.google.com/android/images#hammerhead and Lineage 14.1 (20190126); https://dl.lineageosroms.com/hammerhead/lineage-14.1-20190126-nightly-hammerhead-signed.zip

Built from repo (date and build command) or downloaded from website (links):

Downloaded from: https://kali.download/nethunter-images/kali-2024.2/nethunter-2024.2-hammerhead-nougat-kalifs-full.zip

Flashed TWRP H.H and reformated partitions; https://xdaforums.com/t/recovery-unofficial-twrp-hh-for-nexus-5-hammerhead-discontinued.4047653/

Installed either stock or Lineage 14.1 and Magisk 27.0

Formatted data and cache prior to trying installing Kali Nethunter

Issue:

Failed to map file '/sdcard/Download/nethunter-2024.2-hammerhead-nougat-kalifs-full.zip' Error installing zip file '/sdcard/Download/nethunter-2024.2-hammerhead-nougat-kalifs-full.zip'

Expected behavior:

Being able to install Kali Nethunter

///

Update:

Pre-req:
Bootloader already unlocked!
adb-tools installed and in your "path"
Google USB-drivers; https://developer.android.com/studio/run/win-usb

1) Flashed to stock
Downloaded stock 6.0.1 (M4B30Z, Dec 2016)
https://developers.google.com/android/images#hammerhead
https://dl.google.com/dl/android/aosp/hammerhead-m4b30z-factory-625c027b.zip

2) While in "bootloader"-mode ran (on your computer):
.\flash-all.bat
after extracting the stock zip

3) After above has been completed:
Reboot to system - "Start"
<waiting until the system has been installed - Android with open stomach and blue ball spinning - and then multicolored spinning balls>
<this takes quite a while>

4) Go through the initial prompts to get into the actual Android operatingsystem
4.1) Activate "Developer mode" by going to Settings > About phone > Press "Build number" 7 times 
4.2) Settings > Developer options > Activate USB-debugging > Always trust this computer > OK

5) On your computer:
adb reboot bootloader

6) Download custom TWRP 3.7.0_9-0;
https://xdaforums.com/t/recovery-unofficial-twrp-hh-for-nexus-5-hammerhead-discontinued.4047653/
#https://dl.twrp.me/hammerhead/
#https://dl.twrp.me/hammerhead/twrp-3.7.0_9-0-hammerhead.img.html
Even with "minimal" I get error messages without repartitioning.

7) While in the directory where you have downloaded the file above;
fastboot boot .\twrp-3.7.0_9-HH.R.17.img

8) Download Magisk by downloading the APK and renaming the extension to zip;
https://github.com/topjohnwu/Magisk/releases
8.1) Push it to your device:
adb push .\Magisk-v27.0.zip /sdcard/Download/

9) Use WSL on Windows or a Linux VM and follow these instructions:
https://www.kali.org/docs/nethunter/building-nethunter/
I used the command;
python3 ./build.py -d hammerhead -n -fs minimal
to build a "minimal" build for Nexus 5 (hammerhead) since I received error(s) with trying to install the "full";
"Unpacking the installer...
Error: Unable to extract! The zip may be corrupt or your device may not have enough RAM to proceed.
Consider using a smaller installer if it is available.
Aborting...
Cleaning Up...
Failed to install Kali Nethunter!
Updater process ended with ERROR: 1
Error installing zip file '/sdcard/Download/nethunter-2024.2-hammerhead-nougat-kalifs-full.zip'

9.1) Push the .zip to your device, your filename for the zip will be different;
adb push .\nethunter-20240703_203613-hammerhead-nougat-kalifs-minimal.zip /sdcard/Download/
9.2) In TWRP > Advanced > Terminal > "hh_repart -m"
9.3) For some reason I needed to enter fastboot again and re-flash the custom TWRP;
fastboot boot .\twrp-3.7.0_9-HH.R.17.img

10) In TWRP > Install > Magisk

# The official instructions say to format the data-partition in step 6 but then the installer complains about the data-partition being empty;
https://www.kali.org/docs/nethunter/installing-nethunter/#6-flashing-universal-dm-verity-forceencrypt-disabler

11) In TWRP > Install > Nethunter

12) Rebooting to system even though it says "No OS detected" or similar, log for the installation of Nethunter seems to have gone OK, no errors

13) Stuck at "Google"-screen while booting
Update:
Attaching recovery.log; https://pastebin.com/hrkkzhC8
Got it working through the following.
Update:

Pre-req:
Bootloader already unlocked!
adb-tools installed and in your "path"
Google USB-drivers; https://developer.android.com/studio/run/win-usb

1) Flashed to stock (reverted partition map back to stock since I used the custom TWRP and "hh_partition -m")
Downloaded stock 6.0.1 (M4B30Z, Dec 2016) #Android 6 is "Marshmallow" while Android 7 / Lineage 14.1 is "Nougat"
https://developers.google.com/android/images#hammerhead
https://dl.google.com/dl/android/aosp/hammerhead-m4b30z-factory-625c027b.zip

2) While in "bootloader"-mode ran (on your computer):
fastboot flash bootloader bootloader-hammerhead-hhz20h.img
fastboot reboot-bootloader
fastboot flash radio radio-hammerhead-m8974a-2.0.50.2.30.img
fastboot reboot-bootloader
fastboot flash system system.img
fastboot reboot-bootloader
fastboot flash userdata userdata.img
fastboot flash recovery recovery.img
fastboot flash boot boot.img
fastboot erase cache
fastboot flash cache cache.img
after extracting the stock zip + the included zip inside the stock zip

3) After above has been completed:
Reboot to system - "Start"
<waiting until the system has been installed - Android with open stomach and blue ball spinning - and then multicolored spinning balls>
<this takes quite a while>

4) Go through the initial prompts to get into the actual Android operatingsystem
4.1) Activate "Developer mode" by going to Settings > About phone > Press "Build number" 7 times 
4.2) Settings > Developer options > Activate USB-debugging > Always trust this computer > OK

5) On your computer:
adb reboot bootloader

6) Followed the instructions here:
https://wiki.lineageos.org/devices/hammerhead/install/
6.1) adb reboot bootloader
6.2) fastboot flash recovery twrp-3.7.0_9-0-hammerhead.img
6.3) TWRP > Wipe > Format Data > "yes"
6.4) TWRP > Wipe > Advanced Wipe > Cache + System 
6.5) TWRP > Advanced > ADB Sideload
6.5) On computer: adb -d sideload .\lineage-14.1-20190126-nightly-hammerhead-signed.zip
6.6) TWRP > Advanced > ADB Sideload 
6.7) On computer: adb -d sideload .\Magisk-v27.0.zip
6.8) On computer: adb -d reboot

7) Go through the initial prompts to get into the actual Android operatingsystem
7.1) Activate "Developer mode" by going to Settings > About phone > Press "Build number" 7 times 
7.2) Settings > Developer options > Activate USB-debugging > Always trust this computer > OK

8) adb reboot bootloader
9) fastboot flash recovery .\twrp-3.7.0_9-0-hammerhead.img
10) Boot to recovery mode directly after flashing TWRP
11) adb push .\nethunter-20240703_203613-hammerhead-nougat-kalifs-minimal.zip /sdcard/Download/
12) adb push .\Magisk-v27.0.zip /sdcard/Download/
13) TWRP > Install > nethunter-20240703_203613-hammerhead-nougat-kalifs-minimal.zip
14) TWRP > Install > Magisk-v27.0.zip
15) TWRP > Reboot system
Edited by InfiniteBSOD