[TOOLS] Mstar Android TV firmware tools - Android Software Development

Mstar Android TV firmware tools​Phython 3.4+ required.
Currently available tools:
unpack.py - unpack MStar bin firmware
pack.py - pack MStar bin firmware
extract_keys.py - extract AES and RSA-public keys from MBOOT binary
secure_partition.py - encrypt image and generate signature file
Unpack MStar bin firmware files
Code:
Usage: unpack.py <firmware> <output folder [default: ./unpacked/]>
<firmware> - MStar bin firmware to unpack
<output folder> - directory to store unpacked stuff. Default value: ./unpacked/
Pack MStar bin firmware
Usage: pack.py <config file>
Code:
Example: pack.py configs/letv-x355pro-full.ini
<config file> - Configuration file. The config file structure will be described later.
For now you can take a look at configs/letv-x355pro-full.ini
and use it as an example
Extract keys from MBOOT
That tool is used to get AES and public RSA keys from the MBOOT. AES keys are needed to encrypt/decrypt boot.img and recovery.img images. aescrypt2 tool is used.
Code:
Usage: extract_keys.py <path to mboot> [<folder to store keys>] [<key bank offset>] [<key bank size>]
Defaults:
<folder to store keys> keys
<key bank offset> 0x168e00
<key bank size> 0x450
Example: extract_keys.py ./unpacked/MBOOT.img
Example: extract_keys.py ./unpacked/MBOOT.img ./keys 0x169e00 0x450
Encrypt partition and generate signature
All new MStar builds have SECURE_BOOT option enabled. In that case boot.img and recovery.img is encrypted (AES) and signed with RSA priv keys. That script is used to encrypt image and generate sign file.
To manually encrypt|decrypt image use aescrypt tool from bin folder. AES key can be extracted from MBOOT with extract_keys.py script.
Code:
Usage: secure_partition.py <file to encrypt> <AES key file> <RSA private key file> <RSA public key file> <output encrypted file> <output signature file>
Example: secure_partition.py ./pack/boot.img ./keys/AESbootKey ./keys/RSAboot_priv.txt ./keys/RSAboot_pub.txt ./pack/boot.img.aes ./pack/bootSign
Download tools:
https://github.com/dipcore/mstar-bin-tool

reserved

hi how to backup mstar tv partition including tee.img and sboot.bin?
is there any way to backup them?
i cant find my specific firmware for my mstar CV628H_B42 32SX250 (32EX250F) ctvupgrade.bin

bamster89 said:
hi how to backup mstar tv partition including tee.img and sboot.bin?
is there any way to backup them?
i cant find my specific firmware for my mstar CV628H_B42 32SX250 (32EX250F) ctvupgrade.bin
Click to expand...
Click to collapse
You can use dd tool and create needed images. All what you need is here: /dev/block/platform/mstar_mci.0/by-name/ root is required.
Another way to do so is to create a back up of whole emmc device and then using any hex editor just slice it on required partitions (emmc header structure is pretty straightforward).
You can do it via mboot console (uart acces is required) or you can flash specially prepared firmware bin (look at https://github.com/dipcore/mstar-bin-tool/blob/master/configs/letv-emmc2usb.ini as an example). Basically that bin will just run couple mboot commands to start copying emmc to usb device.
PS You can access to debugging uart via VGA port on the TV. Use 12 and 15 pins (see attachment). 99% of mstar based TV have uart routed to those unused pins on VGA port. So no need to open TV and solder something.
Take a look on this:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

dipcore said:
You can do it via mboot console (uart acces is required) or you can flash specially prepared firmware bin (look at https://github.com/dipcore/mstar-bin-tool/blob/master/configs/letv-emmc2usb.ini as an example). Basically that bin will just run couple mboot commands to start copying emmc to usb device.
Click to expand...
Click to collapse
i modify this 2 lines in configs/letv-emmc2usb.ini
FirmwareFileName=CtvUpgrade.bin
......
#emmcbin 0 to emmcbin 0
.......
setenv CtvUpgrade_complete 1
and pack after that ,,
i upgrade my mstar in factory menu Source +2580 ..,, and it reboot instantly and there is no partition save in USB.,
this is my MBOOT.img
https://mega.nz/#!LBgQjZbZ!ZirBzDOwbJrz6q-wD7gnikeNPGnVXfD8nGyKiaVkPls

bamster89 said:
i upgrade my mstar in factory menu Source +2580 ..,, and it reboot instantly and there is no partition save in USB
Click to expand...
Click to collapse
Its two step process.
1. EMMC backup. Prepare and flash 1st bin file:
Code:
[Main]
FirmwareFileName=CtvUpgrade.bin
ProjectFolder=./pack
useHexValuesPrefix=false
SCRIPT_FIRMWARE_FILE_NAME=${FirmwareFileName}
DRAM_BUF_ADDR=20200000
MAGIC_FOOTER=12345678
HEADER_SIZE=16KB
[HeaderScript]
Prefix:
mmc dd mmc2usb 0
Suffix:
# Nothing here
It will take some time to copy it to usb drive (in my case it was like 25 minutes)
2. Restore normal boot process. Pack and flash 2-nd bin:
Code:
[Main]
FirmwareFileName=CtvUpgrade.bin
ProjectFolder=./pack
useHexValuesPrefix=false
SCRIPT_FIRMWARE_FILE_NAME=${FirmwareFileName}
DRAM_BUF_ADDR=20200000
MAGIC_FOOTER=12345678
HEADER_SIZE=16KB
[HeaderScript]
Prefix:
setenv MstarUpgrade_complete 1
setenv ForcePowerOn 0
saveenv
Suffix:
# Nothing here
After flasing it will restore normal boot process.

One more thing, in the line
mmc dd mmc2usb 0
it uses usb port #0 in the TV. I do not know where is it located in your TV. You may try all usb ports. If that did not worked then just change it to
mmc dd mmc2usb 1 etc

dipcore said:
One more thing, in the line
mmc dd mmc2usb 0
it uses usb port #0 in the TV. I do not know where is it located in your TV. You may try all usb ports. If that did not worked then just change it to
mmc dd mmc2usb 1 etc
Click to expand...
Click to collapse
i already did changing 0-3 and try to put 3 usb on each port each usb have CtvUpgrade.bin same thing happens no partition created on usb ithink my MBOOT does not allow me to use mmc dd mmc2usb and emmcbin
all i did is to manually backup using dd in terminal
this is my fstab.madison
HTML:
[email protected]_caixun_international:/ # cat fstab.madison
# Android fstab file.
#<src> <mnt_point> <type> <mnt_flags> <fs_mgr_flags>
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
/dev/block/platform/mstar_mci.0/by-name/system /system ext4 ro wait
/dev/block/platform/mstar_mci.0/by-name/cache /cache ext4 noatime,nosuid,nodev wait,block_validity,nodiscard,data=ordered,journal_checksum
/dev/block/platform/mstar_mci.0/by-name/userdata /data ext4 noatime,nosuid,nodev wait,block_validity,nodiscard,data=ordered,journal_checksum
/dev/block/platform/mstar_mci.0/by-name/tvservice /tvservice ext4 ro wait
/dev/block/platform/mstar_mci.0/by-name/tvconfig /tvconfig ext4 noatime,nosuid,nodev wait,block_validity,nodiscard,data=ordered,journal_checksum
/dev/block/platform/mstar_mci.0/by-name/tvdatabase /tvdatabase ext4 noatime,nosuid,nodev wait,block_validity,nodiscard,data=ordered,journal_checksum
/dev/block/platform/mstar_mci.0/by-name/tvcustomer /tvcustomer ext4 noatime,nosuid,nodev wait,block_validity,nodiscard,data=ordered,journal_checksum
/dev/block/platform/mstar_mci.0/by-name/usersdcard /usersdcard vfat noatime,nosuid,nodev wait,block_validity,nodiscard,data=ordered,journal_checksum
/dev/block/platform/mstar_mci.0/by-name/factory /factory ext4 noatime,nosuid,nodev wait,block_validity,nodiscard,data=ordered,journal_checksum
/dev/block/zram0 none swap defaults zramsize=104857600
/dev/block/mmcblk0boot0 /boot1 emmc defaults defaults
/dev/block/mmcblk0boot1 /boot2 emmc defaults defaults
/dev/block/platform/mstar_mci.0/by-name/MBOOT /MBOOT emmc defaults defaults
/dev/block/platform/mstar_mci.0/by-name/MPOOL /MPOOL emmc defaults defaults
/dev/block/platform/mstar_mci.0/by-name/misc /misc emmc defaults defaults
/dev/block/platform/mstar_mci.0/by-name/recovery /recovery emmc defaults defaults
/dev/block/platform/mstar_mci.0/by-name/boot /boot emmc defaults defaults
/dev/block/platform/mstar_mci.0/by-name/RTPM /RTPM ext4 defaults defaults
HTML:
dd if=/dev/block/platform/mstar_mci.0/by-name/system of=/mnt/usb/sda1/DUMP/system.img
dd if=/dev/block/platform/mstar_mci.0/by-name/cache of=/mnt/usb/sda1/DUMP/cache.img
dd if=/dev/block/platform/mstar_mci.0/by-name/userdata of=/mnt/usb/sda1/DUMP/userdata.img
dd if=/dev/block/platform/mstar_mci.0/by-name/tvservice of=/mnt/usb/sda1/DUMP/tvservice.img
dd if=/dev/block/platform/mstar_mci.0/by-name/tvconfig of=/mnt/usb/sda1/DUMP/tvconfig.img
dd if=/dev/block/platform/mstar_mci.0/by-name/tvdatabase of=/mnt/usb/sda1/DUMP/tvdatabase.img
dd if=/dev/block/platform/mstar_mci.0/by-name/tvcustomer of=/mnt/usb/sda1/DUMP/tvcustomer.img
dd if=/dev/block/platform/mstar_mci.0/by-name/usersdcard of=/mnt/usb/sda1/DUMP/usersdcard.img
dd if=/dev/block/platform/mstar_mci.0/by-name/factory of=/mnt/usb/sda1/DUMP/factory.img
dd if=/dev/block/mmcblk0boot0 of=/mnt/usb/sda1/DUMP/boot1.bin
dd if=/dev/block/mmcblk0boot1 of=/mnt/usb/sda1/DUMP/boot2.bin
dd if=/dev/block/platform/mstar_mci.0/by-name/MBOOT of=/mnt/usb/sda1/DUMP/MBOOT.img
dd if=/dev/block/platform/mstar_mci.0/by-name/MPOOL of=/mnt/usb/sda1/DUMP/MPOOL.img
dd if=/dev/block/platform/mstar_mci.0/by-name/misc of=/mnt/usb/sda1/DUMP/misc.img
dd if=/dev/block/platform/mstar_mci.0/by-name/recovery of=/mnt/usb/sda1/DUMP/recovery.img
dd if=/dev/block/platform/mstar_mci.0/by-name/boot of=/mnt/usb/sda1/DUMP/boot.img
dd if=/dev/block/platform/mstar_mci.0/by-name/RTPM of=/mnt/usb/sda1/DUMP/RTPM.img
HTML:
[email protected]_caixun_international:/ # ls /dev/block/platform/mstar_mci.0/by-name/
MBOOT
MPOOL
RTPM
boot
cache
factory
misc
recovery
system
tvconfig
tvcustomer
tvdatabase
tvservice
userdata
usersdcard
ifound this on my MBOOT
HTML:
sar sar Command: (0-base, SAR0~SAR5)
sar <ch#> : ex: sar 0 // read sar channel 0
panel_pre_init - init panel by panel.ini
command: panel_pre_init [option]
-s : static init : panel init para from uboot
-d : dynamic init : panel init para from SN panel_init - init panel by panel.ini
command: panel_init [option]
-s : static init : panel init para from uboot
-d : dynamic init : panel init para from SN panel_post_init backligth on - backlight on
command: backlight_on
mmcinfo display MMC info mmcreg mmcreg show ext-csd <dev num>
- device number of the device to dislay info of
bin2emmc bin2emmc - read bin file and restore it to emmc
command: bin2emmc [usbportnum] [pad] [binname] [offset/partitionname]
emmcbootbin emmcbootbin - dump emmc boot partition and write it to fat usb disk
command: emmcbootbin [usbportnum] [partitionname]
emmcbin emmcbin - dump emmc and restore it to fat usb disk
command: emmcbin [usbportnum] [pad] [binname] [offset/partitionname] [dumpsize]
mmcbininfo mmcbininfo - Valid block num in each partition
command: mmcbininfo [usbportnum]
read[.boot|.gp] [bootpart|gppart] addr blk# size
mmc write[.boot|.gp] [bootpart|gppart] addr blk# size [empty_skip:0-disable,1-enable]
mmc readall - read all blocks for device internal ecc check
mmc crcall - read all blocks and calculate crc32
mmc read.p addr partition_name size
mmc read.p.continue addr partition_name offset size
mmc write.p addr partition_name size [empty_skip:0-disable,1-enable]
mmc write.p.continue addr partition_name offset size [empty_skip:0-disable,1-enable]
mmc rescan
mmc part[.gp] - lists available [GP] partition on current mmc device
mmc look [name] - lists specific partition info on mmc
mmc dev [dev] [part] - show or set current mmc device [partition]
mmc list - lists available devices
mmc create [name] [size]- create/change mmc partition [name]
mmc create.gp part_no size enh_attr ext_attr relwr_attr - create/change eMMC GP partition No.[part_no(0~3)] with size and enhance/extended/reliable_write attribute
mmc create.enhusr start_addr size enha_attr relwr_atrr - create/change eMMC enhance user partition(slc mode) from start_addr with size and enhance/reliable_write attribute
mmc create.complete - complete eMMC gp, enhance user, reliable write partition setting
Note: enh_attr = 0: no slc mode 1: using slc mode, ext_attr = 0: no attr 1: system code 2: Non-persisent, relwr_attr = 0: disable 1: enable reliable write
mmc remove [name] - remove mmc partition [name]
mmc rmgpt - clean all mmc partition table
mmc slc size relwr - set slc in the front of user area, 0xffffffff means max slc size
mmc ecsd - print ecsd register of emmc
mmc setecsd num mask value - set value to num of ecsd according to mask
mmc size - print the mmc size info
mmc slcchk - check the slc/mlc mode of emmc
mmc relwrchk - check the reliable write configuration of emmc
mmc slcrelwrchk - check the slc/mlc mode and reliable write configuration of emmc
mmc unlzo Src_Address Src_Length Partition_Name [empty_skip:0-disable,1-enable]- decompress lzo file and write to mmc partition
mmc erase[.boot] bootpart [blk#] [size]
mmc erase.p partition_name
mmc erase - erase all blocks in device
mmc dd mmc2usb/usb2mmc [portnum] [pad] - dump/restore emmc raw data
mmc alignsize - check the alignment size of slc partition
mmc trim_test [chunk_size] [loop_count] - test read/write performance after trim enabled
eMMC sub system emmc info - lists CSD & ExtCSD on eMMC
emmc init count - reset & init eMMC for count loops
emmc test count - verify eMMC & board signals for count loops
emmc speed [mode]- show eMMC speed sdr or ddr mode @ driver layer
emmc t_table [hs200/ddr] build - build timing table
emmc mode - ddr or sdr
emmc clk - set ClkRegVal
emmc cis - check or erase
emmc pwr_cut init [addr][start block] - eMMC Power Cut Init
emmc pwr_cut test [addr][start block] - eMMC Power Cut Test
emmc reset [0/1] - toggle eMMC reset pin

Maybe this is heplful
MSTAR ROOT_BOOT volume production
https://mega.nz/#!jQIyQJKT!PAnuBXZOPuPvOkoWkhpvk_ZCiHR1UJqAu9IobbemuTU

you do not need to play with bin files, if dd works for you.

bamster89 said:
Maybe this is heplful
MSTAR ROOT_BOOT volume production
https://mega.nz/#!jQIyQJKT!PAnuBXZOPuPvOkoWkhpvk_ZCiHR1UJqAu9IobbemuTU
Click to expand...
Click to collapse
Yes I read it, I used it to create that bin file configs.
Here are more docs: https://github.com/dipcore/Madsion/tree/master/MBoot_Madison_TVOS/doc

My Mstar semi conductor tv stuck on boot animation
plz help
what i am doing now
---------- Post added at 03:33 PM ---------- Previous post was at 03:30 PM ----------
Plz Help my tv stuck on boot animation
I changed the boot animation after my tv is not booting plz help
how to tv in pc and any other solution plz help me someone
---------- Post added at 03:34 PM ---------- Previous post was at 03:33 PM ----------
MStar Semiconductor, Inc. MStar Android TV
MStar Android TV (full.cv6a628h_international)
---------- Post added at 03:37 PM ---------- Previous post was at 03:34 PM ----------
last i doing in tv permission in platform.xml
i thing going wrong in this
and other is boot animation change in media zip file
plz help what i am dong now .............any link of tv firmware to download in tv
thanks in advance

masifkalam said:
plz help
Click to expand...
Click to collapse
1. If you have stock bin or zip firmware just flash it.
2. If you do not have a firmware file, just connect to debugging UART and revert all your changes using console.

dipcore said:
1. If you have stock bin or zip firmware just flash it.
2. If you do not have a firmware file, just connect to debugging UART and revert all your changes using console.
Click to expand...
Click to collapse
dont have stock bin and how connect to pc plz some brief
---------- Post added at 04:58 PM ---------- Previous post was at 04:48 PM ----------
dipcore said:
1. If you have stock bin or zip firmware just flash it.
2. If you do not have a firmware file, just connect to debugging UART and revert all your changes using console.
Click to expand...
Click to collapse
plz some brief for debugging UART i will do
thanks fro reply

masifkalam said:
plz some brief for debugging UART i will do
thanks fro reply
Click to expand...
Click to collapse
look at my post #4 https://forum.xda-developers.com/showpost.php?p=71294095&postcount=4
use VGA port

dipcore said:
look at my post #4 https://forum.xda-developers.com/showpost.php?p=71294095&postcount=4
use VGA port
Click to expand...
Click to collapse
and how console used for revert changes
some examples
thanks dear i will understand these things
---------- Post added at 05:49 PM ---------- Previous post was at 05:25 PM ----------
masifkalam said:
and how console used for revert changes
some examples
thanks dear i will understand these things
Click to expand...
Click to collapse
any other solution for revert changes through pc or recovery mode

masifkalam said:
and how console used for revert changes
some examples
thanks dear i will understand these things
Click to expand...
Click to collapse
It's just shell console with root privileges. Use it as you would use any shell console. I.e. using the sell copy needed files to usb drive then do changes on the PC and copy them back to TV.

dipcore said:
It's just shell console with root privileges. Use it as you would use any shell console. I.e. using the sell copy needed files to usb drive then do changes on the PC and copy them back to TV.
Click to expand...
Click to collapse
shell console with root privileges????? root???
and why copy files to usb first
just revert files from pc through deb uart
debugging uart this cable
http://www.96boards.org/wp-content/uploads/2015/06/uart-to-usb-cable.jpg

masifkalam said:
shell console with root privileges????? root???
and why copy files to usb first
just revert files from pc through deb uart
debugging uart this cable
http://www.96boards.org/wp-content/uploads/2015/06/uart-to-usb-cable.jpg
Click to expand...
Click to collapse
1. Yes ROOT, ROOOT, ROOOOT. It's by default for mstar based TV. So you should get root shell via UART debugging port, of course If your TV vendor did not change that.
2. Yes, you can update it directly from PC. I just provided an example of how to do it. Having shell access you can do a lot of stuff in a many different ways.
3. You can use any cable with usb-uart converter, for instance on pl2303 chip. I'm using similar to this one: https://www.aliexpress.com/item/Fre...lgo_pvid=d98f45a8-1c26-4a5e-bac3-39fdef513502

dipcore said:
1. Yes ROOT, ROOOT, ROOOOT. It's by default for mstar based TV. So you should get root shell via UART debugging port, of course If your TV vendor did not change that.
2. Yes, you can update it directly from PC. I just provided an example of how to do it. Having shell access you can do a lot of stuff in a many different ways.
3. You can use any cable with usb-uart converter, for instance on pl2303 chip. I'm using similar to this one: https://www.aliexpress.com/item/Fre...lgo_pvid=d98f45a8-1c26-4a5e-bac3-39fdef513502
Click to expand...
Click to collapse
thanks dear
i will purchased this and connect to later in this platform
thanks for your time
---------- Post added at 06:41 PM ---------- Previous post was at 06:30 PM ----------
masifkalam said:
thanks dear
i will purchased this and connect to later in this platform
thanks for your time
Click to expand...
Click to collapse
just one thing more
debugging uart connect to tv in stand by position just red light , uart working because my tv automatically restart and off in boot animation
thanks ..............thanks.,,,,,,,,,,,,,,,,,,,,,,thanks...........................dear for your time

Related

[nvflash] A very powerfull tool

Here I will post some information regarding using nvlash tool with ThinkPad Tablet.
NVflash tool is a tool for tegra devices which allows different low level operations such as:
1. reading device partition table
2. partitioning device memory
3. reading a device partition
4. writing a device partition
1 and 3 are usefull for backing up device partitions
2 and 4 are usefull for restoring everything back
After backing up a partition you can split the image to a lot of usefull components and information using your PC. You can even edit or add some files to a partition image, i.e. this tool could help you to root your device at any time you want.
Everything here is just for educational puproses. I'm not resposible for any damage which may occur to your device. Use it at your own risk.
Here's small tutorial. Put attached file 04.EBT.img on your hard disk (/space/android/_tpt/device in my case).
Booting to bootloader
1. Turn off your device and disconnect it from PC
2. Hold Rotation button and press Power button for approx 2 seconds
3. Start nvflash:
Code:
$ nvflash -w --bl /space/android/_tpt/device/04.EBT.img --go
4. Connect device via USB. After that you should able to see the following:
Code:
Nvflash started
rcm version 0X20001
System Information:
chip name: t20
chip id: 0x20 major: 1 minor: 4
chip sku: 0x8
chip uid: 0x043c6246433f44d7
macrovision: disabled
hdcp: enabled
sbk burned: false
dk burned: false
boot device: emmc
operating mode: 3
device config strap: 0
device config fuse: 0
sdram config strap: 2
downloading bootloader -- load address: 0x108000 entry point: 0x108000
sending file: /space/android/_tpt/device/04.EBT.img
/ 6291456/6291456 bytes sent
/space/android/_tpt/device/04.EBT.img sent successfully
waiting for bootloader to initialize
bootloader downloaded successfully
5. The device screen should display "Entering NvFlash recovery mode / Nv3p Server" message at the top with Lenovo logo at the backroung.
If everything worked fine you have started a bootloader for futher low level communication with your tablet.
Getting partition table information
1. Boot your device with a bootloader as described above.
2. Run the following command
Code:
$ nvflash -r --getpartitiontable ptable.txt
3. The following output will be displayed on PC console:
Code:
Nvflash started
[resume mode]
Succesfully updated partition table information to ptable.txt
4. This means you have successfully downloaded partition table information to ptable.txt file. You can view it. Here's some useful information from it:
Code:
....
PartitionId=4
Name=EBT
DeviceId=18
StartSector=1536
NumSectors=1536
BytesPerSector=4096
....
PartitionId=6
Name=SOS
DeviceId=18
StartSector=3584
NumSectors=1536
BytesPerSector=4096
PartitionId=7
Name=LNX
DeviceId=18
StartSector=5120
NumSectors=2048
BytesPerSector=4096
PartitionId=8
Name=APP
DeviceId=18
StartSector=7168
NumSectors=196608
BytesPerSector=4096
....
PartitionId=15
Name=UDA
DeviceId=18
StartSector=611840
NumSectors=7202816
BytesPerSector=4096
Here I'll try to give some more information:
PartitionId=4 -- is a number of partition
Name=EBT -- is a name of partition. This partition holds a bootloader image. The same you used to boot your device!
StartSector, NumSectors, BytesPerSector -- these parameters determine a location and size of partition in the internal device memory.
Partition 6 is a recovery partition which holds recovery image (kernel + ramdisk). You can use split_bootimg.pl to split it.
Partition 7 is a bootable partition which holds bootable image (kernel + ramdisk). You can use split_bootimg.pl to split it.
Partition 8 is an ext4 image of /system partition. You can mount it using mount linux utility.
Partition 15 is an ext4 image of /data partition. You can also mount it using mount linux utility.
Reading partition images from device
This method can be used to backup your device. I will show you how to backup a recovery partition (6) but you can do it with any partition you want.
1. Boot your device with a bootloader as described above.
2. Read partition number 6 to file 06.SOS.img with the following command
Code:
$ nvflash -r --read 6 06.SOS.img
3. The following output will indicate a successfull read
Code:
Nvflash started
[resume mode]
receiving file: 06.SOS.img, expected size: 6291456 bytes
/ 6291456/6291456 bytes received
file received successfully
Using split_bootimg.pl you can split you to kernel and ramdisk image:
Code:
$ split_bootimg.pl 06.SOS.img
Page size: 2048 (0x00000800)
Kernel size: 3659716 (0x0037d7c4)
Ramdisk size: 1496705 (0x0016d681)
Second size: 0 (0x00000000)
Board name:
Command line:
Writing 06.SOS.img-kernel ... complete.
Writing 06.SOS.img-ramdisk.gz ... complete.
Now you can get ramdisk contents:
Code:
$ mkdir ramdisk
$ cd ramdisk
ramdisk$ gzip -dc ../06.SOS.img-ramdisk.gz | cpio -im
4405 blocks
ramdisk$ ls
data dev init proc sbin system ueventd.goldfish.rc
default.prop etc init.rc res sys tmp ueventd.rc
Writing an image to device partition
Be very carefull! This operation can brick you device. If you are unsure of result you'd better don't use it
1. Boot your device with a bootloader as described above.
2. Write file recovery.img to partition number 6 (recovery) with the following command:
Code:
$ nvflash -r --download 6 recovery.img
3. Here's a sample output of successfull operation:
Code:
Nvflash started
[resume mode]
sending file: recovery.img
/ 6291456/6291456 bytes sent
recovery.img sent successfully
4. You will also note a large message PASS on your device screen following with the message "Success to update the system, please reboot your system to leave the recovery mode"
5. Now you can easily reboot your system and test your new recovery.
Conclusion
You can use nvflash for deep exploration of your device software, backing up software before any critical updates, flash modified software.
Thank you
P.S. Sorry for any mistakes as English is not my native language.
I thought the bootloader was locked and we can't access nvflash without the proper keys. Has the ics bootloader been unlocked or are the keys not needed? Sorry I'm a bit confused here
darkhandsome18 said:
I thought the bootloader was locked and we can't access nvflash without the proper keys. Has the ics bootloader been unlocked or are the keys not needed? Sorry I'm a bit confused here
Click to expand...
Click to collapse
AFAIK bootloader is locked for Ideapad (but the key has been already disclosed). Thinkpad comes with unlocked bootloader.
It's very interesting. Thank you.
Does this mean that we can make a backup of partitions, and do not need more in CWR?
horsse said:
It's very interesting. Thank you.
Does this mean that we can make a backup of partitions, and do not need more in CWR?
Click to expand...
Click to collapse
We need CWR for different other actions, i.e. for applying unsigned patches in case we had modified our system and normal update fails with consistency check error.
Sent from my ThinkPad Tablet using XDA Premium HD app
Not working for me:
Nvflash started
rcm version 0X4
Command send failed (usb write failed)
Edit:
Maybe you are lucky and have one of the first relased TPT. I heard they have open bootloader but it was closed in later produced ones.
In my case it does not work. Holding rotation (or any other hardbutton) prevents TPT from powering on.
jaba_cz said:
In my case it does not work. Holding rotation (or any other hardbutton) prevents TPT from powering on.
Click to expand...
Click to collapse
I need more help with this in order to try I believe my will work if I only knew how I don't know where to put that .IMG file were I have adb setup?
Sent from my Galaxy Nexus using Tapatalk 2
jaba_cz said:
In my case it does not work. Holding rotation (or any other hardbutton) prevents TPT from powering on.
Click to expand...
Click to collapse
That's normal. Holding rotation and power on will bring the TPT to APX-Mode.
If you plugin to USB while in APX-Mode it will request new drivers.
Exe557 said:
Not working for me:
Nvflash started
rcm version 0X4
Command send failed (usb write failed)
Click to expand...
Click to collapse
Please verify that you have write permissions for usb device:
Code:
$ cat /etc/udev/rules.d/95-nvflash.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="0955", ATTR{idProduct}=="7820", MODE="0660", OWNER="suntechnic"
You can adjust idVendor and idProduct corresponding values you see with lsusb command, i.e.:
Code:
$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 005 Device 002: ID 0a5c:2110 Broadcom Corp. Bluetooth Controller
Bus 005 Device 003: ID 0483:2016 SGS Thomson Microelectronics Fingerprint Reader
Bus 001 Device 045: ID 0955:7820 NVidia Corp.
Is it possible to fix my unit through Nvflash?
Hi,
Just wondering if it would be possible to fix my unit from nvflash. ?
I by mistake applied the wrong cwm file to my device, and now it's stuck at "Booting recovery kernel image"
Regards
Anders
This is what I need to fix my /system partition it looks like :good: Has to be run in Linux i'm guessing?
I only get error 04 as well.
I have European model 1838.
Mine got bricked trying to install ics. Now it is just in a boot loop and won't even go into recovery.
If this doesn't work I guess I'll have to send it in for service.
AFAIK rcm version 0X4 means the bootloader is locked. Just google for it.
Without SBK which is not leaked for TPT yet we have no chance to use it!
Was worth a shot but mine is version 0x4 as well
Damn, guy where you were when my tablet was just a big 10' brick?
You are perfectly know what a service quality is in Russia ;[
alright sorry, I shouldn't.. great finding even too late, maybe we'll have an unlock key for it, call me when its done, I don't want to brick my tablet anymore.. but do want to be a part of a custom rom development.
Where can I find the nvflash to use?
/Anders
osse said:
Where can I find the nvflash to use?
/Anders
Click to expand...
Click to collapse
I ended up finding it googling around...it was for the asus transformer but it seemed to work(as far as I could get with my locked bootloader)
I ended up using this simple guide from modaco, here.
For the people that "can't" get into APX mode, the screen at least mine gave NO indication that it was in APX mode. After trying a few times I flipped the tablet over and noticed the red LED was on. I then proceeded to connect it to my PC and install the drivers and follow the guide.
Unfortunately, I believe my bootloader is also locked because I typed nvflash --sync and received the output:
Nvflash started
rcm version 0X4
Command send failed (usb write failed)
Now, granted this is within windows. I haven't tried it on my Linux machine yet. So who knows what the actual issue is, but I am fairly certain the bootloader is locked. It also took me a few minutes to get my device out of APX-mode and boot normally again (or maybe my power button is on the verge of DEATH).
Edit: I have a US TPT 16GB (WiFi only) 183822U, that I bought practically a year ago.
Same here
Nvflash started
rcm version 0X4
Command send failed (usb write failed)
Device : 1838-2CG

[Q] Plz help unbricking my nook

I have formatted my nook via minitool partitiion manager accidentally... The only backup i have is a 79mb image file i made with roadkil diskimage and reading the threads, i am realising this is not a good backup... indeed i tried restoring this backup via roadkil diskimage but my nook still cannot boot. it says "install failed"
So I am following the instructions here: http://forum.xda-developers.com/showthread.php?t=2104145 and http://forum.xda-developers.com/showthread.php?t=2004630 in the hope of recovering my nook but I am stucked/unsure for some steps... here are the steps i followed in detail below with questions in red:
I made a backup of my nook disk using dd (this tutorial http://forum.xda-developers.com/showthread.php?t=1142983)
But my backup image is 2,000,683,008 bytes instead of 1958739968 bytes as noted in http://forum.xda-developers.com/showthread.php?t=1142983
Is this a problem?
My nook disk looks like this in minitool partition manager:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I used partition recovery to check for my deleted partitions with the following settings
Scanning Range : Full Disk
Full scan
It detected the following partitions... (I don't see the Factory partition and which partitions should I recover?)
I was thinking about recovering the following checked partitions:
Below is how it looks like (I haven't apply changes yet) but this does not match the partitions described in http://nookdevs.com/Nook_Simple_Touch_stock_partition_table
How do i copy the partitions and which partitions should i copy to my sdcard?
Do i need the file Nook Simple Touch Glowlight Image (without Rom partition): goo.gl/W4OYy (280.74mb) from http://forum.xda-developers.com/showthread.php?t=2104145 (The link does not work anymore)
I am stuck now... i don't want to continue without proper guidance... i don't want to mess up... Please take a look at my questions and guide me what to do next. thx in advance
First recover the /rom partition.
16 Meg is the correct size.
Copy all the files to someplace safe.
Make it read-only, burn a CD, whatever.
Make sure that you have sane files.
It would be best if you restore the partition table using nookpart.sh
You need to either use a Linux system and noogie or else get Clockwork Mod Recovery and ADB working and use that shell.
ok thx i have been able to recover the ROM partition. I restored it and save it an sd card. then i wrote the Nook Simple Touch Glowlight Image (without Rom partition) to the internal storage... it have all the partitions. I restored the ROM partition and it booted fine...
only issue i have now is the NST does not recognise the storage/NOOK partition as pointed out in http://forum.xda-developers.com/showthread.php?p=48019675#post48019675
I have run nookpart.sh and here's the result: Does not seem that it has corrected my partition table:
/dev/block/mmcblk0p2 39 46 15360 c Win95 FAT32 (LB
A)
Partition 2 has different physical/logical beginnings (non-Linux?):
phys=(9, 175, 39) logical=(38, 0, 1)
Partition 2 has different physical/logical endings:
phys=(11, 153, 14) logical=(45, 63, 32)
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3 47 141 194560 83 Linux
Partition 3 has different physical/logical beginnings (non-Linux?):
phys=(11, 185, 47) logical=(46, 0, 1)
Partition 3 has different physical/logical endings:
phys=(35, 242, 15) logical=(140, 127, 32)
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4 142 926 1607680 f Win95 Ext'd (LB
A)
Partition 4 has different physical/logical beginnings (non-Linux?):
phys=(35, 242, 16) logical=(141, 0, 1)
Partition 4 has different physical/logical endings:
phys=(236, 24, 44) logical=(925, 127, 32)
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5 142 285 294896 83 Linux
/dev/block/mmcblk0p6 286 405 245744 c Win95 FAT32 (LB
A)
/dev/block/mmcblk0p7 406 525 245744 83 Linux
/dev/block/mmcblk0p8 526 926 821232 83 Linux
Command (m for help): 3: unknown command
Command Action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): Command (m for help): 1: unknown command
Command Action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): No free sectors available
Command (m for help): e: unknown command
Command Action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): Command (m for help): 9: unknown command
Command Action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): No free sectors available
Command (m for help): e: unknown command
Command Action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): Command (m for help): 2: unknown command
Command Action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): No free sectors available
Command (m for help): e: unknown command
Command Action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): Command (m for help): 4: unknown command
Command Action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): No free sectors available
Command (m for help): e: unknown command
Command Action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): Command (m for help): 5: unknown command
Command Action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): No free sectors available
Command (m for help): e: unknown command
Command Action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): Command (m for help): 9: unknown command
Command Action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): Partition number (1-8): Hex code (type L to list codes):
Command (m for help): Partition number (1-8): Hex code (type L to list codes):
Command (m for help): Partition number (1-8): Hex code (type L to list codes):
Command (m for help): Partition number (1-8):
Command (m for help):
Disk /dev/block/mmcblk0: 2000 MB, 2000683008 bytes
128 heads, 32 sectors/track, 954 cylinders
Units = cylinders of 4096 * 512 = 2097152 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1 38 77808 c Win95 FAT32 (LB
A)
Partition 1 has different physical/logical beginnings (non-Linux?):
phys=(0, 0, 33) logical=(0, 1, 1)
Partition 1 has different physical/logical endings:
phys=(9, 175, 38) logical=(37, 127, 32)
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2 39 46 15360 c Win95 FAT32 (LB
A)
Partition 2 has different physical/logical beginnings (non-Linux?):
phys=(9, 175, 39) logical=(38, 0, 1)
Partition 2 has different physical/logical endings:
phys=(11, 153, 14) logical=(45, 63, 32)
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3 47 141 194560 83 Linux
Partition 3 has different physical/logical beginnings (non-Linux?):
phys=(11, 185, 47) logical=(46, 0, 1)
Partition 3 has different physical/logical endings:
phys=(35, 242, 15) logical=(140, 127, 32)
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4 142 926 1607680 f Win95 Ext'd (LB
A)
Partition 4 has different physical/logical beginnings (non-Linux?):
phys=(35, 242, 16) logical=(141, 0, 1)
Partition 4 has different physical/logical endings:
phys=(236, 24, 44) logical=(925, 127, 32)
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5 142 285 294896 83 Linux
/dev/block/mmcblk0p6 286 405 245744 c Win95 FAT32 (LB
A)
/dev/block/mmcblk0p7 406 525 245744 83 Linux
/dev/block/mmcblk0p8 526 926 821232 83 Linux
Command (m for help): The partition table has been altered.
Calling ioctl() to re-read partition table
fdisk: WARNING: rereading partition table failed, kernel still uses old table: D
evice or resource busy
#
Click to expand...
Click to collapse
I have the same problem!
yeahman45 said:
ok thx i have been able to recover the ROM partition. I restored it and save it an sd card. then i wrote the Nook Simple Touch Glowlight Image (without Rom partition) to the internal storage... it have all the partitions. I restored the ROM partition and it booted fine...
only issue i have now is the NST does not recognise the storage/NOOK partition as pointed out in http://forum.xda-developers.com/showthread.php?p=48019675#post48019675
I have run nookpart.sh and here's the result: Does not seem that it has corrected my partition table:
Click to expand...
Click to collapse
I have the same problem... I have a nook simple touch and I wrote in it a nook simple touch glowlight backup image, is that the problem?
The phrase "install failed" is still appearing.
i HAVE BEEN LOOKING FOR A SIMPLE TOUCH BACKUP IMAGE.
OHH PLEASE.. i THINK i'M CLOSE to recover it!
marya.a said:
I have the same problem... I have a nook simple touch and I wrote in it a nook simple touch glowlight backup image, is that the problem?
The phrase "install failed" is still appearing.
i HAVE BEEN LOOKING FOR A SIMPLE TOUCH BACKUP IMAGE.
OHH PLEASE.. i THINK i'M CLOSE to recover it!
Click to expand...
Click to collapse
what nook simple touch glowlight image did you write onto it?
1) Do you have a backup?
2) First thing to do before making any change is to backup, Use this guide to make a proper backup : http://forum.xda-developers.com/showthread.php?t=1142983
How did you exactly got the "install failed" problem?
I know that link, but it doesnt work right know, my nook is bricked.
I wrote a nook sp glowlight backup that I found in a forum from here. It has around 79 mb (http://forum.xda-developers.com/showthread.php?t=1836188&page=4) and I know I need a 1.82gb backup.
Well, my problem is---> I deleted all paritions from my nook when I was rooting it. I have two backups but any of these works. The first one I made has 79mb (as the file I downloaded from this page) but I think I made it in wrong way; and a second one wich has 1.82gb I think I had made it AFTER I deleted the partitions, because it has anything. But, as I told you, I've made a lot of tries with noogie, and the file I downloaded is the only one that works....so when I wrote the file of the link, the "install failed" appears.
What can I do?
The only solution I see now is: find out a COMPLETE nook sp backup, but I have read that the "complete backups" of 1.82gb have personal information about the reader or something like that, and one wants to share it.
What do u know about it?
marya.a said:
I know that link, but it doesnt work right know, my nook is bricked.
I wrote a nook sp glowlight backup that I found in a forum from here. It has around 79 mb (http://forum.xda-developers.com/showthread.php?t=1836188&page=4) and I know I need a 1.82gb backup.
Well, my problem is---> I deleted all paritions from my nook when I was rooting it. I have two backups but any of these works. The first one I made has 79mb (as the file I downloaded from this page) but I think I made it in wrong way; and a second one wich has 1.82gb I think I had made it AFTER I deleted the partitions, because it has anything. But, as I told you, I've made a lot of tries with noogie, and the file I downloaded is the only one that works....so when I wrote the file of the link, the "install failed" appears.
What can I do?
The only solution I see now is: find out a COMPLETE nook sp backup, but I have read that the "complete backups" of 1.82gb have personal information about the reader or something like that, and one wants to share it.
What do u know about it?
Click to expand...
Click to collapse
1) First thing to do before making any change is to backup, Use this guide to make a proper backup : http://forum.xda-developers.com/show....php?t=1142983
2) Then, with minitool partition manager, use partition recovery (full scan) to recover your partitions especially the ROM partition (the essential partition). Copy the ROM partition to an unallocated space on your harddrive or usb drive.
3) Follow this guide http://forum.xda-developers.com/show....php?t=2104145 for more details, it works!
I have been able to fix my problem with nook partition not mounted correctly.. but i have one issue remaining.... I can mount my /system folder as writable via adb shell... it remains read only.. so i have to use root explorer to move my files into that folder... I am trying to replace the .ttf for unicode support but i often get boot issues when doing so... sometimes my nook does not boot anymore if i had replaced fonts in the /system/fonts ..... any idea? (I didn't have this problem before withe the exact same files i am replacing)
@marya.a
ur only problem that u must have ROM partitions files .... then everything else is fine ..... cuz u just need an nook Image (my last update since i was here the partitioning if NSTwG same as NST) and empty all partitions from any files .... then copy ur Uniq ROM Partition files to ur ROM partition now on ur nook .... get 1.2.1 update ....Re-zipped it with they way u unzipped ...... use CWM .... install the Re-zipped update .... and done ur nook is work
Remember ... the Important files on nook only ROM files ... cuz is unique and if u lost it .....u wont able use wifi and u can just cuz ur nook only with no wifi
Good Luck
@yeahman45
try get another image 1st and then try it and if not workin with u try last thing check (Bad sector on ur internal memory).... Renate is best in Partitioning/mounting nook partition .... she already did that for me once "Big THX to her " , w8 her replay
good luck
yeahman45 said:
I have run nookpart.sh and here's the result: Does not seem that it has corrected my partition table:
Click to expand...
Click to collapse
Unfortunately, there are no good, standardized scripting disk partitioners.
The only thing we have in busybox and CWR is fdisk.
That is interactive.
You can feed it a response script.
The problem is that if anything gets out of sync it will plow ahead with wrong responses.
Unfortunately, that's what your log is showing.
nookpart.sh assumes that all partitions have been deleted.
You must first delete all the partitions manually. (This does not delete any file data.)
Code:
fdisk -C 934 -H 128 -S 32 /dev/block/mmcblk0
Type p to display the current state of things.
Type d and then the partition number to delete it.
Type w to write your changes and exit.
Then try running nookpart.sh again.
Note: Just to be clear, if you are restoring a full (~1.9GB backup) then the partition tables are in the backup.
There is no need to configure the partitions in that case.
yeahman45 said:
I can mount my /system folder as writable via adb shell... it remains read only..
Click to expand...
Click to collapse
Huh? That's confusing. Which way did you mean?
Code:
mount -o rw,remount /dev/block/mmcblk0p5 /system
yeahman45 said:
I am trying to replace the .ttf for unicode support but i often get boot issues when doing so.
Click to expand...
Click to collapse
Huh? The Nook is already fully UTF-8.
Do you mean adding the glyphs for some language?
Which files are you trying to replace?
Are you doing this over ADB or in a file manager?
Safest way: Use ADB, use the stop command to shut down the Android subsystem, copy the files, then use the reboot command.
Renate NST said:
Unfortunately, there are no good, standardized scripting disk partitioners.
The only thing we have in busybox and CWR is fdisk.
That is interactive.
You can feed it a response script.
The problem is that if anything gets out of sync it will plow ahead with wrong responses.
Unfortunately, that's what your log is showing.
nookpart.sh assumes that all partitions have been deleted.
You must first delete all the partitions manually. (This does not delete any file data.)
Code:
fdisk -C 934 -H 128 -S 32 /dev/block/mmcblk0
Type p to display the current state of things.
Type d and then the partition number to delete it.
Type w to write your changes and exit.
Then try running nookpart.sh again.
Note: Just to be clear, if you are restoring a full (~1.9GB backup) then the partition tables are in the backup.
There is no need to configure the partitions in that case.
Click to expand...
Click to collapse
yup i have already succeeded in re-creating the partitions thx! i deleted the partitions(using create partition table in GParted) and run your script and it's ok now! thx!
problem now is :
I cannot mount my /system folder as writable via adb shell... it remains read only.. so i have to use root explorer to move my files into that folder... I am trying to replace the .ttf for unicode support but i often get boot issues when doing so... sometimes my nook does not boot anymore if i had replaced fonts in the /system/fonts ..... any idea? (I didn't have this problem before withe the exact same files i am replacing)
I used glownooter previously(before my bricking story lol) and was able to mount /system and add files to it with no issues...but this time(after having recovered from my bricking story) i rooted with nook manager... do you think it's related to the rooting methods or my partitions are still not ok?
Renate NST said:
Huh? That's confusing. Which way did you mean?
Code:
mount -o rw,remount /dev/block/mmcblk0p5 /system
Huh? The Nook is already fully UTF-8.
Do you mean adding the glyphs for some language?
Which files are you trying to replace?
Are you doing this over ADB or in a file manager?
Safest way: Use ADB, use the stop command to shut down the Android subsystem, copy the files, then use the reboot command.
Click to expand...
Click to collapse
yup i am using mount -o remount,rw /system in shell, even used su but the system remains readonly.. no idea why...
trying to add fonts with chinese support.. since i can't push it via adb, i am using root explorer to replace the ttf files... but sometimes it freezes my nook and it does a bootstuck... cannot reboot... I had it two times, one i pasted a font and my nook freezed and another one when i tried to move an apk to system/app ... first time i solved bootstuck by restoring the system/fonts with original.. second time it did not worked.. i had to do a dd restore image... and root again...
Some infos
using grep:
# mount | grep system
mount | grep system
/dev/block/mmcblk0p5 /system ext2 rw,errors=continue 0 0
trying to push a font
adb push Y:\nook\fonts\Caecilia.ttf \system\fonts
failed to copy 'Y:\nook\fonts\Caecilia.ttf' to '\system\fonts': Read-only file system
edit: tried booting with noogie and replace my fonts on linux but i got some weird error : Error splicing file: no space left on device... i have deleted the whole fonts folder and pasted an original stock backup, still getting that error : Error splicing file: no space left on device (although i should have plenty of space as i have deleted the /fonts folder) ... and my nook does not boot anymore once again...
edit2: please help i am getting desperate... my nook does not boot anymore again after i have replaced the fonts with it.. is it a problem with my partition? what are the commands i need to run to see if everything's ok with my partition.. should i try another root method .. i bought the nook to offer it as a gift to someone who reads chinese.. that's why i am trying to install chinese fonts on it before giving it. Did i messed up with the partitions permanently when i deleted all the partittions?
Check how much space you have:
Code:
df
/system: 285583K total, 216938K used, 68645K available (block size 1024)
Check the mount (again):
Code:
mount
/dev/block/mmcblk0p5 /system ext2 rw,errors=continue 0 0
Check the permissions:
Code:
ls -l /
drwxr-xr-x root root 2012-12-22 10:21 system
ls -l /system
drwxr-xr-x root root 2013-03-19 20:18 fonts
Check writing a file:
Code:
cd /system/fonts
echo Hello > hello.txt
cat hello.txt
Hello
where should i execute these commands? in linux via noogie? whenever i put something in /system via noogie and linux, my nook does not boot anymore ... is that normal?
I have rooted once again using glownooter vs nookmanager this time and i am now able to push to the /system folder! finally lol ... i suppose nookmanager did not root it properly.. will stick with glownooter for now but i miss nook mod manager and its patches (any idea how to apply them with glownooter?)
Problem again! It does not boot again .. but last time i was stuck at "Reading forever", now it gets past this screen and when showing the progress dots, the dots move but the screen flashes each time and this cycle goes on forever.. any idea? is this normal that i get these booting issues when replacing fonts in /system/fonts???
edit: do i get adb with cwm? where's the settings for enabling adb in cwm?
Your Nook should re running in Nook alright before you start trying to change fonts.
You should have ADB running.
As you probably know, it's not normal for the dots to flash and restart.
You need ADB and logcat to see what it doesn't like.
It will tell you what the problem is.
I have never tried noogie with Linus or Nookmanager or Glownooter or Modmanager.
ok thx so adb should run even at boot time? i just need to connect it via usb? adb is not detecting it atm

i9100 emulated sdcard, partition resizing and full disk encryption

I recently upgraded a Galaxy S2 to Cyanogenmod 12.1 / android 5.1. I also wanted to use full disk encryption with the device and being able to access the internal memory via MTP instead of having a mass storage device. The removable sd card may be accessed via MTP, too, but will not be encrypted. Updating the recovery images to reflect the changes in the storage configuration (in case this is necessary) is not in scope, either.
Cyanogenmod by default only encrypts the /data partition. Newer models emulate the sdcard storage and save the data to /data/media, so everything gets encrypted. However, being an older phone there is still a separate sdcard-partition on the phone which is physically and directly mounted and which will not be touched by encryption.
In order to achieve the goal of full disk encryption two steps are necessary:
1. Change storage configuration to emulated media
2. Shrink old /sdcard partition and grow /data partition
= Change storage configuration to emulated media =
Emulating the sdcard in /data/media instead of physically mounting it directly requires changes to fstab.hardware (fstab.smdk4210), storage_list.xml and init.hardware.rc (init.smdk4210.rc). These files have to be changed in the Cyanogenmod source code and compiled to a new image. The configuration is based on the "Emulated primary, physical secondary" example given in h t t p s : / / source . android . com / devices / storage / config-example.html (cannot properly post URL due to new user restriction).
Here are the relevant changes in init.hardware.rc (init.smdk4210.rc):
Code:
--- init.smdk4210.rc.bak 2015-11-22 23:01:49.259579157 +0000
+++ init.smdk4210.rc.final 2015-11-30 20:21:37.977943177 +0000
@@ -2,35 +2,47 @@
import init.gps.rc
on init
- export EXTERNAL_STORAGE /storage/sdcard0
+ export EXTERNAL_STORAGE /storage/emulated/legacy
+ export EMULATED_STORAGE_SOURCE /mnt/shell/emulated
+ export EMULATED_STORAGE_TARGET /storage/emulated
export SECONDARY_STORAGE /storage/sdcard1
- mkdir /mnt/media_rw/sdcard0 0700 media_rw media_rw
- mkdir /mnt/media_rw/sdcard1 0700 media_rw media_rw
mkdir /mnt/media_rw/usbdisk0 0700 media_rw media_rw
- mkdir /storage/sdcard0 0770 root root
- mkdir /storage/sdcard1 0770 root root
+ mkdir /mnt/shell/emulated 0700 shell shell
+ mkdir /storage/emulated 0555 root root
+ mkdir /mnt/media_rw/sdcard1 0700 media_rw media_rw
+ mkdir /storage/sdcard1 0700 root root
+
mkdir /storage/usbdisk0 0770 root root
+ mkdir /storage/sdcard1 0775 system system
+
mkdir /efs 0771 radio system
mkdir /preload 0771 system system
mkdir /mnt 0775 root system
mkdir /mnt/.lfs 0755 root root
# for backwards compatibility
- symlink /storage/sdcard0 /sdcard
- symlink /storage/sdcard0 /mnt/sdcard
- symlink /storage/sdcard1 /extSdCard
- symlink /storage/sdcard1 /mnt/extSdCard
symlink /storage/usbdisk0 /usbdisk0
symlink /storage/usbdisk0 /mnt/usbdisk0
+ symlink /storage/emulated/legacy /sdcard
+ symlink /storage/emulated/legacy /mnt/sdcard
+ symlink /storage/emulated/legacy /storage/sdcard0
+ symlink /mnt/shell/emulated/0 /storage/emulated/legacy
+ symlink /storage/sdcard1 /ext_card
+ symlink /storage/sdcard1 /mnt/ext_card
+
+
+
# Disable CFQ slice idle delay
write /sys/block/mmcblk0/queue/iosched/slice_idle 0
on fs
mount_all /fstab.smdk4210
+ setprop ro.crypto.fuse_sdcard true
+
swapon_all /fstab.smdk4210
mkdir /efs/bluetooth
@@ -428,11 +440,10 @@
oneshot
keycodes 114 115 116
-service fuse_sdcard0 /system/bin/sdcard -u 1023 -g 1023 -d /mnt/media_rw/sdcard0 /storage/sdcard0
+service sdcard /system/bin/sdcard -u 1023 -g 1023 -l /data/media /mnt/shell/emulated
class late_start
- disabled
-service fuse_sdcard1 /system/bin/sdcard -u 1023 -g 1023 -d /mnt/media_rw/sdcard1 /storage/sdcard1
+service fuse_sdcard1 /system/bin/sdcard -u 1023 -g 1023 -w 1023 -d /mnt/media_rw/sdcard1 /storage/sdcard1
class late_start
disabled
Here are the relevant changes in fstab.hardware (fstab.smdk4210):
Code:
--- fstab.smdk4210.bak 2015-11-29 23:52:30.652913883 +0000
+++ fstab.smdk4210.final 2015-11-30 20:20:23.513945994 +0000
@@ -11,8 +11,8 @@
/dev/block/mmcblk0p12 /preload ext4 noatime,nosuid,nodev,journal_async_commit wait
# vold-managed volumes ("block device" is actually a sysfs devpath)
-/devices/platform/dw_mmc/mmc_host/mmc0/mmc0* auto auto defaults wait,voldmanaged=sdcard0:11,nonremovable,noemulatedsd
-/devices/platform/s3c-sdhci.2/mmc_host/mmc1* auto auto defaults wait,voldmanaged=sdcard1:auto,noemulatedsd
+/devices/platform/dw_mmc/mmc_host/mmc0/mmc0* auto auto defaults wait,voldmanaged=sdcard0:11,nonremovable
+/devices/platform/s3c-sdhci.2/mmc_host/mmc1* auto auto defaults wait,voldmanaged=sdcard1:auto
/devices/platform/s3c_otghcd/usb* auto auto defaults voldmanaged=usbdisk0:auto
# recovery
Here are the relevant changes in storage_list.xml:
Code:
--- storage_list.xml.bak2 2015-11-30 21:38:14.565769302 +0000
+++ storage_list.xml.final 2015-11-30 21:43:21.697757684 +0000
@@ -1,16 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<StorageList xmlns:android="h t t p : / / schemas . android . com / apk / res / android "(cannot properly post URL due to new user restriction)>
- <storage android:mountPoint="/storage/sdcard0"
- android:storageDescription="@string/storage_internal"
- android:primary="true"
- android:removable="false"
- android:allowMassStorage="true" />
+ <storage android:storageDescription="@string/storage_internal"
+ android:emulated="true"
+ android:mtpReserve="100" />
<storage android:mountPoint="/storage/sdcard1"
android:storageDescription="@string/storage_sd_card"
- android:primary="false"
android:removable="true"
- android:allowMassStorage="true" />
+ android:maxFileSize="4096" />
<storage android:mountPoint="/storage/usbdisk0"
android:storageDescription="@string/storage_usb"
@@ -18,3 +15,4 @@
android:removable="true" />
</StorageList>
Compile Cyanogenmod and flash your phone. It should boot, but the amount of available storage should be significantly lower as the sdcard is emulated on the /data partition which has not been grown, yet.
= Shrink old /sdcard partition and grow /data partition =
Use PIT Magic to resize the partitions to an appropriate size. For a stock i9100 having 16GB of internal memory my configuration was as follows (according to the backup .pit-file downloaded via heimdall):
Code:
DATAFS:
start: 1,392,640
block count: 4,194,304
end: 5,586,943
UMS:
start: 5,586,944
block count: 24,133,632
end: 29,720,575
Hidden:
start: 29,720,576
block count: 1,048,576
end: 30,769,151
I changed the partition layout to the following sizes:
Code:
DATAFS:
start: 1,392,640
block count: 28,295,167
end: 29,687,807
UMS:
start: 29,687,808
block count: 32,768
end: 29,720,575
Hidden:
start: 29,720,576
block count: 1,048,576
end: 30,769,151
Deleting the UMS or hidden partitions or shrinking the hidden led to Cyanogenmod not booting. Upload the new .pit-file using heimdall and boot the modified Cyanogenmod. Reboot to Cyanogenmod recovery and wipe data. Formatting again using the Cyanogenmod recovery was required as apparently only this recovery honours the "encryptable=footer,length=-16384" option for the /data partition in fstab.hardware which directs the formatting tools to leave 16 kiB of space at the end of the partition for in-place encryption.
Is there a way to achieve emulated SD, without changing source code and recompiling?
Like editing fstab and other config files?
I run CM13 at the moment and would like to achieve full encryption through emulated SD.
I was playing around with the idea that i would resize the sdcard partition to 8mb and resize the /data partition (~14gb), so that applications have a hefty space and i would use the external sdcard (sdcard1) for storing data and media files. Would that be possible to with an emulated sdcard ? I was hoping that with the introduction of Android 6.0 it would allow me to merge (LVM?) the /sdcard0 and /sdcard1 but instead it merges /data and /sdcard1.
fireburner-de said:
Is there a way to achieve emulated SD, without changing source code and recompiling?
Like editing fstab and other config files?
Click to expand...
Click to collapse
I cannot prove that there is no way without having to recompile. However, I couldn't find storage_list.xml in the filesystem on my phone, so I assume that this file is only used during image compilation and therefore it's probably hard/impossible to achieve emulated SD without recompiling.
Maybe this configuration is easier to achieve using Cyanogenmod 13 / Android 6 as the storage_list.xml resource overlay has been removed.
PelzigesOhr, thank you sharing and documenting your experience so well, it has inspired me to try the same on Replicant 4.2 (distro based on CyanogenMod 10).
https:// github . com / GrimKriegor / replicant42-device_samsung_galaxys2-common / commit / 84c5a91a45b059a147921d0ea32367534904b314
However it seems the best way to create a partition table is using PitMagic, which seems to be proprietary software. Would you consider sharing your PIT file please?
Thank you for your time, all of this is greatly appreciated!
EDIT:
If you still have memory of the heimdall parameters used to flash this partition table, please do share as well.
EDIT2:
Managed to create a PIT file similar to yours, thanks for documenting it.
The following thread also includes a patch compatible with Replicant/Android 4.2.
Best of luck!
redmine . replicant . us / boards / 39 / topics / 13707
GrimKriegor said:
Would you consider sharing your PIT file please?
Thank you for your time, all of this is greatly appreciated!
EDIT:
If you still have memory of the heimdall parameters used to flash this partition table, please do share as well.
EDIT2:
Managed to create a PIT file similar to yours, thanks for documenting it.
The following thread also includes a patch compatible with Replicant/Android 4.2.
Click to expand...
Click to collapse
Thanks for the praise, I'm happy that the instructions are of use to someone else. Good to know that you managed everything yourself, I'll answer anyway: This forum doesn't seem to support attachments, so I haven't attached the .pit-file. Feeding the parameters I provided to PIT Magic should yield a good result, though. PIT Magic is indeed a proprietary Windows binary, but it runs fine using wine (at least that's the way I use it).
All the flashing has been done by loading clockworkmodrecovery (
Code:
heimdall flash --KERNEL clockworkmodrecovery.6050.i9100.touch.img
) and afterwards sideloading the compiled ROM.
PelzigesOhr said:
Thanks for the praise, I'm happy that the instructions are of use to someone else. Good to know that you managed everything yourself, I'll answer anyway: This forum doesn't seem to support attachments, so I haven't attached the .pit-file. Feeding the parameters I provided to PIT Magic should yield a good result, though. PIT Magic is indeed a proprietary Windows binary, but it runs fine using wine (at least that's the way I use it).
All the flashing has been done by loading clockworkmodrecovery (
Code:
heimdall flash --KERNEL clockworkmodrecovery.6050.i9100.touch.img
) and afterwards sideloading the compiled ROM.
Click to expand...
Click to collapse
Thanks for the reply sir.
Which partitions did you upload via Heimdall when you flashed the PIT file? I believe repartitioning could delete the contents of important partitions such as BOOT and MODEM, but I am unsure. Do you think maintaining their block boundaries would preserve the data in the respective partitions?
guy i can't mount /storage/sdcard0
i use Cyanogenmod 12.1 android 5.1.1
i need help guy
GrimKriegor said:
Which partitions did you upload via Heimdall when you flashed the PIT file? I believe repartitioning could delete the contents of important partitions such as BOOT and MODEM, but I am unsure. Do you think maintaining their block boundaries would preserve the data in the respective partitions?
Click to expand...
Click to collapse
The exact command I used for repartitioning with Heimdall-1.3.1 was as follows:
Code:
heimdall flash --repartition --pit <filename>
Data should be preserved and if you don't mess with the boundaries of partitions other than DATAFS, UMS and HIDDEN you should be fine. Before repartitioning I backed up all partitions as a precautionary measure, but I didn't have to restore any of them. See also http://forum.xda-developers.com/galaxy-s2/orig-development/guide-enlarge-datafs-partition-rid-t2353551
PelzigesOhr said:
The exact command I used for repartitioning with Heimdall-1.3.1 was as follows:
Code:
heimdall flash --repartition --pit <filename>
Data should be preserved and if you don't mess with the boundaries of partitions other than DATAFS, UMS and HIDDEN you should be fine. Before repartitioning I backed up all partitions as a precautionary measure, but I didn't have to restore any of them. See also http://forum.xda-developers.com/galaxy-s2/orig-development/guide-enlarge-datafs-partition-rid-t2353551
Click to expand...
Click to collapse
Ah! This is excellent, thanks for clarifying this! Just one last question if I may, how did you backup the partitions? Did you use Heimdall to download their contents as image files, did you use DD or maybe even ADB?
Thank you for your time!
GrimKriegor said:
Just one last question if I may, how did you backup the partitions? Did you use Heimdall to download their contents as image files, did you use DD or maybe even ADB?
Click to expand...
Click to collapse
Good guess, I used dd and adb. Get a shell on the phone with adb and dump the partitions to files using dd:
Code:
dd if=/dev/block/mmcblk0pX of=/sdcard/mmcblk0pX.bin bs=512
And then copy the files to your computer using adb pull. You may want to get the mountpoints of the partitions (e.g. using mount) so that you can associate them easily.
Read here for an easy way to switch to emulated storage. Thanks to @Lanchon
https://forum.xda-developers.com/galaxy-s2/orig-development/mod-switch-emulated-to-emulated-t3539651

[HOW TO][DISCUSSION] UnBrick Samsung Galaxy Tab 2

There are more possibilities how to repair Hardbrick Samsung Galaxy Tab 2:
* For those who damaged boot loader can try Running stock U-Boot from SD Card
* For those who have HW fault like eMMC bug can participate on development Running entire system from SD Card
The second one may be solve later with help of some experienced people.
Run stock U-Boot from SD Card
Requirements
* Hardbrick Samsung Galaxy Tab 2 (GT-P5100). This can be recognized that it don't do nothing, charging not working, power button do nothing, recovery not working. More info How To Unbrick Your Galaxy Tab!
* SD Card Support UHS-I UHS104 (SDR104), with is not easy to determine with Card support this format and with not. I tried many cards and label UHS-I is not enough so i asked SanDisk support they recommended SanDisk Extreme. I bought SanDisk Extreme 32GB, and this card is working. I would say that every card 90MB/s+ should work.
step 0 not for Linux
Windows
* Install drivers for OMAP 4430 Guide / Drivers inside OMAPFlash download
* VirtualBox with Linux
* Set VirtualBox to capture OMAP 4430
* Download win iso burner
step 1
Windows & Linux
* Download [omapboot](https://github.com/LukasTomek/omapboot) to Linux
* Download [ Debrick dump imgs](https://forum.xda-developers.com/showpost.php?p=65114419&postcount=2)
step 2
Prepare SD card
Windows
Usewin iso burner to write Debrick dump imgs to Sd Card.
Linux
Write Debrick dump imgs to Sd Card.
Be careful to use right device sdX
Code:
dd if=debrick.img of=/dev/sdX
step 3
In Linux Run
Code:
[email protected]:/home/lukas/SamsungP5100/omapboot# python3 omapboot.py -b
you will see:
Code:
[email protected]:/home/lukas/SamsungP5100/omapboot# python3 omapboot.py -b
Boot from MMC1 interface selected.
Waiting for omap44 device.
* Connect Tablet to PC
* Press Power button for long time approximately 10s
* You should see this in command line:
Code:
Boot from MMC1 interface selected.
Waiting for omap44 device.
Model: 4430
ROM revision: 0x04
CH: enabled
Underdocumented ASIC subblock #18: 00
IDEN: 0xE5FD23CE0F5FDF902D7EDA9B4D848D687F62372A
MPKH: 0xB585ACF1DD15B06A74813BFDDD6ECD64227CE4C90658C65B4C53AC229B4C6DC0
CRC0: 0x9C669AD9
CRC0: 0x682ADCCF
recevied ASIC ID banner:
Model: 4430
ROM revision: 0x04
CH: enabled
Underdocumented ASIC subblock #18: 00
IDEN: 0xE5FD23CE0F5FDF902D7EDA9B4D848D687F62372A
MPKH: 0xB585ACF1DD15B06A74813BFDDD6ECD64227CE4C90658C65B4C53AC229B4C6DC0
CRC0: 0x9C669AD9
CRC0: 0x682ADCCF
Giving x-loader a chance to come up...Probably loaded!
* Tablet should start to some firmware recovery mode see picture
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
* You should be able to use ODIN to repair internal memory, in my case ODIN stop in the half of loading, I probably have eMMC bug.
Running entire system from SD Card
I'm trying to modify U-Boot and Kernel to load entire system from SD Card. Some have done it Say hi to "CyanoBoot" -- a 2nd bootloader/w menu aka "ub2" different device same CPU.
First step of boot is loading x-loader. The x-loader is signed so we have to use original one from Samsung. After some peripheral initialization x-loader copy u-boot to ram checking for magic constant as copied code and execute it. This is the place where we can change u-boot to boot from SD Card, because x-loader load u-boot from the same device as was loaded him.
u-boot source
Do anyone have u-boot source from Samsung?
I used this Guide and copy something from Nook device u-boot source because they made boot from SD Card on same CPU OMAP4430. And lge_p920 from LG Open-source repository. Do anyone have better idea?
How to compile
[u-boot source](https://gogs.lukastomek.info/lukas/u-boot)
[Building U-BOOT #(for Blaze)](http://omappedia.org/wiki/4AJ.2.5_OMAP4_Jelly_Bean_Release_Notes)
Kernel
I'm using Stock boot.img from O2C-P5100XXDMJ2-20131203002840.zip package. Do anyone have kernel booting from SD Card?
Prepare Debrick.img
Rewrite part of Image Files
Write recovery.img to specific address in debrick_changed.img address 0x2C00000 write in hex or dec depend on system (seek=$((0x1800000)) for linux) (seek=46137344 for Windows).
You need to rewrite:
x-loader (MLO) 0x20000
u-boot (Sbl.bin) 0x1800000
boot.img 0x2400000
recovery.img 0x2C00000
Code:
dd if=C:\temp\Tablet\sdCardDebrick\recovery.img of=C:\temp\Tablet\sdCardDebrick\debrick_changed.img seek=$((0x1800000)) oflag=seek_bytes conv=notrunc
UART Debugging
Pin 21 of [Samsung Galaxy Tab 30 Pin Dock Connector Pinout](https://forum.xda-developers.com/showthread.php?t=1118986) is output of debug messages for x-loader and u-boot (port UART4). I would like send Kernel debug output to this port. Anyone know how to do it?[/HTML]I’m using UB232R for conecting to PC.
Output from debugging:
Code:
ŕ<0>
Texas Instruments X-Loader 1.41 (Apr 10 2013 - 20:55:49)
Starting OS Bootloader from MMC/SD1 ...
U-Boot 1.1.4-g01076139-dirty (Jan 8 2019 - 14:49:13)
U-Boot code: 80E80000 -> 80EAA870 BSS: -> 80F2F964
Load address: 0x80e80000
DRAM: 2048 MB
Flash: 0 kB
Using default environment
In: serial
Out: serial
Err: serial
Initializing SD(0) Slot.
ptbl slot: SD:(0).
8192 20M EFS
49152 2M SBL1
53248 2M SBL2
57344 8M PARAM
73728 8M KERNEL
90112 8M RECOVERY
106496 700M CACHE
1540096 20M MODEM
1581056 1400M FACTORYFS
4448256 12343M DATAFS
29728734 512M HIDDEN
efi partition table:
bootcmd booti mmc0ptbl slot: SD:(0).
8192 20M EFS
49152 2M SBL1
53248 2M SBL2
57344 8M PARAM
73728 8M KERNEL
90112 8M RECOVERY
106496 700M CACHE
1540096 20M MODEM
1581056 1400M FACTORYFS
4448256 12343M DATAFS
29728734 512M HIDDEN
Net: KS8851SNL
arch_number = 0x00000870
board rev = 0x00000000
env_t = 0x00000000
boot_params = 0x80000100
DRAM bank = 0x00000000
-> start = 0x80000000
-> size = 0x80000000
ethaddr = 00:00:00:00:00:00
ip_addr = 128.247.77.90
baudrate = 115200 bps
81200000: 52444e41 2144494f 0046add8 80008000 ANDROID!..F.....
81200010: 000b63a5 81000000 00000000 80f00000 .c..............
81200020: 80000100 00000800 00000000 00000000 ................
81200030: 00000000 00000000 00000000 00000000 ................
81200040: 736e6f63 3d656c6f 4f797474 31312c32 console=ttyO2,11
81200050: 30303235 6d20386e 313d6d65 4d343230 5200n8 mem=1024M
81200060: 646e6120 64696f72 746f6f62 6e6f632e androidboot.con
81200070: 656c6f73 7974743d 7620324f 3d6d6172 sole=ttyO2 vram=
kernel @ 80008000 (4632024)
ramdisk @ 81000000 (746405)
timed out in wait_for_bb: I2C_STAT=1000
I2C read: I/O error
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
ŕ<0>
This look like kernel is executed but no more info. I tried set ttyO0 - ttyO4 ttyS0 - 4 but no difference to get output from kernel. Do anyone have some idea how to get kernel output or what is wrong?
I realize I'm four years later with this, but I hope you see my message, because I'm also trying to get u-boot working on the Samsung Galaxy Tab 2 and I saw the repository with your work so far, but for some reason it isn't up anymore, so could you re-upload it maybe if it isn't too much effort?
If anyone is still interested; I managed to patch the stock bootloader from Samsung (Sbl.bin), so that more verbose logging from UART4 is working and booting entirely from the SD card is also working: https://github.com/mspitteler/espresso-sbl

Adding an SD card to Glowlights (2, 3, 4)

This all started out in a Glowlight 4 (7.8", 2019) thread: https://forum.xda-developers.com/nook-touch/general/glowlight-plus-7-8-2019-t3934677
An SD card was soldered to test points on the circuit board of a Glow4 to allow for extra storage.
Since it looks like this same technique should work on Glow2 & Glow3 I've broken the thread out here.
The Glow4 has test points labelled by function and has been tested and proven to work with SD cards.
http://www.temblast.com/blogs/glow4/blog.htm#sdcard
The Glow3 has test points labelled by function and has not yet been tested.
The Glow2 has test points, but they are not labelled by function.
I will try to "wiggle" out the pinout soon.
Since the only difference between the models will only be wiring, I suspect that the bulk of this thread will be on configuration and use.
I wiggled the Glow2, the pinout for SD2 is:
TP159 D0
TP160 D1
TP161 D2
TP162 D3
TP163 Cmd
TP164 Clk
TP165 /CD
TP165 VDD
TP167 Gnd
The Glow3, while it's labelled, seems to be on SD3, which is not configured.
I'm still looking at this.
Thanks! I look forward learning more about mounting the sdcard and editing fstab etc.
One more question: Does this method have any restriction on the size of the sdcard and how it's formated? Many old(er) android devices with external storage can only take sdcard of size up to 32Gb, and (independent of that) sometimes people are told to format the sdcard using the device itself, but other times we're suppose to format it in advance (fat32? ext4?).
THANKS!
case-sensitive said:
Does this method have any restriction on the size of the sdcard and how it's formated?
Click to expand...
Click to collapse
This is not so much a method as simply putting in an option that they couldn't be bothered with.
I don't have anything bigger than 16GB on hand.
32GB is the limit for SD 2.0 spec.
Most of the 4GB to 16 GB cards that I have tried are SD 3.0 spec.
You can see this with mmcinfo in uboot.
Formatting things VFAT is only useful if you want to use UMS.
I wouldn't recommend that, VFAT is old and stupid and there are issues with timezones on timestamps.
ext2 is kind of the logical choice.
mkfs.ext2 is included in busybox for formatting.
TLDR: This works on the Glow2 & Glow4 relatively easily.
On the Glow3 you'd need to sacrifice the WiFi to make it work. This works on the Glow3, but you need a modified kernel and a hwcfg change.
http://www.temblast.com/blogs/glow2/blog.htm
http://www.temblast.com/blogs/glow3/blog.htm
http://www.temblast.com/blogs/glow4/blog.htm
Apparently there is already a default place for external SD cards: /mnt/media_rw/extsd
This has a link from /storage/extsd
Since the directory already exists you don't need to modify /init.rc
If you want to use vfat formatted disks and have them hot swappable you don't even have to modify /fstab.E70Q50
My choice is to use an ext2 formatted disk and since it will be internal and not swappable, I don't need or want vold, the volume daemon.
You need to tweak /fstab.E70Q50 (get rid of any line that mentions "extsd").
Code:
/dev/block/mmcblk1p1 /mnt/media_rw/extsd ext2 defaults defaults
You can split the SD card into separate partitions if you want.
You'd have to add some more entries in /fstab.E70Q50 and some mkdirs in /init.rc
For partitioning/formatting cards:
Code:
# busybox fdisk /dev/block/mmcblk1
d [color=red]<-- delete partition[/color]
n [color=red]<-- new partition[/color]
w [color=red]<-- actually write the changes[/color]
#busybox mkfs.ext2 /dev/block/mmcblk1p1
Be very careful when you are talking about mmcblk? and mmcblk?p?
case-sensitive said:
Many old(er) android devices with external storage can only take sdcard of size up to 32Gb...
Click to expand...
Click to collapse
Code:
[email protected]_6sl:/ # df
Filesystem Size Used Free Blksize
...
/mnt/media_rw/extsd 114.4G 20.0K 114.4G 4096
...
[email protected]_6sl:/ # mount
...
/dev/block/mmcblk1p1 /mnt/media_rw/extsd ext2 rw,relatime,errors=continue 0 0
On the Glow2 I ran into a hiccup.
I soldered some 30 gauge wire directly to the micro SD card.
The SD2 is there and fine, but the NtxHwCfg (at least on mine) had to be patched.
Code:
# dd if=/dev/block/mmcblk0 of=/sdcard/hwcfg skip=1024 count=1
This will get you a 512 byte file.
Look at the byte at hex address 0x4f
For the SD card to work this value must be 0x02 (it was 0x00 on mine)
Be very careful modifying the file and writing it back to the internal SD:
Code:
# dd if=/sdcard/hwcfg of=/dev/block/mmcblk0 seek=1024 count=1
Hey! It says "skip" in the first example and "seek" in the second. I warned you!
Well, more sloppiness on NTX/B&N's part.
*.rc files are organized by board names
Usually they shovel the files into the ramdisk.
This means that you have bunches of useless files that aren't used by your hardware.
The Glow2 is a E60QD0 board, the Glow3 is a E60QQ0 board, the Glow4 is a E70Q50 board.
The init.<board>.rc file should load the fstab.<sameboard> file.
On the Glow2 (at least mine) they did sloppy copy/paste and the init.E60QD0.rc loads fstab.E60Q50
I edited init.E60QD0.rc to load fstab.E60QD0
(Then made sure that fstab.E60QD0 had the correct contents.)
Likewise, init.<board>.usb.rc is sloppy.
They don't use the approved syntax of ${ro.serialno}, but instead use $ro.serialno
I get tired of the warnings in the console log.
Also, a lot of redundant junk (the VID/PID stuff can be moved to the "on boot" section).
If you are using a Glow2 and you just installed the 5.0 update and you had previously modified the hwcfg,
then you will have to set it back to the original version to allow the added SD card to work properly.
See: https://forum.xda-developers.com/showpost.php?p=80114208&postcount=623
I had previously said that an SD card and WiFi were not compatible on the Glow3.
It turns out that it's a bit more complicated.
SD2 is the WiFi interface.
SD3 goes to the test points.
The software currently has the WiFi enable/disable switching the SD3 interface, which is wrong.
I've got the hardware itself working
Code:
eBR-1A # mmcinfo
Device: FSL_USDHC
Manufacturer ID: 27
OEM: 5048
Name: SD32G
Tran Speed: 25000000
Rd Block Len: 512
SD version 3.0
Clock: 50000000
High Capacity: Yes
Capacity: 31104958464 Bytes
Bus Width: 4-bit
Boot Partition for boot: No boot partition available
Now I just have to fix the software.
Ok, so I've patched the kernel to make this work on the Glow3.
This also needs a change to the ntxcfg. You can do that with dd or some other tool.
Is anybody ready for this? Do you have the soldering iron warmed up?
Code:
/mnt/media_rw/extsd 28.5G 20.0K 28.5G 4096
I've got to make a version of the image without my stuff in it.
I usually don't like heavily modded images.
The one thing I put in is a rooted adbd.
So, who's ready for the glow3?
You need a new kernel.
If you have access to fastboot you can test drive it with "fastboot boot p1mod.img".
Later you can "fastboot flash boot p1mod.img" to make it permanent.
If you don't (and you're brave and have a good recovery) you can "dd if=p1mod.img of=/dev/block/mmcblk0p1"
You will need to patch the NTX hwcfg.
If this is patched but you are still running the old kernel the WiFi will probably not work, but the glow3 will still be functional.
Code:
# dd if=/dev/block/mmcblk0 skip=1024 count=1 of=/sdcard/hwcfg
[color=red]Use your favorite hex file editor either on of off the glow3 to change address 0x4f from 0x02 to 0x00.
modfile hwcfg 4f 00[/color]
# dd if=/sdcard/hwcfg seek=1024 count=1 of=/dev/block/mmcblk0
If you have access to the u-boot command line you can do it there instead:
Code:
eBR-1A # mmc read 910000 400 1
MMC read: dev # 0, block # 1024, count 1 ... 1 blocks read: OK
eBR-1A # mm.b 91004f
0091004f: 02 ? 00
00910050: 01 ? q
eBR-1A # mmc write 910000 400 1
MMC write: dev # 0, block # 1024, count 1 ... 1 blocks write: OK
eBR-1A #
So, if you get through with all this and reboot it should boot up just fine.
There is a rooted adbd in there so that should not be a problem.
The fstab has been modified to mount your new SD card.
Since that is probably still the original filesystem it will not mount correctly.
You can do an "ls -l /dev/block" and see both mmcblk1 and mmcblk1p1.
You probably noticed that your old /sdcard is empty.
This is an artifact of the fstab not finishing and therefore the nonencrypted is not triggered nor the late_start.
Just do a "start sdcard" and the /sdcard will populate.
So now, just do a "busybox fdisk /dev/block/mmcblk1" to repartition and a "busybox mke2fs /dev/block/mmcblk1p1".
The fstab presumes ext2, a reasonable choice for something used as big storage. If not, just change it.
Reboot and everything should be good.
Good luck.
I've been talking about the NTX hardware configuration, but I don't think that I mentioned or released the utility that I use to dump it.
Availible in the signature, there is NtxHwCfg which can dump or compare NTX configurations.
There is a version for Win32 and one for Android.
http://www.temblast.com/android.htm
It's interesting that the B&N updates don't modify the NTX config.
The Glow2 has version 2.5 vs. the Glow3 with 2.8 vs. the Glow4 with 3.1!
So that means that the u-boots all have to be different.
Code:
C:\>ntxhwcfg hwcfg3 hwcfg4
0b Version 2.8 3.1
0f Size 65 70
10 PCB E60QQ0 (69) E70Q50 (84)
12 AudioCodec No (0) ALC5672 (6)
14 Wifi RTL8189 (8) RTL8723DS (14)
15 BT No (0) RTL8723DS (8)
17 TouchCtrl neonode_v2 (8) ektf2132 (9)
...

Categories

Resources