FORUMS
Remove All Ads from XDA

[4.4 ROM Flash] bypass set_metadata_xxx fails

1,562 posts
Thanks Meter: 4,355
 
By daniel_hk, Recognized Contributor on 18th November 2013, 01:11 PM
Post Reply Email Thread


Before we can take a bite on the new KitKat, some of us may encounter the set_metadata.. error at flashing.

Problem:
The new updater-scritpt use set_metadata and set_metadata_recursive to assign the permissions to the newly copied files.
Most of the existing /system partition doesn't support the "capabilities" option. Script in android/build would assign 0x00 to "capabilities".
However, assigning a "capabilities" with 0x00 to the unsuported partition also cause error!
If you are lucky, you might find an updated custom recovery to solve that.
For those who don't have a workable recovey or don't want to update the recovery yet. Here is a solution

Solution:
I patched the script when building my 4.4 rom for GT-7.7. The included "update-binary" would solve that problem at flashing.
Open the zip of the ROM or gapps. Replace the file in /META-INF/com/google/android with this one.
Now you can flash the 4.4 rom and gapps without an recovery update..

It works for cm11 & aosp based ROMs and gapps.

Cheers!

Edit:
Silly me, how can it be hardware independent... This one is compiled for armv7. Different cpu surely need a recompile.
Here is the change in the source: http://forum.xda-developers.com/show...3&postcount=15
Attached Files
File Type: zip update-binary.zip - [Click for QR Code] (173.0 KB, 38214 views)
The Following 87 Users Say Thank You to daniel_hk For This Useful Post: [ View ] Gift daniel_hk Ad-Free
 
 
18th November 2013, 04:20 PM |#2  
nomancoolboy's Avatar
Senior Member
Flag Ahmedabad
Thanks Meter: 555
 
More
Thanks dude

Sent from my LG-P500 using xda premium
The Following 3 Users Say Thank You to nomancoolboy For This Useful Post: [ View ] Gift nomancoolboy Ad-Free
18th November 2013, 09:50 PM |#3  
phil_greg2001's Avatar
Senior Member
Flag Paris
Thanks Meter: 247
 
More
Thanks daniel_hk

It works fine on my SGS

The Following User Says Thank You to phil_greg2001 For This Useful Post: [ View ] Gift phil_greg2001 Ad-Free
19th November 2013, 11:07 AM |#4  
ibub's Avatar
Senior Member
Flag Louisville,Ky
Thanks Meter: 1,510
 
More
@daniel_hk
Thanks for this. But it does not work for my armv6 device (lg p500). Could you please tell us what you changed, so that it can be "ported" to older devices. I have read that some recoveries have merged changes to source, but these devices do not yet have a ported version. So if you have time, this would be much appreciated by my device community.

Sent from my LG-P500 using Tapatalk 2
The Following User Says Thank You to ibub For This Useful Post: [ View ] Gift ibub Ad-Free
19th November 2013, 12:14 PM |#5  
daniel_hk's Avatar
OP Recognized Contributor
Flag Hong Kong
Thanks Meter: 4,355
 
Donate to Me
More
Quote:
Originally Posted by ibub

@daniel_hk
Thanks for this. But it does not work for my armv6 device (lg p500). Could you please tell us what you changed, so that it can be "ported" to older devices. I have read that some recoveries have merged changes to source, but these devices do not yet have a ported version. So if you have time, this would be much appreciated by my device community.

Sent from my LG-P500 using Tapatalk 2

The theory of what I have done is already mentioned in the thread.

In details, I changed the file in the source of the recovery. The update-binary is generated there.
In the function ApplyParsedPerms, when encounter a 0x0 for "capabilities", I drop the flag .

The attached file was from the rom I built.
For ROMs using the CyanogenMod cm-11 or AOSP 4.4 source, it should work.

Send me the link of your ROM which fail. Let me take a look.
The Following 3 Users Say Thank You to daniel_hk For This Useful Post: [ View ] Gift daniel_hk Ad-Free
19th November 2013, 12:45 PM |#6  
ibub's Avatar
Senior Member
Flag Louisville,Ky
Thanks Meter: 1,510
 
More
Thank you so much. But I may have spoken too soon. I found an updated recovery (4.3), and new update binary for my phone. I will try it later to see if it works, before asking you to waste your time.

Sent from my LG-P500 using Tapatalk 2
20th November 2013, 12:22 AM |#7  
ibub's Avatar
Senior Member
Flag Louisville,Ky
Thanks Meter: 1,510
 
More
Ok, I tried but had no success. So here is a link to the rom:
http://jenkins.androidarmv6.org/job/...sion-test/755/
Again, thanks.

Sent from my LG-P500 using Tapatalk 2
20th November 2013, 09:12 AM |#8  
daniel_hk's Avatar
OP Recognized Contributor
Flag Hong Kong
Thanks Meter: 4,355
 
Donate to Me
More
Quote:
Originally Posted by ibub

Ok, I tried but had no success. So here is a link to the rom:
http://jenkins.androidarmv6.org/job/...sion-test/755/
Again, thanks.

Sent from my LG-P500 using Tapatalk 2

Is your error "set_metadata_recursive"... "fail"? Can you list the exact messages at flash. Take a photo to avoid typing.

I think you might get an assert error not set_metadata related
The Following User Says Thank You to daniel_hk For This Useful Post: [ View ] Gift daniel_hk Ad-Free
20th November 2013, 11:38 AM |#9  
ibub's Avatar
Senior Member
Flag Louisville,Ky
Thanks Meter: 1,510
 
More
Yeah, it's set_metadata_recursive error or fail. I think my recovery will copy messages to SD. Will record soon. The devs for this device are now trying to add set_metadata tags in boardconfig.mk, and then use set metadata =false. But I'm not really sure if that would be an actual fix, or just a temporary work around to get it to flash. So I'd rather try to do it your way. Just wish my 32-bit system would compile newer Android.

Sent from my LG-P500 using Tapatalk 2

---------- Post added at 06:37 AM ---------- Previous post was at 06:06 AM ----------

Ok, here's my recovery log.

Sent from my LG-P500 using Tapatalk 2

---------- Post added at 06:38 AM ---------- Previous post was at 06:37 AM ----------

http://www.mediafire.com/view/?dddwi6vtbo3a1fg
Sent from my LG-P500 using Tapatalk 2
20th November 2013, 05:58 PM |#10  
daniel_hk's Avatar
OP Recognized Contributor
Flag Hong Kong
Thanks Meter: 4,355
 
Donate to Me
More
Quote:
Originally Posted by ibub

Yeah, it's set_metadata_recursive error or fail. I think my recovery will copy messages to SD. Will record soon. The devs for this device are now trying to add set_metadata tags in boardconfig.mk, and then use set metadata =false. But I'm not really sure if that would be an actual fix, or just a temporary work around to get it to flash. So I'd rather try to do it your way. Just wish my 32-bit system would compile newer Android.

Sent from my LG-P500 using Tapatalk 2

---------- Post added at 06:37 AM ---------- Previous post was at 06:06 AM ----------

Ok, here's my recovery log.

Sent from my LG-P500 using Tapatalk 2

---------- Post added at 06:38 AM ---------- Previous post was at 06:37 AM ----------

http://www.mediafire.com/view/?dddwi6vtbo3a1fg
Sent from my LG-P500 using Tapatalk 2

in line 1260:
-> ApplyParsedPerms: removexattr of /system/xbin/su to 0 failed: Operation not supported on transport endpoint

seems the file system doesn't support XATTR, remove a non exsist attr probably cause error.

Did the log come from my update-binary?

If so, you need to tell the rom developer to check the kernel source:
if the kernel support selinux and file system is EXT, you need the following
CONFIG_EXT4_FS_XATTR=y
or
CONFIG_EXT3_FS_XATTR=y
Either one must be enabled dependent on the file system.
If kernel doesn't support selinux, disable it.

For YAFFS, there might be similar config for kernel need to enable or disable

Good luck!
The Following 2 Users Say Thank You to daniel_hk For This Useful Post: [ View ] Gift daniel_hk Ad-Free
20th November 2013, 10:34 PM |#11  
ibub's Avatar
Senior Member
Flag Louisville,Ky
Thanks Meter: 1,510
 
More
Quote:
Originally Posted by daniel_hk

in line 1260:
-> ApplyParsedPerms: removexattr of /system/xbin/su to 0 failed: Operation not supported on transport endpoint

seems the file system doesn't support XATTR, remove a non exsist attr probably cause error.

Did the log come from my update-binary?

If so, you need to tell the rom developer to check the kernel source:
if the kernel support selinux and file system is EXT, you need the following
CONFIG_EXT4_FS_XATTR=y
or
CONFIG_EXT3_FS_XATTR=y
Either one must be enabled dependent on the file system.
If kernel doesn't support selinux, disable it.

For YAFFS, there might be similar config for kernel need to enable or disable

Good luck!

No, that was the original update binary, built with the rom. I don't know for certain, but have read that the binary is specific to the chipset. Anyway, I'm gonna search through the commits to see if the xattr has been used. Remember seeing it... somewhere. Again thanks.

Sent from my LG-P500 using Tapatalk 2
Post Reply Subscribe to Thread

Tags
4.4, 4.4 set_metadata fail, kitkat, set_metadata fail
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes