Skip to content
Permalink
Browse files

Merge branch 'master' of https://github.com/offensive-security/nethun…

  • Loading branch information...
XXH3X committed Mar 16, 2019
2 parents 83fc878 + 032e85f commit 3098663aa2444ec08b98daf16bf42ce3dfe92353
Showing with 2,030 additions and 8 deletions.
  1. +21 −5 README.md
  2. +1 −1 devices.cfg
  3. +127 −0 example_scripts/build.sh
  4. +95 −0 example_scripts/menuconfig.sh
  5. +1 −0 kernels.txt
  6. BIN oreo/angler/Image.gz-dtb
  7. BIN ...ngler/modules/{3.10.73-nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/crypto/cmac.ko
  8. BIN ...nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/drivers/media/usb/gspca/gspca_main.ko
  9. BIN ...-nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/drivers/net/wireless/at76c50x-usb.ko
  10. BIN oreo/angler/modules/3.10.73-angler-nethunter-3.0/kernel/drivers/net/wireless/ath/ath.ko
  11. BIN ...thunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/drivers/net/wireless/ath/ath9k/ath9k.ko
  12. BIN ...-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/drivers/net/wireless/ath/ath9k/ath9k_common.ko
  13. BIN ...ter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/drivers/net/wireless/ath/ath9k/ath9k_htc.ko
  14. BIN ...nter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/drivers/net/wireless/ath/ath9k/ath9k_hw.ko
  15. BIN ...r-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/drivers/net/wireless/ath/carl9170/carl9170.ko
  16. BIN ...hunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/drivers/net/wireless/rt2x00/rt2500usb.ko
  17. BIN ...hunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/drivers/net/wireless/rt2x00/rt2800lib.ko
  18. BIN ...hunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/drivers/net/wireless/rt2x00/rt2800usb.ko
  19. BIN ...hunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/drivers/net/wireless/rt2x00/rt2x00lib.ko
  20. BIN ...hunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/drivers/net/wireless/rt2x00/rt2x00usb.ko
  21. BIN ...ethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/drivers/net/wireless/rt2x00/rt73usb.ko
  22. BIN ...angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/drivers/net/wireless/rtl818x/rtl8187/rtl8187.ko
  23. BIN ...0 → 3.10.73-angler-nethunter-3.0}/kernel/drivers/net/wireless/rtlwifi/rtl8192c/rtl8192c-common.ko
  24. BIN ...er-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/drivers/net/wireless/rtlwifi/rtl8192cu/rtl8192cu.ko
  25. BIN ...thunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/drivers/net/wireless/rtlwifi/rtlwifi.ko
  26. BIN oreo/angler/modules/3.10.73-angler-nethunter-3.0/kernel/drivers/net/wireless/zd1201.ko
  27. BIN ...unter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/drivers/net/wireless/zd1211rw/zd1211rw.ko
  28. BIN ....10.73-nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/drivers/usb/serial/ftdi_sio.ko
  29. BIN ...3.10.73-nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/drivers/usb/serial/keyspan.ko
  30. BIN ....73-nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/drivers/usb/serial/keyspan_pda.ko
  31. BIN ...3.10.73-nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/drivers/usb/serial/mos7720.ko
  32. BIN ...3.10.73-nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/drivers/usb/serial/mos7840.ko
  33. BIN ...{3.10.73-nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/drivers/usb/serial/pl2303.ko
  34. BIN ...10.73-nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/drivers/usb/serial/usbserial.ko
  35. BIN ...gler/modules/{3.10.73-nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/fs/cifs/cifs.ko
  36. BIN oreo/angler/modules/3.10.73-angler-nethunter-3.0/kernel/fs/lockd/lockd.ko
  37. BIN oreo/angler/modules/3.10.73-angler-nethunter-3.0/kernel/fs/nfs/blocklayout/blocklayoutdriver.ko
  38. BIN ...angler/modules/{3.10.73-nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/fs/nfs/nfs.ko
  39. BIN ....73-nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/fs/nfs/nfs_layout_nfsv41_files.ko
  40. BIN ...gler/modules/{3.10.73-nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/fs/nfs/nfsv2.ko
  41. BIN ...gler/modules/{3.10.73-nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/fs/nfs/nfsv3.ko
  42. BIN ...gler/modules/{3.10.73-nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/fs/nfs/nfsv4.ko
  43. BIN oreo/angler/modules/3.10.73-angler-nethunter-3.0/kernel/fs/nfsd/nfsd.ko
  44. BIN oreo/angler/modules/3.10.73-angler-nethunter-3.0/kernel/fs/ntfs/ntfs.ko
  45. BIN ....10.73-nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/net/bluetooth/rfcomm/rfcomm.ko
  46. BIN oreo/angler/modules/3.10.73-angler-nethunter-3.0/kernel/net/dns_resolver/dns_resolver.ko
  47. BIN oreo/angler/modules/3.10.73-angler-nethunter-3.0/kernel/net/mac80211/mac80211.ko
  48. BIN ...73-nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/net/sunrpc/auth_gss/auth_rpcgss.ko
  49. BIN ...ethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/kernel/net/sunrpc/auth_gss/rpcsec_gss_krb5.ko
  50. BIN oreo/angler/modules/3.10.73-angler-nethunter-3.0/kernel/net/sunrpc/sunrpc.ko
  51. 0 oreo/angler/modules/{3.10.73-nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/modules.alias
  52. BIN oreo/angler/modules/{3.10.73-nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/modules.alias.bin
  53. +0 −1 oreo/angler/modules/{3.10.73-nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/modules.builtin
  54. BIN .../angler/modules/{3.10.73-nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/modules.builtin.bin
  55. 0 oreo/angler/modules/{3.10.73-nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/modules.dep
  56. BIN oreo/angler/modules/{3.10.73-nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/modules.dep.bin
  57. 0 oreo/angler/modules/{3.10.73-nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/modules.devname
  58. 0 oreo/angler/modules/{3.10.73-nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/modules.order
  59. 0 oreo/angler/modules/{3.10.73-nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/modules.softdep
  60. 0 oreo/angler/modules/{3.10.73-nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/modules.symbols
  61. BIN .../angler/modules/{3.10.73-nethunter-angler-3.0 → 3.10.73-angler-nethunter-3.0}/modules.symbols.bin
  62. BIN oreo/angler/modules/3.10.73-nethunter-angler-3.0/kernel/drivers/net/wireless/ath/ath.ko
  63. BIN oreo/angler/modules/3.10.73-nethunter-angler-3.0/kernel/drivers/net/wireless/zd1201.ko
  64. BIN oreo/angler/modules/3.10.73-nethunter-angler-3.0/kernel/fs/lockd/lockd.ko
  65. BIN oreo/angler/modules/3.10.73-nethunter-angler-3.0/kernel/fs/nfs/blocklayout/blocklayoutdriver.ko
  66. BIN oreo/angler/modules/3.10.73-nethunter-angler-3.0/kernel/fs/nfsd/nfsd.ko
  67. BIN oreo/angler/modules/3.10.73-nethunter-angler-3.0/kernel/fs/ntfs/ntfs.ko
  68. BIN oreo/angler/modules/3.10.73-nethunter-angler-3.0/kernel/net/dns_resolver/dns_resolver.ko
  69. BIN oreo/angler/modules/3.10.73-nethunter-angler-3.0/kernel/net/mac80211/mac80211.ko
  70. BIN oreo/angler/modules/3.10.73-nethunter-angler-3.0/kernel/net/sunrpc/sunrpc.ko
  71. +20 −0 oreo/angler/patch.d/010-no-force-encrypt
  72. +28 −0 oreo/angler/patch.d/015-no-dm-verity
  73. +23 −0 oreo/angler/patch.d/020-patch-ramdisk
  74. +62 −0 oreo/angler/patch.d/030-kernel-modules
  75. 0 oreo/angler/patch.d/{07-kernel-settings → 070-kernel-settings}
  76. BIN pie/oneplus2cm/Image.gz-dtb
  77. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/usb/asix.ko
  78. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/usb/ax88179_178a.ko
  79. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/usb/hso.ko
  80. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/usb/int51x1.ko
  81. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/usb/ipheth.ko
  82. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/usb/r8152.ko
  83. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/usb/rtl8150.ko
  84. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/usb/sierra_net.ko
  85. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/wireless/at76c50x-usb.ko
  86. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/wireless/ath/ath.ko
  87. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/wireless/ath/ath9k/ath9k_common.ko
  88. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/wireless/ath/ath9k/ath9k_htc.ko
  89. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/wireless/ath/ath9k/ath9k_hw.ko
  90. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/wireless/ath/wil6210/wil6210.ko
  91. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/wireless/atmel.ko
  92. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/wireless/atmel_pci.ko
  93. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/wireless/rt2x00/rt2500usb.ko
  94. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/wireless/rt2x00/rt2800lib.ko
  95. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/wireless/rt2x00/rt2800usb.ko
  96. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/wireless/rt2x00/rt2x00lib.ko
  97. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/wireless/rt2x00/rt2x00usb.ko
  98. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/wireless/rt2x00/rt73usb.ko
  99. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/wireless/rtl818x/rtl8187/rtl8187.ko
  100. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/wireless/rtlwifi/rtl8188ee/rtl8188ee.ko
  101. BIN ...eplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/wireless/rtlwifi/rtl8192c/rtl8192c-common.ko
  102. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/wireless/rtlwifi/rtl8192ce/rtl8192ce.ko
  103. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/wireless/rtlwifi/rtl8192de/rtl8192de.ko
  104. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/wireless/rtlwifi/rtl8192se/rtl8192se.ko
  105. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/wireless/rtlwifi/rtl8723ae/rtl8723ae.ko
  106. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/wireless/rtlwifi/rtlwifi.ko
  107. BIN pie/oneplus2cm/modules/3.10.108-re4son+/kernel/drivers/net/wireless/zd1211rw/zd1211rw.ko
  108. +697 −0 pie/oneplus2cm/modules/3.10.108-re4son+/modules.alias
  109. BIN pie/oneplus2cm/modules/3.10.108-re4son+/modules.alias.bin
  110. +597 −0 pie/oneplus2cm/modules/3.10.108-re4son+/modules.builtin
  111. BIN pie/oneplus2cm/modules/3.10.108-re4son+/modules.builtin.bin
  112. +31 −0 pie/oneplus2cm/modules/3.10.108-re4son+/modules.dep
  113. BIN pie/oneplus2cm/modules/3.10.108-re4son+/modules.dep.bin
  114. 0 pie/oneplus2cm/modules/3.10.108-re4son+/modules.devname
  115. +31 −0 pie/oneplus2cm/modules/3.10.108-re4son+/modules.order
  116. +1 −0 pie/oneplus2cm/modules/3.10.108-re4son+/modules.softdep
  117. +295 −0 pie/oneplus2cm/modules/3.10.108-re4son+/modules.symbols
  118. BIN pie/oneplus2cm/modules/3.10.108-re4son+/modules.symbols.bin
  119. +0 −1 pie/placeholder
@@ -11,7 +11,7 @@ You can find that here: https://github.com/offensive-security/kali-nethunter/tre
All devices are contained in devices.cfg. If you want to add your own device you would add something like:

```sh
# Full device name for CyanogenMod (or some other ROM)
# Full device name for LineageOS (or some other ROM)
[codename]
author = "Your Name"
version = "1.0"
@@ -21,8 +21,8 @@ ramdisk = gzip
block = /dev/block/WHATEVER/by-name/boot
devicenames = codename codename2_if_it_has_one
```
Some devices have more then one codename like the OnePlus One, or variants like the Nexus 7 2012/2013. You should add multiple codenames to devicenames.
Getting the block location isn't too difficult, you can look at other kernels to see where they are installing their boot.img or you can also look at CyanogenMod device repo in the BoardConfig.mk file.
Some devices have more than one codename like the OnePlus One, or variants like the Nexus 7 2012/2013. You should add multiple codenames to devicenames.
Getting the block location isn't too difficult, you can look at other kernels to see where they are installing their boot.img or you can also look at LineageOS device repo in the BoardConfig.mk file.

All fields are optional except the [codename] entry. It's recommended that you leave out any defaults from your device entry to keep it short.
Here are the device entry option defaults:
@@ -45,7 +45,7 @@ As a last resort, you can also include:
`getprop ro.product.name`
Keep in mind that each name is space delimited, and you can't quote them, so don't use values with spaces in them!

If porting for CyanogenMod rather than stock, it's recommended to append cm to the codename in [], ex. `[codenamecm]`
If porting for LineageOS rather than stock, it's recommended to append -los to the codename in [], ex. `[codename-los]`

Once you have a device added to devices.cfg, you need to add a prebuilt kernel to the device's folder.
It should be formatted as:
@@ -54,8 +54,24 @@ It should be formatted as:

Some devices may require a separate dtb file. You can place a `dtb.img` file in the same location as the kernel image, and it will be automatically added to the installer.

If you choose to build kernel modules for your device instead of including them in the kernel image, they can be placed at the location:
`[androidversion]/[codename]/modules/*.ko` or `[androidversion]/[codename]/modules/[kernelversion]/...`
Please use the latter when possible by preparing your kernel modules for install (modprobe support) with the command:
`make INSTALL_MOD_PATH="." INSTALL_MOD_STRIP=1 modules_install`
Alternatively, use the build scripts mentioned below which do this already!

So really all you need is a kernel image and sometimes a dtb.img to build for a new device.

Don't forget to add your newly supported device's kernel sources to the kernels.txt file!

Sat Oct 22 21:31:18 EST 2016
## Building a kernel for your device

There are scripts in the `example_scripts` folder that you can copy to the root of your device's kernel sources.
They should be modified to match your device. It will make it easier to build your device's kernel outside of an Android source tree.

The binary output from the build will be self-contained in a `build` folder, with the kernel modules properly stripped and installed with their modprobe data in `build/lib/modules`.

Using these scripts in your source tree will make it easier for others to make modifications and update your device in the future. It will also increase the likelihood your device will be accepted into the nethunter-devices repository as an officially supported device!


Thu Feb 28 21:05:22 EST 2019
@@ -63,7 +63,7 @@ block = /dev/block/mmcblk0p2

# Nexus 6P
[angler]
author = "Binkybear & jcadduono & kimocoder (8.1+)"
author = "Binkybear & jcadduono & kimocoder"
version = "2.1 & 2.0 & 3.0 (8.1+)"
kernelstring = "NetHunter + ElementalX"
arch = arm64
@@ -0,0 +1,127 @@
#!/bin/bash
# script for building NetHunter kernels by jcadduono

################### BEFORE STARTING ################
#
# download a working toolchain and extract it somewhere and configure this
# file to point to the toolchain's root directory.
# this file should be placed in your kernel source folder with
# the CONFIG section edited to work for your device.
#
# once you've set up the config section how you like it, you can simply run
# ./build.sh [DEVICE] [TARGET]
#
# make a copy of your device's original defconfig file.
# the new defconfig file should follow the format:
# arch/arm64/configs/nethunter_yourdevice_defconfig
#
###################### CONFIG ######################

# default device name (change this!)
DEFAULT_DEVICE=yourdevice

# default target name
DEFAULT_TARGET=nethunter

# release version (increment this with new releases)
RELEASE_VERSION=1.0

# directory containing cross-compile arm64 toolchain (change this!)
TOOLCHAIN=/opt/toolchain/gcc-linaro-5.5.0-2017.10-x86_64_aarch64-linux-gnu

############## SCARY NO-TOUCHY STUFF ###############

# root directory of kernel source git repo (default is this script's location)
RDIR=$(pwd)

CPU_THREADS=$(grep -c "processor" /proc/cpuinfo)
# amount of cpu threads to use in kernel make process
THREADS=$((CPU_THREADS + 1))

ABORT() {
[ "$1" ] && echo "Error: $*"
exit 1
}

CONTINUE=false
export ARCH=arm64
export CROSS_COMPILE=$TOOLCHAIN/bin/aarch64-linux-gnu-

[ -x "${CROSS_COMPILE}gcc" ] ||
ABORT "Unable to find gcc cross-compiler at location: ${CROSS_COMPILE}gcc"

while [ $# != 0 ]; do
if [ "$1" = "--continue" ] || [ "$1" == "-c" ]; then
CONTINUE=true
elif [ ! "$TARGET" ]; then
TARGET=$1
elif [ ! "$DEVICE" ]; then
DEVICE=$1
else
echo "Too many arguments!"
echo "Usage: ./build.sh [--continue] [device] [target defconfig]"
ABORT
fi
shift
done

[ "$DEVICE" ] || DEVICE=$DEFAULT_DEVICE
[ "$TARGET" ] || TARGET=$DEFAULT_TARGET
DEFCONFIG=${TARGET}_${DEVICE}_defconfig

[ -f "$RDIR/arch/$ARCH/configs/${DEFCONFIG}" ] ||
ABORT "Config $DEFCONFIG not found in $ARCH configs!"

export LOCALVERSION=$TARGET-$DEVICE-$RELEASE_VERSION

CLEAN_BUILD() {
echo "Cleaning build..."
rm -rf build
}

SETUP_BUILD() {
echo "Creating kernel config for $LOCALVERSION..."
mkdir -p build
make -C "$RDIR" O=build "$DEFCONFIG" \
|| ABORT "Failed to set up build"
}

BUILD_KERNEL() {
echo "Starting build for $LOCALVERSION..."
while ! make -C "$RDIR" O=build -j"$THREADS"; do
read -rp "Build failed. Retry? " do_retry
case $do_retry in
Y|y) continue ;;
*) return 1 ;;
esac
done
}

INSTALL_MODULES() {
grep -q 'CONFIG_MODULES=y' build/.config || return 0
echo "Installing kernel modules to build/lib/modules..."
while ! make -C "$RDIR" O=build \
INSTALL_MOD_PATH="." \
INSTALL_MOD_STRIP=1 \
modules_install
do
read -rp "Build failed. Retry? " do_retry
case $do_retry in
Y|y) continue ;;
*) return 1 ;;
esac
done
rm build/lib/modules/*/build build/lib/modules/*/source
}

cd "$RDIR" || ABORT "Failed to enter $RDIR!"

if ! $CONTINUE; then
CLEAN_BUILD
SETUP_BUILD ||
ABORT "Failed to set up build!"
fi

BUILD_KERNEL &&
INSTALL_MODULES &&
echo "Finished building $LOCALVERSION!"
@@ -0,0 +1,95 @@
#!/bin/bash
# script for configuring NetHunter kernels by jcadduono

################### BEFORE STARTING ################
#
# download a working toolchain and extract it somewhere and configure this
# file to point to the toolchain's root directory.
# this file should be placed in your kernel source folder with
# the CONFIG section edited to work for your device.
#
# once you've set up the config section how you like it, you can simply run
# ./menuconfig.sh [DEVICE] [TARGET]
#
# make a copy of your device's original defconfig file.
# the new defconfig file should follow the format:
# arch/arm64/configs/nethunter_yourdevice_defconfig
#
###################### CONFIG ######################

# default device name (change this!)
DEFAULT_DEVICE=yourdevice

# default target name
DEFAULT_TARGET=nethunter

# directory containing cross-compile arm64 toolchain (change this!)
TOOLCHAIN=/opt/toolchain/gcc-linaro-5.5.0-2017.10-x86_64_aarch64-linux-gnu

############## SCARY NO-TOUCHY STUFF ###############

# root directory of kernel source git repo (default is this script's location)
RDIR=$(pwd)

ABORT() {
[ "$1" ] && echo "Error: $*"
exit 1
}

export ARCH=arm64
export CROSS_COMPILE=$TOOLCHAIN/bin/aarch64-linux-gnu-

[ -x "${CROSS_COMPILE}gcc" ] ||
ABORT "Unable to find gcc cross-compiler at location: ${CROSS_COMPILE}gcc"

while [ $# != 0 ]; do
if [ ! "$DEVICE" ]; then
DEVICE=$1
elif [ ! "$TARGET" ]; then
TARGET=$1
else
echo "Too many arguments!"
echo "Usage: ./menuconfig.sh [device] [target defconfig]"
ABORT
fi
shift
done

[ "$DEVICE" ] || DEVICE=$DEFAULT_DEVICE
[ "$TARGET" ] || TARGET=$DEFAULT_TARGET
DEFCONFIG=${TARGET}_${DEVICE}_defconfig
DEFCONFIG_FILE=$RDIR/arch/$ARCH/configs/$DEFCONFIG

[ -f "$DEFCONFIG_FILE" ] ||
ABORT "Device config $DEFCONFIG not found in $ARCH configs!"

cd "$RDIR" || ABORT "Failed to enter $RDIR!"

echo "Cleaning build..."
rm -rf build
mkdir build
make -s -i -C "$RDIR" O=build "$DEFCONFIG" menuconfig
echo "Showing differences between old config and new config"
echo "-----------------------------------------------------"
if command -v colordiff >/dev/null 2>&1; then
diff -Bwu --label "old config" "$DEFCONFIG_FILE" --label "new config" build/.config | colordiff
else
diff -Bwu --label "old config" "$DEFCONFIG_FILE" --label "new config" build/.config
echo "-----------------------------------------------------"
echo "Consider installing the colordiff package to make diffs easier to read"
fi
echo "-----------------------------------------------------"
echo -n "Are you satisfied with these changes? y/N: "
read -r option
case $option in
y|Y)
cp build/.config "$DEFCONFIG_FILE"
echo "Copied new config to $DEFCONFIG_FILE"
;;
*)
echo "That's unfortunate"
;;
esac
echo "Cleaning build..."
rm -rf build
echo "Done."
@@ -92,6 +92,7 @@ If you wish to add a kernel/new device, leave a link to source here and feel fre
# OXYGEN
# git clone https://github.com/binkybear/android_kernel_oneplus_msm8994.git -b OXYGEN
# CM
# git clone https://github.com/Re4son/android_kernel_oneplus_msm8994.git -b lineage-16.0
# git clone https://github.com/Re4son/android_kernel_oneplus_msm8994.git -b lineage-15.1
# git clone https://github.com/Re4son/android_kernel_oneplus_msm8994.git -b cm-14.1
# git clone https://github.com/binkybear/android_kernel_oneplus_msm8994.git -b cm-13.0
BIN -1.15 KB (100%) oreo/angler/Image.gz-dtb
Binary file not shown.
@@ -234,7 +234,6 @@ kernel/drivers/input/touchscreen/cyttsp4_device_access.ko
kernel/drivers/input/touchscreen/cyttsp4_loader.ko
kernel/drivers/input/touchscreen/cyttsp4_debug.ko
kernel/drivers/input/touchscreen/synaptics_dsx25/synaptics_dsx_core.ko
kernel/drivers/input/touchscreen/synaptics_dsx25/synaptics_dsx_rmi_dev.ko
kernel/drivers/input/touchscreen/synaptics_dsx25/synaptics_dsx_fw_update.ko
kernel/drivers/leds/led-class.ko
kernel/drivers/leds/leds-qpnp.ko
@@ -0,0 +1,20 @@
#!/sbin/sh

. "$env"

print "Disabling forced encryption in the fstab..."

found_fstab=false

for fstab in fstab.*; do
[ -f "$fstab" ] || continue
print "Found fstab: $fstab"
sed -i "
s/\b\(forceencrypt\|forcefdeorfbe\)=/encryptable=/g
" "$fstab"
found_fstab=true
done

$found_fstab || print "Unable to find the fstab!"

exit 0
@@ -0,0 +1,28 @@
#!/sbin/sh

. "$env"

print "Disabling dm-verity in the fstab..."

found_fstab=false

for fstab in fstab.*; do
[ -f "$fstab" ] || continue
print "Found fstab: $fstab"
sed -i "
s/,verify\b//g
s/\bverify,//g
s/\bverify\b//g
s/,support_scfs\b//g
s/\bsupport_scfs,//g
s/\bsupport_scfs\b//g
" "$fstab"
found_fstab=true
done

$found_fstab || print "Unable to find the fstab!"

setprop ro.config.dmverity false
rm -f verity_key sbin/firmware_key.cer

exit 0
@@ -0,0 +1,23 @@
#!/sbin/sh

. "$env"

cd "$ramdisk_patch" && [ "$(ls)" ] || exit 0

# fix permissions of patch files
chmod -R 0755 .

find -type f \( \
-name "*.rc" ! -name "ueventd.*" \
\) -exec chmod 0750 {} \;

find -type f \( \
-name "*.xml" -o -name "*.do" -o -name "*.pem" -o -name "*.vtab" -o \
-name "fstab.*" -o -name "*.prop" -o -name "*_contexts" -o \
-name "ueventd.*" -o -name "sepolicy" -o -name "sepolicy_version" \
\) -exec chmod 0644 {} \;

print "Copying new files to the ramdisk..."
cp -rd ./. "$ramdisk/"

exit 0
Oops, something went wrong.

0 comments on commit 3098663

Please sign in to comment.
You can’t perform that action at this time.