How to Use edge TWRP on Edge-V

Use edge TWRP Step:

1,Please get the khadas-edge-pie SDK and setup the build environment.

2,Back up the default recovery, the directory path is bootable/recovery, so that you can restore the recovery at any time to provide the full SDK.

$mv bootable/recovery ../

3,Delete the default original recovery

$rm -rf bootable/recovery

4,cp TWRP source

$cp -rf xx/recovery_edge_TWRP bootable/recovery

5, Compilation, Clearing the previously compiled content, because the files in the out directory that have been generated conflict with TWRP, will cause TWRP compilation to fail.(make clean)
or you can restore the previously compiled content

$mv out ../

$source build/envsetup.sh
$lunch rk3399-userdebug
$make recoveryimage -j36

6, Upgrade the compiled recovery.img separately (out/target/product/rk3399/recovery.img)

7, After upgrading, enter the system and execute the following command:
$adb reboot recovery

3 Likes

Thanks, I managed to build recovery.img, but is there a way to burn it separately to Edge-V?

I have packed recovery.img into update.img and burned to Edge-V, but now whenever device runs, TWRP loads (not the Android system) and it’s in Chinese :neutral_face: I can’t seem to be able to start Android…

Is there a way to have TWRP in English?

To only burn the stock recovery.img or TWRP.img recovery, you can use AndroidTool.
Only select the recovery partition and point it to the image location.
Also the last button on the bottom, it will get the partition layout from your device to get the correct location of the recovery partition, you must do this first.

For Linux flashing or TWRP in English only Khadas will be able to help.

1 Like

https://docs.khadas.com/edge/InstructionsforEdgeSinglePackBurningTool.html

recovery_edge_TWRP

--- a/Android.mk
+++ b/Android.mk
@@ -20,7 +20,7 @@ RECOVERY_SDCARD_ON_DATA := true
 TW_THEME := landscape_hdpi
 TW_USE_TOOLBOX := true
 TW_EXTRA_LANGUAGES := true
-TW_DEFAULT_LANGUAGE := zh_CN
+TW_DEFAULT_LANGUAGE := en
2 Likes

Excellent, now TWRP is built with English menu :+1:

Just one problem - when I reboot Edge-V it always boots to TWRP and from it’s menu when I choose Reboot > System or Reboot > Bootloader it says “No OS installed”. Is it so that TWRP does not recognize Android Pie?

There are two possibilities:

  1. Your system is broken
  2. You failed to install the system

So you have to think about what happened to it before

It seems that TWRP source might lack some files - I have initiated Android build having TWRP source as bootable/recovery and it gave me this:

make: Leaving directory '/home/gytis/khadas/edgev/external/rk_tee_user'
[ 11% 11742/100718] //external/one-true-awk:awk yacc awkgram.y
external/one-true-awk/awkgram.y: conflicts: 43 shift/reduce, 85 reduce/reduce
[ 11% 11752/100718] //external/one-true-awk:awk_vendor yacc awkgram.y
external/one-true-awk/awkgram.y: conflicts: 43 shift/reduce, 85 reduce/reduce
[ 13% 13324/100718] //bootable/recovery/applypatch:libapplypatch clang++ applypatch.cpp
FAILED: out/soong/.intermediates/bootable/recovery/applypatch/libapplypatch/android_arm64_armv8-a_cortex-a53_core_static/obj/bootable/recovery/applypatch/applypatch.o 
PWD=/proc/self/cwd prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++ -c -Ibootable/recovery/applypatch/include -Ibootable/recovery/applypatch/include -Ibootable/recovery/applypatch  -Werror=implicit-function-declaration -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -no-canonical-prefixes -DNDEBUG -UDEBUG -fno-exceptions -Wno-multichar -O2 -g -fno-strict-aliasing -fdebug-prefix-map=/proc/self/cwd= -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics -Wno-expansion-to-defined -Wno-zero-as-null-pointer-constant -fdebug-prefix-map=$PWD/= -ffunction-sections -fdata-sections -fno-short-enums -funwind-tables -fstack-protector-strong -Wa,--noexecstack -D_FORTIFY_SOURCE=2 -Wstrict-aliasing=2 -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=date-time -Werror=format-security -nostdlibinc -march=armv8-a -mcpu=cortex-a53 -Isystem/core/base/include -Iexternal/bsdiff/include -Iexternal/bzip2 -Iexternal/boringssl/src/include -Ibootable/recovery/edify/include -Ibootable/recovery/otafault/include -Ibootable/recovery/otautil/include -Iexternal/zlib -Iexternal/libcxx/include -Iexternal/libcxxabi/include -Isystem/core/include -Isystem/media/audio/include -Ihardware/libhardware/include -Ihardware/libhardware_legacy/include -Ihardware/ril/include -Ilibnativehelper/include -Iframeworks/native/include -Iframeworks/native/opengl/include -Iframeworks/av/include -isystem bionic/libc/include -isystem bionic/libc/kernel/uapi -isystem bionic/libc/kernel/uapi/asm-arm64 -isystem bionic/libc/kernel/android/scsi -isystem bionic/libc/kernel/android/uapi -Ilibnativehelper/include_jni -D_FILE_OFFSET_BITS=64 -DZLIB_CONST -Wall -Werror -target aarch64-linux-android -Bprebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin -DANDROID_STRICT -fPIC -D_USING_LIBCXX -std=gnu++14 -Wsign-promo -Wno-inconsistent-missing-override -Wno-null-dereference -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -Wno-thread-safety-negative -Wno-gnu-include-next -fvisibility-inlines-hidden -fno-rtti  -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=address-of-temporary -Werror=return-type -Wno-tautological-constant-compare -Wno-null-pointer-arithmetic -Wno-enum-compare -Wno-enum-compare-switch -MD -MF out/soong/.intermediates/bootable/recovery/applypatch/libapplypatch/android_arm64_armv8-a_cortex-a53_core_static/obj/bootable/recovery/applypatch/applypatch.o.d -o out/soong/.intermediates/bootable/recovery/applypatch/libapplypatch/android_arm64_armv8-a_cortex-a53_core_static/obj/bootable/recovery/applypatch/applypatch.o bootable/recovery/applypatch/applypatch.cpp
bootable/recovery/applypatch/applypatch.cpp:41:10: fatal error: 'bmlutils/bmlutils.h' file not found
#include "bmlutils/bmlutils.h"
         ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
[ 13% 13327/100718] //system/core/libappfuse:libappfuse clang++ FuseBridgeLoop.cc [arm]
ninja: build stopped: subcommand failed.
14:41:09 ninja failed with: exit status 1

#### failed to build some targets (20:35 (mm:ss)) ####

I checked the uploaded code again, there is no problem.

Code is fine, TWRP builds and works on Edge V :+1:

Hi @goenjoy

Can you update TWRP Recovery to v3.3.1, it is currently 3.2.3?
Here is new source code v3.3.1, not sure if extra changes are needed for Khadas Edge-V.

1 Like

OK…I will update it on Android 10…

1 Like

Thanks

You are already experimenting with Android 10, RK released SDK to Khadas to test or you mean in future when Android 10 is available, several weeks or months from now?
:slight_smile:

1 Like

Yes, I’m porting Android 10 today. If it goes well, the first version is expected to be released by next Saturday.

3 Likes

Thanks, looking forward to it.
I hope it will have interesting new features and bug-fixes RK did.

I just hope Google didn’t make Android 10 more strict with security etc, they always want to lock down things more so users can’t root or use Magisk or have nice features anymore. I read Google wants to use Key Attestation then apps like Magisk won’t be able to pass Safetynet anymore in future and with users that use their developer accounts they make it impossible to install any apps from USB, download now and you can only use the Google Play Store for apps, I hope this doesn’t happen in Android 11/12 for normal users. But if things change for the worse, I think lots of users will move over to Linux like KDE BigScreen OS that now also have a tv optimised OS where users have no restrictions, it will be interesting to see what happens in future.

BTW, for the latest Magisk Manager on Android 9, you also need to enable the checkbox in Magisk Manager’s Settings for ‘Magisk Hide’ to hide the app from Safetynet otherwise the ‘Basic Integrity’ test will fail.

1 Like

to the TWRP stock firmware ?! interesting approach, i like it!:+1:

For Firmware with TWRP Recovery,
we must also find a way to use it with micro-sd cards to update firmware on emmc eg. with SDDiskTool.
Currently SDDiskTool only supports upgrading firmware on emmc with stock recovery from a micro-sd card.

1 Like

Is it 64bit version ?

Yes, Rockchip RK3399 & RK3328 are always 64-bit, not like S922x, S905x that are only 32-bit.

2 Likes

there is an exception🙂

You are right there but it’s a custom LineageOS they adapted, not official firmware from Amlogic. It’s also a lot more difficult to maintain and keep updated since hundreds of patches and changes have to be ported every time to make it work.