once jumpdrive is booted, can i then also install it to the emmc? without overwriting my os with disk encryption?
And once that is installed do i still need UUU or can i just plug in and use a volume up/down or some key combi to connect the phone through usb? Like with tow-boot?
Technically it can be booted from the eMMC, but there’s no easy how-to for that. You would have to write a short u-boot script that would, say, check for a button being pressed and then boot Jumpdrive instead of the regular kernel. Then you wouldn’t have to use uuu at all. But at this point, it’s a 100% DIY thing
You can put parts of u-boot boot scripts in /etc/flash-kernel/preboot.d/. flash-kernel will assemble them into a single boot.scr executed at boot.
Command gpio input can be used to read the state of GPIO (buttons, HKS…). For example, gpio input GPIO1_16 reads the state of Vol+ button. For GPIO numbers of other things, consult the schematics and arch/arm64/boot/dts/freescale/imx8mq-pinfunc.h in kernel sources (or imx8mq manual).
You can also control LEDs this way for some user feedback. gpio set GPIO1_13 turns the blue LED on, for example.
Keep in mind that both Vol+ and Vol- buttons are already used for things, so you may have to experiment with adding some time windows for button to be pressed etc.
Putting it all together, a script like this:
if gpio input GPIO1_16; then
setenv bootargs "${bootargs} button"
gpio set GPIO1_13
fi
should make the blue LED shine and string “button” to be appended to kernel’s command line if you hold Vol+ button while this script is being executed. Don’t press it before the green LED shines though, as otherwise you will enter the flash mode!
And remember - if you mess the script up, your phone will become unbootable until you fix it up. For example, with Jumpdrive
(it’s also much easier to play with the bootloader if you have a serial console hooked up - although it’s not strictly required as long as you can deal with debugging things blindly ;))
It always works, provided that you actually manage to turn the phone on (which can trip many people off because of no visible feedback on the phone). You can practice it by having the phone connected to a PC via USB with sudo dmesg --follow displayed there, to see when it shows up and when it disappears as you turn the phone on and off