Sabtu, 04 Agustus 2012

U-boot and Nitdroid for n900 [Camera fixed, Network Working!!!]

Ok this is a short guide for more andvanced users:
1. Download Nitdroid 2.3.4 N12_Umay and install it on ext3/ext4 partition (mmcblk1p2) - for ext4 kernel support use the second link!
2. Your first sd card partition should be FAT (for ext2/ext3 and etc will explain tomorrow)
3. Install U-boot by Pali:
Update: 28.04.2012 11:50 UTC: Fixed problem with mkimage, build error in debian/rules and correct ram size in u-boot rx51 board code
Update: 28.04.2012 17:50 UTC: Fixed and enabled SW cursor. Now problem with damaged video output is fixed.
Update: 09.07.2012 08:10 UTC: New version which generate omap atag
Update: 09.07.2012 15:46 UTC: Set bootdealy to 0 if keyboard is closed

Update: New version 2012.04-2
Changes:
* load bootmenu.src always (if keyboard is closed, first menu entry will be automatically boot)
* u-boot now NOT reusing omap atag, instead it generate it
* item option ITEM_REUSEATAGS is obsolated (but still working). Now use ITEM_OMAPATAG for booting Maemo 5
* u-boot variable atagaddr is now ignored, because u-boot is not reusing atags.
* u-boot command "setenv setup_omap_atag 1" will tell u-boot to generate omap atag for booting kernel PLEASE DO NOT USE IT - INSTEAD USE ITEM CONFIG FILE

Update: New version 2012.04
Visible changes for users:
* atag address for kernel is always 0x80000100, so for reusing atags from nolo is needed this command: "setenv atagaddr 0x80000100" instead "setenv atagaddr ${init_atagaddr}"PLEASE DO NOT WRITE YOUR OWN SCRIPTS - USE ITEM CONFIG FILES
* for reusing atags u-boot-update-bootmenu needs option ITEM_REUSEATAGS=1 (instead ITEM_USEATAG) - but works also old option (it show warning) - update your item config files
* "run noloboot" command renamed to "run attachboot"
* if you are not reusing atags from nolo, u-boot will generate memory atag which is needed to boot kernels (now maybe meego/upstream kernel will boot without nolo atags)

other changes:
* added ext4 support
* added console history support (but without cursor)
* disabled cursor - it is buggy now
* enabled generating memory atag
* restored powerbus state after enabling eMMC
* removed init_atagaddr variable (it must be always 0x80000100)
* fixed keymap, cursor keys
* ...


Das U-Boot is bootloader which can boot kernel image with initrd. It can be used for booting more kernels (Nokia stock, kernel-power, ...) or for booting other systems (Nemo, Nitdroid, Kubuntu, Debian, ...).

This U-Boot version is new and has nice Bootmenu (like Fanoush Bootmenu or Multiboot packages). I'm working on upstreaming U-Boot RX-51 (N900) port and this U-Boot Bootmenu. This version should be stable, it has FIXED battery draining and video output garbage.

U-Boot Bootmenu reading special config file and some images from MyDocs (file bootmenu.scr and directory bootmenu-img.d). This special u-boot config file is binary and is generated from text config files by script u-boot-update-bootmenu

New U-Boot has 3 packages:

u-boot-bootimg - contains only u-boot binary, nothing more (it is not need for end-users)

u-boot-tools - contains tools:
* u-boot-gen-combined - generate combined images (u-boot with kernel)
* u-boot-update-bootmenu - update bootmenu entries for U-Boot
* mkimage - convert zImage kernel format to uImage (U-Boot format)

u-boot-flasher - contains combined image: u-boot binary with stock PR1.3 kernel. After installation is this image flashed, and replace actual kernel. This package depends on u-boot-tools!

Download & Install (in this order)
http://atrey.karlin.mff.cuni.cz/~pal...04-2_armel.deb
http://atrey.karlin.mff.cuni.cz/~pal...04-2_armel.deb

!BEFORE INSTALLING PACKAGES ALL OTHER/OLD U-BOOT VERSIONS MUST BE UNINSTALLED!
!INSTALLING u-boot-flasher PACKAGE WILL REPLACE YOUR KERNEL IN NAND!


Source code:
Full source code with debian control files are in branch pali on gitorious project u-boot-shr: https://gitorious.org/u-boot-shr/u-boot/commits/pali

How to create bootmenu entry for U-Boot:
copy kernel image zImage-my to /boot/
create config file in /etc/bootmenu.d/ with suffix .item

/etc/bootmenu.d/20-my-kernel.item

Code:
ITEM_NAME="My kernel"   # Menu entry name
ITEM_KERNEL="zImage-my" # file name stored in /boot/
ITEM_OMAPATAG=1         # This is needed for booting Maemo
Warning: ITEM_USEATAG and ITEM_REUSEATAGS options was renamed to ITEM_OMAPATAG

Set bootmenu item file as default first entry
Create symlink to /etc/default/bootmenu.item from your item file. For example:
$ ln -s /etc/bootmenu.d/20-Maemo5-kernel-power-2.6.28.10-power51.item /etc/default/bootmenu.item

Item config file has same format as Fanoush bootmenu and is stored in same folder (Multiboot package has same format too, but in folder /etc/multiboot.d/)

After creating config run tool u-boot-update-bootmenu. u-boot-update-bootmenu must be called every time, when config file is changed.

See also u-boot-images.tar.gz which contains example item files.

How to easy create Maemo kernel dualbooting: Stock PR1.3 kernel, kernel-power and other...

Just copy zImages to /boot, create config files for each and run u-boot-update-bootmenu

kernel-power v50 has package kernel-power-bootimg in extras-devel & extras-testing. It contains proper zImage and item file.

Examples:

This tarball http://atrey.karlin.mff.cuni.cz/~pal...12.04-1.tar.gz contains some kernels (stock PR1.3 and stock PR1.3 with framebuffer) and some item files.

For playing & testing download archive to / and unpack it as root:
$ cd / && tar -xf u-boot-images.tar.gz

Do not forget to update bootmenu:
$ u-boot-update-bootmenu

Screenshot:
Attached Images

4. Download nitdroid rc7 kernel and extract the file - then go to /system/lib/modules/2.6.28.NIT.07/  and copy all the files to  /system/lib/modules/current in NITDROID partition (mmcblk1p2)
4.1. Replace init.nokia.rc with mine
5. Now download boot.scr from attachments and copy it to the first partition (FAT)
6. Dowload uImage and copy it to the same place as boot.scr
7. Insert sd card in n900 and power on with opened keeyboard
8. Stop u-boot counting and enter U-boot console
9. Write - run sdboot... and watch booting

Bluetooth, Wi-fi, charging, hardware acceleration, lights and other things NOW working!!!  Just replace init_subsys in /system/maemo/bin

P.S. If using boot.scr from the archive below it will stop for 10 seconds to wait for rootfs to be mounted! If these steps are not convenient for you read the text below to find out how to configure your own boot.scr

Credits: E-yes (For help and Nitdroid), Pali (for help and U-boot), Marex_ (at #u-boot at freenode) for help and Vakkov for making it possible. and everybody else who i have forgot about.

FILES: http://www.mediafire.com/?lu5hq6rinitce5e
Kernel only(with ext4 support): http://www.mediafire.com/?0v7ed0jzp6zcqb0


- I want to boot Nitdroid from a partition different from mmcblk1p2 (second partiton of sd card). How to do it?
- Here is how to:
nit.src is the "source" file of boot.src. You can open it with a text editor and see its contents
Change "root=/dev/mmcblk1p2" to your desired partition (where Nitdroid is stored) - for example /dev/mmcblk0p2 (that's eMMC).
rootdelay=10 is the time in seconds to wait for the rootfs to be mounted before continuing with loading the kernel. You can set it to 1 if you want or you can replace the whole rootdelay parameter with rootwait (it will wait for the file system to mount and then continue). FOR EXT4 USE THE KERNEL FROM THE SECOND LINK!

- I want to place the kernel (uImage) wherever I want. How to do it?
Go on the second line of nit.scr (starts with setenv bootcmd) i Used fatload mmc 1:1 This means it will search for the uImage at the first partition of the sd card and that partition has to be a FAT one.
The format of this can be:
Code: [Select]
fatload mmc <device>:<partition number> 0x82000000 <filepath/file>
ext2load mmc <device>:<partition number> 0x82000000 <filepath/file>
So if you want to use an ext2/ext3 partition to store the kernel use ext2load (yes, it's also loading ext3)

Generating boot.scr
When you finish editing nit.scr to your desired settings save it and run in terminal:
Code: [Select]
mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "NITDroid" -d nit.scr boot.scr
This will generate a valid boot.scr which you have to copy to the FIRST partition of sd card or to boot.scr

New init.nokia.rc and camd - Camera FIXED! Works on N12_UMay (2.3.4) with 2.3.7 camera libs, should also work on 2.3.7
P.s. Replace camd in system/maemo/bin (where init_subsys is stored)

Soon - bootmenu guide!
* nit.scr (0.26 kB - downloaded 401 times.)
* init_subsys (1.95 kB - downloaded 423 times.)
* init.nokia.rc (7.86 kB - downloaded 328 times.)
* camd (0.21 kB - downloaded 376 times.)

Tidak ada komentar: