[HOW TO]Get Base Address from boot.img - Android

Hello guys,
What I did
I just create a way to
extract the base address information from boot.img(the image made from mkbootimg).
Base address is very important when call mkbootimg to make image.
Here is the link how to unpack repack image
That method is very useful when there is no config information from kernel img(Like my situation)
The concept of it
I read the source code of mkbootimg.c, that's the git of it
And find that the all the information of kernel address, ramdisk address is contained in the header of boot.img,
and the base address can be calculate from them.
then you don't need to look for the base address information from the config.gz,
and just need one official rom to get the information.
What I bring
In attachment, It is the small tool I made to get the information from boot.img(include calculate the base address)
And Here is the source code of it
How to Use it
It needs to be run under linux or cygwin.
Go into the directory contain the tool, and type command
Code:
./GetImageInfo Boot_Image_Path
I just make the code today, so maybe there are some defect.
If you have some suggestion, please let me know.
Thank you very much

Compiled it for arm and tried it out on my image. It's reading base address as 0 and reports that the header is not correct so it cannot give me the base address. However, my base address is 0x80600000. Could you explain?

SHM said:
Compiled it for arm and tried it out on my image. It's reading base address as 0 and reports that the header is not correct so it cannot give me the base address. However, my base address is 0x80600000. Could you explain?
Click to expand...
Click to collapse
Hello, if you see the output is "Image Header is not in correct format" or "Error Header Information:"
It means there are some data corruption in the header part.
Maybe it hasn't assign kernel_address or ramdisk_addr correctly.
Here is the right relation ship between every address
1, kernel_address < ramdisk_address
2, ramdisk_address - kernel_address == ramdisk_offset - kernel_offset
3 kernel_offset = 0x00008000 ramdisk_offset = 0x01000000
4, Conclusion: base_address = ramdisk_address - ramdisk_offset;
Any of Condition 1 or 2 or 3 is not met, it means the header is not in a correct form.
You can give me your image, I can check it for you.

huuu said:
Hello, if you see the output is "Image Header is not in correct format" or "Error Header Information:"
It means there are some data corruption in the header part.
Maybe it hasn't assign kernel_address or ramdisk_addr correctly.
Here is the right relation ship between every address
1, kernel_address < ramdisk_address
2, ramdisk_address - kernel_address == ramdisk_offset - kernel_offset
3 kernel_offset = 0x00008000 ramdisk_offset = 0x01000000
4, Conclusion: base_address = ramdisk_address - ramdisk_offset;
Any of Condition 1 or 2 or 3 is not met, it means the header is not in a correct form.
You can give me your image, I can check it for you.
Click to expand...
Click to collapse
Here you go. This isn't my stock recovery image. It's my personal TWRP build for my device but the offsets are no different between the two. I'm curious to learn more about your logic on all this.

Also, my recovery/boot uses non standard base, and ramdisk offset as typically seen in mkbootimg.c.

SHM said:
Here you go. This isn't my stock recovery image. It's my personal TWRP build for my device but the offsets are no different between the two. I'm curious to learn more about your logic on all this.
Click to expand...
Click to collapse
Let me check you image first.
I learned all those logic from the source code of mkbootimg.
But I am not able to see the source code of it so far, I can post it later after I get home.

SHM said:
Also, my recovery/boot uses non standard base, and ramdisk offset as typically seen in mkbootimg.c.
Click to expand...
Click to collapse
That's the output of the information
kernel size = 0x5905a0
kernel address = 0x80608000
ramdisk size = 0x56c7bd
ramdisk address = 0x81c08000
second size = 0x0
second address = 0x81500000
tag address = 0x80600100
page size = 0x800
Actually, Kernel address is ok,
The problem is on Ramdisk Address.
base_address == kernel_address - kernel_offset == ramdisk_address - ramdisk_offset

huuu said:
That's the output of the information
kernel size = 0x5905a0
kernel address = 0x80608000
ramdisk size = 0x56c7bd
ramdisk address = 0x81c08000
second size = 0x0
second address = 0x81500000
tag address = 0x80600100
page size = 0x800
Actually, Kernel address is ok,
The problem is on Ramdisk Address.
base_address == kernel_address - kernel_offset == ramdisk_address - ramdisk_offset
Click to expand...
Click to collapse
Yea, in mkbootimg.c the standard ramdisk offset is 0x01000000 but my recovery and boot images uses non standard ramdisk offsets. It uses, 0x01608000.
Sent from my C525c using Tapatalk
---------- Post added at 08:40 PM ---------- Previous post was at 08:32 PM ----------
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Sent from my C525c using Tapatalk

SHM said:
Yea, in mkbootimg.c the standard ramdisk offset is 0x01000000 but my recovery and boot images uses non standard ramdisk offsets. It uses, 0x01608000.
Sent from my C525c using Tapatalk
Click to expand...
Click to collapse
Ok, then that's the problem XD
The program is using the ramdisk offset of 0x01000000,
and in the header, there is no way to check the ramdisk_offset and kernel_offset. So I use the standard one.
I did a secure check of ramdisk_address - kernel_address == ramdisk_offset - kernel_offset, to make sure the header is not corrupted.
If you are using one none standard ramdisk_offset
you need to do following change to main.c
1st comment ln46
2nd, change ln48 to base_address = kernel_address - kernel_offset;

SHM said:
Yea, in mkbootimg.c the standard ramdisk offset is 0x01000000 but my recovery and boot images uses non standard ramdisk offsets. It uses, 0x01608000.
Sent from my C525c using Tapatalk
---------- Post added at 08:40 PM ---------- Previous post was at 08:32 PM ----------
Sent from my C525c using Tapatalk
Click to expand...
Click to collapse
Or I will make some more change to the program, to allow to add some none-standard ramdisk_offset or kernel_offset.

huuu said:
Or I will make some more change to the program, to allow to add some none-standard ramdisk_offset or kernel_offset.
Click to expand...
Click to collapse
Would recommend doing the same for tags, kernel, and second as well. I came across one image where all offsets were non standard lol. Nice job putting this together though.
Sent from my C525c using Tapatalk

SHM said:
Would recommend doing the same for tags, kernel, and second as well. I came across one image where all offsets were non standard lol. Nice job putting this together though.
Sent from my C525c using Tapatalk
Click to expand...
Click to collapse
Sure, I can do it in the weekend, since I am not able to commit the change to the repository right now XD

There is an app on the play store called sgit. I use it all the time to clone, commit changes, and push. May be useful to you .
Sent from my C525c using Tapatalk

SHM said:
There is an app on the play store called sgit. I use it all the time to clone, commit changes, and push. May be useful to you .
Sent from my C525c using Tapatalk
Click to expand...
Click to collapse
Thanks

SHM said:
There is an app on the play store called sgit. I use it all the time to clone, commit changes, and push. May be useful to you .
Sent from my C525c using Tapatalk
Click to expand...
Click to collapse
Sorry for the delay. I was quit busy those days.
I just finished the code for customized the kernel offset and ramdisk offset parameter, you can try it from my github.
GetImageInfo [--kernel_offset <KernalOffset>] [--ramdisk_offset <RamdiskOffset>] <filename>

Related

[MortScript] iniEditor: get a friendly menu out of an .ini file!

It's very usefull as a developper to use .ini file to store settings of apps or MortScript scripts.
Unfortunately, you may have so many complicated settings (check IPTWeather for instance ), that you or newbies would like to be able to edit those settings without having to open the .ini configuration file.
That's why I've created the iniEditor.mscr script to get a friendly menu out of an .ini file:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
This is more a proof of concept, and I would really like some developper can port it to a real .exe app to have a great layout as in the S2U2 settings for instance!
It can be used for any app or MortScript script that uses a .ini configuration file.
In the attachment, checkout the iniEditor.mscr which needs two parameters: the .ini file to edit, and your application name.
I've attached:
- the 'iniEditor.mscr' script which is the generic .ini file parser and configurator.
- the 'sample.ini' file to be edited.
- the 'sample.ini.desc' file that is the description file so you can remove all the comments in the 'sample.ini' file but still have them in the iniEditor menus to improve speed performance of your apps reading the 'sample.ini' file! All values in the 'sample.ini.desc' are the default values that are proposed if you cancel your changes for a field.
- the 'sampleConfig.mscr' script which calls the 'iniEditor.mscr' script with the right arguments.
- the 'calledScript.mscr' script which is called for one of the settings.
For the moment, you can set four types for the different settings:
- list: the setting is in a choice list defined in the .ini file;
- int: the setting is an integer;
- callscript: the setting is set using a MortScript script defined in the .ini file;
- fullfilepath: the setting is the full path of a file, to be set with a specific selection dialog box;
- path: the setting is a path, to be set with a specific selection dialog box;
- default: the setting is any entered string.
You set the type of a setting in the .ini.desc file by adding a comment just after the settings, like that:
Code:
[Some settings]
enableFeatureA=0
;list,0,1
You can also add some comments to be displayed for the user, by adding comments (on several lines if you want), like that:
Code:
[Some settings]
enableFeatureA=0
;list,0,1
;Set 0 to disable Feature A.
;Set 1 to enable Feature A.
And that gives you that:
Sometimes, there are so many things to say on a setting, that you don't want to or can't display all the comments about a setting in the menus of iniEditor.mscr.
Then, just added two semicolons at the beginning of the first "comment" line (after the "type" line"), like that:
Code:
advancedSetting=
;
;;Please check FAQ or sample.ini.desc file for more help on this setting.
;This is an advanved option.
;It is so long to explain how it works.
;I cannot show it in a MortScript message dialog box.
;But your are an advanced user.
;So you can find some tips directly here, but not through the iniEditor.mscr script.
And that gives you that:
If you set a parameter of type int, the user will be able to enter only an integer value:
If you set a parameter of type fullfilepath, you get this:
If you set a parameter of type path, you get this:
Feel free to use or modify my iniEditor.mscr, and if someone could make a real .exe app out of it, that would be great!
Pas mal !
Bon outils (qui simplifie la vie) comme je les aime !
A++
Thank you for your support JMHL .
I know I'm alone in my ini editor trip, but I've added two types of parameters: fullfilepath and path.
Just check the first post to have more information on these.
Still no one motivated to developp this in CF.Net for instance?
I've seen that two people have downloaded my second version of iniEditor.
Please find in the first post a new version with a small bug corrected.
Hi michoob,
A BIG THANKS for your new fantastic MortScript app...!!!!
As usual a great work...!!!!
I will of course use it also in my apps...!!!!
Greetings
sv0911
Thanks, thanks and again thanks
michoob,
a really great job you did! Extremely user friendly and tremendously fast!
You're welcome jwoegerbauer!
michoob said:
Feel free to use or modify my iniEditor.mscr
Click to expand...
Click to collapse
I followed your invitation. These are the 2 changes I mainly made in my copy of your iniEditor.mscr
Code:
[COLOR="Red"][B]Copy(fileName, fileName & ".bak", 1)
iniChanged = 0[/B][/COLOR]
choosenSection = 1
While (choosenSection <> 0)
choosenSection = Choice(appName & " settings", "Please choose a settings section:", 0,0, sectionList)
If (choosenSection <> 0)
Call("IPTWkeys")
EndIf
EndWhile
[COLOR="Red"][B]If(not iniChanged)
Delete(fileName & ".bak")
EndIf[/B][/COLOR]
If (confirmation)
valueList[choosenKey] = newValue
keyValueList[choosenKey] = keyList[choosenKey] & "=" & newValue
IniWrite(fileName, sectionList[choosenSection], keyList[choosenKey], newValue)
[COLOR="Red"][B]iniChanged += 1[/B][/COLOR]
EndIf
I've just updated the iniEditor.mscr script with a new feature really usefull when you have huge .ini files to improve reading performance of your .ini file and have your MortScript apps run faster!
This new feature is the use of the .ini.desc file that contains all default values and all the comment structure of iniEditor. Now, the .ini file can be comment free and still you'll have all the information while editing your .ini file through iniEditor!
As usual, you can test this new version with IPTWeather.
Feedbacks welcomed!
michoob said:
I've just updated the iniEditor.mscr script with a new feature really usefull when you have huge .ini files to improve reading performance of your .ini file and have your MortScript apps run faster!
This new feature is the use of the .ini.desc file that contains all default values and all the comment structure of iniEditor. Now, the .ini file can be comment free and still you'll have all the information while editing your .ini file through iniEditor!
Click to expand...
Click to collapse
Tried v04. Simply an ingenious improvement. Thanks.
Thanks jwoegerbauer ! I just thought about XML description files and said: why not the same with .ini file!
I just discovered the Configuration tool for Mortscripter that is an exe, but unfortunately, it doesn't right to nor from ini files, so it is a bit more complicated to use with .ini files, even though it can be done using some mortscript...
But I must admit that I like now the idea of a full MortScript "app" to read .ini files used by other MortScript "apps"... It is a bit like the meaning of GNU...
michoob said:
I just thought about XML description files
Click to expand...
Click to collapse
The C++ source code for a XML-parser, which easily can be converted into MortScript, one can get here (e-mail to author required):
http://www.applied-mathematics.net/tools/xmlParser.html
Will you developp an iniEditor in C++ for me?
Honestly, I won't have time to learn developping on Windows Mobile, but thank you for the information. Maybe someone will be motivated to work on this, but I doubt it because of WP7...
michoob said:
Will you developp an iniEditor in C++ for me?
Click to expand...
Click to collapse
Of course NOT!
BTW: Here I small routine I made to prepare using iniEditor v0.4, may be others are interested in
Code:
Sub IniToIniDesc(ini)
Local(inicontent,idx,line,trimline,newini,desc,newdesc,fpos,feature)
desc=ini&".desc"
Copy(ini,desc,1)
inicontent=Split(ReadFile(ini)&"^NL^","^NL^")
#
#pass ONE
newini=Array()
idx=0
ForEach line In Array(inicontent)
If(Find(line,";"))
Continue
EndIf
trimline=Replace(line," ","")
If(Length(trimline)=0)
Continue
EndIf
idx+=1
newini[idx]=line
EndForEach
WriteFile(ini,Join(newini,"^NL^"),0)
Clear(newini)
#
#pass TWO
newdesc=Array()
idx=0
ForEach line In Array(inicontent)
trimline=Replace(line," ","")
If(Length(trimline)=0)
Continue
EndIf
idx+=1
newdesc[idx]=line
fpos=Find(trimline,"=0")
If(NOT fpos)
fpos=Find(trimline,"=1")
EndIf
If(fpos)
#test whether 0 and/or 1 is the only character here
If((fpos+2)>Length(trimline))
feature=Substr(trimline,1,(fpos-1))
idx+=1
newdesc[idx]=";Set 0 to disable "&feature&".^NL^;Set 1 to enable "&feature&"."
EndIf
EndIf
EndForEach
WriteFile(desc,Join(newdesc,"^NL^"),0)
EndSub
As one will notice, this script 1) trims the original ini - thus the goal to gain speed when processing it will definitly be reached, and 2) only adds some ;Set lines to the desc, hence one of course have to edit the desc after having run this script.
It just prepares it for 0 or 1 values ini fields, doesn't it?
Then, to use iniEditor as a switch for 0 or 1 values to disable or enable a feature, it would be better to use a list with a choice between 0 or 1 .
I wonder which scripts do you use iniEditor with.
1) To satisfy your curiosity, the ini is attached
2) Only a suggestion:
If (endNextLinePos > 0)
valueTypeList[keyIndex] = ToLower(SubStr(iniDescFile, endLinePos + 2, endNextLinePos - endLinePos - 3))
endLinePos = endNextLinePos
Else
valueTypeList[keyIndex] = ToLower(SubStr(iniDescFile, endLinePos + 2, Length(iniDescFile) - endLinePos - 1))
endLinePos = endLinePos +1
EndIf
Don't know this useful for others too: I added to v0.4 valueTypes as follows:
alpha
num
alphanum
hex
range
The modified version v0.4-p1 is attached.
Well done, great idea!
@michoob I have made some tweaks to an older version that I wanted to share. It skips the choose [settings] group if there is only one setting group. Also it updates the array with the latest saved changes so if you go to another setting group and then go back to a previously edited one the updates show. And I think lastly I added some code to keep the original settings if you cancel the change since some of them went blank.
RoryB said:
@michoob I have made some tweaks to an older version that I wanted to share.
Click to expand...
Click to collapse
Thanks, I'll have a look at this.
RoryB said:
]It skips the choose [settings] group if there is only one setting group.
Click to expand...
Click to collapse
Good idea!
RoryB said:
Also it updates the array with the latest saved changes so if you go to another setting group and then go back to a previously edited one the updates show.
Click to expand...
Click to collapse
Hum... the latest version already does that. Maybe because you edited an older version .
RoryB said:
And I think lastly I added some code to keep the original settings if you cancel the change since some of them went blank
Click to expand...
Click to collapse
I don't get it. But I'll have a look at this .

[DEV] RS232 for X8, X10mini

Hello,
First off, this mod is NOT for users, but is helpful for developers only that would like to do cool stuff (i.e. port new kernels, etc.). Do not start hacking your phone unless you know what you are doing.
The msm7227 has RS232 serial connection which is accessed via /dev/ttyMSM2. The issue is getting the pins on the board right, and this is because there is great confusion online about the actual pinout for these semc devices (probably because nobody has actually grabbed serial tty on them).
Requirements:
- Solder iron, solder, flux (you know, the cool stuff )
- Small wires, single core ideally - not too large to avoid noise
- Multimeter: useful for checking if you've sorted pins that you are soldering (happens all the time )
- Steady hand, patience (I lack those actually)
- A 3.3V TTL RS232 adapter. I'm using the FT232RL USB to Serial board which works flawlessly. You could come up with other solutions too if you are into electronics via MAX232 or Arduino.
Important: do NOT wire the phone to the serial port of you PC - it can potentially burn up your phone!
Be careful while soldering, don't let the iron for too much time on the connector or you'll end up destroying it (as I did for two connectors while reverse engineering where the tty pins are).
So here's the pinout on the X8:
The connection should be like so:
Code:
Phone <-> Serial Adapter
Tx <-> Rx
Rx <-> Tx
GND <-> GND
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Once soldered and connected, you can use any tty program under linux or windows that you like. E.g. minicom (linux) works great for me, it picks up the bootloader / kernel output instantly.
Connection details: Port: /dev/ttyUSB0, baud: 115200-8N1
Some cosmetics for harnessing the added wires:
s1loader log
Some interesting stuff now... here's the log from the moment the power button is pressed, until the kernel picks up:
Code:
S1 Boot stage 1
CONF_FUSE 0-4 = 0x0077fd4d 0x00040447 0x2004080f 0xb79cc2de 0x00000180
HW_REVISION_NUMBER = 0x203c00e1
OEM_ID = 0x00000001
SEMCSEC Secure Bootstrap "1229-3593 S1Boot MSM7227 CRH1099189_R8A029" (2010-06-01 12:17)
Detected memories:
SMI CS0: UNKNOWN 32MB LPDDR (SR 0x0000)
EBI1 CS0: UNKNOWN 32MB LPDDR (SR 0x0000)
EBI1 CS1: UNKNOWN 32MB LPDDR (SR 0x0000)
EBI2 CS0: Samsung 512MB NAND (0x00ec 0x00bc)
PMIC initialization iterations=0x00000001
bq24180 charger IC rev 1.1 detected
OTP User segment locked
OTP User segment locked
TA @ 0x08100000 (8*128kB)
Hardware Config: verification OK
MSN=CB511K1YZM IMEI=XXXXXXXXXXXXXX
OTP User segment locked
Service Mode Config From TA (ver 1.0): KEYS:1 USB:eek:N SERVICEMODE:USB SERVICE_PIN:ENABLED
VBus is low (not a "chinese charger"), SoftService is not asserted...
TA_ReadData FlaFla is set
S1 BOOT waiting for USB connection
s1_main_loop: No Service mode comm interface found!
Configuring long press:500
plf_bootos MSM7227
Startup reason before override: PWRKEY WDOG
Overriding default boot partitions: reason=0x00000011, mArm=0x00000005, aDsp=0x00000008, aArm=0x00000003
Partition table contents:
PartID Descr Attribs StartBlock NumBlocks UsedAs
0x00000001 S1Boot 0x00000022 0x00000000 0x00000008
0x00000002 TA 0x00000001 0x00000008 0x00000008
0x00000005 ModemSW 0x40000022 0x00000030 0x000000c0 mARM image
0x00000003 Linux 0x40000001 0x00000120 0x00000040 aARM image
0x0000000f Cache 0x80000001 0x000007d0 0x00000190
0x00000010 AppsLog 0xc0000001 0x00000ffe 0x00000002
0x0000000b FOTA0 0x40000022 0x00000010 0x00000010
0x0000000c FOTA1 0x40000022 0x00000020 0x00000010
0x00000006 ModemFS 0x40000001 0x000000f0 0x00000030 mARM-FS image
0x00000009 UserData 0xc0000001 0x00000960 0x0000069e
0x00000004 AppsFS1 0x80000001 0x00000160 0x00000670
ARM ELF image (0x0028), entry point @ 0x0db00000
SIN Verification of aARM failed!
ARM ELF image (0x0028), entry point @ 0x00208000
plf_ta_cmd_params()
Boot parameters found in config data
Commandline:serialno=CB511K1YZM console=ttyMSM0 startup=0x00000011.
Warmboot address calculated: 0x00200000
NAND MPU Partition 0 start:0x00000160 end:0x00000960
NAND MPU Partition 1 start:0x00000960 end:0x00001000
NAND MPU ON according to partition table
Jumping to code @ 0x0db00000, goodbye and thanks for all the fish...
Linux version 2.6.29.6-nAa-jb-03 ([email protected]) (gcc version 4.7.3 20121106 (prerelease) (Linaro GCC 4.7-2012.11) ) #1 PREEMPT Sat 2
goodbye and thanks for all the fish...
Pinouts for mini:
Cant believe in this !!!
bro, you are crazy
thats great...
This is a good xmas gift
P.S.: Merry Christmas!
Firstly I thought you made a 4.2 rom then I realised that you are crazy...cool work and merry Christmas
PS:just realised I spamed,sorryy wont happen again
Sent from my E15i using xda app-developers app
Daveee10 said:
bro, you are crazy
thats great...
This is a good xmas gift
P.S.: Merry Christmas!
Click to expand...
Click to collapse
Almost killed my shakira, but it was worth it
@all, please only post contributing stuff - don't clutter the thread.
- More pics uploaded.
- Bootloader log captured. Output is hmm... interesting
Glade to see that you have black color of x8 too
First of all, impressive work @nobodyAtall. You must have kind of huge balls to do so.
These days, I've been trying to modify CMDLINE from kernel to edit mtdparts parameter and, therefore, to resize MTD partitions. This way, it would be possible to reduce system and cache partitions in favour of data. Unfortunately, I didn't success, but I still don't know if it was because of a wrong kernel (I tried to compile Alfs, which is so [irony]easy[/irony] to compile) or something else...
I haven't tried with yours because your Git source seemed to be a little outdated.
Anyway, as I've seen in the output you posted, partitions are already set by default, leading me to think it is not possible to modify them through the kernel command line.
Have you ever thought about this before?
GaBOr1 said:
First of all, impressive work @nobodyAtall. You must have kind of huge balls to do so.
These days, I've been trying to modify CMDLINE from kernel to edit mtdparts parameter and, therefore, to resize MTD partitions. This way, it would be possible to reduce system and cache partitions in favour of data. Unfortunately, I didn't success, but I still don't know if it was because of a wrong kernel (I tried to compile Alfs, which is so [irony]easy[/irony] to compile) or something else...
I haven't tried with yours because your Git source seemed to be a little outdated.
Anyway, as I've seen in the output you posted, partitions are already set by default, leading me to think it is not possible to modify them through the kernel command line.
Have you ever thought about this before?
Click to expand...
Click to collapse
Hi,
Outdated in terms of what? All kernels for these devices are 2.6.29 - they are indeed outdated. The nAa-jb has all it's needed for jellybean and great performance.
@partitions
Changing the mtdparts via cmdline is absolutely possible. This is how I got the extra /system space needed for jellybean. The problem is that it breaks existing installations cause you are altering the default partitioning - therefore it's not suggested. People have to format all partitions before getting out of the kernel with the modded ones.
Don't mind the partitioning the s1loader says - those are of the internal nand as hardcoded via s1loader. My guess is that they can be exposed to userspace.
EDIT: pinouts for x10mini posted.
now our x8 can get kernel 3 ?
nobodyAtall said:
Hi,
Outdated in terms of what? All kernels for these devices are 2.6.29 - they are indeed outdated. The nAa-jb has all it's needed for jellybean and great performance.
@partitions
Changing the mtdparts via cmdline is absolutely possible. This is how I got the extra /system space needed for jellybean. The problem is that it breaks existing installations cause you are altering the default partitioning - therefore it's not suggested. People have to format all partitions before getting out of the kernel with the modded ones.
Don't mind the partitioning the s1loader says - those are of the internal nand as hardcoded via s1loader. My guess is that they can be exposed to userspace.
EDIT: pinouts for x10mini posted.
Click to expand...
Click to collapse
¡Oh! Don't misunderstand me, please. What I tried to mean is your GitHub nAa-kernel repository's last commit is "nAa-13", while latest version of this kernel is v14. That's why I said it seemed a bit outdated.
And as far as MTD partitioning is concerned, I already knew the possible risks of doing it, but these devices have such tiny internal storage and they waste that much space in system and cache partitions that I thought about resizing them.
So, let me thank you one more time for your time.
nobodyAtall if you ever come to Croatia I will give you free holidays at my place in Zadar.
Keep up the good work
i have been to zadar,that place has good beaches...nice offer maybe i will drop by so we can hang out
Sent from my E15i using xda app-developers app
@mn31pro: no, this is not means we will get kernel 3.x. But this method make the kernel developing more easy. We can build any kernel what newer than the old .29 branch, but these kernels not booting. Now nAa give a tool what is a big help to find the booting problems with newer kernels.
@GaBOr1: the nAa-13 commit is the latest changes. The nAa-14 contains only ramdisk changes for SDE (only a new init binary with added drm usergroup to start the drmframework service in init.rc). So, the binary part of the kernel is same in nAa-13 and 14.
Sent from my E15i using xda app-developers app
pilu1978 said:
@mn31pro: no, this is not means we will get kernel 3.x. But this method make the kernel developing more easy. We can build any kernel what newer than the old .29 branch, but these kernels not booting. Now nAa give a tool what is a big help to find the booting problems with newer kernels.
@GaBOr1: the nAa-13 commit is the latest changes. The nAa-14 contains only ramdisk changes for SDE (only a new init binary with added drm usergroup to start the drmframework service in init.rc). So, the binary part of the kernel is same in nAa-13 and 14.
Sent from my E15i using xda app-developers app
Click to expand...
Click to collapse
i think bigest problem way new kernel not booting coz we dont have fastboot
great work...
we should develop an apk for getting extra features....
If I'm correct this info can be used for porting newer kernel versions like 3.0.x etc. It will be hard but I've seen a similar thread on the G3 forum, so I'm guessing this is for the same purpose. It can also be used to debug the kernel. Please correct me if I'm wrong.
EDIT: And thanks to snip3rboy I just realized that I said almost exactly what pilu1978 said in his last post here. LOL.
sgt. meow said:
If I'm correct this info can be used for porting newer kernel versions like 3.0.x etc. It will be hard but I've seen a similar thread on the G3 forum, so I'm guessing this is for the same purpose. It can also be used to debug the kernel. Please correct me if I'm wrong.
Click to expand...
Click to collapse
lol,check post #15
Lukenda said:
i have been to zadar,that place has good beaches...nice offer maybe i will drop by so we can hang out
Sent from my E15i using xda app-developers app
Click to expand...
Click to collapse
i will drop by too
...sorry for ot

[HELP] writting to sensors sysfs

I want to change the poll_delay sysfs file from the gesture_sensor, I can read it fine but when I try to write to it nothing happens, I have already read the dmesg and found nothing, the source code for this driver is here:
https://github.com/gokulnatha/GT-I9505/blob/master/drivers/sensorhub/ssp.h#L98
https://github.com/gokulnatha/GT-I9505/blob/master/drivers/sensorhub/ssp_sysfs.c#L45
I am not so experienced in C so maybe someone can help me to understand what happens when I try to write this value
the file is located at "/sys/class/input/input7/poll_delay" on GT-I9505
frapeti said:
I want to change the poll_delay sysfs file from the gesture_sensor, I can read it fine but when I try to write to it nothing happens, I have already read the dmesg and found nothing, the source code for this driver is here:
https://github.com/gokulnatha/GT-I9505/blob/master/drivers/sensorhub/ssp.h#L98
https://github.com/gokulnatha/GT-I9505/blob/master/drivers/sensorhub/ssp_sysfs.c#L45
I am not so experienced in C so maybe someone can help me to understand what happens when I try to write this value
the file is located at "/sys/class/input/input7/poll_delay" on GT-I9505
Click to expand...
Click to collapse
I think you need to use an init.d script to write to the file.
is it declared in ueventd.rc in ramdisk?
like
/sys/class/input/input7/poll_delay 0664 system system
broodplank1337 said:
is it declared in ueventd.rc in ramdisk?
like
/sys/class/input/input7/poll_delay 0664 system system
Click to expand...
Click to collapse
Yep it's there
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I'm on a root shell and permissions are right, I guess the problem is in the format I write to the file or the driver code itself :/
EDIT: is that a typo on Samsung file? lol
frapeti said:
Yep it's there
View attachment 2675684
I'm on a root shell and permissions are right, I guess the problem is in the format I write to the file or the driver code itself :/
EDIT: is that a typo on Samsung file? lol
Click to expand...
Click to collapse
lol idd a typo, try fixing it and retry
doesn't it just set permissions and user/group? it's doble setted, look some lines above that typo, I'm sure I have permissions to write to the file, but I don't know the format I should write to it, Samsung services can do it fine btw
frapeti said:
doesn't it just set permissions and user/group? it's doble setted, look some lines above that typo, I'm sure I have permissions to write to the file, but I don't know the format I should write to it, Samsung services can do it fine btw
Click to expand...
Click to collapse
yes thats what it does, the owners that are now given are root and input. you need to add system, and maybe even put that 664 to 666. then apps should have access to it
broodplank1337 said:
yes thats what it does, the owners that are now given are root and input. you need to add system, and maybe even put that 664 to 666. then apps should have access to it
Click to expand...
Click to collapse
I'm trying to write it on a root shell already, where I can even chown and chmod that file, only samsung sensors service knows how to interact with its sysfs. And looking at the source code maybe some one can figure it out too
Enviado desde mi GT-I9505 mediante Tapatalk
frapeti said:
I'm trying to write it on a root shell already, where I can even chown and chmod that file, only samsung sensors service knows how to interact with its sysfs. And looking at the source code maybe some one can figure it out too
Enviado desde mi GT-I9505 mediante Tapatalk
Click to expand...
Click to collapse
I just tried it,
echo '200000000' > /sys/class/input/input7/poll_delay
it said
/system/bin/sh: can't create poll_delay: Read-only file system
then i did 'mount -o remount rw /' and it worked just fine.
so its just echoing the value to it, can't be easier
broodplank1337 said:
yes thats what it does, the owners that are now given are root and input. you need to add system, and maybe even put that 664 to 666. then apps should have access to it
Click to expand...
Click to collapse
if you use "su" in a terminal, it has access to everything. The issue isnt a permissions issue. Usually when i change /sys/class files, i have to do it in an init.d script so the kernel writes to it after others have written to it to prevent my values from being overriden. But init.d does not change it either. i really think the kernel source file holds this value.
broodplank1337 said:
I just tried it,
echo '200000000' > /sys/class/input/input7/poll_delay
it said
/system/bin/sh: can't create poll_delay: Read-only file system
then i did 'mount -o remount rw /' and it worked just fine.
so its just echoing the value to it, can't be easier
Click to expand...
Click to collapse
Try echoing a value other than whats already set, it won't hold. I think either the kernel is controlling this, and "poll_delay" is only there so we can view the speed, or that value is set and can't be changed due to hardware limitation. I don't think its possible to change on the fly so to speak. But maybe by editing the kernel source and compiling it yourself would change it.
Yeah that's what I mean, I want to set poll delay to 10000000 ns and the only who can do that is samsung sensors service because it knows how to write to that file
Enviado desde mi GT-I9505 mediante Tapatalk
elesbb said:
if you use "su" in a terminal, it has access to everything. The issue isnt a permissions issue. Usually when i change /sys/class files, i have to do it in an init.d script so the kernel writes to it after others have written to it to prevent my values from being overriden. But init.d does not change it either. i really think the kernel source file holds this value.
Try echoing a value other than whats already set, it won't hold. I think either the kernel is controlling this, and "poll_delay" is only there so we can view the speed, or that value is set and can't be changed due to hardware limitation. I don't think its possible to change on the fly so to speak. But maybe by editing the kernel source and compiling it yourself would change it.
Click to expand...
Click to collapse
I know this, just wanted to say that it is possible to write to that file, some files are not writable at all or readable, so thats a gain. and yes sysfs gets overwrited by kernel by default
And idd you're right I didn't notice it didn't hold. sorry
frapeti said:
Yeah that's what I mean, I want to set poll delay to 10000000 ns and the only who can do that is samsung sensors service because it knows how to write to that file
Enviado desde mi GT-I9505 mediante Tapatalk
Click to expand...
Click to collapse
What you can try is making a c program that regulates it, my experiences with c apps is that they do not require much permissions in order to work correctly
broodplank1337 said:
I know this, just wanted to say that it is possible to write to that file, some files are not writable at all or readable, so thats a gain. and yes sysfs gets overwrited by kernel by default
And idd you're right I didn't notice it didn't hold. sorry
What you can try is making a c program that regulates it, my experiences with c apps is that they do not require much permissions in order to work correctly
Click to expand...
Click to collapse
You can write apps in c code instead of Java and they will run on android!?
Sent from my SGH-M919 using Tapatalk
I think I don't need an app, I just need to understand the driver's source code to find out how to write to its sysfs
Enviado desde mi GT-I9505 mediante Tapatalk
elesbb said:
You can write apps in c code instead of Java and they will run on android!?
Sent from my SGH-M919 using Tapatalk
Click to expand...
Click to collapse
Well not as an apk, but as a binary, like everything in system/bin and xbin. like this: https://github.com/broodplank/android_external_s4utils/blob/master/s4utils.c please note that that is my first c script ever made without any tutorial, so I know, its really poor! anyways, since sensor service has permission to write to it, why shouldn't a custom binary also have that with the right permissions set.
frapeti said:
I think I don't need an app, I just need to understand the driver's source code to find out how to write to its sysfs
Enviado desde mi GT-I9505 mediante Tapatalk
Click to expand...
Click to collapse
ok sorry I wont spam your topic anymore, I just dont know how to read the usage from that code. :silly:
broodplank1337 said:
Well not as an apk, but as a binary, like everything in system/bin and xbin. like this: https://github.com/broodplank/android_external_s4utils/blob/master/s4utils.c please note that that is my first c script ever made without any tutorial, so I know, its really poor! anyways, since sensor service has permission to write to it, why shouldn't a custom binary also have that with the right permissions set.
ok sorry I wont spam your topic anymore, I just dont know how to read the usage from that code. :silly:
Click to expand...
Click to collapse
Thanks for helping btw, I'm sure it isn't related to permissions but format of the data written to that sysfs file, I'm going to find out by reverse engineering samsung service or reading driver's source code again many times lol -.-
Enviado desde mi GT-I9505 mediante Tapatalk
frapeti said:
Thanks for helping btw, I'm sure it isn't related to permissions but format of the data written to that sysfs file, I'm going to find out by reverse engineering samsung service or reading driver's source code again many times lol -.-
Enviado desde mi GT-I9505 mediante Tapatalk
Click to expand...
Click to collapse
Well, i finally had the time to look through those source codes thoroughly. And those values are set by the kernel itself. I don't even know if changing them via on the kernel level will work as limited by hardware. But those values in this file are applied in java when registering a new sensor listener. You can read the standard google example here which tells you what the meaning of those set values are used for.
elesbb said:
Well, i finally had the time to look through those source codes thoroughly. And those values are set by the kernel itself. I don't even know if changing them via on the kernel level will work as limited by hardware. But those values in this file are applied in java when registering a new sensor listener. You can read the standard google example here which tells you what the meaning of those set values are used for.
Click to expand...
Click to collapse
Are you sure? Look at set_gesture_delay and change_sensor_delay functions
Enviado desde mi GT-I9505 mediante Tapatalk
frapeti said:
Are you sure? Look at set_gesture_delay and change_sensor_delay functions
Enviado desde mi GT-I9505 mediante Tapatalk
Click to expand...
Click to collapse
Yes and from what I'm making sense of it, the kernel is calling those methods, they aren't being set by an app so to say. The kernel itself is doing it. That's what I'm getting from it anyhow.
Sent from my SGH-M919 using Tapatalk
look
Code:
static struct device_attribute dev_attr_gesture_poll_delay
= __ATTR([COLOR="Red"]poll_delay[/COLOR], S_IRUGO | S_IWUSR | S_IWGRP,
show_gesture_delay, [COLOR="Red"]set_gesture_delay[/COLOR]);
>>
Code:
static ssize_t set_gesture_delay(struct device *dev,
struct device_attribute *attr, const char *buf, size_t size)
{
int64_t [COLOR="blue"][B]dNewDelay[/B][/COLOR];
struct ssp_data *data = dev_get_drvdata(dev);
if (kstrtoll(buf, 10, &[COLOR="Blue"][B]dNewDelay[/B][/COLOR]) < 0)
return -1;
[COLOR="Red"]change_sensor_delay[/COLOR](data, GESTURE_SENSOR, [COLOR="Blue"][B]dNewDelay[/B][/COLOR]);
return size;
}
>>
Code:
static void change_sensor_delay(struct ssp_data *data,
int iSensorType, int64_t [COLOR="blue"][B]dNewDelay[/B][/COLOR])
{
u8 uBuf[2];
unsigned int uNewEnable = 0;
int64_t dTempDelay = data->adDelayBuf[iSensorType];
if (!(atomic_read(&data->aSensorEnable) & (1 << iSensorType))) {
data->aiCheckStatus[iSensorType] = NO_SENSOR_STATE;
return;
}
data->adDelayBuf[iSensorType] = [COLOR="blue"][B]dNewDelay[/B][/COLOR];
switch (data->aiCheckStatus[iSensorType]) {
case ADD_SENSOR_STATE:
ssp_dbg("[SSP]: %s - add %u, New = %lldns\n",
__func__, 1 << iSensorType, [COLOR="blue"][B]dNewDelay[/B][/COLOR]);
uBuf[1] = (u8)get_msdelay([COLOR="Blue"][B]dNewDelay[/B][/COLOR]);
uBuf[0] = (u8)get_delay_cmd(uBuf[1]);
if (send_instruction(data, ADD_SENSOR, iSensorType, uBuf, 2)
!= SUCCESS) {
uNewEnable =
(unsigned int)atomic_read(&data->aSensorEnable)
& (~(unsigned int)(1 << iSensorType));
atomic_set(&data->aSensorEnable, uNewEnable);
data->aiCheckStatus[iSensorType] = NO_SENSOR_STATE;
data->uMissSensorCnt++;
break;
}
data->aiCheckStatus[iSensorType] = RUNNING_SENSOR_STATE;
if (iSensorType == PROXIMITY_SENSOR) {
proximity_open_lcd_ldi(data);
proximity_open_calibration(data);
input_report_abs(data->prox_input_dev, ABS_DISTANCE, 1);
input_sync(data->prox_input_dev);
}
break;
case RUNNING_SENSOR_STATE:
if (get_msdelay(dTempDelay)
== get_msdelay(data->adDelayBuf[iSensorType]))
break;
ssp_dbg("[SSP]: %s - Change %u, New = %lldns\n",
__func__, 1 << iSensorType, [COLOR="blue"][B]dNewDelay[/B][/COLOR]);
uBuf[1] = (u8)get_msdelay([COLOR="blue"][B]dNewDelay[/B][/COLOR]);
uBuf[0] = (u8)get_delay_cmd(uBuf[1]);
send_instruction(data, CHANGE_DELAY, iSensorType, uBuf, 2);
break;
default:
data->aiCheckStatus[iSensorType] = ADD_SENSOR_STATE;
}
}

[EASY]Dump TrustZone/QSEE logs

Hi guys,
I've got a pretty basic one for you. It's possible to dump the TrustZone and QSEE (Qualcomm Secure Extension Environment) logs. This may benefit the right people. No risk of danger or anything with this. It makes use of the debugfs, not sure if you need to have debug on HIGH (*#9900#, then select DEBUG LEVEL HIGH if it doesn't work.)
TZ Log:
Code:
cat /d/tzdbg/log
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
QSEE Log:
Code:
cat /d/tzdbg/qsee_log
Hopefully someone finds this useful.
Man, you always come up with goodies when least expected. Exactly what I was looking for. I was just diggin' through these binaries trying to understand what they do. What about the device /dev/qseecom ? Any idea how it is used?
Just wondering here but could these logs help out with anything such as unlocking the bootloader or anything else?
AngryManMLS said:
Just wondering here but could these logs help out with anything such as unlocking the bootloader or anything else?
Click to expand...
Click to collapse
Certainly. QSEE is the Qualcomm Secure Extension Environment. This is Qualcomm's TrustZone kernel. This kernel has secure memory where it can store information that is heavily protected. This is where secureboot configuration information is stored, including read/write to QFPROM (QFuses), eFuses (software fuses like Speed Bin for CPU scaling, yes they also have other useful functions), and the warranty 'fuse' which is located onboard the Snapdragon CPU (unlike Exynos where the warranty bit is on the RPMB of the eMMC.) This kernel has access to low level and secure hardware. It is my belief that this kernel operates on the Hexagon DSP by Qualcomm.
I was playing around with my Z3x JTAG box, and in order to do so I had to solder to the back of our mainboard. I decided to do a little analysis of the PBA, and found a third chip labeled 'ARM'. The Hexagon DSP chip is a roughly 600Mhz processor (I believe) with Secure World access. aside from the MDM9215 (CP) and APQ8064T (AP). This DSP chip is not secret, and is actually pretty cool IMO and efficient at what it does.
Can we just hack into this kernel? No, it's VERY difficult, and it was designed to be that way. People like Dan Rosenberg are very good at what they do, as he is a professional. However it is possible there are vulnerabilities or design flaws present, it's just a matter of analyzing the code and logic. This can be complicated and take a significant amount of time.
Anyways... using the following command after boot:
Code:
cat /d/tzdbg/log
You can see (usually):
Code:
Bam Devices pointer struct size : 24 bytes
tzbsp_secure_channel_key_gen status 0
Initializing PIL
QSEE version major=1, minor=2
TYPE = 0x0
FUSE ID: 0x0
IS_WRITE: 0x0
READ: QFPROM row data 0xf03 0x0
READ: Final masked val 0x0
tzbsp_es_is_activated: row_address=[B]0xfc4b81f8[/B].row_data[0]=[B]0x1[/B].row_data[1]=[B]0x4000000.[/B]
tzbsp_es_is_activated: row_address=[B]0xfc4b81f8[/B].row_data[0]=[B]0x1[/B].row_data[1]=[B]0x4000000.[/B]
global_tz_app_id 0x555, 0x0
global_tz_app_id 0x888, 0x0
global_tz_app_id 0x789, 0x0
global_tz_app_id 0xaaa, 0x0
global_tz_app_id 0x777, 0x0
The bold addresses are QFuse addresses. This fuse in particular is what I believe to be the OEM Config fuse chain. This has all of Samsung's configuration for Secure Boot and other odds and ends.
ryanbg said:
... I decided to do a little analysis of the PBA, and found a third chip labeled 'ARM'. The Hexagon DSP chip is a roughly 600Mhz processor (I believe) with Secure World access. aside from the MDM9215 (CP) and APQ8064T (AP).
Click to expand...
Click to collapse
What do you mean?
The DSP is not a "chip" is part of the dye of APQ and MDM SoC's, the APQ doesn't ahve a "modem" on dye, but that doesn't mean it doesn't have a DSP.
The 3rd chip you found, must be something else. Post a picture!
Remind what device you have there again?
Also, do you have a "true" /d/ device or is it symlinked to /sys/kernel/debug like it is on the 4.2.2 i9195. (I can't find such a directory, nor the log file, but I'm not done looking either.)
E:V:A said:
What do you mean?
The DSP is not a "chip" is part of the dye of APQ and MDM SoC's, the APQ doesn't ahve a "modem" on dye, but that doesn't mean it doesn't have a DSP.
The 3rd chip you found, must be something else. Post a picture!
Remind what device you have there again?
Also, do you have a "true" /d/ device or is it symlinked to /sys/kernel/debug like it is on the 4.2.2 i9195. (I can't find such a directory, nor the log file, but I'm not done looking either.)
Click to expand...
Click to collapse
It appears this third chip is actually the PMIC chip. This is on a Galaxy S4. I thought it was a true debugfs but I guess I'm not sure.
Thanks @ryanbg for the explanation on things. I've followed the KNOX discussion over in the dev area and now knowing what you posted it makes things a bit easier for me to understand going forward - I had an idea on things but needed clarifying in regards to how much this stuff effects the boot loader itself. I really hope this leads to unlocking or at least some kind of KEXEC solution since the NC2 leak might very well get us that.
Qualcomm Secure Execution Communicator driver
E:V:A said:
What about the device /dev/qseecom ? Any idea how it is used?
Click to expand...
Click to collapse
maybe that is well known, but..
there is driver code at 'classic' kernel souces;
for example: CAF ver.
Code:
config QSEECOM
tristate "Qualcomm Secure Execution Communicator driver"
help
Provides a communication interface between userspace and
Qualcomm Secure Execution Environment (QSEE) using Secure Channel
Manager (SCM) interface.
config QFP_FUSE
tristate "QFPROM Fuse Read/Write support"
help
This option enables device driver to read/write QFPROM
fuses. The ioctls provides the necessary interface
to the fuse block. Currently this is supported only
on FSM targets.
Click to expand...
Click to collapse
appr. files:
Code:
...
-rw-r--r-- qfp_fuse.c 9430 log stats plain
...
-rw-r--r-- qseecom.c 113933 log stats plain
-rw-r--r-- qseecom_kernel.h 1443 log stats plain
-rw-r--r-- qseecom_legacy.h 2556 log stat splain
or googl hammerhead kernel
@E:V:A and @ryanbg, look to the attached file. This is the part of QSEE which work with Qfuses.

[Q] Need help compiling Liquid Smooth!

Hey guys!
I finally did it and downloaded the liquid smooth's and device's repos. But now when I type 'make otapackage -j4 -i' after 4 hours(!) of compiling it stucks at a certain file and then I can't move the mouse, type someting or anything, Ubuntu 14.04 freezes and I have to press the power button to force the PC close.
Please anyone help? I'm posting a picture with my PC:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
lefterios said:
Please anyone help? I'm posting a picture with my PC:
Click to expand...
Click to collapse
You might have a corrupted gvfsd-metadata. Do pkill gvfsd-metadata, rm -rf ~/.local/share/gvfs-metadata.
And compiling time depends on the computer specs and can easily take more than 3 hours on an average core processor(i3).
MasterAwesome said:
You might have a corrupted gvfsd-metadata. Do pkill gvfsd-metadata, rm -rf ~/.local/share/gvfs-metadata.
And compiling time depends on the computer specs and can easily take more than 3 hours on an average core processor(i3).
Click to expand...
Click to collapse
Okay I'll try it today I'll report if this worked.
I have an Intel core i5 with 3GB Ram and I think that it's quite long...
But thanks anyway!
Okay so I compiled again and now no freezes. Unfortunately however when it was going to end an error occured:
The weird thing is that all folders like system, recovery etc are there
Can you help?
lefterios said:
Okay so I compiled again and now no freezes. Unfortunately however when it was going to end an error occured:
The weird thing is that all folders like system, recovery etc are there
Can you help?
Click to expand...
Click to collapse
Can you paste the error here? With screenshots I can really help you. Just paste the error like this:
Code:
Error
GeekyDroid said:
Can you paste the error here? With screenshots I can really help you. Just paste the error like this:
Code:
Error
Click to expand...
Click to collapse
Ok sure:
Code:
Traceback (most recent call last):
File "./build/tools/releasetools/ota_from_target_files",line 1123, in <module>
main(sys.argv[1:])
File "./build/tools/releasetools/ota_from_target_files",line 1091, in main
WriteFullOTAPackage(input_zip, output_zip)
File "./build/tools/releasetools/ota_from_target_files",line 539, in WriteFullOTAPackage(OPTIONS.input_tmp,"BOOT")
File "/home/lefteris/working/build/tools/releasetools/common.py", line 361, in GetBootableImage
info_dict))
File "/home/lefteris/working/build/tools/releasetools/common.py", line 836, in __init__
self.size = len(data)
TypeError: object of type 'NoneType' has no len()
make: [/home/lefteris/working/out/target/product/golden/liquid_golden-ota-userdebug.lefteris.zip] Error 1 (ignored)
Sorry I may have made a mistake because I copied from the image. If you want full changelog you can right-click the image and press 'open image in a new tab'
lefterios said:
Ok sure:
Code:
Traceback (most recent call last):
File "./build/tools/releasetools/ota_from_target_files",line 1123, in
main(sys.argv[1:])
File "./build/tools/releasetools/ota_from_target_files",line 1091, in main
WriteFullOTAPackage(input_zip, output_zip)
File "./build/tools/releasetools/ota_from_target_files",line 539, in WriteFullOTAPackage(OPTIONS.input_tmp,"BOOT")
File "/home/lefteris/working/build/tools/releasetools/common.py", line 361, in GetBootableImage
info_dict))
File "/home/lefteris/working/build/tools/releasetools/common.py", line 836, in __init__
self.size = len(data)
TypeError: object of type 'NoneType' has no len()
make: [/home/lefteris/working/out/target/product/golden/liquid_golden-ota-userdebug.lefteris.zip] Error 1 (ignored)
Sorry I may have made a mistake because I copied from the image. If you want full changelog you can right-click the image and press 'open image in a new tab'
Click to expand...
Click to collapse
Did you type make -i (ignoring the errors?) If you did that, the zImage might not have been built because of errors and the boot image is not built due to this. It might also be because of fs size constraints. In your out folder of your device, check if you have the kernel and the root directory.
And in the py file the typecasting might have been done wrong since it says "object of type 'NoneType' has no len()"
MasterAwesome said:
Did you type make -i (ignoring the errors?) If you did that, the zImage might not have been built because of errors and the boot image is not built due to this. It might also be because of fs size constraints. In your out folder of your device, check if you have the kernel and the root directory.
And in the py file the typecasting might have been done wrong since it says "object of type 'NoneType' has no len()"
Click to expand...
Click to collapse
Ιn the out folder I have the root directory but not the kernel... And yes I typed -i because there were many errors and I couldn't build the ROM. So what do I have to do now? Please note that I'm beginner and I don't know very much for ROM development...
lefterios said:
Ιn the out folder I have the root directory but not the kernel... And yes I typed -i because there were many errors and I couldn't build the ROM. So what do I have to do now? Please note that I'm beginner and I don't know very much for ROM development...
Click to expand...
Click to collapse
As I said the error must have been in the kernel and ignoring that will not build the kernel, you will have to fix it manually the errors you face in the kernel building stage, post it here.
MasterAwesome said:
As I said the error must have been in the kernel and ignoring that will not build the kernel, you will have to fix it manually the errors you face in the kernel building stage, post it here.
Click to expand...
Click to collapse
Sorry I don't know how to do that :crying:
A question: Can I build the ROM with existing kernel image(boot.img) from another ROM? I don't make changes to kernel...
lefterios said:
Sorry I don't know how to do that :crying:
A question: Can I build the ROM with existing kernel image(boot.img) from another ROM? I don't make changes to kernel...
Click to expand...
Click to collapse
Yes you can, in the boardconfig.mk add a flag
TARGET_PREBUILT_KERNEL := $(DEVICE_FOLDER)/prebuilt/kernel
Be sure to define the DEVICE_FOLDER at the top of the make file.
Although its deprecated. But it'll work in your case if the kernel is a kitkat kernel.
MasterAwesome said:
Yes you can, in the boardconfig.mk add a flag
TARGET_PREBUILT_KERNEL := $(DEVICE_FOLDER)/prebuilt/kernel
Be sure to define the DEVICE_FOLDER at the top of the make file.
Although its deprecated. But it'll work in your case if the kernel is a kitkat kernel.
Click to expand...
Click to collapse
I tried it but again no luck What am I doing wrong? It produces all files and folders except kernel!
lefterios said:
I tried it but again no luck What am I doing wrong? It produces all files and folders except kernel!
Click to expand...
Click to collapse
I believe you forgot to remove the kernel directory flags from the board config.mk. attach it here.
MasterAwesome said:
I believe you forgot to remove the kernel directory flags from the board config.mk. attach it here.
Click to expand...
Click to collapse
Ok I attached the file found under ~/working/device/samsung/golden. I hope you can help me. I created the folder prebuilt and I put there a zImage. Is that right?
lefterios said:
Ok I attached the file found under ~/working/device/samsung/golden. I hope you can help me. I created the folder prebuilt and I put there a zImage. Is that right?
Click to expand...
Click to collapse
You named it as zImage and specified it as prebuilt/kernel. It should be $(DEVICE_FOLDER)/prebuilt/zImage.
MasterAwesome said:
You named it as zImage and specified it as prebuilt/kernel. It should be $(DEVICE_FOLDER)/prebuilt/zImage.
Click to expand...
Click to collapse
Firtsly is everything alright with the boardconfig file? So should I rename the file to zImage and that's it? And also which difference there is between kernel and zImage and which should I use?
lefterios said:
Firtsly is everything alright with the boardconfig file? So should I rename the file to zImage and that's it? And also which difference there is between kernel and zImage and which should I use?
Click to expand...
Click to collapse
Everything else seems fine... The path must be the path to your kernel or what ever you renamed it as.
I'd recommend you try and compile the kernel alone to check if it work
MasterAwesome said:
Everything else seems fine... The path must be the path to your kernel or what ever you renamed it as.
I'd recommend you try and compile the kernel alone to check if it work
Click to expand...
Click to collapse
I compiled the kernel alone and it didn't show any error. It made a zImage file successfully. So where is the problem?
lefterios said:
I compiled the kernel alone and it didn't show any error. It made a zImage file successfully. So where is the problem?
Click to expand...
Click to collapse
Trying doing a "make" without the -i and see where the build stops.

Categories

Resources