5,603,981 Members 43,715 Now Online
XDA Developers Android and Mobile Development Forum

[4.4 ROM Flash] bypass set_metadata_xxx fails

Tip us?
 
daniel_hk
Old
(Last edited by daniel_hk; 9th March 2014 at 12:58 AM.)
#1  
daniel_hk's Avatar
Senior Member - OP
Thanks Meter 2098
Posts: 931
Join Date: Nov 2012
Location: Hong Kong

 
DONATE TO ME
Default [4.4 ROM Flash] bypass set_metadata_xxx fails



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, 5864 views)

"I am only one, but I am one. I cannot do everything, but I can do something. And because I cannot do everything, I will not refuse to do the something that I can do. What I can do, I should do. And what I should do, by the grace of God, I will do." - Edward Everett Hale
The Following 54 Users Say Thank You to daniel_hk For This Useful Post: [ Click to Expand ]
 
nomancoolboy
Old
#2  
nomancoolboy's Avatar
Senior Member
Thanks Meter 356
Posts: 609
Join Date: Jun 2012
Thanks dude

Sent from my LG-P500 using xda premium
The Following 2 Users Say Thank You to nomancoolboy For This Useful Post: [ Click to Expand ]
 
phil_greg2001
Old
#3  
phil_greg2001's Avatar
Senior Member
Thanks Meter 79
Posts: 261
Join Date: Oct 2010
Location: Paris
Thanks daniel_hk

It works fine on my SGS

The Following User Says Thank You to phil_greg2001 For This Useful Post: [ Click to Expand ]
 
ibub
Old
#4  
ibub's Avatar
Senior Member
Thanks Meter 1265
Posts: 1,313
Join Date: Oct 2012
Location: Louisville,Ky
@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: [ Click to Expand ]
 
daniel_hk
Old
(Last edited by daniel_hk; 19th November 2013 at 12:23 PM.)
#5  
daniel_hk's Avatar
Senior Member - OP
Thanks Meter 2098
Posts: 931
Join Date: Nov 2012
Location: Hong Kong

 
DONATE TO ME
Quote:
Originally Posted by ibub View Post
@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.

"I am only one, but I am one. I cannot do everything, but I can do something. And because I cannot do everything, I will not refuse to do the something that I can do. What I can do, I should do. And what I should do, by the grace of God, I will do." - Edward Everett Hale
The Following 2 Users Say Thank You to daniel_hk For This Useful Post: [ Click to Expand ]
 
ibub
Old
#6  
ibub's Avatar
Senior Member
Thanks Meter 1265
Posts: 1,313
Join Date: Oct 2012
Location: Louisville,Ky
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
 
ibub
Old
#7  
ibub's Avatar
Senior Member
Thanks Meter 1265
Posts: 1,313
Join Date: Oct 2012
Location: Louisville,Ky
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
 
daniel_hk
Old
#8  
daniel_hk's Avatar
Senior Member - OP
Thanks Meter 2098
Posts: 931
Join Date: Nov 2012
Location: Hong Kong

 
DONATE TO ME
Quote:
Originally Posted by ibub View Post
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

"I am only one, but I am one. I cannot do everything, but I can do something. And because I cannot do everything, I will not refuse to do the something that I can do. What I can do, I should do. And what I should do, by the grace of God, I will do." - Edward Everett Hale
The Following User Says Thank You to daniel_hk For This Useful Post: [ Click to Expand ]
 
ibub
Old
#9  
ibub's Avatar
Senior Member
Thanks Meter 1265
Posts: 1,313
Join Date: Oct 2012
Location: Louisville,Ky
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
 
daniel_hk
Old
#10  
daniel_hk's Avatar
Senior Member - OP
Thanks Meter 2098
Posts: 931
Join Date: Nov 2012
Location: Hong Kong

 
DONATE TO ME
Quote:
Originally Posted by ibub View Post
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!

"I am only one, but I am one. I cannot do everything, but I can do something. And because I cannot do everything, I will not refuse to do the something that I can do. What I can do, I should do. And what I should do, by the grace of God, I will do." - Edward Everett Hale

The Following 2 Users Say Thank You to daniel_hk For This Useful Post: [ Click to Expand ]
Tags
4.4, 4.4 set_metadata fail, kitkat, set_metadata fail
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes