Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2017, Danila Suslov <d@suslovd.ru>
Copyright (c) 2018, Danila Suslov <d@suslovd.ru>

Permission to use, copy, modify, and/or distribute this software, with or without modifications, for any
purpose with or without fee is hereby granted, provided that the above
Expand Down
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# HELPERS

### ```My scripts. Developed to make kernel and android development easier```

``` How to Use ```

> ### For Parsing DTS From Stock DTB :
./dts.sh markw Image.gz-dtb
markw = my device name here
Image.gz-dtb = my kernel name in this directory!

> ### For comparing Defconfigs :
python compare_defconfig.py mido_defconfig mido1_defconfig > Difference.txt
mido_defconfig & mido1_defconfig = name of defconfig to compare!
Difference.txt = Difference between two defconfig!

> ### For Repacking ( boot.img & recovery.img ) :
python repack_images.py stock.img folderwithkernels/


```contributors ```

* @assusdan
* @yuvraj99
3 changes: 0 additions & 3 deletions compare_defconfig.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Usage:
# python compare_defconfig.py defconfigA defconfigB > difference.txt
#
# Compare two defconfigs and add difference in file

import sys
Expand Down
Empty file modified dtc
100644 → 100755
Empty file.
59 changes: 59 additions & 0 deletions dts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/bash

#
# Copyright (c) 2018 - 2019 Danya Suslov
# https://github.com/assusdan
#

# Don't Touch This

DEVICE=$1
DTBIMG=$2
ARG_COUNT="$#"

# ARGS

if [ $ARG_COUNT -lt "2" ]
then
echo "Not enough arguments were specified, run the script again with proper arguments"
exit 1
fi

# Start Parsing

DTBSIG="00 00 d0 0d fe ed"
DTBSIGOFF=2
rm -rf ./$DEVICE_$(date +%Y%m%d)
mkdir -p $DEVICE_$(date +%Y%m%d)
hexdump -v -e "1/1 \"%02x \"" $DTBIMG >./$DEVICE_$(date +%Y%m%d)/$DEVICE_hex.txt
unset OFFSETS
unset SIZES
declare -a OFFSETS
declare -a SIZES
BCNT=0
for OFF in `grep -oba "$DTBSIG" ./$DEVICE_$(date +%Y%m%d)/$DEVICE_hex.txt | awk -F':' '{print $1}'`; \
do \
let "SIGOFF = OFF/3 + DTBSIGOFF"; \
let "OFFSETS[BCNT] = SIGOFF"; \
if [[ $BCNT > 0 ]]; then let "SIZES[BCNT-1] = SIGOFF - OFFSETS[BCNT-1]"; fi; \
let "BCNT += 1"; \
done
rm ./$DEVICE_$(date +%Y%m%d)/$DEVICE_hex.txt
ACNT=0
for OFF in "${OFFSETS[@]}"; \
do \
DTNAME=$(printf "./$DEVICE_$(date +%Y%m%d)/dt_%02d" $ACNT); \
if [[ $ACNT == $(($BCNT-1)) ]]; then \
dd if=$DTBIMG of=$DTNAME.bin ibs=1 skip=$(($OFF)); \
else \
dd if=$DTBIMG of=$DTNAME.bin ibs=1 skip=$(($OFF)) count=$((${SIZES[$ACNT]})); \
fi; \
./dtc -I dtb $DTNAME.bin -O dts -o $DTNAME.dts; \
rm $DTNAME.bin; \
let "ACNT += 1"; \
done

# Unsetting variables
unset DEVICE
unset DTBIMG
unset ARG_COUNT
6 changes: 0 additions & 6 deletions mailru.sh

This file was deleted.

6 changes: 1 addition & 5 deletions repack_images.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# Usage:
# python repack_images.py stock.img folderwithkernels/
#
# Repacks your boot/recovery image with all kernels from folderwithkernels/ dir.
# Uses tool.exe for repacking
# Start Repacking Image

import sys
from shutil import copyfile
Expand Down
32 changes: 0 additions & 32 deletions sc.sh

This file was deleted.

Empty file modified tool.exe
100644 → 100755
Empty file.