Flash android to NAND without unlocking device - Touch Pro2, Tilt 2 Android Development

I want to flash fastboot image and other android ****stuff to NAND flash, but i stucked on device unlocking. I can't unlock device because unlocking program isn't working.
So, I made an linux distro (custom gentoo rootfs on uclibc with some perfomance tweaks) on 3.4.41 kernel, founded on github. It's very small, less than 512Mb. I boot it from haret.exe on partitioned sdcard. I want to flash rootfs on NAND, without having WinMO.
I have some utils like nand-tools and have access for reading/writing to NAND partition from gentoo rootfs. May I give any full backup from NAND partition on the same unlocked phone (rhod100) and flash it with nand-tools from gentoo?
sorry for my bad english :3

Related

[Q] [lt26] Boot flow, how does it work?

I got my hands on a Xperia S and just started looking into the android development stuff...
If I would compiled a JB kernel for the device as well as AOSP 4.1.2, and lets say the recoveryimage from CM. I am wondering how / if everything works together.
The recovery partition seems to be non writable and it seems that people are advised to flash the CWM recovery to the boot partition. I thought this partition is the one for the actual kernel? Even if so, how does the combination of my kernel.elf and CWM recovery work?
If I get this done this brings up the next question, is the same kernel used to bootup the whole system later on? What I would like to see is something like a flow chart where I see how control is passed around and to what address, and which initrd does what... maybe someone can correct or expand the following:
first stage bootloader (recovery partition?)
apparently I can boot into different modes (fastboot, flash, ...)
on normal boot the kernel from the boot partition gets loaded into ram (execution starts at 0x40208000 ?)
kernel (boot partition)
... does initializaiton stuff ...
in the end init from initrd fires up either the CWM recovery (?) or userspace (?)
I assume in userspace the usr init fires up the dalvik vm and android boots as usual (this is the system partition I get from AOSP ?)
How exactly does it work for CWM and where is it located in the ROM and RAM?
I am sorry if the information is already posted somewhere in these forums but I wasn't able to acquire it so far.
cheers
Welcome to the forum. Thread moved, please post your questions here in Q&A in future.
Thanks
AvRS
Hi,
Let me try to clarify a bit, at least on how I see it:
Bootloader is indeed capable of handling multiple modes:
- flash mode
- fastboot
- normal kernel boot
- recovery / fota kernel boot (disabled with unlocked bootloader)
When unlocking bootloader, the only kernel we can boot is normal kernel. You can write to fota kernel partition, but it will not boot anything unsigned there and will boot normal kernel instead.
So in our custom roms, Android and recovery are using the same kernel, we add recovery files in the Android initramfs, and the switch is handled by init.*.rc with a script that detects keypress and is launching recovery if volume key is pressed.

Use external SD card for /data

The what:
Use an ext4 partition on the external SD card as /data instead of the internal userdata partition.
Warning:
This method does not require root permissions, but does involve boot image modification and, as such, bootloader unlocking.
I only tested this successfully with the firmware K350n10e_00_0630.kdz (Android 6.0.x Marshmallow, Vodafone Hungary) from 2016-07-27.
Doing this on a newer firmware could brick your device!
If you are not willing to take the risk and/or you don't mind moving some apps by hand, you can use the the following guide instead: [GUIDE] Configure SD card as internal storage in Marshmallow on LG Spirit [H440n] by SteSko.
Slowdowns on bootup and app startup have been observed!
The why:
The LG K8 (K350n) has only 8 GB of internal storage space, which gets filled up very fast, resulting in not being to install/update apps or update the OS.
Some applications don't permit being moved to the SD card.
I only found about about SteSko's method after discovering this one, even though I have search a lot.
The how:
Obtain adb and fastboot by downloading android platform-tools.
Obtain [TOOL] KDZ and TOT Extractor from the thread by bullghost
Obtain your firmware, for example by perusing the thread [STOCK][KDZ][FIRMWARE] All models of the device LG K8 (code name: M1V) by ze7zez.
Obtain or port yourself a TWRP, for example by perusing the thread "Portable" TWRP porter [MTK] [TWRP 3.0.2 - 3.1.1] by gottlasz.
Obtain [TOOL][UTILITY] Carliv Image Kitchen for Android - unpack/repack boot-recovery by bluefirebird from the repository. Don't forget to change to the branch supporting your operating system.
Unlock your bootloader:
Open Settings -> General -> About phone -> Software info.
Keep tapping Build number until you become a developer!
Open Settings -> General -> Developer options.
Turn on USB debugging and Enable OEM unlock.
Run adb and enable access on the phone if asked:
Code:
adb devices
Reboot to bootloader/fastboot mode:
Code:
adb reboot bootloader
Check if fastboot can see your phone:
Code:
fastboot devices
Note: It's okay if the phone's name is unreadable letter soup.
Unlock your bootloader, agree on your phone when asked:
Code:
fastboot oem unlock
Warning: This will wipe your data!
Modify the boot image:
Enable USB debugging, Enable OEM unlock, reboot into bootloader just like before.
Boot the TWRP image you downloaded or ported earlier:
Code:
fastboot boot yourTWRP.img
Press Cancel when asked about the decyption key. You can allow modifications to System.
Tap Advanced -> Partition SD Card.
Select your SD card, tap OK.
Set the size for the new partition (what remains will be usable as the external SD card), switch the File System to ext4, swipe to partition.
Go back to the main menu, select Advanced -> Terminal.
List your block devices, the device we are looking for will only have two partitions. We need the second one, take note of its path.
Code:
ls /dev/block
On my phone, the new partition was located at /dev/block/mmcblk1p2.
Go back to the main menu, select Reboot -> System.
Use the KDZ extractor obtained earlier to unpack the DZ file from your KDZ file obtained earlier.
Use the KDZ extractor obtained earlier to unpack the boot image from the DZ file. (This tool can also be used to extract the recovery image for porting TWRP.)
Unpack Carliv Image Kitchen.
Copy your boot image into the boot-resources directory, change the extension from bin to img.
Use Carliv Image Kitchen to unpack the boot image. The unpacked data will appear in the boot directory.
Modify boot/ramdisk/fstab.mm1v:
Find the line dealing with /data. On my phone it was:
Code:
/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/userdata /data ext4 noatime,nosuid,nodev,noauto_da_alloc,discard wait,check,resize,forceencrypt=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/encrypt
Change the partition to the one we just created. On my phone this resulted in:
Code:
/dev/block/mmcblk1p2 /data ext4 noatime,nosuid,nodev,noauto_da_alloc,discard wait,check,resize,forceencrypt=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/encrypt
Save the file, then repack the boot image. You will find your modified boot image in the output directory.
Copy the image file to your SD card, we will need it.
Flash the boot image:
Reboot into bootloader just like before, boot TWRP, Cancel decryption, allow System modification.
In the main menu, tap Install.
Tap Select Storage and select your SD card.
Tap Install Image, because that's what we are going to do.
Select your boot image file.
Select the Boot partition, swipe to flash.
Wipe data and restart:
Go back to the main menu, tap Wipe.
Swipe to complete the wipe, then Reboot.
Notes:
Tested with the firmware K350n10e_00_0630.kdz (Android 6.0.x Marshmallow, Vodafone Hungary) from 2016-07-27.
Warning: Doing this on a newer firmware could brick your device! (Although it can be unbricked by flashing a new firmware in download mode using LGUP.)
This is my first thread, criticism is welcome.
hi, i just wonder, is it possible to change and make it permanent the stock recovery into twrp recovery as we all knew that the only chance we can boot into twrp into this LG K8 k350n model is by boot into fastboot mode and do fastboot boot twrp.img (recovery).
I did successfully flash the twrp recovery with the same size and proper with the stock recovery. But when i tries to boot into twrp by pressing Vol Down + Power Button and klik release Power Button when the logo appears it did just entering the stock recovery..
thanks..

Project Treble For XZ Premium Xperia Pie Rom

Back up your phone's data
Make sure your XZP has been brushed with the latest official 9.0 firmware
Have certain risks
1 Brush twrp to restart the phone into twrp
2 Copy make_vendor.sh to the internal storage root directory of the phone
3 Enter the twrp terminal command interface (advanced terminal)
Enter the following command to split the 800MB from the system partition to create a vendor partition.
sh make_vendor.sh
4 Restart the phone and enter the twrp terminal command interface. Enter the following command and press Enter to format the system and vendor.
make_ext4fs /dev/block/bootdevice/by-name/system
make_ext4fs /dev/block/bootdevice/by-name/vendor
5 Restart the phone and enter the twrp card brush XZP_47.2.A.10.107_PT and boot.
If you want to restore the partition, you can completely brush the 9.0 firmware.
The partition script comes from the network, the original author should be xda, thanks.
The file was changed from the official firmware of XZP and XZ1.
You can use the official vendor to brush gsi.
Currently known bugs
Loss of fingerprint
Sorry, bad English.
Download:https://mega.nz/#F!sp52iK4T!836RP-sggkpaSR0-kWRyBw
If you like, you can donate :https://paypal.me/machao44?locale.x=zh_XC
Anyone tested m rom sounds great might root my recently replaced XZp if it good as daily driver
does this support Android 10 GSI?
and is this one more stable than sjll's treble mod?
I moved make_vendor.sh to internal storage, root, but terminal in twrp cannot find it. Or I get: can't open "make_vendor.sh"

Question RMX3363 recovery partition

Hey,
so I'm trying to make a custom twrp recovery for the rmx3363 but I can't seem to find the recovery partition or which other partition is used for such a role.
Does anyone has any idea which partition is used for recovery?
Thanks!
P.S.: I've tried applications like Flashify and the Official TWRP app to make a back up of the stock recovery but neither can find the partition used for it.
This phone doesn't have recovery partition...
you could study about A/B (Seamless) System Updates in follow web page.
A/B (Seamless) System Updates | Android Open Source Project
source.android.com
Virtual A/B Overview | Android Open Source Project
source.android.com

Question Can I get A325N vender image?

I root my devices with magisk and make chmod 555 to NVD_IMEI. because of magisk bug. Then I use few week(maybe 2 week?) with no problem. but I trid mount ext4 sdcard(because I want easy to recover with TWRP(but I did not install yet) but AP file is to big so can't use fat32) and it's successful. At next morning(January 28th), I saw signal was dead.(but, wifi is alive. ; I can't remember about Bluetooth, IMEI and is only signal dead or can't attach sim card.) So I reboot my phone( because I just think something crash it) but can't boot and get stuck. so I flash stock rom but can't boot. but only recovery(Normal and TWRP all) work well. So I do re-partition but also not work. I do NAND Erase with magisk patched AP and it booted. but IMEI disappear(of course because I do NAND Erase) and wifi did not work. I flash stock rom again but boot fail... when flash magisk patched AP it boot. I don't know why only magisk patched AP only boot, but I will use patched AP so not important yet.(I don't know what will happen future.) I think wifi error because I NAND Erase so vender partition broke. So I will flash vender image first. but sadly I have IMEI backup but I don't have vender partition backup... So I search internet but couldn't find vender image. Where can I get image? Is because of other problem? Then what and how can I fix it?
vendor.zip is vender folder(partition) backup after I NAND Erase it. TWRP backups of Vender partitions are also fine. If there's anything that needs to be changed for each device, please let me know as well.(ex.S/N, IMEI)
Broken partition after NAND erase? Sounds unlikely if flashing went successful. You cannot break NAND memory itself using software, and flashing with the "re-partition" option using external PIT file will re-partition everything unconditionally, so no broken partition may remain after that. Sounds more like you flashed wrong or incompatible stock firmware. And did you do Factory Reset after flashing?
P.S.: And I still don't understand why so many people need Magisk so badly. Root is needed only for a few quite low-level apps.
uluruman said:
Broken partition after NAND erase? Sounds unlikely if flashing went successful. You cannot break NAND memory itself using software, and flashing with the "re-partition" option using external PIT file will re-partition everything unconditionally, so no broken partition may remain after that. Sounds more like you flashed wrong or incompatible stock firmware. And did you do Factory Reset after flashing?
P.S.: And I still don't understand why so many people need Magisk so badly. Root is needed only for a few quite low-level apps.
Click to expand...
Click to collapse
NAND Erase is at odin option.
I do root for use "few quite low-level apps" and view and fix or backup app data.
I use "SM-A325N_2_20230113085551_pl06359zs5_fac.zip". It's compatible stock from samsung server. I use this stock to recover once, and I recover it.
Ok ) I have extracted vendor.img from your firmware: https://easyupload.io/vgzftz (if that's what you needed, I cannot understand your language clearly enough). Only I am not sure how you're going to flash it, because it's a dynamic partition inside the physical "super" partition and cannot be flashed directly besides (reportedly) using dd from the shell or using fastboot.
I still think you somehow mixed parts from different firmware versions. I never seen a situation when flashing a complete stock firmware with re-partition and NAND erase and then Factory Reset would not fix the booting. Try going into Recovery and do Factory Reset right after flashing, without allowing the system to try booting.
uluruman said:
Ok ) 귀하의 펌웨어에서 vendor.img를 추출했습니다: https://easyupload.io/vgzftz (필요한 경우 귀하의 언어를 충분히 이해할 수 없습니다). 물리적 "슈퍼" 파티션 내부의 동적 파티션이고 셸에서 dd를 사용하거나 fastboot를 사용하는 것 외에는 직접 플래시할 수 없기 때문에 어떻게 플래시할지 확신할 수 없습니다.
Click to expand...
Click to collapse
삼성에는 패스트부트가 없습니다. 그러나 다운로드 모드가 있습니다. 다운로드 모드에서 odin을 사용하여 펌웨어를 업로드하십시오. 또한 TWRP에서 img를 플래시할 수 있습니다.
uluruman said:
Ok ) I have extracted vendor.img from your firmware: https://easyupload.io/vgzftz (if that's what you needed, I cannot understand your language clearly enough). Only I am not sure how you're going to flash it, because it's a dynamic partition inside the physical "super" partition and cannot be flashed directly besides (reportedly) using dd from the shell or using fastboot.
Click to expand...
Click to collapse
At samsung, there is no fastboot. but, there is download mode. Use odin to flash at download mode. Also can flash img and zip at TWRP.
If you still need help please be a bit clearer what exactly is your problem, what you cannot achieve. I think a Korean-speaking person would be of much help here but it seems there is none

Categories

Resources