LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
LinkBack Search this Thread
Old 11-15-2011, 03:46 PM   #1
abtekk
Member
 
Registered: Aug 2011
Posts: 30

Rep: Reputation: Disabled
How do you modify a uImage?


I need help extracting and modifying the uImage used for my tablet device, in the end product I need to modify the init to look to the SDCARD rather than NAND.

Right anyway to start I'm unsure where to go.
I understand the uImages have a 64byte header, so I open uImage in hex editor and remove the first 64bytes, I then save the new file as name.bz2 and open it, this gives me a data file (which I believe is raw data).

Now, where to I go from there?

Last edited by abtekk; 11-15-2011 at 03:54 PM.
 
Old 11-16-2011, 02:49 AM   #2
rulingminds
LQ Newbie
 
Registered: Sep 2011
Posts: 9

Rep: Reputation: Disabled
First, What is your intension, do you want to boot from SD card instead of NAND Device. It is done at the boot loader level not at the kernel level. And one more thing is as far as I know you can't modify the kernel image once you built it, it is an object file and not a plain text file.
 
Old 11-16-2011, 04:58 AM   #3
DarkVenger
Member
 
Registered: Mar 2004
Location: VCO
Distribution: Arch
Posts: 42

Rep: Reputation: 25
Not what you what

I also believe modifying uImage is not what you what, since it does not control the device boot, only the OS boot.
You have to tell the boot loader (maybe uBoot?) where do you want it to boot from, or rather, where do you want it to read the kernel image (uImage) from...
 
Old 11-16-2011, 03:15 PM   #4
abtekk
Member
 
Registered: Aug 2011
Posts: 30

Original Poster
Rep: Reputation: Disabled
Well, last with my old tablet device I extracted the initramfs from the zImage and modified init to boot from SD card, this worked successfully. However, this new tablet (made by the same company) uses a uImage, and it won't work the same.
 
Old 11-17-2011, 04:11 AM   #5
DarkVenger
Member
 
Registered: Mar 2004
Location: VCO
Distribution: Arch
Posts: 42

Rep: Reputation: 25
I have heard of people that extracted the initramfs from a zImage, but editing it would cause problems if the image size changed...
 
Old 11-17-2011, 05:53 PM   #6
formiaczek
LQ Newbie
 
Registered: Nov 2011
Posts: 8

Rep: Reputation: 0
Quote:
Originally Posted by DarkVenger View Post
You have to tell the boot loader (maybe uBoot?) where do you want it to boot from, or rather, where do you want it to read the kernel image (uImage) from...
I have not done it with tables, but I think I agree. What you might want to do is to modify (or create if there isn't any) a boot.scr.

You can create one from your boot script using mkimage. Command would look something like:
mkimage -A arm -T script -C none -n "My Boot.scr" -d /tmp/boot.script /mnt/boot.scr


see following (and google for more) resources:
http://processors.wiki.ti.com/index....difying_U-boot
https://wiki.linaro.org/Resources/HowTo/boot.scr
http://groups.google.com/group/beagl...5c09a98c?pli=1
http://www.denx.de/wiki/view/DULG/UBootScripts
 
Old 11-18-2011, 04:19 AM   #7
DarkVenger
Member
 
Registered: Mar 2004
Location: VCO
Distribution: Arch
Posts: 42

Rep: Reputation: 25
More on the subject :)

[QUOTE=formiaczek;4526979]I have not done it with tables, but I think I agree. What you might want to do is to modify (or create if there isn't any) a boot.scr.

You can create one from your boot script using mkimage. Command would look something like:
mkimage -A arm -T script -C none -n "My Boot.scr" -d /tmp/boot.script /mnt/boot.scr

(...)

Well, with uBoot it depends. Yes you can create the boot.scr file.
But you can also create an uEnv.txt with environment variables assignments which would replace the default values in the uBoot binary.

However, if the uBoot binary is in an internal memory of the device, that is always read at start-up, then none of this methods will work. You need to boot into uBoot, modify the variables you need, and save them. Some useful commands are printenv, setenv, saveenv.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
uImage Header Format Question gsinde Linux - Embedded & Single-board computer 3 01-12-2012 08:17 AM
Why zero-pad uImage? littlebigman Linux - Embedded & Single-board computer 0 06-08-2011 05:57 AM
Build Uimage utkarshrawat Linux - Newbie 6 03-13-2011 04:25 PM
Can't load UImage aemindia Linux - Kernel 1 06-16-2009 10:35 PM
u-boot and uImage.cc for LDK5910 Anitha Linux - Kernel 0 02-19-2007 09:44 PM


All times are GMT -5. The time now is 04:22 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration