Skip to content

Commit fa465aa

Browse files
committed
imporve patch kernel
Kernelpatch: Deprecate user_init.sh to apd,possible repair of module failures caused by certain system non writable issues kptools: support LZ decompress patch: show more info when patch
1 parent 6efec6e commit fa465aa

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

app/src/main/assets/boot_patch.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,13 @@ command -v ./kptools >/dev/null 2>&1 || { >&2 echo "- Command kptools not found!
4242

4343
if [ ! -f kernel ]; then
4444
echo "- Unpacking boot image"
45-
./kptools unpack "$BOOTIMAGE" >/dev/null 2>&1
46-
if [ $? -ne 0 ]; then
47-
>&2 echo "- Unpack error: $?"
45+
46+
set -x
47+
./kptools unpack "$BOOTIMAGE" "$@"
48+
patch_rc=$?
49+
set +x
50+
if [ $patch_rc -ne 0 ]; then
51+
>&2 echo "- Unpack error: $patch_rc"
4852
exit $?
4953
fi
5054
fi
@@ -76,7 +80,7 @@ if [ $patch_rc -ne 0 ]; then
7680
fi
7781

7882
echo "- Repacking boot image"
79-
./kptools repack "$BOOTIMAGE" >/dev/null 2>&1
83+
./kptools repack "$BOOTIMAGE"
8084

8185
if [ ! $(./kptools -i kernel.ori -f | grep CONFIG_KALLSYMS_ALL=y) ]; then
8286
echo "- Detected CONFIG_KALLSYMS_ALL is not set!"

app/src/main/assets/boot_unpatch.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@ command -v ./kptools >/dev/null 2>&1 || { echo "- Command kptools not found!"; e
2424

2525
if [ ! -f kernel ]; then
2626
echo "- Unpacking boot image"
27-
./kptools unpack "$BOOTIMAGE" >/dev/null 2>&1
28-
if [ $? -ne 0 ]; then
29-
>&2 echo "- Unpack error: $?"
30-
exit $?
27+
28+
set -x
29+
./kptools unpack "$BOOTIMAGE" "$@"
30+
patch_rc=$?
31+
if [ $patch_rc -ne 0 ]; then
32+
>&2 echo "- Unpack error: $patch_rc"
33+
exit $patch_rc
3134
fi
3235
fi
3336

@@ -38,13 +41,13 @@ if [ ! $(./kptools -i kernel -l | grep patched=false) ]; then
3841
else
3942
mv kernel kernel.ori
4043
echo "- Unpatching kernel"
41-
./kptools -u --image kernel.ori --out kernel
44+
./kptools -u --image kernel.ori --out kernel "$@"
4245
if [ $? -ne 0 ]; then
4346
>&2 echo "- Unpatch error: $?"
4447
exit $?
4548
fi
4649
echo "- Repacking boot image"
47-
./kptools repack "$BOOTIMAGE" >/dev/null 2>&1
50+
./kptools repack "$BOOTIMAGE"
4851
if [ $? -ne 0 ]; then
4952
>&2 echo "- Repack error: $?"
5053
exit $?

0 commit comments

Comments
 (0)