[Q][Info][Tab3] System Dump / Kitchen - Galaxy Tab 3 Q&A, Help & Troubleshooting

I'm trying to pull a system dump to make a Back it in kitchen for the Tab3 10.1
I did a ton of reading on this device, since there is not much developing with it
I pulled a Firmware/ system dump from My Samsung Galaxy Tab 3 10.1
GT-P5210 JDQ39.P5210UEUAMK1
It's rooted with recovery only
After pulling the dump I was able to load it up into kitchen
I loaded up the following three files:
boot.img, cache.img, and system.img
fired up the kitchen Set up working folder as usual
extracted it (no errors)
Added root permissions
Added Busybox
Added /etc/init.d script support
De-odex
zipalign all the APK's
updated the mounting point in the updater-script
Code:
unmount("/system");
format("ext4", "EMMC", "/dev/block/mmcblk0p8", "0");
mount("ext4", "EMMC", "/dev/block/mmcblk0p8", "/system");
-------------------------------------------------------------------------------------
I flashed it in recovery (seemed to have flashed) But when it reboots it just sits @ the boot screen.
Now I'm trying to figure out where i went wrong.
does below look correct?
are the commands i used correct?
Mounting points seem correct ?
I'm 99% sure the mounting points are correct..
I'm 50% sure I used the correct commands to create the sys dump etc
I'm not sure why the recovery img and boot img are the same exact size
(is it normal for the boot.img and the recovery.img to be the same exact size?)
I baked it in kitchen. with out any errors
here are the mounting points I used
1 '/efs' 'ext4' '/dev/block/mmcblk0p2'
2 '/config' 'ext4' '/dev/block/mmcblk0p3'
3 '/cache' 'ext4' '/dev/block/mmcblk0p6'
4 '/system' 'ext4' '/dev/block/mmcblk0p8'
5 '/data' 'ext4' '/dev/block/mmcblk0p9'
6 '/recovery' 'emmc' '/dev/block/mmcblk0p11'
7 '/modem' 'emmc' '/dev/block/mmcblk0p12'
8 '/preload' 'ext4' '/dev/block/mmcblk0p13'
9 '/boot' 'emmc' '/dev/block/mmcblk0p10'
10 '/sdcard' 'vfat' '/dev/block/mmcblk1p1'
I used these commands in terminal
Code:
dd if=/dev/block/mmcblk0p8 of=/mnt/extSdCard/backup/mmcblk0p8_system.img bs=4096
Code:
dd if=/dev/block/mmcblk0p10 of=/mnt/extSdCard/backup/mmcblk0p10_boot.img bs=4096
Code:
dd if=/dev/block/mmcblk0p6 of=/mnt/extSdCard/backup/mmcblk0p6_cache.img bs=4096
Code:
dd if=/dev/block/mmcblk0p12 of=/mnt/extSdCard/backup/mmcblk0p12_modem.img bs=4096
Code:
dd if=/dev/block/mmcblk0p11 of=/mnt/extSdCard/backup/mmcblk0p11_recovery.img bs=4096
So nowI ended up with
[*] mmcblk0p6_cache.img 350M
[*] mcblk0p8_system.img 2.3G
[*] mmcblk0p10_boot.img 20M
[*] mmcblk0p11_recovery.img 20M
[*] mmcblk0p12_modem.img 4.0M
etc
Any Help would be greatly appreciated

Related

Is there an easy way to unpack system.img and modify it?

I am using ubuntu 12.04.
I am trying following step.
1. compile yaffs2 kernel module and insmod yaffs2multi.ko
2. Simulate NAND
sudo modprobe mtd
sudo modprobe mtdblock
# Simulate a 1024MB 2048-byte erase-block sized MTD device backed by a file on disk,
sudo modprobe nandsim first_id_byte=0xec second_id_byte=0xd3 third_id_byte=0x51 fourth_id_byte=0x95
cat /proc/mtd
dev: size erasesize name
mtd0: 00400000 00020000 "mtdram test device"
mtd1: 40000000 00020000 "NAND simulator partition 0"
3. dd if=./system.img of=/dev/mtdblock1
4. mount sytem.img
mount -t yaffs2 /dev/mtdblock1 /tmp/system
ls /tmp/system/
lost+found
But there are no files in /tmp/system/.
What's wrong?
Is there an easy way to unpack system.img and modify it?

[KERNEL] [U-boot] Dual-boot Powered by U-boot and Custom Kernel[Fully Working][04/18]

Dual-boot Powered by U-boot and Custom Kernel on Galaxy Nexus.​
Everyone can look at my github for details.
https://github.com/dlhxr
The uboot-tuna repository is for u-boot and the 2nd-kernel-for-galaxy-nexus is for kernel modification.
Edit: I forked the fancykernel repository and change the ramdisk to support image boot in branch fancykernel-ramdisk-imageboot. You can easily use that repository to build an image boot supported kernel.
Instructions are in the post #2, #3 and #4.
The first post is for introduction and some pre-built binaries.
There are pre-built u-boot for dual-boot, tri-boot, quad-boot and quad-recovery-boot!!!
You can find how I modify the u-boot in the branches of uboot-tuna repository.
Dual Boot
View attachment GN_U-Boot_Kernel.zip
* Normal Boot -> No keys are pressed, cyan LED ->Find kernel in /data/media/boot/1st.img
* Recovery Boot -> Volume Up key pressed, green LED -> Go to recovery
* Custom Boot -> Volume Down key pressed, blue LED ->Find kernel in /data/media/boot/2nd.img
!!!It will replace your kernel. Remember to copy your boot.img to /data/media/boot/1st.img first!!!
Tri Boot
View attachment GN_U-Boot_Triboot_Kernel.zip
* First Boot -> No keys are pressed, cyan LED ->Find kernel in /data/media/boot/1st.img
* Third Boot -> Volume Up key pressed, green LED -> Find kernel in /data/media/boot/3rd.img
* Second Boot -> Volume Down key pressed, blue LED ->Find kernel in /data/media/boot/2nd.img
!!!It will replace your kernel. Remember to copy your boot.img to /data/media/boot/1st.img first!!!
Quad Boot Thank Zittoro to remind me about pessing both keys!
View attachment GN_U-Boot_QuadBoot_Kernel.zip
* First Boot -> No keys are pressed, cyan LED ->Find kernel in /data/media/boot/1st.img
* Third Boot -> Volume Up key pressed, green LED -> Find kernel in /data/media/boot/3rd.img
* Second Boot -> Volume Down key pressed, blue LED ->Find kernel in /data/media/boot/2nd.img
* Recovery Boot -> Volume Up and Down keys pressed, yellow LED ->Go to recovery
Quad Boot with Recovery Image Boot
View attachment GN_U-Boot_QuadBoot_Recovery_Kernel.zip
* First Boot -> No keys are pressed, cyan LED ->Find kernel in /data/media/boot/1st.img
* Third Boot -> Volume Up key pressed, green LED -> Find kernel in /data/media/boot/3rd.img
* Second Boot -> Volume Down key pressed, blue LED ->Find kernel in /data/media/boot/2nd.img
* Recovery Boot -> Volume Up and Down keys pressed, yellow LED ->Find recovery image in /data/media/boot/recovery.img. You can put either CWM recovery or TWRP recovery image there.
!!!It will replace your kernel. Remember to copy your boot.img to /data/media/boot/1st.img first!!!
If you want to bulid your own u-boot from source, you can look into post #2.
Three ways to modify the 2nd kernel fully working now!
1. Image Boot Recommanded!
Partition relation for the 2nd kernel.
Code:
system /rdata/media/rom/system.img
data /rdata/media/rom/data.img
cache /rdata/media/rom/cache.img
See post #3 part I
2. Image Folder Mix Boot
Partition relation for the 2nd kernel
Code:
system /rdata/media/2nd/system.img
data /rdata/media/2nd/data
cache /rdata/media/2nd/cache
See post #3 part II
3. Folder Cache Boot
Partition relation for the 2nd kernel.
Code:
system /dev/block/platform/omap/omap_hsmmc.0/by-name/cache
data /rdata/media/2nd/data
cache /rdata/media/2nd/cache
See post #3 part III.
Acknowledgement
twistedumbrella for doing these thing together and his help.
sp3dev for his port of u-boot to galaxy nexus and his help to modify u-boot source.
Jijonhyuni for firstly putting his dual boot kernel on xda.
crayon for his busybox mount way to support HTC DHD multiboot, which inspired me a lot!
Most Frequently Asked Questions Updated on April 18th.
Q: Some of the 4.1 kernels seem not work, right?
A: The init binary in the ramdisk is not compatible. Replace the init in /ramdisk/ by this one.View attachment init.7z
(Don't forget to extract the init in the init.7z first.)
Q: Some kernel has serious color problem, the screen showing a green color?
A: Unpack the kernel and repack it with the cmdline adding "mms_ts.panel_id=18". And I made an easy linux script for this.View attachment Fix_Color.7z:laugh: and an android arm script and binary for people's computer not available.View attachment fix_color_arm.7z I use SManager to execute the script.
Edit: Someone reported his panel_id is not 18, but 162. If 18 doesn't work with your device, try 162.
Q: When I am using the image boot way to dual boot, the zip file seems not being flashed?
A: The TWRP seems not compatible with image boot flashing script and please use CWM recovery instead.
Step 1: How to Modify the U-boot Source
Since developer sp3dev on xda ported u-boot for galaxy nexus, we have the opportunity to exploit it and realize dual-boot on our device. Feel free to email me ([email protected]) or pm me on xda.
Modify the U-boot
Notice: This step can be skipped using my pre-built u-boot.
View attachment GN_U-Boot_Kernel.zip
* Normal Boot -> No keys are pressed, cyan LED ->Find kernel in /data/media/boot/1st.img
* Recovery Boot -> Volume Up key pressed, green LED -> Go to recovery
* Custom Boot -> Volume Down key pressed, blue LED ->Find kernel in /data/media/boot/2nd.img
!!!It will replace your kernel. Remember to copy your boot.img to /data/media/boot/1st.img first!!!
Another pre-built u-boot by me for tri-boot!!!
View attachment GN_U-Boot_Triboot_Kernel.zip
* First Boot -> No keys are pressed, cyan LED ->Find kernel in /data/media/boot/1st.img
* Third Boot -> Volume Up key pressed, green LED -> Find kernel in /data/media/boot/3rd.img
* Second Boot -> Volume Down key pressed, blue LED ->Find kernel in /data/media/boot/2nd.img
!!!It will replace your kernel. Remember to copy your boot.img to /data/media/boot/1st.img first!!!
The pre-compiled version sp3dev provides can only boot one kernel when using android 4.2 system as the main system because sdcard simulation method changed in 4.2 system. The sdcard path is /data/media/0, not /data/media. Sp3dev made the volume down button function to boot from /data/media and it cannot find the kernel we put in sdcard. So I managed to correct the path, successfully boot different kernel on device.
Edit: I change the kernel path to /data/media/boot to make sure the kernel won't be wiped by cwm recovery!
With the help of sp3dev, I successfully change the location of the custom boot kernel to /data/media/boot/2nd.img and the normal boot kernel to /data/media/boot/1st.img.
Firstly, I downloaded the source file of u-boot (https://github.com/Ksys-labs/uboot-tuna) and ARM cross-compiler codesourcery 2010q1-188 version. Exact them to the folder you like.
Change some configuration in /u-boot-source/include/configs/omap4_tuna.h.
Find the following lines.
Code:
"kernel_name=/boot/vmlinux.uimg\0" \
"script_img/boot/vmlinux.scr.uimg\0" \
Change to
Code:
"kernel_name=/meida/boot/1st.img\0" \
"script_img/media/boot/1st.scr.uimg\0" \
And find
Code:
"boot_system=echo Booting SYSTEM; "\
Change one of the lines below it from
Code:
"setenv kernel_part 0xa; " \
to
Code:
"setenv kernel_part 0xc; " \
This one changes the normal boot kernel location and kernel file name to /data/media/boot/1st.img
Now we correct the location for custom boot kernel location. Find the following lines.
Code:
"boot_custom_emmc=echo Booting custom image; " \
"tuna_set_led 4; " \
"setenv loadaddr 0x81f00000; " \
"setenv script_img media/boot/vmlinux.scr.uimg; " \
"setenv kernel_name media/boot/vmlinux.uimg; " \
"setenv script_part 0xc; " \
"setenv kernel_part 0xc; " \
"setenv rootpart 0xc; " \
"setenv devnum 0; " \
"setenv devtype mmc; " \
"setenv bootargs " \
"${dev_extras} root=/dev/${devname}${rootpart} rootwait ro ;"\
"run load_boot_script; " \
"run custom_boot\0" \
Change to
Code:
"boot_custom_emmc=echo Booting custom image; " \
"tuna_set_led 4; " \
"setenv loadaddr 0x81f00000; " \
"setenv script_img /media/boot/2nd.scr.uimg; " \
"setenv kernel_name /media/boot/2nd.img; " \
"setenv script_part 0xc; " \
"setenv kernel_part 0xc; " \
"setenv rootpart 0xc; " \
"setenv devnum 0; " \
"setenv devtype mmc; " \
"setenv bootargs " ANDROID_CMDLINE " ;"\
"run load_boot_script; " \
"run custom_boot\0" \
Save the file and recompile the u-boot using the following script. (Go to source folder first.)
Code:
export PATH=/home/hoary/codesourcery/bin:$PATH
#Note: You should change the path to your codesourcery compiler location.
export ARCH=arm
export CROSS_COMPILE=arm-none-eabi-
make clean
make distclean
make omap4_tuna_config
make -j8 omap4_tuna
And you can find u-boot.bin in your source folder.
Find pre-compiled mkbootimg to make u-boot.bin a flashable img in CWM recovery.
View attachment mkboot-script.zip
Code:
mkbootimg --kernel u-boot.bin --ramdisk /dev/null -o u-boot.aimg
And copy your current kernel (boot.img) to /data/media/boot/1st.img. Using CWM flashable zip or fastboot to flash u-boot to boot partition.
Code:
CWM zip updater-script
package_extract_file("u-boot.aimg", "/dev/block/platform/omap/omap_hsmmc.0/by-name/boot");
Fastboot
fastboot flash boot u-boot.aimg
Step 2: How to Modify the Kernel
There are three ways to modify the kernel.
First one is called image boot, which means we can boot just from images on our device, like system.img, data.img, cache.img.
Second one is called image folder mix boot, which means we can boot from system.img and /data/media/2nd/data, /data/media/2nd/cache folders.
Third one is called folder cache boot, which means we boot from cache partition (mmcblk0p11) and /data/media/2nd/data, /data/media/2nd/cache folders.
I recommand the image boot, because it won't have the possiblity to influence our real system.
Let's begin.
Part I: Image Boot --Booting from images.
See details in https://github.com/dlhxr/2nd-kernel-for-galaxy-nexus/tree/image_boot
An image boot kernel based on learnkernel 6.2 for 4.2
View attachment 2nd_image_boot.7z
This one is color-fixed.
View attachment 2nd_image_boot_color_fixed.7z
Partition relation in the kernel
Code:
system /rdata/media/rom/system.img
data /rdata/media/rom/data.img
cache /rdata/media/rom/cache.img
rdata is the original data partition /dev/block/platform/omap/omap_hsmmc.0/by-name/userdata and I mount it to /rdata instead of /data.
Modify your own kernel
After some study in xda developer Jijonhyuni’s dual boot kernel and a Chinese DHD Multi-boot thread, I managed to change the partition relation in the kernel. There are two files needing to be modified and one file need to be added.
But firstly we should unpack a compiled boot.img for the modification. Using unpackbootimg.
(
One script modified by me. View attachment mkboot-script.zip
See details in extract.sh and pack_boot.sh
Remember to use chmod command to make files in tools folder executable.
Code:
chmod +x ./tools/mkbootimg ./tools/mkbootfs ./tools/unpackbootimg
)
Code:
unpackbootimg –i boot.img
You can get five files.
Code:
boot.img-base
boot.img-cmdline
boot.img-pagesize
boot.img-ramdisk.gz
boot.img-zImage
Unpack the boot.img-ramdisk.gz using
Code:
mkdir ramdisk
cd ramdisk
gzip -dc ../boot.img-ramdisk.gz | cpio –i
OK, let's add a busybox binary.
View attachment busybox.zip
Unzip it and copy busybox to /ramdisk/sbin/busybox.
Then modify two files in ramdisk folder, init.tuna.rc and fstab.tuna.
Find fstab.tuna and modify the system, cache and data mounting line. (Don't forget to delete the check parameter in the data mounting line!)
Code:
[COLOR="Red"]#[/COLOR]/dev/block/platform/omap/omap_hsmmc.0/by-name/system /system ext4 ro wait
/dev/block/platform/omap/omap_hsmmc.0/by-name/efs /factory ext4 ro wait
[COLOR="Red"]#[/COLOR]/dev/block/platform/omap/omap_hsmmc.0/by-name/cache /cache ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait,check
/dev/block/platform/omap/omap_hsmmc.0/by-name/userdata [COLOR="Red"]/rdata[/COLOR] ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic [COLOR="Red"]wait,encryptable[/COLOR]=/dev/block/platform/omap/omap_hsmmc.0/by-name/metadata
Then find init.tuna.rc.
The on fs part. Change it to this.
Code:
on fs
mkdir /factory 0775 radio radio
mkdir /rdata 0771 system system
mount_all /fstab.tuna
exec /sbin/busybox mount -t ext4 -o ro /rdata/media/rom/system.img /system
exec /sbin/busybox mount -t ext4 -o noatime,nosuid,nodev,nomblk_io_submit,errors=panic,rw /rdata/media/rom/data.img /data
exec /sbin/busybox mount -t ext4 -o noatime,nosuid,nodev,nomblk_io_submit,errors=panic,rw /rdata/media/rom/cache.img /cache
setprop ro.crypto.fuse_sdcard true
Modifications are done and we need to repack the kernel using following command.
Code:
mkbootfs ramdisk | gzip > ramdisk-new.gz
mkbootimg --cmdline "no_console_suspend=1 console=null " --base 0x10000000 --pagesize 2048 --kernel boot.img-zImage --ramdisk ramdisk-new.gz -o 2nd.img
The parameters like cmdline, base and pagesize can be found in the exact files boot.img-base, boot.img-cmdline, boot.img-pagesize.
If you have a serious color problem using this kernel, you need to add "mms_ts.panel_id=18" to cmdline parameter when repacking the kernel.
Put it in /data/media/boot/2nd.img.
Make some img files by dd command in Ubuntu or other linux system.
Code:
dd if=/dev/zero bs=1M count=500 >> 500.img
And then use mke2fs format the image to ext4 file system.
Code:
mke2fs –T ext4 500.img
Rename them and put them into /data/media/rom/xxx.img
View attachment IMGs.zip Images from 50M to 800M pre-made by me.
Part II: Image Folder Mix Boot --Booting from image and folders.
See details in https://github.com/dlhxr/2nd-kernel-for-galaxy-nexus/tree/image_folder_boot
An Image folder boot kernel based on learnkernel 6.2 for 4.2
View attachment 2nd_image_folder_boot.7z
Partition relation in the kernel
Code:
system /rdata/media/2nd/system.img
data /rdata/media/2nd/data
cache /rdata/media/2nd/cache
rdata is the original data partition /dev/block/platform/omap/omap_hsmmc.0/by-name/userdata and I mount it to /rdata instead of /data.
Modify your own kernel
Firstly, unpack the boot.img using the method in the second post.
Find fstab.tuna and modify the system, cache and data mounting line. (Don't forget to delete the check parameter in the data mounting line!)
Code:
[COLOR="Red"]#[/COLOR]/dev/block/platform/omap/omap_hsmmc.0/by-name/system /system ext4 ro wait
/dev/block/platform/omap/omap_hsmmc.0/by-name/efs /factory ext4 ro wait
[COLOR="Red"]#[/COLOR]/dev/block/platform/omap/omap_hsmmc.0/by-name/cache /cache ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait,check
/dev/block/platform/omap/omap_hsmmc.0/by-name/userdata [COLOR="Red"]/rdata [/COLOR] ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic [COLOR="Red"]wait,encryptable[/COLOR]=/dev/block/platform/omap/omap_hsmmc.0/by-name/metadata
Then find init.tuna.rc.
The on fs part. Change it to this.
Code:
on fs
mkdir /factory 0775 radio radio
mkdir /rdata 0771 system system
mount_all /fstab.tuna
exec /sbin/busybox mount -t ext4 -o ro /rdata/media/2nd/system.img /system
mkdir /rdata/media/2nd
mkdir /rdata/media/2nd/data 0775 system system
mkdir /rdata/media/2nd/cache 0775 system cache
exec /sbin/busybox mount --bind /rdata/media/2nd/data /data
exec /sbin/busybox mount --bind /rdata/media/2nd/cache /cache
setprop ro.crypto.fuse_sdcard true
Thirdly, put busybox binary into /ramdisk/sbin/busybox
At last repack the boot.img.
You can find how to make images in Part I: Image Boot.
Part III: Folder Cache Boot
See details in https://github.com/dlhxr/2nd-kernel-for-galaxy-nexus/tree/folder_boot
I call this way to modify the kernel ----Folder Boot.
here is one folder boot kernel packed by me based on leankernel 6.2
View attachment 2nd_folder_boot.7z
The partition relation in the 2nd kernel is
Code:
system /dev/block/platform/omap/omap_hsmmc.0/by-name/cache
data /rdata/media/2nd/data
cache /rdata/media/2nd/cache
rdata is the original data partition /dev/block/platform/omap/omap_hsmmc.0/by-name/userdata and I mount it to /rdata instead of /data.
There are two files needing to be modified and one file need to be added.
Unpack the boot.img.
Firstly, let's add a busybox binary.
View attachment busybox.zip
Unzip it and copy busybox to /ramdisk/sbin/busybox.
Then modify two files in ramdisk folder, init.tuna.rc and fstab.tuna
fstab.tuna
Change like this
Code:
/dev/block/platform/omap/omap_hsmmc.0/by-name/[B][COLOR="Red"]cache[/COLOR][/B] /system ext4 ro wait
/dev/block/platform/omap/omap_hsmmc.0/by-name/efs /factory ext4 ro wait
[B][COLOR="Red"]#[/COLOR][/B]/dev/block/platform/omap/omap_hsmmc.0/by-name/cache /cache ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait,check
/dev/block/platform/omap/omap_hsmmc.0/by-name/userdata /[B][COLOR="Red"]rdata[/COLOR][/B] ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait,check,encryptable=/dev/block/platform/omap/omap_hsmmc.0/by-name/metadata
Init.tuna.rc
Find on fs and change like this
on fs
Code:
mkdir /factory 0775 radio radio
[B][COLOR="Red"]mkdir /rdata 0771 system system[/COLOR][/B]
mount_all /fstab.tuna
[B][COLOR="Red"]mkdir /rdata/media/2nd
mkdir /rdata/media/2nd/data 0775 system system
mkdir /rdata/media/2nd/cache 0775 system cache
exec /sbin/busybox mount --bind /rdata/media/2nd/data /data
exec /sbin/busybox mount --bind /rdata/media/2nd/cache /cache[/COLOR][/B]
setprop ro.crypto.fuse_sdcard true
Then find # virtual sdcard daemon running as media_rw (1023)
Change from
Code:
service sdcard /system/bin/sdcard /data/media /mnt/shell/emulated 1023 1023
to
Code:
service sdcard /system/bin/sdcard[B][COLOR="Red"] /rdata/media[/COLOR][/B] /mnt/shell/emulated 1023 1023
Repack the 2nd.img and put it in /data/media/boot/2nd.img.
Step 3: How to Modify the updater-script in the Flashable Zip Installer.
Part I: Image Boot
Firstly, add following lines below the first line. assert(getprop("ro.product.device") == "maguro" || getprop("ro.build.product") == "maguro");
Code:
unmount("system");
unmount("data");
unmount("cache");
run_program("/sbin/mkdir", "/rdata");
run_program("/sbin/mount", "-t", "ext4", "/dev/block/platform/omap/omap_hsmmc.0/by-name/userdata", "/rdata");
Replace the following line
Code:
mount("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/system", "/system");
by
Code:
run_program("/sbin/losetup", "/dev/block/loop1", "/rdata/media/rom/system.img");
run_program("/sbin/mount", "-t", "ext4", "/dev/block/loop1", "/system");
Replace the following lines
Code:
format("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/system", "0", "/system");
mount("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/system", "/system");
by
Code:
run_program("/sbin/losetup", "/dev/block/loop1", "/rdata/media/rom/system.img");
run_program("/sbin/mke2fs", "-T", "ext4", "/dev/block/loop1");
run_program("/sbin/mount", "-t", "ext4", "/dev/block/loop1", "/system");
Replace the following line
Code:
mount("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/userdata", "/data");
by
Code:
run_program("/sbin/losetup", "/dev/block/loop2", "/realdata/media/rom/data.img");
run_program("/sbin/mount", "-t", "ext4", "/dev/block/loop2", "/data");
Replace the following line (not include the lines you add at first.)
Code:
unmount("data");
by
Code:
run_program("/sbin/umount", "-d", "/data");
Replace the following line (not include the lines you add at first.)
Code:
unmount("system");
by
Code:
run_program("/sbin/umount", "-d", "/system");
Delete the following line
Code:
package_extract_file("boot.img", "/dev/block/platform/omap/omap_hsmmc.0/by-name/boot");
Add the following line in the end
Code:
run_program("/sbin/umount", "/rdata");
Part II: Image Folder Mix Boot
Firstly, add following lines below the first line. assert(getprop("ro.product.device") == "maguro" || getprop("ro.build.product") == "maguro");
Code:
unmount("system");
unmount("data");
unmount("cache");
run_program("/sbin/mkdir", "/realdata");
run_program("/sbin/mount", "-t", "ext4", "/dev/block/platform/omap/omap_hsmmc.0/by-name/userdata", "/rdata");
Replace the following line
Code:
mount("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/system", "/system");
by
Code:
run_program("/sbin/losetup", "/dev/block/loop1", "/rdata/media/2nd/system.img");
run_program("/sbin/mount", "-t", "ext4", "/dev/block/loop1", "/system");
Replace the following lines
Code:
format("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/system", "0", "/system");
mount("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/system", "/system");
by
Code:
run_program("/sbin/losetup", "/dev/block/loop1", "/rdata/media/2nd/system.img");
run_program("/sbin/mke2fs", "-T", "ext4", "/dev/block/loop1");
run_program("/sbin/mount", "-t", "ext4", "/dev/block/loop1", "/system");
Delete the following line
Code:
mount("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/userdata", "/data");
Delete the following line (not include the lines you add at first.)
Code:
unmount("data");
Replace the following line (not include the lines you add at first.)
Code:
unmount("system");
by
Code:
run_program("/sbin/umount", "-d", "/system");
Delete the following line
Code:
package_extract_file("boot.img", "/dev/block/platform/omap/omap_hsmmc.0/by-name/boot");
Add the following line in the end
Code:
run_program("/sbin/umount", "/rdata");
Modify the orginal line related to data partition. For example.
Replace the following line
Code:
package_extract_dir("data", "/data");
by
Code:
package_extract_dir("data", "/rdata/media/2nd/data");
Part III: Folder Cache Boot
Modify the updater-script to mount /dev/block/platform/omap/omap_hsmmc.0/by-name/cache to /system.
And rember to wipe your cache in CWM recovery, before apply the zip file.
You can also use twistedumbrella's app Dual-Boot Builder to install the system as folder cache boot system.
http://forum.xda-developers.com/showthread.php?t=2192064
Delete the following line in updater-script
Code:
format("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/system", "0", "/system");
Delete the following line in updater-script
Code:
package_extract_file("boot.img", "/dev/block/platform/omap/omap_hsmmc.0/by-name/boot");
Replace the following line in updater-script
Code:
mount("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/system", "/system");
by
Code:
mount("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/cache", "/system");
And replace the package extract for data like this.
Code:
package_extract_dir("data", "/data");
To
Code:
package_extract_dir("data", "/data/media/2nd/data");
Re: [KERNEL] [U-boot]Dual-boot Powered by U-boot and Custom Kernel [24/03]
So if I follow, this is doing the same thing the current dual boot kernels do but needs two kernels?
keep trying... true multi boot will be awesome
In theory this is the u-boot kernel with both the first and second kernel for running two 4.2 ROMs. I haven't tested it, but it should fix the issues with the second kernel by fixing the fstab and then symlinking the directories instead of all that realdata stuff that didn't match up to anything
twistedumbrella said:
In theory this is the u-boot kernel with both the first and second kernel for running two 4.2 ROMs. I haven't tested it, but it should fix the issues with the second kernel by fixing the fstab and then symlinking the directories instead of all that realdata stuff that didn't match up to anything
Click to expand...
Click to collapse
Thank you so much.
But i tested it and something was wrong.
The screen said Cannot mount filesystem on /dev/block/platform/omap/omap_hsmmc.0/by-name/system at /data/media/2nd/system.
And other stuffs...
I see in your fstab.tuna.
Code:
/dev/block/platform/omap/omap_hsmmc.0/by-name/system /data/media/2nd/system ext4 noatime,ro wait
/dev/block/platform/omap/omap_hsmmc.0/by-name/efs /factory ext4 ro wait
/dev/block/platform/omap/omap_hsmmc.0/by-name/cache /data/media/2nd/cache ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic,noauto_da_alloc,data=writeback wait,check
/dev/block/platform/omap/omap_hsmmc.0/by-name/userdata /data/media/2nd/data ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic,noauto_da_alloc,data=writeback wait,check,encryptable=/dev/block/platform/omap/omap_hsmmc.0/by-name/metadata
The second parameter is the mount point, right?
/data/media/2nd/system seems not work.....
dlhxr said:
Thank you so much.
But i tested it and something was wrong.
The screen said Cannot mount filesystem on /dev/block/platform/omap/omap_hsmmc.0/by-name/system at /data/media/2nd/system.
And other stuffs...
I see in your fstab.tuna.
Code:
/dev/block/platform/omap/omap_hsmmc.0/by-name/system /data/media/2nd/system ext4 noatime,ro wait
/dev/block/platform/omap/omap_hsmmc.0/by-name/efs /factory ext4 ro wait
/dev/block/platform/omap/omap_hsmmc.0/by-name/cache /data/media/2nd/cache ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic,noauto_da_alloc,data=writeback wait,check
/dev/block/platform/omap/omap_hsmmc.0/by-name/userdata /data/media/2nd/data ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic,noauto_da_alloc,data=writeback wait,check,encryptable=/dev/block/platform/omap/omap_hsmmc.0/by-name/metadata
The second parameter is the mount point, right?
/data/media/2nd/system seems not work.....
Click to expand...
Click to collapse
# Android fstab file.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
It's not working because you can't really mount something to data without mounting data first and you are trying to have a second data folder inside the first. Basically, the way you are trying to do it won't work.
twistedumbrella said:
# Android fstab file.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
It's not working because you can't really mount something to data without mounting data first and you are trying to have a second data folder inside the first. Basically, the way you are trying to do it won't work.
Click to expand...
Click to collapse
So it is the end?
/data/2nd/system is even not a mount point, but why you write it in fstab.tuna?
How did the dual-boot work deal with the first-mount stuff?
dlhxr said:
So it is the end?
/data/2nd/system is even not a mount point, but why you write it in fstab.tuna?
How did the dual-boot work deal with the first-mount stuff?
Click to expand...
Click to collapse
dlhxr said:
Since I don’t want the 2nd system to have any influence on the 1st system, I choose to put 2nd system into data partition. The partition relation in the 2nd kernel is
Code:
[B][I][U][SIZE="3"]system /data/media/2nd/system[/SIZE][/U][/I][/B]
data /data/media/2nd/data
cache /data/media/2nd/cache
Click to expand...
Click to collapse
/dev/block/platform/omap/omap_hsmmc.0/by-name/system /data/media/2nd/system ext4 noatime,ro wait
I have it that way because you said that was where you were trying to mount...
If this one doesn't work, then you need to restructure the directories to have your "fake" folder as a top-level directory like /udata
twistedumbrella said:
/dev/block/platform/omap/omap_hsmmc.0/by-name/system /data/media/2nd/system ext4 noatime,ro wait
I have it that way because you said that was where you were trying to mount...
If this one doesn't work, then you need to restructure the directories to have your "fake" folder as a top-level directory like /udata
Click to expand...
Click to collapse
ah, I didn't explain myself well....
What I want is to mount /mmcblk0p12(realdata)/media/2nd/system to /system.....etc.
dlhxr said:
ah, I didn't explain myself well....
What I want is to mount /mmcblk0p12(realdata)/media/2nd/system to /system.....etc.
Click to expand...
Click to collapse
mmcblk0p12 mounts as /data in the first ROM correct? So in the second ROM, you are mounting a subdirectory of /data, otherwise you just overwrite the first ROMs data. Maybe it's better to leave you to it.
twistedumbrella said:
mmcblk0p12 mounts as /data in the first ROM correct? So in the second ROM, you are mounting a subdirectory of /data, otherwise you just overwrite the first ROMs data. Maybe it's better to leave you to it.
Click to expand...
Click to collapse
When I boot into the second rom kernel, I need to firstly mount mmcblk0p12 to /realdata and then mount its subdirectory to /data.
When I am in second rom, it would not influence the first rom because I even didn't load the first rom....
twistedumbrella said:
mmcblk0p12 mounts as /data in the first ROM correct? So in the second ROM, you are mounting a subdirectory of /data, otherwise you just overwrite the first ROMs data. Maybe it's better to leave you to it.
Click to expand...
Click to collapse
I made it work and updated my second post in this thread.
But in the second system there's no root access and I can't see what's in data and what's in cache in root explorer....
Don't know what's wrong.
dlhxr said:
I made it work and updated my second post in this thread.
But in the second system there's no root access and I can't see what's in data and what's in cache in root explorer....
Don't know what's wrong.
Click to expand...
Click to collapse
Try this one. I know what's in it and I can explain it if it works, but I don't have a setup to test it on.
twistedumbrella said:
Try this one. I know what's in it and I can explain it if it works, but I don't have a setup to test it on.
Click to expand...
Click to collapse
It doesn't work showing system not mounted (can't find /system/xxxxxx)
I unpacked your kernel and I think we should remove the check part during mounting realdata in fstab.tuna because it uses e2fsck in the system partition to check whether the partition mounted right or not, which lead to an error.
After I changed this, the system boots! But still no root access.....
Maybe my updater-script modification is not right?
At last, great work! Thanks a lot!
dlhxr said:
It doesn't work showing system not mounted (can't find /system/xxxxxx)
I unpacked your kernel and I think we should remove the check part during mounting realdata in fstab.tuna because it uses e2fsck in the system partition to check whether the partition mounted right or not, which lead to an error.
After I changed this, the system boots! But still no root access.....
Maybe my updater-script modification is not right?
At last, great work! Thanks a lot!
Click to expand...
Click to collapse
https://github.com/ThePlayground/uboot-tuna
dlhxr said:
Another u-boot searching another location for kernel by me.
View attachment 1834529
* Normal Boot -> no keys are pressed, cyan LED ->Find kernel in /data/media/boot/1st.img
* Recovery Boot -> Volume Up key pressed, green LED -> Go to recovery
* Custom Boot -> Volume Down key pressed, blue LED ->Find kernel in /data/media/boot/2nd.img
Note: It will replace your kernel. Remember to copy your boot.img to /data/media/boot/1st.img first!
Click to expand...
Click to collapse
Classy... but I have one better for ya:
http://forum.xda-developers.com/showthread.php?t=2009485
twistedumbrella said:
https://github.com/ThePlayground/uboot-tuna
Click to expand...
Click to collapse
it is very interesting...
I followed your git and made the same change (init.rc, init.tuna.rc, fstab.tuna) for leankernel 6.2 and it didn't work...
It is stuck in the u-boot bootimg 2nd kernel on the screen...

[Q] [T3buntu] - GT-P5210, Loop device

Hi
I'm trying to install this http://forum.xda-developers.com/showthread.php?t=2573441 on my freshly bought and updated GT-P5210 (rooted stock rom).
The script runs to the point where it has to mount the Image. (using the script from the post)
Code:
$bbox mount -t ext2 /dev/block/loop255 $mnt
This fails with 'invalid parameter', and if i remove '-t ext2' it fails with I/O error
Code:
[email protected]:/ $
[email protected]:/ $ cd /storage/extSdCard/Img
[email protected]:/storage/extSdCard/Img $ su
[email protected]:/storage/extSdCard/Img # sh /data/data/com.zpwebsites.linuxonandroid/files/bootscript.sh /storage/extSdCard/Img/t3buntuv1.2_20131216.img
Checking loop device... FOUND
mount: mounting /dev/block/loop255 on /data/local/mnt failed: Invalid argument
Error: Unable to mount the loop device!
1|[email protected]:/storage/extSdCard/Img #
Do I tell busybox to overwrite the 'mount' command?
I used TWRP for root/recovery instead of CWM if that makes a difference.
Best Regards
*Edit, turns out it was a bodged image file transfer

Unbricking my Fonepad7 k00e with a currupted partition.

Here are the facts:
my tablet was throwing errors about google app and google search box crashing. I restarted the tablet and it got stuck at boot loop.
K00E with firmware,UL-K00E-WW-7.6.0.0-user, not rooted.
what I've tried:
factory reset under droidboot:
Code:
E:failed to mount /cache (Invalid argument)
unable to mount /cache! we skip check debricking
SD download of the latest RAW file under under droidboot:
again
Code:
E:failed to mount /cache (Invalid argument)
unable to mount /cache!
Installing the firmware zip file using custom recovery:
I used this to run CWM. I cleared cache, user data, factory reset and then tried to install using external SD zip file.
Code:
failed to mount /dev/block/mmcblk0p8 at /system: Invalid argument
trying to re partition the internal SD:
from here
I tried to run parted to fix it but I am getting this
Code:
~ # parted
parted
/sbin/parted: line 1: syntax error: unexpected word (expecting ")")
~ #
I added no arguments to parted, and still it is giving me this error. I even tried pushing another copy of parted and chmodding it to execute it, still the same thing occurs.
I also tried this
on running th second command I have
Code:
~ # tune2fs -O extents,uninit_bg,dir_index -C 1 /dev/block/mmcblk0p8
tune2fs -O extents,uninit_bg,dir_index -C 1 /dev/block/mmcblk0p8
tune2fs 1.41.11 (14-Mar-2010)
tune2fs: Bad magic number in super-block while trying to open /dev/block/mmcblk0
p8
Couldn't find valid filesystem superblock.
~ #
any ideas how to move forward?

How to unpack & repack GSIs? I want to edit GSIs so I can make it smaller then flash it [Question]

I want a method/tool to unpack and repack GSIs, I want to do some edits like removing unnecessary bloatware to make GSI smaller in size so I can flash it on my device. There is custom android 12 GSI I want to flash it on my device (Evolution X), it's size about 4 GB after extracting and System Image partition in my device is 3 GB and 3.5 GB after resize by TWRP recovery and still can't flash it (Size of image is larger than target device). so how can I unpack to do some edits and repack it again?
on Linux environment (ubuntu)
write the following in the terminal
Code:
mkdir folder_d
mount -o loop,rw nam_of_GSI.img folder_d
then open folder_d and delete "system_ext/apex/com.android.vndk.vXX" where xx other vndk (if your device vndk 28 then delere other files 29,30,31, 32)
then write the following in the terminal
Code:
umount d
e2fsck -f -y nam_of_GSI.img || true
resize2fs -M nam_of_GSI.img
or you can use this script
https://github.com/Abdelhay-Ali/huawei-creator/blob/android-13/run-huawei-ab-a13-yahia.sh
Abdelhay.ali said:
on Linux environment (ubuntu)
write the following in the terminal
Code:
mkdir folder_d
mount -o loop,rw nam_of_GSI.img folder_d
then open folder_d and delete "system_ext/apex/com.android.vndk.vXX" where xx other vndk (if your device vndk 28 then delere other files 29,30,31, 32)
then write the following in the terminal
Code:
umount d
e2fsck -f -y nam_of_GSI.img || true
resize2fs -M nam_of_GSI.img
or you can use this script
https://github.com/Abdelhay-Ali/huawei-creator/blob/android-13/run-huawei-ab-a13-yahia.sh
Click to expand...
Click to collapse
You Android hero! Thanks for your help.

Categories

Resources