Active Topics

 


Reply
Thread Tools
Posts: 1,225 | Thanked: 1,905 times | Joined on Feb 2011 @ Quezon City, Philippines
#41
Originally Posted by juiceme View Post
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"
Not necessarily, however for naming's sake (the partition name is set in the MTD partition table), let's make the UBIFS partition use "var" as the name.

(NOTE: ubi.mtd kernel parameter sets the mtd device to pass to ubiattach; it must always be "var". ubi0:$x (where $x is the UBIFS label) can be anything. However, again, for naming's sake, let's keep it names var.)

Originally Posted by juiceme View Post
  • 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 MOSLO booter is practically the same thing as a Harmattan-NITDroid kernel+utilites in /var.

OH, and this will not use an initramfs! It's not a ramdisk, the first kernel will boot into a barebones complete system on /var, then kexec into a new system!

It would make very little difference either way, as both first-stage kernels would have their own root filesystem (ubi0:var), and kexec a second-stage kernel (Harmattan PR1.3, NITDroid or Nemo) into their respective root filesystem.

Originally Posted by juiceme View Post
  • 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
It could be mounted to /boot for convenience's sake.
A reference entry is already provided in /etc/fstab, however it is not mounted by default at boot.

You will need to call ubiattach and mount by yourself (or add the needed lines in /etc/init/mount-home.conf)

__________________
N9 PR 1.3 Open Mode + kernel-plus for Harmattan
@kenweknot, working on Glacier for Nemo.

Last edited by Hurrian; 2012-12-04 at 12:46.
 
Community Council | Posts: 4,920 | Thanked: 12,867 times | Joined on May 2012 @ Southerrn Finland
#42
(This turned out to be rather a long rant, but please bear with me, there are some important observations embedded in this posting...)

I have had some advances and some backsteps now when I am trying to create a kexec based boot loader.

For some time I tried to implement it so that the first-stage kernel would be the normal Harmattan/Nitdroid kernel, and the optional Nemo stage would be loaded with kexec on selection.
As kexec is not enabled in the PR1.3 Nitdroid image, I wnted to get the sources for that to build it myself. Only answer I got from e-yes was that kexec is broken and cannot be made to work on the kernel (and I got no source to try it myself )

Well, as obviously kexec works with MOSLO kernel I decided to try it with the standard PR1.3 kernel (kernel_2.6.32-20121301+0m8.tar)
myself and see if it works.
At least with this e-yes was correct, I did not manage to get kexec to boot another image reliably. I did not furter debug it but one option still would be to fix that and continue with the original idea.

Oh, and I found out something I did not know before, fyi;
When I tried booting into a freshly compiled kernel image, I thought, why bother flashing it, I will just load it up with flasher to see if it works correctly.
Turns out Harmattan will not boot up correctly if it has not been booted from actual flash chip. I wasted days on debugging this, every time I booted, the device would rise correctly to preinit phase, and then *BOOM*
Only when I checked logs for nth time I got a hunch this has something to do with kernel boot parameters.
When booting external kernel, there is an item "bootreason=usb", and when booting from chip it is "bootreason=pwr_key"

Nitdroid does not care about this, it will boot to ICS whichever way but Harmattan throws up and plays DEAD if the reason is usb.

OK, I have now confirmed this by managing to boot correctly to Harmattan from MOSLO kernel via kexec when I replaced the bootreason tag on kernel command line. You live, You learn.

So, now as I have method to boot Harmattan from MOSLO, I decided to do it the correct way: Create a first-stage boot from modified MOSLO booter, which will then kexec either Harmattan/Nitdroid or Nemo, based on selection.

But how to get the first stage to boot so that root device is ubi0:var ?
What I have learned is that when the system boots, whatever the boot reason, usb/flash, the kernel command line is always set so that the first items are "init=/sbin/preinit root=/dev/mmcblk0p2"
I have found no way of easily changing that to something like "init=/init root=/dev/ubi0:var", for example.
I have not tried to recompile kernel to force it to ignore that part yet.
However, what mystifies me is how is it possible that when I load up the MOSLO kernel & initramfs, then what happens is the kernel mounts the initramfs as root and executes /init from there, even as the commandline still reads "init=/sbin/preinit root=/dev/mmcblk0p2" ??

So, I wanted to try to flash the MOSLO kernel permanently to the device, but it seems that it is impossible to flash the initramfs part.
I tried several ways to flash it:

sudo flasher -a firmware.bin -k zImage-moslo -n initrd-moslo.new --flash-only=kernel,initfs -f -R
sudo flasher -a firmware.bin -k zImage-moslo -n initrd-moslo.new --flash-only=initfs -f -R

but no way, it seems that only the kernel got flashed, it is impossible to flash initramfs on the device. (maybe there is no place it could be flashed to...?)

My experiments continue, though.
 

The Following 3 Users Say Thank You to juiceme For This Useful Post:
Community Council | Posts: 4,920 | Thanked: 12,867 times | Joined on May 2012 @ Southerrn Finland
#43
Holidays are a really good time for some serious hacking

Now I can announce that I have a working multiboot toolkit that can be used to load any suitable OS to N9 device using a graphical touch selection menus.

The work is based on patched Nemo kernel which is used to boot up a minimal system which will be used to select the next-level OS and load it up. With this system, we are no longer limited to tripleboot but indeed can create even quadboot and up

The patching is needed to override the default command line that NOLO forces on the booting kernel.

Happy new year to all TMO'ers
 

The Following 15 Users Say Thank You to juiceme For This Useful Post:
farfary's Avatar
Posts: 147 | Thanked: 300 times | Joined on Mar 2012 @ ^^ IRAN ^^ - Tehran :D
#44
Originally Posted by juiceme View Post
Holidays are a really good time for some serious hacking

Now I can announce that I have a working multiboot toolkit that can be used to load any suitable OS to N9 device using a graphical touch selection menus.

The work is based on patched Nemo kernel which is used to boot up a minimal system which will be used to select the next-level OS and load it up. With this system, we are no longer limited to tripleboot but indeed can create even quadboot and up

The patching is needed to override the default command line that NOLO forces on the booting kernel.

Happy new year to all TMO'ers
WooW Very Thank Bro , Happy New Year too
 

The Following User Says Thank You to farfary For This Useful Post:
Akkumaru's Avatar
Posts: 694 | Thanked: 619 times | Joined on Nov 2011
#45
Hope whatever juiceme is up to will be released soon!
__________________
Still learning on geeky knowledge
N9 *stolen*N900 *died*N900 *on hiatus* OnePlus X
 
AMD's Avatar
Posts: 1,390 | Thanked: 710 times | Joined on May 2012 @ Beirut, Lebanon
#46
Originally Posted by Akkumaru View Post
Hope whatever juiceme is up to will be released soon!
This is such a great community
__________________
Twitter: @ahmadmdaher

Originally Posted by Dave999
I will vote AMD for president next time if I'm having any shares during next meeting.


Do good for a human being and like my art page!
 
Posts: 98 | Thanked: 142 times | Joined on Mar 2011
#47
Originally Posted by juiceme View Post
Holidays are a really good time for some serious hacking

Now I can announce that I have a working multiboot toolkit that can be used to load any suitable OS to N9 device using a graphical touch selection menus.

The work is based on patched Nemo kernel which is used to boot up a minimal system which will be used to select the next-level OS and load it up. With this system, we are no longer limited to tripleboot but indeed can create even quadboot and up

The patching is needed to override the default command line that NOLO forces on the booting kernel.

Happy new year to all TMO'ers
There have been some semi-successful efforts in the past from Android users on getting a Kexec module running. Theoretically, if we can compile this module for the Harmattan kernel, we could possiby boot any kernel with any arbitrary command line arguments from the default Harmattan kernel at the preinit stage. That way, no flashing would be required. I'll try looking into it.
 
Community Council | Posts: 4,920 | Thanked: 12,867 times | Joined on May 2012 @ Southerrn Finland
#48
Originally Posted by Sazpaimon View Post
There have been some semi-successful efforts in the past from Android users on getting a Kexec module running. Theoretically, if we can compile this module for the Harmattan kernel, we could possiby boot any kernel with any arbitrary command line arguments from the default Harmattan kernel at the preinit stage. That way, no flashing would be required. I'll try looking into it.
That was my original idea, but it seems not to be easy to do. I experimented quite a lot with the vanilla Nokia kernel, both to use kexec as module and as compiled-in feature but the results were not very good. With the Nemo kernel it is lot easier.

With this method I am using, all you need is to flash the first stage kernel just once, and any of the second-stage kernels can be booted from a directory in the filesystem.

You can have multiple kernels running on the same filesystem, just by starting them with a different command line; for example I have both the nitdroid kernel (running the normal way of chrooting it to /home/nitdroid/) and an own flavour of openmode Nokia kernel, either one can be launched from a file on the FS.

Also, as the selection is done before booting the final kernel I can rearrange partittions as I like, mounting for example Nemo partition as root and launching the Nemo kernel.

Nothing would prevent me running Debian, for example using my Harm-Chom-install image, mounting it as root and starting a kernel of my desire on it. (I could do that, but there is no point really as of course it would not use the phone functionality)
 
Posts: 98 | Thanked: 142 times | Joined on Mar 2011
#49
Originally Posted by juiceme View Post
That was my original idea, but it seems not to be easy to do. I experimented quite a lot with the vanilla Nokia kernel, both to use kexec as module and as compiled-in feature but the results were not very good. With the Nemo kernel it is lot easier.

With this method I am using, all you need is to flash the first stage kernel just once, and any of the second-stage kernels can be booted from a directory in the filesystem.

You can have multiple kernels running on the same filesystem, just by starting them with a different command line; for example I have both the nitdroid kernel (running the normal way of chrooting it to /home/nitdroid/) and an own flavour of openmode Nokia kernel, either one can be launched from a file on the FS.

Also, as the selection is done before booting the final kernel I can rearrange partittions as I like, mounting for example Nemo partition as root and launching the Nemo kernel.

Nothing would prevent me running Debian, for example using my Harm-Chom-install image, mounting it as root and starting a kernel of my desire on it. (I could do that, but there is no point really as of course it would not use the phone functionality)
Out of curiosity have you looked into booting nemo via a chroot ala nitdroid? I briefly tried to get it to work that way, but at the time I was trying to make a single kernel that booted both Nitdroid and Nemo, but ran into some issues and lost interest. Your way of actually separating the kernels is a lot better, and I think not having to sacrifice a partition on the EMMC would be a better solution to running Nemo. You could basically add something like a real_root argument to the kernel command line, and the preinit script could take that and use it to determine where to chroot before running init.

Last edited by Sazpaimon; 2013-01-01 at 22:58.
 

The Following User Says Thank You to Sazpaimon For This Useful Post:
Akkumaru's Avatar
Posts: 694 | Thanked: 619 times | Joined on Nov 2011
#50
Originally Posted by juiceme View Post
That was my original idea, but it seems not to be easy to do. I experimented quite a lot with the vanilla Nokia kernel, both to use kexec as module and as compiled-in feature but the results were not very good. With the Nemo kernel it is lot easier.
By nemo kernel you mean the harmattan update kernel right? Isn't it still incomplete? I guess it should be complete for stability reasons and for 'new people' to use.
__________________
Still learning on geeky knowledge
N9 *stolen*N900 *died*N900 *on hiatus* OnePlus X
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 10:03.