Active Topics

 


Reply
Thread Tools
Posts: 362 | Thanked: 426 times | Joined on Nov 2010 @ Italy, Lombardia
#1
This is my simple guide to modify power kernel v45 image and to change or remove u-boot from it.

It needs a linux pc (or you can use N900 itself) do some steps.
With some modifications steps can be adapted to windows systems too

How-to remove u-boot:
  1. Download power kernel deb file from repository and extract fiasco image from it
  2. Unpack Fiasco image
    flasher-3.5 -u -F zImage-2.6.28-maemo45.fiasco
  3. Remove u-boot from kernel image (starting read at offset 0x40000 aka 512 blocks)
    dd if=zImage of=uImage_pow45_noUBoot skip=512
  4. Remove uImage header from kernel file to obtain a flashable zImage kernel
    dd ibs=64 if=uImage_pow45_noUBoot of=zImage_pow45_noUBoot skip=1
  5. Flash new kernel to device
    sudo flasher-3.5 -f -k zImage_pow45_noUBoot -R

How-to change u-boot with Matan's version:

  1. Download power kernel deb file from repository and extract fiasco image from it
  2. Download Matan's u-boot from repository (it is named u-boot-for-power-kernel) and extract file image from it
  3. Unpack Fiasco image
    flasher-3.5 -u -F zImage-2.6.28-maemo45.fiasco
  4. Remove u-boot from kernel image (starting read at offset 0x40000 aka 512 blocks)
    dd if=zImage of=zImage_pow45_noUBoot skip=512
  5. Copy u-boot to destination zImage
    cp u-boot.bin.0x38000 zImage_pow45_MatanUBoot
  6. Add power kernel at end of previous file (starting write at offset 0x38000 aka 448 blocks)
    dd if=zImage_pow45_noUBoot of=zImage_pow45_MatanUBoot seek=448
  7. Flash new kernel to device
    sudo flasher-3.5 -f -k zImage_pow45_MatanUBoot -R

ATTENTION: Actual Matan's u-boot can have problems with HW revision different from v2101

How-to add u-boot Matan's version:
  1. Download power kernel deb file from repository and extract fiasco image from it
  2. Download Matan's u-boot from repository (it is named u-boot-for-power-kernel) and extract file image from it
  3. Unpack Fiasco image
    flasher-3.5 -u -F zImage-2.6.28.10-power48.fiasco
  4. Transform zImage in uImage (necessary because u-boot boots Kernel only in uImage file format)
    mkimage -A arm -O linux -T kernel -C none -a 80008000 -e 80008000 -n "Power Kernel v48" -d zImage uImage
  5. Copy u-boot to destination zImage
    cp u-boot.bin.0x38000 zImage_pow48_MatanUBoot
  6. Add power kernel uImage at end of previous file (starting write at offset 0x38000 aka 448 blocks)
    dd if=uImage of=zImage_pow48_MatanUBoot seek=448
  7. Flash new kernel to device
    sudo flasher-3.5 -f -k zImage_pow48_MatanUBoot -R

ATTENTION: Actual Matan's u-boot can have problems with HW revision different from v2101

Last edited by Fabry; 2011-08-24 at 14:09. Reason: Updated to Power Kernel v48
 

The Following 18 Users Say Thank You to Fabry For This Useful Post:
cfh11's Avatar
Posts: 1,062 | Thanked: 961 times | Joined on May 2010 @ Boston, MA
#2
It might be worth mentioning that uninstalling power kernel v45 and installing v42 is also an option.

http://wiki.maemo.org/Kernel_Power#Deinstallation
__________________
Want to browse streamlined versions of websites automatically when in 2g? Vote for this brainstorm.

Sick of your cell signal not reconnecting after coming out of a bad signal area? Vote for this bug.
 
Posts: 362 | Thanked: 426 times | Joined on Nov 2010 @ Italy, Lombardia
#3
Added guide to add u-boot on power-kernel v46
 
Posts: 87 | Thanked: 26 times | Joined on Oct 2009
#4
Hey

Is it possible to install v45 via apt-get to device.
I just wanted to test meegon and figured out that v46 does not have u-boot anymore
 
Posts: 1,042 | Thanked: 430 times | Joined on May 2010
#5
Originally Posted by cfh11 View Post
It might be worth mentioning that uninstalling power kernel v45 and installing v42 is also an option.

http://wiki.maemo.org/Kernel_Power#Deinstallation
It might also be worth mentioning that you would miss a couple of patches and fixes other than uboot when downgrading from v45 to v42.
 
Posts: 2,225 | Thanked: 3,822 times | Joined on Jun 2010 @ Florida
#6
If you're flashing from onboard the device, instead of running this as root:
Code:
flasher-3.5 -f -k [image name] [-R]
You do:
Code:
softupd --local -D
flasher --local -f -k [image name] [-R]
The "-R" is optional in both. It just tells your device to reboot right after flashing. This is somewhat safer because in case your N900 has a battery problem or runs out of power or crashes soon after, it might not be able to actually write the changes to disk. (In Linux, the kernel sometimes waits, keeping changes to disk in memory, instead of writing it to disk immediately. When it reboots, it will write every change not yet made to disk before shutting everything down.) However, if you don't immediately need or want to reboot, you can just run "sync", which does just that - writes all the not-yet-written-to-disc-changes to disk. Then you can rest soundly knowing your flashed kernel is saved, so you can reboot at leisure.

- Edit -

Didn't actually say this first time around so: Thanks for posting this in a single concise how-to. I suspect this information was lying around in various places, but it's always nice to see people making clear instructions.

Also, I haven't tried this one, but I thought I'd point out that e-yes (one of the NITDroid developers) created a patch for uboot that makes it boot the attached kernel if you boot with keyboard closed, and takes you to the normal uboot loader screen with the countdown if you boot with keyboard slid out.
Thread - first post on this page: http://talk.maemo.org/showthread.php?t=64921&page=10
Post itself: http://talk.maemo.org/showpost.php?p...1&postcount=91

Last edited by Mentalist Traceur; 2010-11-23 at 23:25. Reason: Cleaned up the stuff in code tags; added thanks and another uboot image suggestion.
 
Posts: 1,224 | Thanked: 1,763 times | Joined on Jul 2007
#7
Originally Posted by Mentalist Traceur View Post
Also, I haven't tried this one, but I thought I'd point out that e-yes (one of the NITDroid developers) created a patch for uboot that makes it boot the attached kernel if you boot with keyboard closed, and takes you to the normal uboot loader screen with the countdown if you boot with keyboard slid out.
This patch is included in the u-boot-for-power-kernel package.
__________________
My repository

"N900 community support for the MeeGo-Harmattan" Is the new "Mer is Fremantle for N810".

No more Nokia devices for me.
 

The Following User Says Thank You to Matan For This Useful Post:
Posts: 2,225 | Thanked: 3,822 times | Joined on Jun 2010 @ Florida
#8
Oh. Was this in power44? I never noticed, but then again I was on Power44 maybe 4-5 days and then power45 came out. Thanks for correcting me on that.
 
Posts: 2,225 | Thanked: 3,822 times | Joined on Jun 2010 @ Florida
#9
Yay, fun stuff:

Followed instructions of adding uboot to Power 46. Downloaded the respective files and extracted u-boot.bin.0x38000 and zImage-2.6.28-maemo46.fiasco images. Used flasher-3.5 to extract the, well, whatever was in there, from the zImage-2.6.28-maemo46.fiasco image. It put out one file, a "zImage". I ran it again just to make sure, it put out the same file, so I figured everything was correct. This was on a Windows Vista 32 bit laptop.

Plugged in N900, copied both the uboot.bin.0x38000 and zImage files on board. (I then remembered the u-boot-for-power-kernel package installed a uboot.bin.0x38000 file into the /usr/lib/uboot.bin/0x38000/ directory. ls -l showed the files as being the same size, so there was no reason to think that the file I got out of that package's source .tar.gz was any different.) Okay, so, I copied uboot.bin.0x038000 to a file I called "u-boot.power46". (Since I've used Matan's "my.u-boot.power41[a/d]" images, I had deduced the name didn't matter.) Then I ran the dd command above, with "of=u-boot.power46" being the only difference. (This was all done in the directory the files were in, so I don't think that should've been any issue.)

From here, I used fiasco-flasher, instead of the softupd -D / flasher combo. Because out of the two, fiasco-flasher, if you have it, is just faster for flashing kernel, and as far as I know does the same exact thing. At any rate, result? I reboot, and it loads uboot - even though I have the keyboard in, the uboot menu does the countdown. Then it does the normal looking-for-kernel-on-SD-card thing. Doesn't have one (I don't have one there, so so far so good), and then it reports that the format of the kernel image is wrong, so it can't boot. "run noloboot", predictably, reports the same error.

So it stays in uboot. The white LED stays on indefinitely. If there's a way to shutdown from uboot directly, I don't know it. So eventually I had to just pull the battery. Which to me is unpleasant but something I knew I was signing up for when I started mucking with kernel flashing. I know how to reflash, not too much of an issue. So I figured I'll go reflash to the just-previously-working power46 kernel (using the same zImage-2.6.28-maemo46.fiasco image I originally extracted my zImage to make the uboot one from). Did that from my Windows laptop - no problem, it flashed. However, even that's not loading now. It takes me to the white Nokia screen, and just sits there. Just like with the non-working uboot just beforehand. White LED stays on, white nokia screen stays on.

Right now I'm gonna test by trying to flash just kernel from stock global pr1.3 fiasco image. I suspect I either got a messed up version of the power46 zImage, or the zImage flasher extracted from that got messed up. If so, it's probably PeaZip's fault, because that's the archive manager I used to get the image out of the .deb on Windows.

If that doesn't work, I'll try for an entire fiasco-image reflash. Not my idea of fun, restoring all my programs afterwords, but, again, something I don't mind doing because I knew I was signing up for that when I fiddle with custom kernel images.

What I am REALLY worried about though, is that somehow, I screwed up the NAND chip itself, or the bootloader on it. In which case I suppose necessity will dictate I spend the time to figure out how to fix that. Anyway, I'll report if even a stock kernel reflash doesn't work. At that point, suggestions will be welcome, especially if the full fiasco-image reflash doesn't work either.

- Edit -

*Sigh of relief*

Extracted zImage from the stock Global firmware fiasco image. It worked. I'm assuming it was just something messed up in the power46 fiasco image or the extracted zImage I got.

Emboldened by things working again, I prepare to attempt to do the same thing all over again. I'm supposing that I should be able to use the N900's available tools to extract the image from the power-kernel deb onboard.

Last edited by Mentalist Traceur; 2010-11-24 at 04:58. Reason: Yeah, it seems to have been the zImage-2.6.28-maemo46.fiasco image I got that was messed up. That or just the zImage I extracted from it.
 
Posts: 1,224 | Thanked: 1,763 times | Joined on Jul 2007
#10
There is indeed a problem in the instructions. u-boot expects a uImage, not a zImage. power46 is u-boot-less, so its image is not a uImage. This is just a few bytes added at the start of the image, telling u-boot about its size, purpose, etc.

So indeed, of the three operations in the original post, only the middle one - replacing one u-boot with another will work. The others need an extra step of converting between uImage and zImage.

You can find a mkimage binary (for x86_64 linux) here:
http://my.svgalib.org/770/n900/u-boot/
and instructions for converting a zImage to a uImage here:
http://al.robotfuzz.com/~al/maemo/u-boot/
__________________
My repository

"N900 community support for the MeeGo-Harmattan" Is the new "Mer is Fremantle for N810".

No more Nokia devices for me.
 

The Following 4 Users Say Thank You to Matan For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 08:25.