[Q] Problems booting kernel - Android Software/Hacking General [Developers Only]

Hi, hopefully this is the correct place to post this.
I´m developing a device on a beagleboard and have some problems starting the kernel.
I´m using yaffs2 as root filesystem and the version of the kernel is 2.6.29.
We have the latest yaffs2 code compiled into the kernel, not from googles kernel but from yaffs git sources.
We come so far as it has finished uncompressing the kernel and tried booting it but after that it freezes without no output what so ever.
The uBoot enviroment is as following:
OMAP3_Kajsa # printenv
bootdelay=10
baudrate=115200
loadaddr=0x82000000
usbtty=cdc_acm
console=ttyS0,115200n8
loadbootscript=fatload mmc 0 ${loadaddr} boot.scr
bootscript=echo Running bootscript from mmc ...; source ${loadaddr}
loaduimage=fatload mmc 0 ${loadaddr} uImage
netmask=255.255.255.0
gatewayip=192.168.0.99
dieid#=1d5a0004000000000403643203019007
ethact=smc911x-0
ethaddr=00:11:22:33:44:55
ipaddr=10.0.0.2
serverip=10.0.0.1
echo=Booting from nand ...
nandargs=console=ttyS0,115200n8 root=/dev/mtdblock4 opamfb.mode=lcd vram=32M omapfb.vram=0:8M rdinit=/init rootwait rootfstype=yaffs2
nandboot=echo Booting from NAND...; nand read ${loadaddr} 280000 400000; bootm ${loadaddr}
bootfile=uMulti-2
bootargs=console=ttyS0,115200n8 root=/dev/mtdblock4 rw opamfb.mode=lcd vram=32M omapfb.vram=0:8M init=/init rootwait rootfstype=yaffs2
stdin=serial
stdout=serial
stderr=serial
Environment size: 1175/131068 bytes
And the output when we start to boot the kernel is:
OMAP3_Kajsa # set ethaddr 00:11:22:33:44:55 ; set ipaddr 10.0.0.2 ; set serverip 10.0.0.1 ; tftp 0x82000000 uImage-yaffs
smc911x: detected LAN9220 controller
smc911x: phy initialized
smc911x: MAC 00:11:22:33:44:55
Using smc911x-0 device
TFTP from server 10.0.0.1; our IP address is 10.0.0.2
Filename 'uImage-yaffs'.
Load address: 0x82000000
Loading: T #################################################################
#################################################################
###############################
done
Bytes transferred = 2360952 (240678 hex)
OMAP3_Kajsa # bootm
## Booting kernel from Legacy Image at 82000000 ...
Image Name: Linux-2.6.29-rc3-omap1-gb7a2014-
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2360888 Bytes = 2.3 MB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK
Starting kernel ...
Uncompressing Linux...................................................................................................................................................... done, booting the kernel.
We have also tried to write the kernel to NAND and booted from there with the same result.
Any input will be appriciated.
Best regards.
Eric

Related

Mounting in Gentoo Linux with A2SD partitions

I am running cyanogen's rom with a fat32 partition and ext3 partition. When i run fdisk on the device /dev/sdb, i get this as a result and it looks ok:
Code:
# fdisk /dev/sdb
Command (m for help): p
Disk /dev/sdb: 8067 MB, 8067743744 bytes
249 heads, 62 sectors/track, 1020 cylinders
Units = cylinders of 15438 * 512 = 7904256 bytes
Disk identifier: 0x000eadb7
Device Boot Start End Blocks Id System
/dev/sdb1 1 941 7263548 c W95 FAT32 (LBA)
/dev/sdb2 942 1005 487398 83 Linux
Partition 2 does not end on cylinder boundary.
however, I cant mount my partitions reliably. Sometimes when I plug it in, I get the fat32 partition as /dev/android, and sometimes I get the ext3 partition. but under both circumstances, i NEVER see /dev/sdb1 or /dev/sdb2.
Code:
# ls /dev | grep sd
lrwxrwxrwx 1 root root 4 2009-07-20 15:55 root -> sda3
brw-rw---- 1 root disk 8, 0 2009-07-20 15:55 sda
brw-rw---- 1 root disk 8, 1 2009-07-20 15:55 sda1
brw-rw---- 1 root disk 8, 2 2009-07-20 15:55 sda2
brw-rw---- 1 root disk 8, 3 2009-07-20 15:55 sda3
brw-rw---- 1 root disk 8, 16 2009-07-21 20:43 sdb
however, my dmesg reports this:
Code:
78640.618666] sd 30:0:0:0: [sdb] 15757312 512-byte hardware sectors: (8.06 GB/7.51 GiB)
[78640.620661] sd 30:0:0:0: [sdb] Write Protect is off
[78640.620664] sd 30:0:0:0: [sdb] Mode Sense: 03 00 00 00
[78640.620667] sd 30:0:0:0: [sdb] Assuming drive cache: write through
[78640.624658] sd 30:0:0:0: [sdb] 15757312 512-byte hardware sectors: (8.06 GB/7.51 GiB)
[78640.626659] sd 30:0:0:0: [sdb] Write Protect is off
[78640.626662] sd 30:0:0:0: [sdb] Mode Sense: 03 00 00 00
[78640.626665] sd 30:0:0:0: [sdb] Assuming drive cache: write through
[78640.626669] sdb: sdb1 sdb2
[78640.633034] usb 1-2:1.0: uevent
[78640.633122] usb 1-2: uevent
[78640.899187] usb 1-2:1.0: uevent
[78640.899276] usb 1-2: uevent
[78641.054596] VFS: Can't find ext3 filesystem on dev sdb1.
it takes a bunch of tries of unplugging the usb and plugging it back in until it finally somehow mounts my fat32 partition under /media/disk. Is this some configuration issue? Before I partitioned my sdcard, it was fine mounting just a fat32 partition as the entire card, no problems.
check you hald
/etc/init.d/hald restart
do you have support for udev in you kernel ?
Check this steps and tell us it worked
yes HAL is running and has been running the entire time:
Code:
# rc-update show
alsasound | boot
bootmisc | boot
checkfs | boot
checkroot | boot
clock | boot
consolefont | boot
cupsd | default
dbus | default
hald | default
hostname | boot
keymaps | boot
lm_sensors | default
local | default nonetwork
localmount | boot
modules | boot
net.eth0 | default
net.lo | boot
numlock | default
rdate | default
rmnologin | boot
sshd | default
syslog-ng | default
urandom | boot
xdm | default
Code:
$ ps aux | grep hal
103 3544 0.0 0.0 26956 4032 ? Ss Jul24 0:01 /usr/sbin/hald --use-syslog --verbose=no
root 3545 0.0 0.0 15624 1176 ? S Jul24 0:00 hald-runner
root 3548 0.0 0.0 17748 1124 ? S Jul24 0:00 hald-addon-input: Listening on /dev/input/event1 /dev/input/event0 /dev/input/event3
103 3553 0.0 0.0 16608 968 ? S Jul24 0:00 hald-addon-acpi: listening on acpi kernel interface /proc/acpi/event
root 3558 0.0 0.0 17748 1128 ? S Jul24 0:08 hald-addon-storage: polling /dev/sr0 (every 2 sec)
john5788 4596 0.0 0.0 130688 3120 ? Sl Jul24 0:00 /usr/libexec/gvfs-hal-volume-monitor
root 11452 0.0 0.0 17748 1124 ? S Jul24 0:01 hald-addon-storage: polling /dev/sdb (every 2 sec)
john5788 13851 0.0 0.0 84792 864 pts/1 R+ 10:10 0:00 grep --colour=auto hal
restarting does not help anything.
udevd --version ??
since version 140 those stupids rules messed up with removable devices.
Since I'm lazy I built my kernel with genkernel and it took care of everything about udev.
Code:
# udevd --version
141
so its a rule in udev that is screwin this up?
i'm not using genkernel, I rolled my own kernel out, have been doing it this way for years.
Code:
# uname -a
Linux john5788 2.6.29-gentoo-r5 #1 SMP Fri May 29 16:56:58 PDT 2009 x86_64 Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz GenuineIntel GNU/Linux
John5788 said:
Code:
# udevd --version
141
so its a rule in udev that is screwin this up?
i'm not using genkernel, I rolled my own kernel out, have been doing it this way for years.
Code:
# uname -a
Linux john5788 2.6.29-gentoo-r5 #1 SMP Fri May 29 16:56:58 PDT 2009 x86_64 Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz GenuineIntel GNU/Linux
Click to expand...
Click to collapse
Yeah i think ...
what's the output of dmesg |grep EXT3-fs ?
the output has a bunch of instances last night when i was plugging and unplugging the device. like i said, sometimes it recognized my fat32 partition, sometimes ext3.
Code:
# dmesg | grep EXT3-fs
[ 9016.479321] EXT3-fs warning: mounting unchecked fs, running e2fsck is recommended
[ 9016.481783] EXT3-fs: mounted filesystem with ordered data mode.
[ 9111.770944] EXT3-fs error (device sdb2): ext3_put_super: Couldn't clean up the journal
[ 9134.532699] EXT3-fs warning: mounting unchecked fs, running e2fsck is recommended
[ 9134.534632] EXT3-fs: recovery complete.
[ 9134.536841] EXT3-fs: mounted filesystem with ordered data mode.
[ 9166.843481] EXT3-fs warning: mounting unchecked fs, running e2fsck is recommended
[ 9166.849252] EXT3-fs: mounted filesystem with ordered data mode.
[ 9184.778649] EXT3-fs error (device sdb2): ext3_put_super: Couldn't clean up the journal
[ 9243.636550] EXT3-fs warning: mounting unchecked fs, running e2fsck is recommended
[ 9243.638973] EXT3-fs: recovery complete.
[ 9243.638976] EXT3-fs: mounted filesystem with ordered data mode.
[ 9305.343298] EXT3-fs warning: mounting unchecked fs, running e2fsck is recommended
[ 9305.345249] EXT3-fs: mounted filesystem with ordered data mode.
[ 9328.776678] EXT3-fs error (device sdb2): ext3_put_super: Couldn't clean up the journal
[15048.450805] EXT3-fs: recovery complete.
[15048.452800] EXT3-fs: mounted filesystem with ordered data mode.
[15055.778655] EXT3-fs error (device sdb2): ext3_put_super: Couldn't clean up the journal
ok it seems one of partitions is broken i've looked around the web
try to :
e2fsck -p your /home partitions and
fsck.vfat -p /dev/sdb1 and e2fsck -p /dev/sdb2
I don't use any kind of automation, not even hal, but I have the same issue, without corruption though.
However, I have found that using cfdisk on /dev/sdb makes /dev/sdb{1,2} appear magically, and I can mount them correctly.
That's not really elegant, but it works for me.
I use adb push most of the time anyways, that way I don't have to unmount the SD from the phone and everything is smooth.
Zappletoo said:
I don't use any kind of automation, not even hal, but I have the same issue, without corruption though.
However, I have found that using cfdisk on /dev/sdb makes /dev/sdb{1,2} appear magically, and I can mount them correctly.
That's not really elegant, but it works for me.
I use adb push most of the time anyways, that way I don't have to unmount the SD from the phone and everything is smooth.
Click to expand...
Click to collapse
tht's strange cfdisk should not help mounting the devices but if it work it's worthing give it a try.
it has to be something with hal and rules :
emerge -pv hal dbus
etc-update
should get rid of that problem
PS : Zappletoo what linux distribution are you using ??
Gentoo.
But I don't use HAL, I don't see any good reason to. I'll try to activate it to see if it makes a difference, but I doubt it.
I'm not sure why cfdisk helps, maybe it simply updates the partition table somewhere.
Update : starting hald makes it work. Using partprobe works as well.. So I guess I was right about the partition table part.
what do you mean use cfdisk on it?
did you just select mount from the phone, then run cfdisk /dev/sdb, then immediately quit?
no no run cfdisk on your computer
Edit: yes I misread. That's what he did.
If things goes well your 2 partitions should appear
John5788 said:
what do you mean use cfdisk on it?
did you just select mount from the phone, then run cfdisk /dev/sdb, then immediately quit?
Click to expand...
Click to collapse
Yes, on the computer.
Apparently it does the same as partprobe, which is available in the sys-apps/parted package.
Hald does everything automatically though, but it's bloated.
Never had a problem with gentoo. No Hal...udev 1.41...custom kernel. Somewhere else on this forum however someone pointed out the phone doesn't show up properly in linux without first probing it. i.e. 'fdisk -l /dev/sda'. This has worked for me whenever I choose to mount it (which is almost never cuz i love adb).

[TOOL] rkflashtool for Linux and rk2808, rk2818 and rk2918 based tablets

Hi,
Because I don't run Windows nor NetBSD, I rewrote rkflash from scratch with the use of libusb-1.0, so you can now read and write your rk2818-based tablet's flash memory under Linux (also w/o the need to root your tablet). Credit for reverse-engineering the protocol goes to the original author of rkflash (see source).
Small guide
- unzip the file
- compile
Linux (Debian, Ubuntu, ...)
Code:
sudo apt-get install libusb-1.0-0-dev
gcc -o rkflashtool rkflashtool.c -lusb-1.0 -O2 -W -Wall -s
Mac OS X (thanks to surfer63, binary here)
Code:
sudo port install libusb
gcc -I/opt/local/include -I/opt/local/include/libusb-1.0 \
-L/opt/local/lib -o rkflashtool rkflashtool.c -lusb-1.0 -O2 -W -Wall
Preparation
- powerdown your tablet
- disconnect all cables
To get into flash mode differs for many tablets. Google around or use trial and error
- insert the USB cable in computer
- hold vol+ (or put on/off/locked-switch in the locked position)
- insert the other end of your cable in the tablet
- wait a few seconds
- release vol+
Now if you run lsusb, the following line should appear:
Bus 001 Device 044: ID 2207:281a (290a for rk2918 based tablets)
Bus and device number may be different. The screen of your tablet stays black.
The USB device must be readable and writable for the user running rkflashtool. If that's not the case, you'll see an error like this:
Code:
$ ./rkflashtool b
libusb couldn't open USB device /dev/bus/usb/001/048: Permission denied.
libusb requires write access to USB device nodes.
rkflashtool: fatal: cannot open device
This can be fixed in several ways (chmod, run as root, udev rules) but that's beyond the scope of this posting. For now, chmod 666 the device mentioned in the error message.
Usage of rkflashtool
Code:
$ ./rkflashtool
rkflashtool: fatal: usage:
rkflashtool b reboot device
rkflashtool r offset size >file read flash
rkflashtool w offset size <file write flash
offset and size are in units of 512 bytes
On my tablet, the boot partition starts at offset 0x8000 (in blocks of 512 bytes)
Its size is 0x2000 blocks
To backup the partition, issue:
Code:
$ ./rkflashtool r 0x8000 0x2000 >boot.img.backup
rkflashtool: info: interface claimed
rkflashtool: info: reading flash memory at offset 0x00008000
rkflashtool: info: reading flash memory at offset 0x00008020
.......
rkflashtool: info: reading flash memory at offset 0x00009fe0
To write a new boot.img or an old backup back to the device:
Code:
$ ./rkflashtool w 0x8000 0x2000 <boot.img.backup
rkflashtool: info: interface claimed
rkflashtool: info: writing flash memory at offset 0x00008000
rkflashtool: info: writing flash memory at offset 0x00008020
.......
rkflashtool: info: writing flash memory at offset 0x00009fe0
You can find a list of all partitions of your tablet in the HWDEF file, which is inside the update.img for your tablet. If no such file is available, you can also look at /proc/cmdline on a running device (either through adb or a terminal app running on the device itself). Depending on the tablet, you might need root access to view /proc/cmdline. Another option is dumping the first 0x2000 blocks of nand flash by issuing rkflashtool r 0x0000 0x2000 >parm. View the file with hexedit, xxd, or a similar program. The kernel parameters contain a description of several mtd partitions (sizes and offsets).
After reading and writing at will, you can reboot your tablet by issuing
./rkflashtool b
Note that if your tablet has an on/off/locked-switch and it is still in the locked position, rebooting won't work.
If the file you are writing is smaller than the specified size, the rest is padded with zeroes. If it's bigger, it will be truncated. This is different from rkflash, which will overwrite blocks beyond the partition size.
rkflashtool does not support flashing a new bootloader directly.
If you have a different tablet, please try rkflashtool b and r first before flashing (w) something new.
Standard DISCLAIMER with regard to bricking your tablet applies.
Enjoy!
EDIT: better build instructions, clean up text
EDIT2: works on rk2918 tablets too (tested on Arnova 7 G2) if you change the USB product id from 0x281a to 0x290a before compilation
EDIT3: released version 2 of rkflashtool. now supports rk2918 tablets out of the box. if it doesn't find one, it falls back to rk2808/rk2818. also, updated the wording a bit.
EDIT4: new mac osx binary
EDIT5: more ways to find offsets and sizes of partitions on your tablet
EDIT6: small emphasis changes above and...
version 1 is here ONLY for archival purposes or if version 2 does not work on your rk28xx tablet. In all other cases, you need to download rkflashtool-v2.zip
Thanks a lot for this flash tool. I'm on MacOSX and Ubuntu and don't have Windows either. I tried the original rkflash as well but couldn't get it to work. On my Ubuntu boxes your rkflashtool compiles and works fine.
My Archos 7 HT V2 presents itself also as:
Code:
Bus 002 Device 004: ID 2207:281a
Reading partitions works fine and so does writing.
I did a quick modification of a system.img (left some files out) of my custom froyo rom and wrote it to my tablet.
That works fine. As /data is a separate partition I even have all my downloaded apps, data, settings, etc. This makes modifying a new rom much faster then building a complete update.img, flashing it, restore some data and then start testing.
Nice work.
great! finally I can remove one line from my todo list
thank you!
EDIT:
random notes (I don't see your code yet so it may be fixed, then sorry)
* I always specify b(reboot) for rk2818 tablets with my rkflash because it hanged easily if I try to write multiple times without b
* parameter file need to be converted with rkcrc -p. official RKAndroid tools flashed it 5 times with offsets. (read & check 1st 0x0-0x2000 block)
* I logged how to update bootloader, but it's complicated and I could not understand probably bootloader can be updated via misc partition. see update-script in update.img. (but not recommended/no reason to do it)
EDIT2:
there is libusb for Windows and OS X. rkflashtool may work on them.
on Windows, there is RKAndroidTool.exe (not batchupgrade). but "read" function in rkflash/rkflashtool may be useful on some case on Windows
Good to hear it works for others, too! I have not had a hanging tablet after several writes in one session, but this might depend on the tablet.
Thanks for mentioning that it should also work on other platforms supported by libusb. I'd forgotten to do that.
About using update.img to flash a new bootloader, this can be done, but if you brick the tablet by flashing a wrong/faulty bootloader, you can only unbrick it with the Windows tools
Which leads me to the question: could you send me the snooped log of updating the bootloader? Two people see more than one and perhaps we can eventually manage to do this through libusb too.
ivop said:
About using update.img to flash a new bootloader, this can be done, but if you brick the tablet by flashing a wrong/faulty bootloader, you can only unbrick it with the Windows tools
Click to expand...
Click to collapse
probably you also need a needle to short pins of NAND chip
so I don't recommend to flash bootloader
ivop said:
Which leads me to the question: could you send me the snooped log of updating the bootloader? Two people see more than one and perhaps we can eventually manage to do this through libusb too.
Click to expand...
Click to collapse
I made that log several months ago with another windows machine which is not used lately. I'm not sure log is still exist... if I find it, I'll send it to you (but please don't expect)
probably you may also get log on Windows on VM on Linux. it seems VMware has log function (refer http://vusb-analyzer.sourceforge.net/tutorial.html) or there is "usbmon" function in Linux.
actually I didn't try this way myself so it may be wrong, sorry.
I've tryed a couple of firmwares, cooking my own.
Every time after flashing, tablet shows boot animation and after few seconds display becomes dark.
My investigation led me to following:
Log shows:
Code:
ERROR/Lights(865): write_int failed to open /sys/class/backlight/rk28_button_light/brightness
in /sys/class/backlight I found symlink (rk28_bl):
rk28_bl -> ../../devices/platform/rk28_backlight/backlight/rk28_bl
Shouldn't be there another symlink named r28_button_light ?
I'm using MANTA MID001 from Poland.
fun_ said:
EDIT2:
there is libusb for Windows and OS X. rkflashtool may work on them.
Click to expand...
Click to collapse
ivop said:
Good to hear it works for others, too! I have not had a hanging tablet after several writes in one session, but this might depend on the tablet.
Click to expand...
Click to collapse
I did a couple of successive writes as well from ubuntu.
ivop said:
Thanks for mentioning that it should also work on other platforms supported by libusb. I'd forgotten to do that.
Click to expand...
Click to collapse
My main platform is OSX and I immediately added libusb. So far I have not been able to compile rkflashtool despite declaring all kind of CFLAGS, CXXFLAGS and/or LDFLAGS.
Trying a little bit more.
Could you post the compiler warnings/errors here? I might be able to help out.
ivop said:
Could you post the compiler warnings/errors here? I might be able to help out.
Click to expand...
Click to collapse
I managed to compile it. It took a lot of hurdles. I used the build environment I also use for Hugin for which I'm the OSX maintainer.
I now built a single combined 32/64bit (i386/x86_64) rkflashtool that will run on 10.4.x/10.5.x/10.6.x/10.7.x (building multi-architecture, multi-version binaries/libraries in one binary/library is possible on OSX. I'm not going to explain that here but it's a feature of OSX).
The compiled version is attached. You can also attach it to your first post if you like.
It works fine. I did some reading/writing of images without issues.
If you are on OSX and have macports installed, you can do the following to build rkflashtool.
Install libusb from Macports:
Code:
sudo port install libusb
cd into the folder where your rkflashtool.c is is and run the following command:
Code:
gcc -I/opt/local/include -I/opt/local/include/libusb-1.0 \
-L/opt/local/lib -o rkflashtool rkflashtool.c -lusb-1.0 -W -Wall
This will build rkflashtool for your native environment (OSX version, hardware and config).
--- removed the rest of the post as well as the attachments. He/She who is interested in building a complete universal distributable rkflashtool can ask via this thread ---
UPDATE: Works on rk2918 tablet too
Yesterday I have tested the tool on an Arnova 7 G2 tablet, which has an rk2918 CPU. If you change the ProductID before compilation, like this:
... libusb_open_device_with_vid_pid(c, 0x2207, 0x281a) ...
to
... libusb_open_device_with_vid_pid(c, 0x2207, 0x290a) ...
it'll work, except for rebooting the device if the tablet is still locked. To boot the tablet in bootloader mode, turn off the tablet completely, put the on/off-switch in the locked position and connect it to your computer. It should be visible now with lsusb. For further instructions, see first post. I advise dumping the first 0x2000 blocks at offset 0x0000 first as this contains the parameter block in which you can see where each partition starts and how big it is.
ivop said:
UPDATE: Works on rk2918 tablet too
Yesterday I have tested the tool on an Arnova 7 G2 tablet, which has an rk2918 CPU. If you change the ProductID before compilation, like this:
... libusb_open_device_with_vid_pid(c, 0x2207, 0x281a) ...
to
... libusb_open_device_with_vid_pid(c, 0x2207, 0x290a) ...
Click to expand...
Click to collapse
Feature request :
I's nice but could you also make it a startup option, like the b,r,w options, with an if-else option in the source code? Something like (RK)2818 and (RK)2918 and maybe even for the older ones: (RK)2808.
In that case you only need one binary. Users who are going to use the tool will definitely know what CPU they have.
surfer63 said:
Feature request :
I's nice but could you also make it a startup option, like the b,r,w options, with an if-else option in the source code? Something like (RK)2818 and (RK)2918 and maybe even for the older ones: (RK)2808.
In that case you only need one binary. Users who are going to use the tool will definitely know what CPU they have.
Click to expand...
Click to collapse
I released a new version and updated the first post. It now tries to connect to an rk2918 tablet and if it doesn't find one, it falls back to rk2818.
The V2 version works fine too on MacOSX. The compilation is still the same for a "my machine only" version.
I compiled a universal Intel 32bit/64bit 10.4/10.5/10.6/10.7 V2 version as well.
See attached.
Note: I don't have a RK2918 so I can only test for a RK2818 tablet.
Hi,
Thanks for your thread it's very intersting.
I succeed flashing my boot partition with your tool but I don't success in remount,rw my system partition. It's cramFS and in init.rk28board.rc you can see those line :
Code:
# Mount /system rw first to give the filesystem a chance to save a checkpoint
mount cramfs [email protected] /system
mount cramfs [email protected] /system ro remount
I tried everything like replacing ro by rw, deleting the second line but my system stills in ReadOnly, don't understand why. I also tried deleting those lines to test if my flash process works properly and it's worked... So I'm lost. Any idea ?
----
Other thing, if I want to do same as flashing boot partition but with system partition is it possible with the same process ? Unfortunately I don't know the beginning offset of the partition. I don't know where to find HWDEF file. The size of partition is 00038000 (hex) bytes => 229376 (dec) bytes
Here is my /proc/mtd :
Code:
dev: size erasesize name
mtd0: 00002000 00000010 "misc"
mtd1: 00004000 00000010 "kernel"
mtd2: 00002000 00000010 "boot"
mtd3: 00004000 00000010 "recovery"
mtd4: 00038000 00000010 "system"
mtd5: 0003a000 00000010 "backup"
mtd6: 0003a000 00000010 "cache"
mtd7: 00080000 00000010 "userdata"
mtd8: 00534000 00000010 "user"
mtd9: 00020000 00000010 "pagecache"
mtd10: 00020000 00000010 "swap"
Thank you for your great job
My problem is solved. I was searching for a while but ivop gave the answer in a previous post
I advise dumping the first 0x2000 blocks at offset 0x0000 first as this contains the parameter block in which you can see where each partition starts and how big it is.
Click to expand...
Click to collapse
So I did it, after I opened an Hex Editor like GHex on Ubuntu and I can saw this :
Code:
[email protected](misc),
[email protected](kernel),
[email protected](boot),
[email protected](recovery),
[email protected](system),
[email protected](backup),
[email protected](cache),
[email protected](userdata),
[email protected](user)
So system partition starts at E000 and has a length of 38000 (hex) bytes.
Thanks for your help this thread is now in my bookmarks
And really nice job with this flashtool
I pushed latest my rkutils to https://github.com/naobsd/rkutils
rkunpack can unpack RKFW image used in RK2918 ROM, RKAF image (update.img), KRNL/PARM image used in some single partition image. unpack will be done recursively.
rkcrc can make KRNL/PARM images with -k/-p.
rkafpack can make RKAF image. (I need to write docs/howtos...)
little off-topic,
latest RK2918 ROMs which is based on "SDK2.0", new format for boot.img/recovery.img is introduced. it's almost same as common boot.img format for android. unpackbootimg/mkbootimg can be used to unpack/repack it with one exception...
there is SHA1 hash value in header of boot.img (offset 0x240 bytes). Rockchip changes it by some unknown way. normal mkbootimg can't generate same hash value as Rockchip, so we can't make custom boot.img with new format
fortunately, we can split new boot.img, and we can make separate kernel.img and boot.img(ramdisk) like as pre-SDK2.0 RK2918 ROMs, which is loadable with new bootloader in SDK2.0 ROMs.
--
btw I just found interesting one: https://github.com/jhonxie/rk2918_tools
relsyou said:
My problem is solved. I was searching for a while but ivop gave the answer in a previous post
So I did it, after I opened an Hex Editor like GHex on Ubuntu and I can saw this :
Code:
[email protected](misc),
[email protected](kernel),
[email protected](boot),
[email protected](recovery),
[email protected](system),
[email protected](backup),
[email protected](cache),
[email protected](userdata),
[email protected](user)
So system partition starts at E000 and has a length of 38000 (hex) bytes.
Thanks for your help this thread is now in my bookmarks
And really nice job with this flashtool
Click to expand...
Click to collapse
I'll add that to my first post. Also, you can view /proc/cmdline to see a list of partitions. It's part of the kernel command line.
Note that the lengths are not in bytes but in blocks of 512 bytes. This happens to be the same as the requirements of the rkflashtool btw (length in blocks).
As for having a writable system partition, currently the system partition is cramfs which cannot be written to. Ever. If you want a writable system partition, you need to change it to ext3 for example. That means unpacking fun_'s system.img and recreating it as an ext3 partition.
In short:
Unpack cramfs img with cramfsck -x (as root, so you preserve permissions and uid/gid)
Create an empty file the size of your system partition (dd if=/dev/null of=fubar.img bs=512 count=...... et cetera, do the math)
mkfs.ext3 fubar.img
mount -o loop fubar.img /someplacemountable
copy contents of old image to /someplacemountable (use cp -a to preserve ownership etc)
umount
flash fubar.img to system partition
change init.rk28board.rc to reflect the changes
reflash boot.img
reboot device
This is untested, but should work in theory.
Another option is to keep the system partition read-only and use unionfs to overlay a writable partition. I'm not sure if this can be a file on your userdata partition mounted with -o loop, but I suppose it can. This depends on your kernel having unionfs and loopback support though.
fun_ said:
I pushed latest my rkutils to https://github.com/naobsd/rkutils
Click to expand...
Click to collapse
Nice! I was thinking about creating an rkpack(tool ) myself, but I see it's not necessary anymore.
here is an example for rkafpack
Code:
$ rkunpack N3NET-2.3-20110722.img
[COLOR="Red"][B]FIRMWARE_VER:1.0.0[/B][/COLOR]
[COLOR="Red"][B]MACHINE_MODEL:rk2818sdk[/B][/COLOR]
MACHINE_ID:
[COLOR="Red"][B]MANUFACTURER:rock-chips[/B][/COLOR]
unpacking 12 files
-------------------------------------------------------------------------------
00000800-00000fff [COLOR="Red"][B]HWDEF:HWDEF[/B][/COLOR] 797 bytes
00001000-000017ff [COLOR="Red"][B]package-file:package-file[/B][/COLOR] 532 bytes
00001800-00021fff [COLOR="Red"][B]bootloader:RK28xxLoader(L).bin[/B][/COLOR] 131700 bytes
00022000-000227ff [COLOR="Red"][B]parameter:parameter:[email protected][/B][/COLOR] 506 bytes
00022800-0002e7ff [COLOR="Red"][B]misc:Image/misc.img:[email protected][/B][/COLOR] 49152 bytes
0002e800-0066bfff [COLOR="Red"][B]kernel:Image/kernel.img:[email protected][/B][/COLOR] 6541946 bytes
0066c000-006947ff [COLOR="Red"][B]boot:Image/boot.img:[email protected][/B][/COLOR] 163844 bytes
00694800-008e8fff [COLOR="Red"][B]recovery:Image/recovery.img:[email protected][/B][/COLOR] 2441220 bytes
008e9000-085fc7ff [COLOR="Red"][B]system:Image/system.img:[email protected][/B][/COLOR] 131149828 bytes
----------------- [COLOR="Red"][B]backup:SELF:[email protected][/B][/COLOR] (N3NET-2.3-20110722.img) 140498948 bytes
085fc800-085fcfff [COLOR="Red"][COLOR="Red"][B]update-script:update-script[/B][/COLOR][/COLOR] 1294 bytes
085fd000-085fd7ff [COLOR="Red"][B]recover-script:recover-script[/B][/COLOR] 266 bytes
-------------------------------------------------------------------------------
unpacked
$ rkafpack \
[COLOR="Red"][B]FIRMWARE_VER:1.0.0[/B][/COLOR] \
[COLOR="Red"][B]MACHINE_MODEL:rk2818sdk[/B][/COLOR] \
[COLOR="Red"][B]MANUFACTURER:rock-chips[/B][/COLOR] \
[COLOR="Red"][B]HWDEF:HWDEF[/B][/COLOR] \
[COLOR="Red"][B]package-file:package-file[/B][/COLOR] \
'[COLOR="Red"][B]bootloader:RK28xxLoader(L).bin[/B][/COLOR]' \
[COLOR="Red"][B]parameter:parameter:[email protected][/B][/COLOR] \
[COLOR="Red"][B]misc:Image/misc.img:[email protected][/B][/COLOR] \
[COLOR="Red"][B][B]kernel:Image/kernel.img:[email protected][/B][/B][/COLOR] \
[COLOR="Red"][B]boot:Image/boot.img:[email protected][/B][/COLOR] \
[COLOR="Red"][B]recovery:Image/recovery.img:[email protected][/B][/COLOR] \
[COLOR="Red"][B]system:Image/system.img:[email protected][/B][/COLOR] \
[COLOR="Red"][B]backup:SELF:[email protected][/B][/COLOR] \
[COLOR="Red"][B]update-script:update-script[/B][/COLOR] \
[COLOR="Red"][B]recover-script:recover-script[/B][/COLOR] \
> new.img
$ sha1sum N3NET-2.3-20110722.img new.img
e758a6c47dca7f09f0b8a82ad89b0cd7c7c8e826 N3NET-2.3-20110722.img
e758a6c47dca7f09f0b8a82ad89b0cd7c7c8e826 new.img
some values are empty in RK2818 ROM.
--
here is how to make RKFW image
Code:
$ rkunpack N50-2.3-20111103-ZZ-SDK2.0.img
VERSION:2.0.3
unpacking
00000000-00000065 N50-2.3-20111103-ZZ-SDK2.0.img-HEAD 102 bytes
00000066-00022623 N50-2.3-20111103-ZZ-SDK2.0.img-BOOT 140734 bytes
00022624-0c342627 update.img 204603396 bytes
unpacking update.img
================================================================================
FIRMWARE_VER:0.2.3
MACHINE_MODEL:rk29sdk
MACHINE_ID:007
MANUFACTURER:RK29SDK
unpacking 10 files
-------------------------------------------------------------------------------
00000800-00000fff package-file:package-file 540 bytes
00001000-000237ff bootloader:RK29xxLoader(L)_V2.08.bin 140734 bytes
00023800-00023fff parameter:parameter:[email protected] 610 bytes
00024000-0002ffff misc:Image/misc.img:[email protected] 49152 bytes
00030000-006a3fff boot:Image/boot.img:[email protected] 6766592 bytes
006a4000-01167fff recovery:Image/recovery.img:[email protected] 11288576 bytes
01168000-0c31efff system:Image/system.img:[email protected] 186346496 bytes
----------------- backup:SELF:[email protected] (update.img) 204603396 bytes
0c31f000-0c31f7ff update-script:update-script 933 bytes
0c31f800-0c31ffff recover-script:recover-script 266 bytes
-------------------------------------------------------------------------------
================================================================================
00022624-0c342627 N50-2.3-20111103-ZZ-SDK2.0.img-MD5 32 bytes
unpacked
$ cat N50-2.3-20111103-ZZ-SDK2.0.img-HEAD N50-2.3-20111103-ZZ-SDK2.0.img-BOOT update.img > new.img
$ md5sum new.img
[COLOR="Red"][B]5191abc65649eacf8d2476e37d84a046[/B][/COLOR] new.img
$ cat N50-2.3-20111103-ZZ-SDK2.0.img-MD5
5191abc65649eacf8d2476e37d84a046
$ echo -n [COLOR="Red"][B]5191abc65649eacf8d2476e37d84a046[/B][/COLOR] >> new.img
$ sha1sum N50-2.3-20111103-ZZ-SDK2.0.img new.img
3120b13df8886e0ddfae0e35379443c27c925572 N50-2.3-20111103-ZZ-SDK2.0.img
3120b13df8886e0ddfae0e35379443c27c925572 new.img

[Q] HELP stuck in a serious bootloop

My htc was off for one month because i went to a trip and did not take it with me. when i came back i turned it on and boom! bootloop! came from nowhere.
I had the vipers rom on it so i tried to update to the newest vipers rom but still bootloop. i tried to install different rom but nothing help,
At the end i installed RUU and still i'm in bootloop! please help me
amitshkuri said:
My htc was off for one month because i went to a trip and did not take it with me. when i came back i turned it on and boom! bootloop! came from nowhere.
I had the vipers rom on it so i tried to update to the newest vipers rom but still bootloop. i tried to install different rom but nothing help,
At the end i installed RUU and still i'm in bootloop! please help me
Click to expand...
Click to collapse
can you boot into bootloader?
if yes post all the on screen details
rzr86 said:
can you boot into bootloader?
if yes post all the on screen details
Click to expand...
Click to collapse
yes i can get into bootloader but in recovery i get error.
***LOCKED***
PYRAMID PVT SHIP S-OFF RL
HBOOT-1.27.0000
RADIO-11.24A.3504.31_M
OpenADSP-v05.6.0.2226.00.0418
eMMC-boot
JAN 13 2012, 17:33:34
HBOOT
FASTBOOT
RECOVERY
FACTORY RESET
SIMLOCK
IMAGE CRC
amitshkuri said:
yes i can get into bootloader but in recovery i get error.
***LOCKED***
PYRAMID PVT SHIP S-OFF RL
HBOOT-1.27.0000
RADIO-11.24A.3504.31_M
OpenADSP-v05.6.0.2226.00.0418
eMMC-boot
JAN 13 2012, 17:33:34
HBOOT
FASTBOOT
RECOVERY
FACTORY RESET
SIMLOCK
IMAGE CRC
Click to expand...
Click to collapse
from this guide it has 3 options to flash 4ext recovery(see step 1)
http://forum.xda-developers.com/showthread.php?t=1472298
after that go into recovery
format all partitions except sdcard
flash the rom
see if it boots
rzr86 said:
from this guide it has 3 options to flash 4ext recovery(see step 1)
http://forum.xda-developers.com/showthread.php?t=1472298
after that go into recovery
format all partitions except sdcard
flash the rom
see if it boots
Click to expand...
Click to collapse
i flashed 4ext recovery and flashed 3.33 firmware and flashed ARHD 7.2 (i did full wipe for all patitions)
still in bootloop but now it pass the HTC logo and the quitly brilliant logo and start the beats animation then it restart.
HI
GREETINGS
according to your bootloader you have stock htc hboot and
stock htc hboot does not go well with soff
flash the hboot in my attachment
to flash the hboot:-
1 put the file in root of sd card
2 reboot into bootloader
3 the bootloader will scan the file, follow on screen instruction
4 reboot back in to bootloader and make a clean installation of the rom as suggested by "RZR86"
shrex said:
HI
GREETINGS
according to your bootloader you have stock htc hboot and
stock htc hboot does not go well with soff
flash the hboot in my attachment
to flash the hboot:-
1 put the file in root of sd card
2 reboot into bootloader
3 the bootloader will scan the file, follow on screen instruction
4 reboot back in to bootloader and make a clean installation of the rom as suggested by "RZR86"
Click to expand...
Click to collapse
I flashed the new hboot and flashed the recovery again and made a clean installation including format for all partitions and still i stuck in this bootloop! what can i do more?
amitshkuri said:
what can i do more?
Click to expand...
Click to collapse
Absolutely loads of stuff. First thing is to get the logs.
Flash a rom with adb set in the default.prop in the boot image ramdisk ( CM for example )
while the device is bootlooping run
Code:
adb shell dmesg
which gives the kernel messages then you can run
Code:
adb logcat -b system -b radio -b events -b main
this will run forever, you'll notice it repeating the same messages over and over, look out for lines that start with "E/"
they're errors being reported and will lead you to the cause of you're bootloop
If either of these two fail then reboot into recovery and run
Code:
adb shell cat /dev/last_kmsg
This is a saved copy of dmsg from the last session.
Once you've got the logs you can easily pinpoint the cause of the problem all you got is read them
PROTIP: Look for the word error or fail or something similar
ok so that's all the errors i found while booting:
E/QC-NETMGR-LIB( 165): couldn't open file /sys/module/f_rmnet/parameters/rmnet_ctl_ch
E/QC-NETMGR-LIB( 165): couldn't open /sys/module/rmnet/parameters/rmnet_ctl_ch
E/QC-NETMGR-LIB( 165): ifioctl: close port failed: (9)Bad file number
E/DxDrmNexPlayerIntegrator( 169): ** Discretix Server loaded config file - result=0 **
E/DxDrmNexPlayerIntegrator( 169): ** Discretix SignalsListener Thread is starting **
E/DxSecureClock( 169): ** Discretix Clock Monitor is starting **
E/msm8660.gralloc( 153): DEBUG_CALC_FPS: 0
E/msm8660.gralloc( 153): period: 10
E/msm8660.gralloc( 153): ignorethresh_us: 500000
E/QC-NETMGR-LIB( 165): ifioctl: open port failed: (19)No such device
E/QC-NETMGR-LIB( 165): netmgr_kif_ifioctl_open_port() failed for rmnet0 on attempt 0
E/SurfaceFlinger( 153): composer device failed to initialize (Invalid argument)
E/rmt_storage( 120): Unable to open /boot/modem_fsg
E/rmt_storage( 120): Invalid rmt_storage client
E/QC-NETMGR-LIB( 165): ifioctl: close port failed: (9)Bad file number
E/QC-NETMGR-LIB( 165): ifioctl: open port failed: (19)No such device
E/QC-NETMGR-LIB( 165): netmgr_kif_ifioctl_open_port() failed for rmnet0 on attempt 1
E/QC-NETMGR-LIB( 165): ifioctl: close port failed: (9)Bad file number
E/QC-NETMGR-LIB( 165): ifioctl: open port failed: (19)No such device
E/QC-NETMGR-LIB( 165): netmgr_kif_ifioctl_open_port() failed for rmnet0 on attempt 2
E/HtcBootAnimation( 225): Could not find width.
E/HtcBootAnimation( 225): Could not find height.
E/HtcBootAnimation( 225): Could not find framerate.
E/HtcBootAnimation( 225): Could not find part1.
E/HtcBootAnimation( 225): Could not find part2.
E/HtcBootAnimation( 225): Could not find part3.
E/HtcBootAnimation( 225): sqlite3_open error, sqlite result: 14, errno: 2, No such file or directory
E/QC-DIAG_LSM( 156):
E/QC-DIAG_LSM( 156): Diag_LSM: Diag_LSM_Init: Failed to open handle to diag driver, error = 13
E/QC-NETMGR-LIB( 165): ifioctl: close port failed: (9)Bad file number
E/QC-NETMGR-LIB( 165): ifioctl: open port failed: (19)No such device
E/QC-NETMGR-LIB( 165): netmgr_kif_ifioctl_open_port() failed for rmnet0 on attempt 3
E/ExtendedExtractor( 156): Failed to open MM_PARSER_LIB, dlerror = Cannot load library: reloc_library[1290]: 156
E/AudioPolicyManagerBase( 156): Could not open support_receiver()
E/QC-NETMGR-LIB( 165): ifioctl: close port failed: (9)Bad file number
E/QC-NETMGR-LIB( 165): ifioctl: open port failed: (19)No such device
E/QC-NETMGR-LIB( 165): netmgr_kif_ifioctl_open_port() failed for rmnet0 on attempt 4
And this came at the second of crash:
E/QC-NETMGR-LIB( 165): ifioctl: close port failed: (9)Bad file number
E/QC-NETMGR-LIB( 165): ifioctl: open port failed: (19)No such device
E/QC-NETMGR-LIB( 165): netmgr_kif_ifioctl_open_port() failed for rmnet0 on attempt 5
E/QC-NETMGR-LIB( 165): ifioctl: close port failed: (9)Bad file number
E/QC-NETMGR-LIB( 165): ifioctl: open port failed: (19)No such device
E/QC-NETMGR-LIB( 165): netmgr_kif_ifioctl_open_port() failed for rmnet0 on attempt 6
E/QC-NETMGR-LIB( 165): ifioctl: close port failed: (9)Bad file number
E/QC-NETMGR-LIB( 165): ifioctl: open port failed: (19)No such device
E/QC-NETMGR-LIB( 165): netmgr_kif_ifioctl_open_port() failed for rmnet0 on attempt 7
am i in trouble?
amitshkuri said:
am i in trouble?
Click to expand...
Click to collapse
It's difficult to say with ONLY the errors LOL. You've just removed all the context of what was going on around leading upto it. Can you post the rest of them, not here though, pastebin or somewhere like that.
Also dmesg output would be pretty useful to see if all the drivers are install correctly.
At first glance, You seem to be missing some vital libraries. files, to say anything more at this point would just be guessing? but yeah, dmesg and a full logcat.
Actually to save a back and forth you can run the following commands
Code:
adb root
adb shell stop
adb shell dumpstate > state.txt
adb shell dumpsys > sys.txt
Don't know what you know so I'll explain what this does.
adb root , restarts adb as the root user
adb shell stop, this stops the servicemanager and it's child services , basically stop loading android. If you have a boot animation you should see it stop, this also stops device from rebooting as the next commands take some time to run.
dumpstate and dumpsys will dump your entire device contents to state.txt and sys.txt on your desktop machine. you won't see any output and they do take some time to run so please be patient. As you've fully formatted it I wouldn't expect any personal data to be present in those files but may contain device specific info please have a look before posting. searching the for things like your email address, name, IMEI, serial no's etc should help.
Then zip the files and attach them to this thread. Like I mentioned these files contain everything about the Device and the current state and will give us everything we need to figure out whats wrong.
If you're not comfortable "doing the dump!" ( sounds like a song ) then option 1 of logcat and dmesg should do I'll probably end up asking for more but meh!
ok i tried but
Code:
adb root
adb shell stop
didn't help and the boot restart again and again so i cannot write the rest of codes you gave me.
i attached a rar file with the context of logcat and dmesg.
amitshkuri said:
ok i tried but
Code:
adb root
adb shell stop
didn't help and the boot restart again and again so i cannot write the rest of codes you gave me.
i attached a rar file with the context of logcat and dmesg.
Click to expand...
Click to collapse
That's fine dmesg tells all in this case, It's a bit weird. you system partition seem to be at fault. these messages
Code:
<6>[ 2.457794] EXT4-fs (mmcblk0p22): INFO: recovery required on readonly filesystem
<6>[ 2.457977] EXT4-fs (mmcblk0p22): write access will be enabled during recovery
<6>[ 2.466827] EXT4-fs (mmcblk0p22): barriers disabled
<6>[ 2.468963] EXT4-fs (mmcblk0p22): recovery complete
<6>[ 2.476013] EXT4-fs (mmcblk0p22): mounted filesystem with writeback data mode. Opts: barrier=0
which is just information but a couple of lines down is this
Code:
<6>[ 3.588012] EXT4-fs (mmcblk0p22): re-mounted. Opts: noauto_da_alloc,barrier=0
Logcat also has this related message
Code:
I//system/xbin/busybox( 107): tune2fs 1.41.12 (17-May-2010)
I//system/xbin/busybox( 107): tune2fs 1.41.12 (17-May-2010)
I//system/xbin/busybox( 107): The needs_recovery flag is set. Please run e2fsck before clearing
what it looks like is happening is the kernel has remounted your /system partition to try to set it up for recovery while the device is booting make system files unavailable in the process, which ties up to the messages about missing libraries from earlier on. it may well be easily solved simply by following the instruction and running e2fsck on /dev/block/mmcblk0p22, it worth a shot I'd say.
reboot into recovery and run
Code:
adb shell e2fsck /dev/block/mmcblk0p22
you may also have to remove the need_recovery flag from the partition... I don't know how to do that off the top of my head and I have to go out for a bit.... Google may be your friend
More Soon!
own diBeco
trevd said:
That's fine dmesg tells all in this case, It's a bit weird. you system partition seem to be at fault. these messages
Code:
<6>[ 2.457794] EXT4-fs (mmcblk0p22): INFO: recovery required on readonly filesystem
<6>[ 2.457977] EXT4-fs (mmcblk0p22): write access will be enabled during recovery
<6>[ 2.466827] EXT4-fs (mmcblk0p22): barriers disabled
<6>[ 2.468963] EXT4-fs (mmcblk0p22): recovery complete
<6>[ 2.476013] EXT4-fs (mmcblk0p22): mounted filesystem with writeback data mode. Opts: barrier=0
which is just information but a couple of lines down is this
Code:
<6>[ 3.588012] EXT4-fs (mmcblk0p22): re-mounted. Opts: noauto_da_alloc,barrier=0
Logcat also has this related message
Code:
I//system/xbin/busybox( 107): tune2fs 1.41.12 (17-May-2010)
I//system/xbin/busybox( 107): tune2fs 1.41.12 (17-May-2010)
I//system/xbin/busybox( 107): The needs_recovery flag is set. Please run e2fsck before clearing
what it looks like is happening is the kernel has remounted your /system partition to try to set it up for recovery while the device is booting make system files unavailable in the process, which ties up to the messages about missing libraries from earlier on. it may well be easily solved simply by following the instruction and running e2fsck on /dev/block/mmcblk0p22, it worth a shot I'd say.
reboot into recovery and run
Code:
adb shell e2fsck /dev/block/mmcblk0p22
you may also have to remove the need_recovery flag from the partition... I don't know how to do that off the top of my head and I have to go out for a bit.... Google may be your friend
More Soon!
Click to expand...
Click to collapse
The shell e2fsck did not help, still in bootloop.
i searched in google about the need_recovery flag and i found one post that explain how to do this but in ubuntu linux
the command " debugfs " mentioned there, i dont really understand what to do.
amitshkuri said:
The shell e2fsck did not help, still in bootloop.
i searched in google about the need_recovery flag and i found one post that explain how to do this but in ubuntu linux
the command " debugfs " mentioned there, i dont really understand what to do.
Click to expand...
Click to collapse
hi again.
After reading some more e2fsck need some extra options. apologises for that
Also as is usually the case with these things you're not the first person to have this problem. A quick xda search for "The needs_recovery flag is set" brings up this post
I've just tested it because my cache partition has the needs_recovery flag set so I ran the commands in that post in recovery and it did clear the needs_recovery flag. so in your case you need to boot into recovery make sure /system is NOT mount which should be the default state and run the following commands
Code:
adb shell
tune2fs -l /dev/block/mmcblk0p22 | grep features
this command get the list of filesystem features it should look something like this ( order may be different )
Code:
Filesystem features: has_journal resize_inode filetype needs_recovery extent sparse_super large_file
Next we'll run e2fsck with the right command this time LOL
Code:
e2fsck -f /dev/block/mmcblk0p22
After that we can remove the old journal with tune2fs
Code:
tune2fs -O ^has_journal -c 1 -i 1d -m 0 /dev/block/mmcblk0p22
This should remove both the has_journal and needs_recovery flags from the feature list. Seeing as has_journal was set we'll turn it back on
Code:
tune2fs -O has_journal -c 1 -i 1d -m 0 /dev/block/mmcblk0p22
Note the caret symbol ( ^ ) which is the difference between the above to commands. This controls whether a feature should be added or removed
Finally check the feature list again
Code:
tune2fs -l /dev/block/mmcblk0p22 | grep features
It should now look like this or something similar, If it still has needs_recovery in the list then something is wrong
Code:
Filesystem features: has_journal resize_inode filetype extent sparse_super large_file
All we need to do now is pray to the ghost of steve jobs and say the magic words
Code:
reboot
And hopefully we might have a win for you! :good:
when i write this line: e2fsck -f /dev/block/mmcblk0p22
i get this: Pass 1: Checking inodes, blocks, and sizes
Inodes that were part of a corrupted orphan linked list found. Fix<y>?
if i press "y" i get this: Inode 13765 is in use, but has dtime set. Fix<y>?
and more and more and more questions and cant continue with the next lines you gave me.
what to do?
amitshkuri said:
when i write this line: e2fsck -f /dev/block/mmcblk0p22
i get this: Pass 1: Checking inodes, blocks, and sizes
Inodes that were part of a corrupted orphan linked list found. Fix<y>?
if i press "y" i get this: Inode 13765 is in use, but has dtime set. Fix<y>?
and more and more and more questions and cant continue with the next lines you gave me.
what to do?
Click to expand...
Click to collapse
e2fsck -f -y /dev/block/mmcblk0p22
That will answer yes to all questions!
i did all exactly and still in a bootloop..
i got Filesystem features: has_journal resize_inode filetype extent sparse_super large_file
without the needs recovery, all went well.
is there hope?
amitshkuri said:
i did all exactly and still in a bootloop..
i got Filesystem features: has_journal resize_inode filetype extent sparse_super large_file
without the needs recovery, all went well.
is there hope?
Click to expand...
Click to collapse
Time to rinse and repeat, Grab the dmesg and the logcat and lets see what it's saying now? Also Have you tried reflashing the rom, it's possible the tune2fs has deleted some files but we can only find out by looking at the logs!
i tried now to reflashed and still bootloop :/
i attached the new demsg and logcat.
thank you for all the help!
amitshkuri said:
i tried now to reflashed and still bootloop :/
i attached the new demsg and logcat.
thank you for all the help!
Click to expand...
Click to collapse
Not a problem on the help. At least you bought an interesting problem to solve It's not your normal bootloop cause.
hmmm , It seems to have gone back to needs recovery.... Ok. Can you run the command from earlier but this time do not re-add the journal feature, so these commands
Code:
tune2fs -l /dev/block/mmcblk0p22 | grep features
e2fsck -f -y -v /dev/block/mmcblk0p22
tune2fs -O ^has_journal -c 1 -i 1d -m 0 /dev/block/mmcblk0p22
tune2fs -l /dev/block/mmcblk0p22 | grep features
#EDIT Mount as read only to mark it ready for mounting
mount -ro -text4 /dev/block/mmcblk0p22 /system
reboot
can you copy the output of these commands and post them up, I'm just curious to see what its runnning.
Do you know how to make your boot image insecure and how to mount /system with rw by default?
If not can you send me the boot image you're using an i'll fix it up.
The plan is to attempt the fs repair and remove journaling which from what I understand can be responsible for triggering the needs_recovery. should that not work, the kernel will try running recovery on the fs at boot time but this time it won't need to remount the /system partition because it will be already mounted as rw ... that's the theory at least.
If it fails send the logs and we'll have a look a some other options depending on the log out. But I wouldn't be worried there's still a couple of more things we can leverage to fixup the system partition.

Sony Z5 Premium pure AOSP 7.0 Nougat

Z5 Premium AOSP
This rom is just AOSP build with Sony sources for Z5 premium. Not everything works perfectly.
Download: Download
== Installation ==
Flash all files via fastboot:
- fastboot flash boot boot.img
- fastboot boot boot-recovery.img
- enter recovery with volume up, advanced wipe: data, cache, dalvik cache
- flash or adb sideload the aosp.zip
- flash or adb sideload gapps and/or supersu
- Reboot
Enjoy!
XDA:DevDB Information
Sony Z5 Premium pure AOSP 7.0 Nougat, ROM for the Sony Xperia Z5 Premium
Contributors
krabappel2548
Source Code: https://github.com/xperia-aosp-project
ROM OS Version: 7.x Nougat
ROM Kernel: Linux 3.10.x
Based On: AOSP
Version Information
Status: Beta
Current Stable Version: 1.0
Stable Release Date: 2016-09-19
Created 2016-04-02
Last Updated 2016-09-19
Hi, know you from the Xperia S days! Thanks for your work. Would it be possible to add what's not working as intended?
K,
okay,
What's working, with the exception of NFC and Communications which i can't test as I have no sim installed or alternate device to test NFC.
NOTE: I did not flash userdata.img
Tunes :good:
Bluetooth Pairing :good: , no tethering for wifi, but then again I'm probably doing that wrong.
currently there is no app or filemanager with a transfer function so i can't test file transfer.
Rotation :good:
ADB :good:
Storage, external :good: , Exfat support needed [kernel]
Code:
adb shell cat /proc/filesystems
nodev sysfs
nodev rootfs
nodev bdev
nodev proc
nodev cgroup
nodev cpuset
nodev tmpfs
nodev debugfs
nodev sockfs
nodev pipefs
nodev anon_inodefs
nodev configfs
nodev devpts
ext3
ext2
ext4
nodev ramfs
vfat
fuseblk
nodev fuse
nodev fusectl
nodev pstore
nodev selinuxfs
nodev functionfs
Wifi , kind of mixed, I use mac filters on my router, when trying to connect with this rom connection fails.
mac address in this rom is different. After adding new mac, connection is go.
Youtube playback via browser is good. So video and audio playback are good.
Mic is up :good: Recording audio is good to go.
Cameras are janky, but well, yeah. :silly: Video recording DOES function though, the colors are all porked and images are backwards/flipped and off color, Note this is using opencamera and not default, default is porky.
Booting/rebooting , you don't have the sony init set up properly so no button trigger/ led functions to boot to FOTAKernel/recovery.
That's what i have so far. Didn't do the GAPPS test as per note on booting/rebooting.
m
Edit: Please post your specific sources if different from current offerings including any build system patches? Thanks.
krabappel2548 said:
- fastboot flash recovery recovery.img
Click to expand...
Click to collapse
Tried that (recovery.img) with the Z5 and it wouldn't work,
also there's some issue if you use the twrp recovery script to boot to TWRP via volume-button pressing during bootup - also didn't work - which was weird
moonbutt74 said:
[snip]
Storage, external :good: , Exfat support needed [kernel]
[snip]
Click to expand...
Click to collapse
not only that - it needs support in the ROM, I tried a kernel with exfat included and it still insisted to format the microSD with FAT32,
being formatted with exFAT - it said that it's corrupted and wouldn't recognized or automount it
This is ridiculous - using a patent encumbered filesystem as a default which can't be used with the default system (AOSP) :silly:
Who cares about Microsoft's filesystems ? They should have used ext4 with some minor changes, reiserfs, reiser4, etc. instead,
it's not like you access the microSD directly via usb-storage functionality like in the good ol' days, it's through MTP anyway ...
moonbutt74 said:
Wifi , kind of mixed, I use mac filters on my router, when trying to connect with this rom connection fails.
mac address in this rom is different. After adding new mac, connection is go.
Click to expand...
Click to collapse
Afaik there's a MAC address jumbling functionality in the Kernel that does this,
after a reboot it should fail for you again
moonbutt74 said:
Cameras are janky, but well, yeah. :silly: Video recording DOES function though, the colors are all porked and images are backwards/flipped and off color, Note this is using opencamera and not default, default is porky.
Click to expand...
Click to collapse
yeah, had the same experience, that was terrible
moonbutt74 said:
Booting/rebooting , you don't have the sony init set up properly so no button trigger/ led functions to boot to FOTAKernel/recovery.
Click to expand...
Click to collapse
Even when using the recovery script it didn't work for me - but perhaps on another revisit it might work with some changes - dunno
Besides that ... yeah, had similar experiences - it was rather stable so actually usable as a daily driver (aside from the camera, FM radio, etc.)
Bootrec stuff
Z,
Code:
also there's some issue if you use the twrp recovery script to boot to TWRP via volume-button pressing during bootup - also didn't work - which was weird
okay this is the bootimage repacked with bootrec setup, straight from androplus ramdisk setup aosp_z5p_boot.img
here's just the bootrec directory and init shortcut, unpack, rename init in ramdisk to init.real then extract zip, paste this directory [bootrec] and the init shortcut in.
check properties on the init shortcut to make sure it's pointing to /init bootrec.zip
and the recoveryimage you want is the twrp build for z5p
that should be it it worked for me just fine.
m
K, Z,
Quick note, the mac address in "stock" MM does not randomize. Meaning mac filter entry in router remains valid/correct across reboot.
So this is build or kernel. would appreciate the commit kernel side if you come across it that "makes it so" or modification to build system that achieves the same. Thanks.
m
derp, nvm i can just script it, init.d or service
Code:
[email protected]:/ # ifconfig -a | grep HWaddr
wlan0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
dummy0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
[email protected]:/ # ifconfig wlan0 down
[email protected]:/ # ifconfig wlan0 hw ether 00:11:22:33:44:55
[email protected]:/ # ifconfig wlan0 up
[email protected]:/ # ifconfig wlan0 | grep HWaddr
wlan0 Link encap:Ethernet HWaddr 00:11:22:33:44:55
Only posting because privacy is NOT an issue for my situation, so i need mac to stay the same.
@zacharias.maladroit the twrp build in my kernel thread.
I'm still in training for the army, and my gf needs the laptop this week. But I'll try to fix some bugs after next week
moonbutt74 said:
Z,
Code:
also there's some issue if you use the twrp recovery script to boot to TWRP via volume-button pressing during bootup - also didn't work - which was weird
okay this is the bootimage repacked with bootrec setup, straight from androplus ramdisk setup aosp_z5p_boot.img
here's just the bootrec directory and init shortcut, unpack, rename init in ramdisk to init.real then extract zip, paste this directory [bootrec] and the init shortcut in.
check properties on the init shortcut to make sure it's pointing to /init bootrec.zip
and the recoveryimage you want is the twrp build for z5p
that should be it it worked for me just fine.
m
Click to expand...
Click to collapse
Thanks M !
Perhaps I didn't do it correctly the last time I tried,
what Recovery did you use for this ? TWRP ?
moonbutt74 said:
K, Z,
Quick note, the mac address in "stock" MM does not randomize. Meaning mac filter entry in router remains valid/correct across reboot.
So this is build or kernel. would appreciate the commit kernel side if you come across it that "makes it so" or modification to build system that achieves the same. Thanks.
m
derp, nvm i can just script it, init.d or service
Code:
[email protected]:/ # ifconfig -a | grep HWaddr
wlan0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
dummy0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
[email protected]:/ # ifconfig wlan0 down
[email protected]:/ # ifconfig wlan0 hw ether 00:11:22:33:44:55
[email protected]:/ # ifconfig wlan0 up
[email protected]:/ # ifconfig wlan0 | grep HWaddr
wlan0 Link encap:Ethernet HWaddr 00:11:22:33:44:55
Only posting because privacy is NOT an issue for my situation, so i need mac to stay the same.
Click to expand...
Click to collapse
yeah, that is an annoyance when you're working with a MAC filter,
https://github.com/sonyxperiadev/kernel/commit/6ad557733ff801d6ba70fdba3af9a64a9819c9a4 is one related
net: wireless: bcmdhd: Remove random mac code from PNO module
Generalizing the code that sets the random mac
as it will be used by PNO, gscan, RTT.
Click to expand...
Click to collapse
but I had a different commit (or configuration) in mind, will notice you once I stumbled upon it again
Meanwhile git blame path/to/file is your friend that way you could trace down the offending commits of the changes in the files
krabappel2548 said:
I'm still in training for the army, and my gf needs the laptop this week. But I'll try to fix some bugs after next week
Click to expand...
Click to collapse
Can you host those changes somewhere, once you do ? That way it would be easier to fix issues across the devices (Z5, Z5P and Z5C)
I've just read that the flash of the cam doesn't appear to work (and the colors are off - perhaps that improved from the last time I tested due to recent kernel changes)
---------- Post added at 02:31 PM ---------- Previous post was at 02:20 PM ----------
moonbutt74 said:
K, Z,
Quick note, the mac address in "stock" MM does not randomize. Meaning mac filter entry in router remains valid/correct across reboot.
So this is build or kernel. would appreciate the commit kernel side if you come across it that "makes it so" or modification to build system that achieves the same. Thanks.
m
derp, nvm i can just script it, init.d or service
Code:
[email protected]:/ # ifconfig -a | grep HWaddr
wlan0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
dummy0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
[email protected]:/ # ifconfig wlan0 down
[email protected]:/ # ifconfig wlan0 hw ether 00:11:22:33:44:55
[email protected]:/ # ifconfig wlan0 up
[email protected]:/ # ifconfig wlan0 | grep HWaddr
wlan0 Link encap:Ethernet HWaddr 00:11:22:33:44:55
Only posting because privacy is NOT an issue for my situation, so i need mac to stay the same.
Click to expand...
Click to collapse
Found the commits:
commit d9c59afc703570ce1ed9f14945d288bf797fd8f3
Author: Chirayu Desai <[email protected]>
Date: Sat Dec 12 18:50:54 2015 +0530
net: wireless: bcmdhd/somc-wifi-ctrl: Fix random MAC usage ...
... when nothing is written to the macaddr file.
The current check for 'readlen > 0' only accounts for the cases
where something is written to the macaddr file.
If nothing is written at all, the random MAC won't be used either,
and the bcmdhd driver's random MAC setting fails as well, which results
in a MAC of all zeroes, which isn't usable.
While this isn't perfect for normal use cases (as it'll generate a new random
MAC each boot), it's better to have wifi functioning with this rather
than not working at all.
Also sneak in a little change to move the file closing near it's usage.
Change-Id: I27aed88160e735460ba6e76160e6f5660e0bbd39
commit a3263d45ed60227cd20c668df7215e9376d94099
Author: Ecco park <[email protected]>
Date: Wed Sep 3 14:06:05 2014 -0700
net: wireless: bcmdhd set random mac for SOFTAP
17373032 SoftAp has constant MAC that is not changed between reboots
Change-Id: I3cd0283175e47391e5def68cf1c6cc375b777163
Signed-off-by: Ecco park <[email protected]>
Signed-off-by: Dmitry Shmidt <[email protected]>
commit d82d3d0f0e79b46f18b0bbba9ae0d021e2b26f6c
Author: Ashwin <[email protected]>
Date: Fri Aug 1 18:33:51 2014 -0700
net: wireless: bcmdhd: PNO MAC address rotation
This change will need updated FW to work
Change-Id: Iaa94ee1969ddab1a3c3d61a3e1bbdebaea2022af
Signed-off-by: Ashwin <[email protected]>
Click to expand...
Click to collapse
the oldest one is probably that one that you seek,
didn't know that Apple with iOS8 also started to implement that "feature"
exfat card mount manual approach
K, Z, @CTXz
Okay got my exfat card to mount, but it's sort of funky here goes
first in your device tree make sure you have the following option set/defined
TARGET_KERNEL_HAVE_EXFAT := true
Patch in exfat support in kernel
OKay now,
Code:
cat /proc/partitions
major minor #blocks name
[ snip snip ]
[COLOR="Red"]179 64 124868608 mmcblk1[/COLOR]
Warning: slightly goofy example!
Code:
mkdir /storage/nubby
mount.exfat -d -o rw /dev/block/mmcblk1 /storage/nubby
which results from an adb shell in running output as:
Code:
FUSE exfat 1.2.3
FUSE library version: 2.9.3
nullpath_ok: 0
nopath: 0
utime_omit_ok: 0
unique: 1, opcode: INIT (26), nodeid: 0, insize: 56, pid: 0
INIT: 7.23
flags=0x0001f7fb
max_readahead=0x00080000
INIT: 7.19
flags=0x00000031
max_readahead=0x00080000
max_write=0x00020000
max_background=0
congestion_threshold=0
unique: 1, success, outsize: 40
unique: 2, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 6363
getattr /
unique: 2, success, outsize: 120
unique: 3, opcode: OPENDIR (27), nodeid: 1, insize: 48, pid: 6363
unique: 3, success, outsize: 32
unique: 4, opcode: READDIR (28), nodeid: 1, insize: 80, pid: 6363
readdir[0] from 0
unique: 4, success, outsize: 464
unique: 5, opcode: READDIR (28), nodeid: 1, insize: 80, pid: 6363
unique: 5, success, outsize: 16
unique: 6, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 6363
getattr /
unique: 6, success, outsize: 120
unique: 7, opcode: LOOKUP (1), nodeid: 1, insize: 56, pid: 6363
LOOKUP /.android_secure
getattr /.android_secure
NODEID: 2
unique: 7, success, outsize: 144
unique: 8, opcode: LOOKUP (1), nodeid: 1, insize: 48, pid: 6363
LOOKUP /Android
getattr /Android
NODEID: 3
unique: 8, success, outsize: 144
unique: 9, opcode: LOOKUP (1), nodeid: 1, insize: 45, pid: 6363
LOOKUP /DCIM
getattr /DCIM
NODEID: 4
unique: 9, success, outsize: 144
unique: 10, opcode: LOOKUP (1), nodeid: 1, insize: 49, pid: 6363
LOOKUP /Download
getattr /Download
NODEID: 5
unique: 10, success, outsize: 144
unique: 11, opcode: LOOKUP (1), nodeid: 1, insize: 47, pid: 6363
LOOKUP /Movies
getattr /Movies
NODEID: 6
unique: 11, success, outsize: 144
unique: 12, opcode: LOOKUP (1), nodeid: 1, insize: 49, pid: 6363
and so on, each LOOKUP is a directory on my external sdcard [exfat format]
this is in my cm13 build
and so
Code:
mount -o bind /storage/nubby /sdcard/nubby/
ls /sdcard/nubby/
Android DCIM Download Movies Pictures TWRP Tunes apkbak customized-capability.xml video
So, nubby rules !!! :silly:
What doesn't happen is the registering of the media files on the now mounted and readable/writeable external sdcard [exfat]
my guess is groups and permissions, as even manual launching of a media file does not pick up via cm's media player or mxplayer, but copying files to and from work.
m
derp, okay so with the above it appears to be vold being the problem and not format support on the kernel-side
Mounted External sdcard [exfat]
K, Z, @CTXz
Okay, continuing from my previous post on mounting your exfat external sdcard,
This works in CM13 and should in AOSP, admittedly it's a little sloppy but hey.
Changes in boot.img as follows:
/sbin/<name of script>
Script contents:
Code:
#!/system/bin/sh
mount -o rw,remount /
mkdir /mnt/media_rw/sdcard1
mount.exfat -o uid=1023,gid=1023 /dev/block/mmcblk1 /mnt/media_rw/sdcard1
mkdir /storage/sdcard1
mount -o bind,uid=1023,gid=1023 /mnt/media_rw/sdcard1 /storage/sdcard1
mount -o ro,remount /
/init.environ.rc
add the following line below
Code:
export SECONDARY_STORAGE /storage/sdcard1
/init.rc
make sure media_rw is 755
Code:
mkdir /mnt/media_rw 0755 root media_rw
AT THE VERY BOTTOM OF init.rc <just to make sure everything else is already in place,
add the service which will fire the script
Code:
service <name of script> /sbin/<name of script>
class main
oneshot
repack the boot.img and flash, recognition should be instant though some apps will still not register
the existence of the card, haven't tested on a full factory reset yet.
Again from my previous post, you must have exfat support patched into kernel,
you must make sure to include in boardconfig.mk
Code:
TARGET_KERNEL_HAVE_EXFAT := true
so your rom-side support will compile, all the exfat stuff.
m
K, i will make the mod to your build and test it out in a bit. I did not utilize the fstab in this so your external card will not be picked up as a candidate for adoptable storage.
@krabappel2548
Okay, yeah you don't have the rom-side exfat support, you're kernel's good.
You're missing:
Code:
/system/bin/exfatck
/system/bin/exfatinfo
/system/bin/exfatlabel
/system/bin/exfatvsn
/system/bin/fsck.exfat
/system/bin/mkexfat
/system/bin/mkfs.exfat
/system/bin/mount.exfat
/system/lib64/libexfat.so
/system/lib64/libfuse.so
I've attached the above mentioned files for convenience.
The above files i pushed into your build from cm13. Although vold still seems to accuse the card of being corrupt.
After pushing the above mentioned files in conjuction with the modifications to boot.img mentioned previously i do get my card to mount @ an alternate point. /sdcard1 , and it does pick up as storage in totalcommander file manager. but still doesn't get past the vold smell test so no other apps looking for "proper" mount point see it.
Okay final round,
after factory resetting, with your original boot.img modified only with the bootrec setup for booting into recovery, and the aforementioned files for exfat support rom-side:
The card initially comes up as corrupt,
Format for Portable storage succeeds , card useable normally.
Format for internal storage corrupts, I am guessing it to be an issue with the size of the card [128gb]
as two additional partitions are created but neither readable, i don't have a 32gb card to test/verify..
Card format as portable storage seems to survive across reboots so :good: ?
So adoptable storage option for this size card seems to be broken.
m
before the aosp formatting the card, the entire card/block/device was mmcblk1 <-- working for cm13 with sloppy mount / not working with aosp
after aosp format the card/block/device was mmcblk1p1 <-- not working at all cm13 / working in aosp
Click to expand...
Click to collapse
on closer look - this is an issue of the naming scheme of devices:
if devices e.g. are attached, not properly unmounted and then another one attached
the previous device name is already taken - so a "simple" script will fail
You could either see whether it works
1) with regular expressions:
mounting it via mmcblk1p*
(don't ask how to do it - I haven't done it yet )
2) with persistent naming:
/dev/disk/by-id , by-label (does exFAT use these ?), by-uuid
https://wiki.archlinux.org/index.php/persistent_block_device_naming
http://unix.stackexchange.com/questions/86764/understanding-dev-disk-by-folders
http://unix.stackexchange.com/quest...a-way-to-change-a-device-id-in-dev-disk-by-id
http://unix.stackexchange.com/questions/86764/understanding-dev-disk-by-folders
I flashed via fastboot files and reboots the phone screen only Sony ... why this happens ?
Rubensss said:
I flashed via fastboot files and reboots the phone screen only Sony ... why this happens ?
Click to expand...
Click to collapse
Make sure you really flash all:
(recovery is not necessarily needed for the AOSP to boot up)
- fastboot flash boot boot.img
- fastboot flash recovery recovery.img
- fastboot flash userdata userdata.img
- fastboot flash system system.img
Click to expand...
Click to collapse
otherwise you'll get into a loop during boot,
otherwise:
do an emergency off,
flash again and see whether that helps (it did once or twice for me)
zacharias.maladroit said:
Make sure you really flash all:
(recovery is not necessarily needed for the AOSP to boot up)
otherwise you'll get into a loop during boot,
otherwise:
do an emergency off,
flash again and see whether that helps (it did once or twice for me)
Click to expand...
Click to collapse
I try to flash it again without recovery.img No I have to do before flashing wipes ?
Rubensss said:
I try to flash it again without recovery.img No I have to do before flashing wipes ?
Click to expand...
Click to collapse
formatting /cache, wiping dalvik cache
might help, yes
Not sure what else you have in mind
Backup your data since this will surely wipe internal storage (userdata.img)
zacharias.maladroit said:
formatting /cache, wiping dalvik cache
might help, yes
Not sure what else you have in mind
Backup your data since this will surely wipe internal storage (userdata.img)
Click to expand...
Click to collapse
I have tried again , this time making full and wipes without flashing recovery.img but when you start the phone gets directly to the TWRP recovery ... I've flashed 2 times and does the same. I think I 'll wait to see if they make a flashable file TWRP , thank you very much anyway zacharias.maladroit . By the way , I have installed in your kernel v.2.2 and will RomAur luxury . a greeting
I'm having bootloops as well. I cleared the system, cache and dalvik using TWRP. Model is 6833
May I know what is the difference between your build and fxp's aosp?
frostmore said:
May I know what is the difference between your build and fxp's aosp?
Click to expand...
Click to collapse
There are FXP Marshmallow builds ?
Link please
I searched and I see this:
http://fxpblog.co/aosp/aosp-6-0/
http://uploaded.net/f/53n94q
AOSP_M_160416_satsuki.zip seems to be the latest. What do you think? @zacharias.maladroit
I might be wrong but you can check guys!

Test custom (zip) ROM on Android Emulator

Hi all,
As the title says, the question is how to test a custom rom (the zip file that you should flash on your device) on an Android emulator. I opened this thread because also if this is a common problem with several threads about it (also here on xda), there isn't a real answer, i.e. a working method. I think I'm close to the solution, but it still doesn't work. So, I decided to share here my knowledge with the hope that someone can help me. This method is only for Linux.
Initial setup
Download and open Android Studio. Go to Tools -> Android -> AVD Manager. Create a new device with the same specs of your device. This means that you should choose the same screen size/resolution and the right cpu architecture. Android Studio suggests to install x86 images, because the emulation is faster. Nowadays, the most common architecture on smartphones is armeabi-v7a, so choose this one. I'll use as example a device with Android 4.2 (armeabi-v7a).
Replace system.img
If you go into ~/Android/Sdk/system-images folder, you'll find the folders related to the images that you've installed previously (in the initial setup). In my case I have ~/Android/Sdk/system-images/android-17/google_apis/armeabi-v7a/ which contains system.img. The system.img is the system partition. It's an ext4 filesystem image that you can mount in a folder (i.e. it's a way to "extract" its content):
Code:
$ mkdir system
# mount -o loop system.img system
Now you can edit its content, e.g. replacing some files. When you've done, you can unmount the image with the following command:
Code:
# umount /absolute/path/to/the/system.img
Our goal is to replace the system.img file with the system.img of our custom rom. Unzip the custom rom. If you go into its folder, you'll see the system folder that we need to transform into system.img.
First of all, we should rename the original system.img file (the stock android image):
Code:
$ cd ~/Android/Sdk/system-images/android-17/google_apis/armeabi-v7a
$ mv system.img original_system.img
Now we'll create a new ext4 filesystem (with the same number of blocks) where we'll put the content of the system folder of our custom rom.
Code:
$ dd if=/dev/null of=system.img bs=1M seek=550
$ mkfs.ext4 -F system.img
$ mkdir custom_system
# mount -o loop system.img custom_system
# cp -r /path/to/our/custom/rom/system/* custom_system/
# chmod 755 -R custom_system/
# umount /absolute/path/to/system.img
Note that we are using seek=550, because if the original system.img has 140800 blocks with a total size of 576.7 MB, we need to allocate the same amount of space. In fact, also our (custom) system.img will have a size of 576.7 MB with the same number of blocks. The last command (umount) isn't mandatory, you can proceed keeping mounted the image.
Start the emulator
At this point we should execute the emulator hoping that our system.img is ok.
Run the emulator following this command (I've a 64 bit system):
Code:
$ LD_LIBRARY_PATH=~/Android/Sdk/tools/emulator/lib64 ~/Android/Sdk/tools/emulator/emulator64-arm -show-kernel -avd Name_of_your_avd
I defined LD_LIBRARY_PATH because otherwise it can't find the libraries for the gpu emulation, an alternative solution is to use -gpu off to disable gpu emulation. The -show-kernel parameter is useful to see if there is some problem while the device is booting, instead of -debug-all that is useful to see all the stuff related to the emulator itself and not to the operating system (Android).
-----------------
Small Off-Topic:
Note that on my Linux system to start the emulator for an x86 image I should use:
Code:
LD_PRELOAD="/usr/lib/libstdc++.so.6" ./emulator -avd Avd_Name
--------------
In my case, it seems there is some problem during the boot (black screen all the time). The kernel messages are:
Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0
Initializing cgroup subsys cpu
Linux version 3.4.67-01422-gd3ffcc7-dirty ([email protected]) (gcc version 4.8 (GCC) ) #1 PREEMPT Tue Sep 16 19:34:06 CEST 2014
CPU: ARMv7 Processor [410fc080] revision 0 (ARMv7), cr=10c53c7d
CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: Goldfish
Truncating RAM at 00000000-3fffffff to -2f7fffff (vmalloc region overlap).
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 193040
Kernel command line: qemu=1 androidboot.hardware=goldfish console=ttyS0 android.qemud=1 android.checkjni=1 qemu.gles=0
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 760MB = 760MB total
Memory: 748640k/748640k available, 29600k reserved, 0K highmem
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
vmalloc : 0xf0000000 - 0xff000000 ( 240 MB)
lowmem : 0xc0000000 - 0xef800000 ( 760 MB)
.text : 0xc0008000 - 0xc0450618 (4386 kB)
.init : 0xc0451000 - 0xc0476000 ( 148 kB)
.data : 0xc0476000 - 0xc04af9c8 ( 231 kB)
.bss : 0xc04afa08 - 0xc05f9cb0 (1321 kB)
NR_IRQS:256
sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 4294967286ms
Console: colour dummy device 80x30
Calibrating delay loop... 410.41 BogoMIPS (lpj=2052096)
pid_max: default: 32768 minimum: 301
Security Framework initialized
SELinux: Initializing.
Mount-cache hash table entries: 512
Initializing cgroup subsys debug
Initializing cgroup subsys cpuacct
Initializing cgroup subsys freezer
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x3628b0 - 0x362908
NET: Registered protocol family 16
bio: create slab <bio-0> at 0
Switching to clocksource goldfish_timer
NET: Registered protocol family 2
IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
TCP bind hash table entries: 65536 (order: 6, 262144 bytes)
TCP: Hash tables configured (established 131072 bind 65536)
TCP: reno registered
UDP hash table entries: 512 (order: 1, 8192 bytes)
UDP-Lite hash table entries: 512 (order: 1, 8192 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Trying to unpack rootfs image as initramfs...
Freeing initrd memory: 176K
goldfish_new_pdev goldfish_interrupt_controller at ff000000 irq -1
goldfish_new_pdev goldfish_device_bus at ff001000 irq 1
goldfish_new_pdev goldfish_timer at ff003000 irq 3
goldfish_new_pdev goldfish_rtc at ff010000 irq 10
goldfish_new_pdev goldfish_tty at ff002000 irq 4
goldfish_new_pdev goldfish_tty at ff011000 irq 11
goldfish_new_pdev smc91x at ff012000 irq 12
goldfish_new_pdev goldfish_fb at ff013000 irq 13
goldfish_new_pdev goldfish_audio at ff004000 irq 14
goldfish_new_pdev goldfish_mmc at ff005000 irq 15
goldfish_new_pdev goldfish-battery at ff014000 irq 16
goldfish_new_pdev goldfish_events at ff015000 irq 17
goldfish_new_pdev goldfish_nand at ff016000 irq -1
goldfish_new_pdev qemu_pipe at ff017000 irq 18
goldfish_pdev_worker registered goldfish_interrupt_controller
goldfish_pdev_worker registered goldfish_device_bus
goldfish_pdev_worker registered goldfish_timer
goldfish_pdev_worker registered goldfish_rtc
goldfish_pdev_worker registered goldfish_tty
goldfish_pdev_worker registered goldfish_tty
goldfish_pdev_worker registered smc91x
goldfish_pdev_worker registered goldfish_fb
goldfish_pdev_worker registered goldfish_audio
goldfish_pdev_worker registered goldfish_mmc
goldfish_pdev_worker registered goldfish-battery
goldfish_pdev_worker registered goldfish_events
goldfish_pdev_worker registered goldfish_nand
goldfish_pdev_worker registered qemu_pipe
audit: initializing netlink socket (disabled)
type=2000 audit(0.240:1): initialized
Installing knfsd (copyright (C) 1996 [email protected]).
fuse init (API version 7.18)
msgmni has been set to 1462
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
console [ttyS0] enabled
brd: module loaded
loop: module loaded
nbd: registered device at major 43
goldfish_audio_probe
goldfish nand dev0: size 22600000, page 512, extra 0, erase 0
goldfish nand dev1: size 80000000, page 512, extra 0, erase 0
goldfish nand dev2: size 4200000, page 512, extra 0, erase 0
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <[email protected]>
smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <[email protected]>
eth0: SMC91C11xFD (rev 1) at fe012000 IRQ 12 [nowait]
eth0: Ethernet addr: 52:54:00:12:34:56
mousedev: PS/2 mouse device common for all mice
*** events probe ***
events_probe() addr=0xfe015000 irq=17
events_probe() keymap=qwerty2
input: qwerty2 as /devices/virtual/input/input0
goldfish_rtc goldfish_rtc: rtc core: registered goldfish_rtc as rtc0
device-mapper: uevent: version 1.0.3
device-mapper: ioctl: 4.22.0-ioctl (2011-10-19) initialised: [email protected]
ashmem: initialized
logger: created 256K log 'log_main'
logger: created 256K log 'log_events'
logger: created 256K log 'log_radio'
logger: created 256K log 'log_system'
Netfilter messages via NETLINK v0.30.
nf_conntrack version 0.5.0 (11700 buckets, 46800 max)
ctnetlink v0.93: registering with nfnetlink.
NF_TPROXY: Transparent proxy support initialized, version 4.1.0
NF_TPROXY: Copyright (c) 2006-2007 BalaBit IT Ltd.
xt_time: kernel timezone is -0000
ip_tables: (C) 2000-2006 Netfilter Core Team
arp_tables: (C) 2002 David S. Miller
TCP: cubic registered
NET: Registered protocol family 10
ip6_tables: (C) 2000-2006 Netfilter Core Team
IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
NET: Registered protocol family 15
8021q: 802.1Q VLAN Support v1.8
VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 0
mmc0: new SD card at address e118
goldfish_rtc goldfish_rtc: setting system clock to 2017-04-11 07:32:53 UTC (1491895973)
Freeing init memory: 148K
mmcblk0: mmc0:e118 SU02G 100 MiB
mmcblk0:
init (1): /proc/1/oom_adj is deprecated, please use /proc/1/oom_score_adj instead.
init: cannot open '/initlogo.rle'
yaffs: dev is 32505856 name is "mtdblock0" rw
yaffs: passed flags ""
yaffs: dev is 32505857 name is "mtdblock1" rw
yaffs: passed flags ""
yaffs: dev is 32505858 name is "mtdblock2" rw
yaffs: passed flags ""
fs_mgr: Warning: unknown flag voldmanaged=sdcard:auto
fs_mgr: Warning: unknown flag noemulatedsd
EXT4-fs (mtdblock0): mounted filesystem with ordered data mode. Opts: barrier=1
EXT4-fs (mtdblock1): recovery complete
EXT4-fs (mtdblock1): mounted filesystem with ordered data mode. Opts: nomblk_io_submit,errors=remount-ro
fs_mgr: Running /system/bin/e2fsck on /dev/block/mtdblock1
fs_mgr: Cannot run fs_mgr binary /system/bin/e2fsck
EXT4-fs (mtdblock1): mounted filesystem with ordered data mode. Opts: barrier=1,nomblk_io_submit
EXT4-fs (mtdblock2): recovery complete
EXT4-fs (mtdblock2): mounted filesystem with ordered data mode. Opts: nomblk_io_submit,errors=remount-ro
fs_mgr: Running /system/bin/e2fsck on /dev/block/mtdblock2
fs_mgr: Cannot run fs_mgr binary /system/bin/e2fsck
EXT4-fs (mtdblock2): mounted filesystem with ordered data mode. Opts: (null)
fs_mgr: Cannot mount filesystem on /devices/platform/goldfish_mmc.0* at auto
init: fs_mgr_mount_all returned an error
fs_mgr: Cannot mount filesystem on /dev/block/mtdblock2 at /cache
init: fs_mgr_mount_all returned an error
fs_mgr: Cannot mount filesystem on /dev/block/mtdblock1 at /data
init: fs_mgr_mount_all returned an error
init: cannot find '/system/bin/qemu-props', disabling 'qemu-props'
init: cannot find '/system/etc/install-recovery.sh', disabling 'flash_recovery'
init: cannot find '/system/bin/qemud', disabling 'qemud'
init: cannot execve('/system/etc/init.goldfish.sh'): No such file or directory
init: cannot find '/system/bin/sh', disabling 'console'
init: untracked pid 63 exited
warning: `rild' uses 32-bit capabilities (legacy support in use)
init: untracked pid 56 exited
init: untracked pid 99 exited
init: untracked pid 149 exited
...continue with endless processes termination...
Click to expand...
Click to collapse
I created the system.img from a custom rom for huawei u9508 based on Android 4.2.2. I hope this post could be useful.
Nrin said:
Hi all,
As the title says, the question is how to test a custom rom (the zip file that you should flash on your device) on an Android emulator. I opened this thread because also if this is a common problem with several threads about it (also here on xda), there isn't a real answer, i.e. a working method. I think I'm close to the solution, but it still doesn't work. So, I decided to share here my knowledge with the hope that someone can help me. This method is only for Linux.
Initial setup
Download and open Android Studio. Go to Tools -> Android -> AVD Manager. Create a new device with the same specs of your device. This means that you should choose the same screen size/resolution and the right cpu architecture. Android Studio suggests to install x86 images, because the emulation is faster. Nowadays, the most common architecture on smartphones is armeabi-v7a, so choose this one. I'll use as example a device with Android 4.2 (armeabi-v7a).
Replace system.img
If you go into ~/Android/Sdk/system-images folder, you'll find the folders related to the images that you've installed previously (in the initial setup). In my case I have ~/Android/Sdk/system-images/android-17/google_apis/armeabi-v7a/ which contains system.img. The system.img is the system partition. It's an ext4 filesystem image that you can mount in a folder (i.e. it's a way to "extract" its content):
Now you can edit its content, e.g. replacing some files. When you've done, you can unmount the image with the following command:
Our goal is to replace the system.img file with the system.img of our custom rom. Unzip the custom rom. If you go into its folder, you'll see the system folder that we need to transform into system.img.
First of all, we should rename the original system.img file (the stock android image):
Now we'll create a new ext4 filesystem (with the same number of blocks) where we'll put the content of the system folder of our custom rom.
Note that we are using seek=550, because if the original system.img has 140800 blocks with a total size of 576.7 MB, we need to allocate the same amount of space. In fact, also our (custom) system.img will have a size of 576.7 MB with the same number of blocks. The last command (umount) isn't mandatory, you can proceed keeping mounted the image.
Start the emulator
At this point we should execute the emulator hoping that our system.img is ok.
Run the emulator following this command (I've a 64 bit system):
I defined LD_LIBRARY_PATH because otherwise it can't find the libraries for the gpu emulation, an alternative solution is to use -gpu off to disable gpu emulation. The -show-kernel parameter is useful to see if there is some problem while the device is booting, instead of -debug-all that is useful to see all the stuff related to the emulator itself and not to the operating system (Android).
-----------------
Small Off-Topic:
Note that on my Linux system to start the emulator for an x86 image I should use:
--------------
In my case, it seems there is some problem during the boot (black screen all the time). The kernel messages are:
I created the system.img from a custom rom for huawei u9508 based on Android 4.2.2. I hope this post could be useful.
Click to expand...
Click to collapse
kernel is not work for your system.img

Categories

Resources