abootimg extract ?

Asked by Sherif Aliti on 2018-07-04

Hi,

On abootimg -x boot.img i am getting only
bootimg.cfg or config file
intrd.img or ramdisk
zImage or kernel

How to extract those 3 and repack them back

no too much familiar with Linux
I saw this command but its a bit hard to understand
abootimg -x <bootimg> [<bootimg.cfg> [<kernel> [<ramdisk> [<secondstage>]]]]
abootimg -x <bootimg> [<bootimg.cfg> [<kernel> [<ramdisk> [<secondstage>]]]]

What confuses me are []]]].
Any explanation will be highly appreciated.

Thanks in Advance

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu abootimg Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
2018-07-06
Last query:
2018-07-06
Last reply:
2018-07-06
Manfred Hampl (m-hampl) said : #1

"[" and "]" in manpage listings indicate optional parameters. You can either add the text between a pair of square brackets, or omit it.
In the case above that means that you have the choice between the commands

abootimg -x <bootimg>
abootimg -x <bootimg> <bootimg.cfg>
abootimg -x <bootimg> <bootimg.cfg> <kernel>
abootimg -x <bootimg> <bootimg.cfg> <kernel> <ramdisk>
abootimg -x <bootimg> <bootimg.cfg> <kernel> <ramdisk> <secondstage>

where you have to replace <...> by the value of the parameter.
(e.g. "abootimg -x boot.img bootimg.cfg zImage intrd.img")

Sherif Aliti (formingus) said : #2

Hi, Thanks for Replay

On
abootimg -x i got 2 files as i say

writing boot image config in bootimg.cfg
extracting kernel in zImage
extracting ramdisk in initrd.img

Then i try
abootimg -x bootimg.cfg
it says
bootimg.cfg: Success
but nothing extracted , ok let say cfg cant be extracted

but even i try your last command
abootimg -x boot.img bootimg.cfg zImage intrd.img
there is only 3 thing extracted
writing boot image config in bootimg.cfg
extracting kernel in zImage
extracting ramdisk in intrd.img

So to get things clear what i am trying to do is to unpack boot.img and rest of stuffs included like kernel . ram ect
so i can modify build.prop and repack again without changing orginal structure.

This is boot.img info, What command will you use to unpack till build.prop and repac again? Thnks in Advance

boot.img info with abootimg -i boot.img

formingus@vProUbuntu:~/bin$ abootimg -i boot.img

Android Boot Image Info:

* file name = boot.img

* image size = 25143584 bytes (23.98 MB)
  page size = 2048 bytes

* Boot Name = "SYSMAGIC000KU"

* kernel size = 20549316 bytes (19.60 MB)
  ramdisk size = 3308242 bytes (3.15 MB)

* load addresses:
  kernel: 0x10008000
  ramdisk: 0x11000000
  tags: 0x10000100

* empty cmdline
* id = 0x2b7814e9 0xad98a08a 0x3bbaef3d 0xf68882b7 0x31391f77 0x00000000 0x00000000 0x00000000

Regards

Best Manfred Hampl (m-hampl) said : #3

This question is not really related to Ubuntu, but more to Android.

Maybe you find the desired information when reading
http://mediawiki.compulab.com/w/index.php5/Android:_Boot_image
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack%2C_Edit%2C_and_Re-Pack_Boot_Images

Sherif Aliti (formingus) said : #4

Yes you do have right , its related to android, but with those links will probably solve mine problem
There is 100 % detailed explanation, strange how i miss those links. Thank You.

Now , this thread will be marked as done and This Solved mine Problem.
I Have 1 more question this time is related to Ubuntu.

I am trying to copy files inside existing paths like usr\local\bin ect it says no permission
After i check permission it says "owner root", so need to be root to copy , but I Dont know how to become root via file manager. Sudo su on terminal work, but its not solution. So i decide to create own working directory and add permanently as path.

Chek SHELL
"echo $SHELL" i get as return results /bin/bash , so mine SHELL is bash

Then will open as administrator so i can edit it
sudo gedit $HOME/.bashrc
and add following line to end of
export PATH=$PATH:/nameofyourpath

When i check path
"echo $PATH"
path is there even after reboot system
but even if i copy some script or file there ex: volid.sh or mkbootinf
when i try to execute it says command not exist or when i put ./ in front i am getting error message

Mine question is how to get or change permission to folder so when i copy files there i can use from anywhere in terminal?

Thank you Friend...

Sherif Aliti (formingus) said : #5

Thanks Manfred Hampl, that solved my question.

Manfred Hampl (m-hampl) said : #6

Ubuntu is using the "sudo" concept for temporarily granting root privileges see e.g. https://help.ubuntu.com/community/RootSudo

if you want to copy files in a terminal window into the protected area, just put "sudo" before the command.
e.g.
sudo cp whatever_file /usr/whatever_directory/

If you need a file manager with administrative rights you can start the command "sudo nautilus" in a terminal window, and the file explorer that is started will have root powers - be cautious!

Sherif Aliti (formingus) said : #7

Ok Friend this help me allot , more then allot.
I am begginer and hope that didnt bother you

Last question is when i need to use ./something and when i need to use without ./ ?
when i use sometimes ./for some file name i am getting menus
Can you explain me difference between ./ and without them

Thanks

Manfred Hampl (m-hampl) said : #8

When you are executing a system command then it is enough to just write the name of it (without ./)
When you want to execute a program (or script) that is not located in the system area for executable programs (which is defined with the PATH variable), you have to give the directory name and the file name to that file.
The meaning of "./" is "in the current directory".