maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Alternatives (https://talk.maemo.org/forumdisplay.php?f=36)
-   -   [Announce] N9 Multiboot - Harmattan, Nemo & Nitdroid (https://talk.maemo.org/showthread.php?t=83189)

Akkumaru 2012-11-21 00:55

Re: [Announce] N9 Multiboot - Harmattan, Nemo & Nitdroid
 
Do I smell a possibility of QUADBOOT? :D

thedead1440 2012-11-21 02:31

Re: [Announce] N9 Multiboot - Harmattan, Nemo & Nitdroid
 
Quote:

Originally Posted by Akkumaru (Post 1296473)
Do I smell a possibility of QUADBOOT? :D

If farfary adds backupmenu and sshd to juiceme's triple boot then we are looking at a quintboot :D

Akkumaru 2012-11-21 04:52

Re: [Announce] N9 Multiboot - Harmattan, Nemo & Nitdroid
 
This makes me want to buy a 64 GB N9 :D

thedead1440 2012-11-21 05:55

Re: [Announce] N9 Multiboot - Harmattan, Nemo & Nitdroid
 
Quote:

Originally Posted by Akkumaru (Post 1296492)
This makes me want to buy a 64 GB N9 :D

Of course :D 16GB is just too small to fiddle with things...

juiceme 2012-11-21 08:30

Re: [Announce] N9 Multiboot - Harmattan, Nemo & Nitdroid
 
I am thinking ways how to create an useful multiboot loader for N9. Last night I did some experiments with booting the device to normal Harmattan image using kexec from running MOSLO envireonment, and it seems doable.

So I am investigating this now from the following idea;
  • Device is partitioned so that there are 2 different partitions that contain a root filesystem, one for Harmattan/Nitdroid and one for Nemo
  • The modified MOSLO (kernel & initramfs) is flashed as the boot kernel of the device
  • Based on user action in MOSLO boot, the next stage is loaded in place with kexec (which is quite fast way to load the kernel)

Of course it is possible to add my almost-singleuser-mode-console and farfry's Backup Menu in the selections. :)

I have not tried yet to flash the MOSLO kenel permanently to the device, but rather in my experiments I have loaded with flasher options "-l -b". I would like to understand the Harmattan boot sequence a bit more thoroughly before I start really messing with it.

I have not yet found anywhere a detailed description how the boot sequence REALLY goes, all I know is what I have experimented with.
If anyone could point me to right direction, I would appreciate it.
  • What happens (detailed view) when the device is powered on?
  • The primary boot loader is something called NOLO, how does it work?
  • Where actually the flashed kernel is in the memory? (I cannot find it on any partition on mmcblk0 device?)
  • What is the format of the flashable kernel? How do I create one? (I have built modules in the kernel source tree but not yet managed to build a loadable kernel...?)

farfary 2012-11-21 08:50

Re: [Announce] N9 Multiboot - Harmattan, Nemo & Nitdroid
 
see here http://omappedia.org/wiki/Bootloader_Project

farfary 2012-11-21 08:56

Re: [Announce] N9 Multiboot - Harmattan, Nemo & Nitdroid
 
i think bootloader not flashed in main storage
it flashed in NAND

farfary 2012-11-21 08:58

Re: [Announce] N9 Multiboot - Harmattan, Nemo & Nitdroid
 
you can tell http://www.sakoman.com/ to port u-boot for n9
i told him , but he didn't it

Hurrian 2012-12-01 14:04

Re: [Announce] N9 Multiboot - Harmattan, Nemo & Nitdroid
 
juiceme, for your super-bootloader idea, you can flash the kernel, and set its cmdline to boot from /dev/mtd4 ("var", unused)

It's pretty big, you can definitely have a hell of a time sticking every kind of utility and kernel module and whatnot on there.

Time to answer some questions:
Quote:

Originally Posted by juiceme (Post 1296545)
I would like to understand the Harmattan boot sequence a bit more thoroughly before I start really messing with it.

I have not yet found anywhere a detailed description how the boot sequence REALLY goes, all I know is what I have experimented with.
If anyone could point me to right direction, I would appreciate it.[*]What happens (detailed view) when the device is powered on?

OMAP ROM does the bootchain all the way to NOLO, which loads the kernel into memory, passes atags, and executes the kernel.

Quote:

Originally Posted by juiceme (Post 1296545)
[*]The primary boot loader is something called NOLO, how does it work?

It's actually the secondary boot loader (see secondary.bin). The primary boot loader is the OMAP ROM, which has support for loading code via USB. As you can see when attaching USB cable while flasher is running. This is also why a cold flash even when NOLO is corrupted works.

It used to be able to store options for boot device etc, but that was removed in Fremantle. All it does now is the above (see {1})

Quote:

Originally Posted by juiceme (Post 1296545)
[*]Where actually the flashed kernel is in the memory? (I cannot find it on any partition on mmcblk0 device?)

Code:

$ cat /proc/mtd
mtd2, apparently.

Quote:

Originally Posted by juiceme (Post 1296545)
[*]What is the format of the flashable kernel? How do I create one? (I have built modules in the kernel source tree but not yet managed to build a loadable kernel...?)

It is the zImage which is directly flashable (and loadable via kexec) to the device (build product is at arch/arm/boot/zImage)

juiceme 2012-12-04 12:20

Re: [Announce] N9 Multiboot - Harmattan, Nemo & Nitdroid
 
Okay, now I had time to prepare the "/dev/mtd4" partition. Apparently that can be done neatly on the normally running device, there was no need to boot to single mode etc. to prepare it:

Code:

~ # cat /proc/mtd
dev:    size  erasesize  name
mtd0: 00100000 00040000 "bootloader"
mtd1: 002c0000 00040000 "config"
mtd2: 01000000 00040000 "kernel"
mtd3: 00200000 00040000 "log"
mtd4: 1ca40000 00040000 "var"
mtd5: 02000000 00040000 "moslo"
mtd6: 20000000 00040000 "omap2-onenand"
~ #
~ # /usr/sbin/ubiattach /dev/ubi_ctrl -m 4
UBI device number 0, total 1832 LEBs (472743936 bytes, 450.8 MiB), available 1810 LEBs (467066880 bytes, 445.4 MiB), LEB size 258048 bytes (252.0 KiB)
~ #
~ # /usr/sbin/ubimkvol /dev/ubi0 -N var -m
Set volume size to 467066880
Volume ID 0, size 1810 LEBs (467066880 bytes, 445.4 MiB), LEB size 258048 bytes (252.0 KiB), dynamic, name "var", alignment 1
~ #
~ # mount -t ubifs ubi0:var /root/tp1
~ #
~ # mount
rootfs on / type rootfs (rw)
/dev/root on / type ext4 (rw,noatime,errors=remount-ro,barrier=1,stripe=8,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=503976k,nr_inodes=125994,mode=755)
/dev/mmcblk0p3 on /home type ext4 (rw,noatime,errors=remount-ro,barrier=1,stripe=8,data=ordered)
none on /proc type proc (rw,nosuid,nodev,noexec,relatime)
none on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /tmp type tmpfs (rw,noatime,size=4096k)
tmpfs on /var/run type tmpfs (rw,nosuid,noatime,size=512k)
none on /dev type tmpfs (rw,noatime,size=10240k,mode=755)
securityfs on /sys/kernel/security type securityfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,noatime,size=65536k)
none on /sys/kernel/debug type debugfs (rw,relatime)
cgroup on /syspart type cgroup (rw,relatime,freezer,memory,cpu)
/dev/mapper/signonfs on /home/user/.signon/signonfs-mnt type ext2 (rw,sync,noexec,relatime,errors=continue)
/dev/mmcblk0p1 on /home/user/MyDocs type vfat (rw,nosuid,nodev,noexec,noatime,nodiratime,uid=29999,fmask=0133,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,rodir,errors=remount-ro)
ubi0:var on /root/tp1 type ubifs (rw,relatime)
~ #
~ # ls tp1/ -la
total 4
drwxr-xr-x    2 root    root          160 Dec  4 13:52 .
drwxr-xr-x  18 root    root          4096 Dec  4 00:35 ..
~ #
~ # df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                3.9G      3.2G    535.1M  86% /
devtmpfs                10.0M    248.0K      9.8M  2% /dev
/dev/mmcblk0p3            2.0G    760.8M      1.1G  40% /home
tmpfs                    4.0M    108.0K      3.9M  3% /tmp
tmpfs                  512.0K    112.0K    400.0K  22% /var/run
none                    10.0M    248.0K      9.8M  2% /dev
tmpfs                    64.0M    248.0K    63.8M  0% /dev/shm
/dev/mapper/signonfs      6.8M    41.0K      6.4M  1% /home/user/.signon/signonfs-mnt
/dev/mmcblk0p1          53.7G      5.9G    47.8G  11% /home/user/MyDocs
ubi0:var                414.8M    24.0K    410.0M  0% /root/tp1
~ #

Some thoughts;
  • Does the partition name have to be "var", or will something in the system break if I change it to something else entirely. Just a cosmetic thing but if it is to be holding boot related stuff rather than /var/ then it might be nice to call it something else... forex. "rescue"
  • I am still thinking about which is the best launching order for the rest of the system... whether to use Harmattan/Nitdroid kernel as the first stage boot and then kexec other images from that, or have own small subsytem like the MOSLO booter kernel+initramfs which then would kexec further images if needed.
  • The mtd4 partition is indeed a nice place to set up stuff, I thought of maybe putting all the kernels and initramfs/initrd's there. It would be easy to load them up from there, each with tailored command line to set up the rest of the system.
    Having full debian environment there is also a nice idea, currently I use a loop-mounted HARM-CHOM image which is 2G of size but a lot smaller filesystem is OK


All times are GMT. The time now is 16:54.

vBulletin® Version 3.8.8