maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Alternatives (https://talk.maemo.org/forumdisplay.php?f=36)
-   -   Introducing ubiboot N9 (multiboot OS loader) (https://talk.maemo.org/showthread.php?t=89345)

juiceme 2016-01-03 21:44

Re: Introducing ubiboot N9 (multiboot OS loader)
 
Quote:

Originally Posted by marmistrz (Post 1493525)
Juiceme,

can you please properly document all the steps needed to boot another OS which is not any of the built-in ones? It's basically trial and error with the current documentation.

Thanks, I will try to improve documentation then :)

Can you specify which tasks and parts of the process exactly are the difficult ones? Of course it is difficult to me to know, as it is always hard to see mistakes in own work... (which is why we have peer review :p)

peterleinchen 2016-01-03 22:05

Re: Introducing ubiboot N9 (multiboot OS loader)
 
I guess the most misleading may be the definition of location where the second-level kernel is stored on device.

Excerpt from my config:
Code:

# The first OS is usually Nitdroid.
# This section lists the Nitdroid specific switches and kernels
G_OS1_NUM=3
G_OS1_AUTOBOOT=0
G_OS1_PARTITION=5
G_OS1_NAME="Nitdroid"
G_OS1_1_LABEL="E-yes Nitdroid kernel -
 zImage_pr13"
G_OS1_1_FILE="/boot/Nitdroid/boot/zImage_pr13"
#G_OS1_1_FILE="/boot/Harmattan/boot/zImage_pr13"

G_OS1_2_LABEL="E-yes Nitdroid kernel, L2 cache fix -
 zImage_pr13-l2fix"
G_OS1_2_FILE="/boot/Nitdroid/boot/zImage_pr13-l2fix"
#G_OS1_2_FILE="/boot/Harmattan/boot/zImage_pr13-l2fix"
G_OS1_3_LABEL="E-yes Nitdroid kernel, ADB/USB -
 zImage_pr13-adb_usb"
G_OS1_3_FILE="/boot/Nitdroid/boot/zImage_pr13-adb_usb"
#G_OS1_3_FILE="/boot/Harmattan/boot/zImage_pr13-adb_usb"
G_OS1_4_LABEL=""

Nitdroid base system is located on my device on partition #5 (G_OS1_PARTITION).
The kernel (second-level, to-be-booted) may be where ever you like.
For convenience juiceme created links (named after the definition of G_OS1_NAME) on first-level system under /boot:
so /boot/Nitdroid defines /dev/mmcblk0p5

In my case the kernel is on
/dev/mmcblk0p5/boot/
see
G_OS1_2_FILE="/boot/Nitdroid/boot/zImage_pr13-l2fix"

but in former times I had in on partition #2:
G_OS2_PARTITION=2
G_OS2_NAME="Harmattan"
#G_OS1_2_FILE="/boot/Harmattan/boot/zImage_pr13-l2fix"

marmistrz 2016-01-04 07:27

Re: Introducing ubiboot N9 (multiboot OS loader)
 
Yeah, the paths are confusing should be documented. How is it with preinits? Will it suffice to modify the target system's /sbin/init or more trickery is required? Are there any thing which have to be done? (The preinit is needed due to the watchdog kicking in)

I seem to spend far much time wondering about how to properly set up the boot process.

juiceme 2016-01-04 15:04

Re: Introducing ubiboot N9 (multiboot OS loader)
 
Quote:

Originally Posted by marmistrz (Post 1493578)
Yeah, the paths are confusing should be documented.

I agree, the paths and other defines are a bit confusing. The reason they are used like in ubiboot.conf is that the file is sourced from the ubiboot init and loader scripts.
Moreover, the partition definitions correspond to the physical partition layout of the device which is something else as the way the partitions are mounted in various OS'es...


Quote:

Originally Posted by marmistrz (Post 1493578)
How is it with preinits? Will it suffice to modify the target system's /sbin/init or more trickery is required? Are there any thing which have to be done? (The preinit is needed due to the watchdog kicking in)

I seem to spend far much time wondering about how to properly set up the boot process.

Again, you do have a point there. The reason I have not paid that much respect to the watchdog setup is because in my devices I have turned all watchdogs off :D
Reason for that is simple; if I have a potential lockup, I want to see the kernel oops... :p

marmistrz 2016-01-04 15:33

Re: Introducing ubiboot N9 (multiboot OS loader)
 
Quote:

Originally Posted by juiceme (Post 1493633)
Again, you do have a point there. The reason I have not paid that much respect to the watchdog setup is because in my devices I have turned all watchdogs off :D
Reason for that is simple; if I have a potential lockup, I want to see the kernel oops... :p

And is it possible to turn all watchdogs off? I heard ubiboot wakes them back again.

juiceme 2016-01-04 16:39

Re: Introducing ubiboot N9 (multiboot OS loader)
 
Quote:

Originally Posted by marmistrz (Post 1493640)
And is it possible to turn all watchdogs off? I heard ubiboot wakes them back again.

No, I don't think so. If the dogs are removed with flasher (--enable-rd-mode --set-rd-flags=no-omap-wd,no-ext-wd,no-lifeguard-reset) then they should remain off.

However this might be dependent on the actual HW revision of the device...?

pasko 2016-01-25 19:04

Re: Introducing ubiboot N9 (multiboot OS loader)
 
Hi.
I think the 'nand chip'/'omap2-onenand'/'whatever' is showing symptoms of ageing in my backup device (possibly a refurbrished one).....
Code:

[86115.653320] init: xsession/sysuid main process (8139) killed by FPE signal
[86115.653656] init: xsession/sysuid main process ended, respawning
[86409.535064] omap_device: smartreflex.1: new worst case activate latency 0: 2105712
[86443.541137] onenand_wait: correctable ECC error = 0x5555, addr1 0xa, addr8 0x0
[86443.541687] onenand_wait: correctable ECC error = 0x5555, addr1 0x4, addr8 0x8
[86443.541931] onenand_wait: correctable ECC error = 0x5555, addr1 0x4, addr8 0x10
[86443.546508] onenand_wait: correctable ECC error = 0x5555, addr1 0x4, addr8 0xc0
[86443.551147] onenand_wait: correctable ECC error = 0x5555, addr1 0xa, addr8 0x0
[86443.553894] onenand_wait: correctable ECC error = 0x5555, addr1 0xb, addr8 0xc
[86443.557708] onenand_wait: controller error! state 7 ctrl 0x0400 intr 0x8000
[86443.557769] onenand_write_ops_nolock: write failed -5

.... and I would like to ask:
Is it possible to use ubiboot to avoid the use of partitions mtd0 --> mtd6? I think this could help to extend the device's life a bit :).
I'm running nandtest command and all six show r/w errors.
Maybe only using /dev/mtd0 as bootloader to redirect the process somewhere else would help?
Regard.

peterleinchen 2016-01-25 19:11

Re: Introducing ubiboot N9 (multiboot OS loader)
 
Not really knowing what I speak of, but:

we all have those errors in kernel log.
And as long as the error is correctable -as I understood the discussion (somewhere on TMO)- it is not a problem. So I do not think about it...

tioubxancur 2016-05-09 15:19

Re: Introducing ubiboot N9 (multiboot OS loader)
 
I use the latest version of ubiboot with 6 boot options, i'd like to use one with this menu of only 3 OS (meego, android, sailfish) mainly because this looks more clean and i dont use the others anyway.
How do I do it?

juiceme 2016-05-09 18:57

Re: Introducing ubiboot N9 (multiboot OS loader)
 
1.) get the toolkit from https://toosa.swagman.org/svn/animatronics/
2.) the essentials are described in the README file

tioubxancur 2016-05-10 13:37

Re: Introducing ubiboot N9 (multiboot OS loader)
 
I followed that, but it seems a lot of work.
I was wondering if someone uses that or who knows it can point me to the .cpio file responsible. Perhaps someone still has it handy.

juiceme 2016-05-10 20:16

Re: Introducing ubiboot N9 (multiboot OS loader)
 
Well, it is not that difficult.

If I correctly understand what you have in mind, it is just the picture-icons react to tapping, and the texts next to them only describe the actions, right?

To achieve that, all you need is to create the right-hand texts as png images just like described in the animatronics README, and modify the top level touchmap so that their area does not trigger any events... and that's all there is to it! :)

marmistrz 2017-08-16 18:47

Re: Introducing ubiboot N9 (multiboot OS loader)
 
I'm trying once again to boot Debian with mainline kernel on my N950.

My Ubiboot configuration is: https://pastebin.com/dByXqphq
ubiboot.log: https://pastebin.com/HCV6y0kA
ubiboot.dmesg: https://pastebin.com/T9W6HeT6

The system lives for awhile and then reboots. I have no logs in /var/log/journal even though `Storage=persistent` is in /etc/systemd/journald.conf. On the Debian filesystem, /boot/bzImage is a symlink to /boot/vmlinuz-4.9.0-3-armmp (neither of them works)

Does it look like an error in ubiboot configuration?

juiceme 2017-08-16 20:34

Re: Introducing ubiboot N9 (multiboot OS loader)
 
So you have Debian on slot #5

Rootfs for it is on /dev/mmcblk0p4, and you have the kernel correctly placed in /boot/vmlinuz-4.9.0-3-armmp of the said partition.

According to the logs your setup is pretty much OK. The only thing that's not checked in your ubiboot version is the availability/executability of the init fie of the booting OS. (that is checked in the latest version, 0.3.6-tiny...)

So, according to ubiboot everything goes well until it hands execution to the newly loaded kernel. The new kernel then tries to execute /sbin/init.

How doe the boot continue, exactly?
You mention it goes OK first, then reboots?

juiceme 2017-08-17 03:56

Re: Introducing ubiboot N9 (multiboot OS loader)
 
One thing I thought about; have you turned off the watchdogs?
Debian of course doesn't know how to feed the dogs unless you added a script for that in initialization yourself...

marmistrz 2017-08-17 17:54

Re: Introducing ubiboot N9 (multiboot OS loader)
 
Quote:

Originally Posted by juiceme (Post 1532743)
One thing I thought about; have you turned off the watchdogs?
Debian of course doesn't know how to feed the dogs unless you added a script for that in initialization yourself...

Of course I did not.

Are the R&D flags explained anywhere? I see in 0xFFFF:
Code:

  no-omap-wd          disable auto reboot by OMAP watchdog
  no-ext-wd          disable auto reboot by external watchdog
  no-lifeguard-reset  disable auto reboot by software lifeguard

what are the different watchdogs on the N950? what is software lifeguard? dsme?

juiceme 2017-08-17 19:08

Re: Introducing ubiboot N9 (multiboot OS loader)
 
I just turn 'em all off :p

marmistrz 2017-08-17 19:23

Re: Introducing ubiboot N9 (multiboot OS loader)
 
I disabled them all, unfortunately, the device reboots after a while. :(

Is there any way to easily set up a telnet/ssh session to the device, like Nemo does? They're using their own `init-debug` script, though.

juiceme 2017-08-17 19:45

Re: Introducing ubiboot N9 (multiboot OS loader)
 
Quote:

Originally Posted by marmistrz (Post 1532789)
I disabled them all, unfortunately, the device reboots after a while. :(

How far do you get, I assume debian starts to at least some extent?
The kernel you are using, did you compile it yourself with all the patches needed to make it work on N9?


Quote:

Originally Posted by marmistrz (Post 1532789)
Is there any way to easily set up a telnet/ssh session from the device, like Nemo does? They're using their own `init-debug` script, though.

Sure you mean to the device, not from?
Easiest is to enable serial console and connect to N9's serial port with minicom; that is pretty much foolproof. Same way you will get kernel logs visible while the device is booting.

marmistrz 2017-08-17 19:58

Re: Introducing ubiboot N9 (multiboot OS loader)
 
Quote:

Originally Posted by juiceme (Post 1532790)
How far do you get, I assume debian starts to at least some extent?
The kernel you are using, did you compile it yourself with all the patches needed to make it work on N9?

That was installed from the repo. 4.9 should have the most needed patches
http://elinux.org/N950

The patches for display were not merged yet, though.

Quote:

Originally Posted by juiceme (Post 1532790)
Sure you mean to the device, not from?

of course, to ;)

Quote:

Originally Posted by juiceme (Post 1532790)
Easiest is to enable serial console and connect to N9's serial port with minicom; that is pretty much foolproof. Same way you will get kernel logs visible while the device is booting.

and without unscrewing the device? :) I'm a little afraid I'll break my N950.

juiceme 2017-08-17 20:35

Re: Introducing ubiboot N9 (multiboot OS loader)
 
Quote:

Originally Posted by marmistrz (Post 1532792)
Quote:

Originally Posted by juiceme (Post 1532790)
How far do you get, I assume debian starts to at least some extent?
The kernel you are using, did you compile it yourself with all the patches needed to make it work on N9?

That was installed from the repo. 4.9 should have the most needed patches
http://elinux.org/N950

The patches for display were not merged yet, though.

Ooh, I was not aware such a recent kernel has been fixed to work with N9(50)... Maybe I need to try that myself.

How's the init system in your kernel; is it expecting to use systemd or sysvinit? As I presume you are taking some arm debian disk image and integrating that with the elinux kernel?


Quote:

Originally Posted by marmistrz (Post 1532792)
Quote:

Originally Posted by juiceme (Post 1532790)
Easiest is to enable serial console and connect to N9's serial port with minicom; that is pretty much foolproof. Same way you will get kernel logs visible while the device is booting.

and without unscrewing the device? :) I'm a little afraid I'll break my N950.

I don't know about N950 (since I only ever was allowed once to hold @eekkelund's device in my hands for about a minute :p) but in N9 the access to serial port is through the simtray, there is no need to open the device for that :D

Any other way to access the device requires you to have a daemon running in it, which basically means your userland needs to start.
For debugging init problems this is not the optimal strategy :p

[OK, yes there are other ways of course, you could build serial-emulation-for-usb in your kernel, or route kernel logging to audio port or modulate the status led with it... however you probably don't want to know about those methods]

eekkelund 2017-08-17 20:49

Re: Introducing ubiboot N9 (multiboot OS loader)
 
If I am correct the serial port is accessed via 3.5mm headphone plug in N950. So there wouldn't be need to tear phone apart(maybe). But somebody needs to comfirm this. :)

marmistrz 2017-08-17 21:19

Re: Introducing ubiboot N9 (multiboot OS loader)
 
I have journalctl installed, so I think I have the full right to assume it's systemd.

My steps were:
1. Create a partition, setup ubiboot
2. Mount the partition from the ubiboot rescue, follow this guide:
http://blog.lazy-evaluation.net/post...bootstrap.html
3. install the kernel package linux-image-armmp

That's the normal upstream kernel, as provided by Debian.

I guess I have no serial cable...

juiceme 2017-08-17 21:57

Re: Introducing ubiboot N9 (multiboot OS loader)
 
What I meant; what is the debian rootfs you installed to your mmcblk0p4 partition?
When your kernel boots does it find all it needs on the rootfs?

And you still did not answer; how far does the boot go, do you see anything at all on your device screen after ubiboot hands the execution to the debian kernel?

And another thing; have you checked that the debian kernel handles the CPU L2 cache initialization correctly? (See the section 4. of ubiboot README file...)

marmistrz 2017-08-18 16:48

Re: Introducing ubiboot N9 (multiboot OS loader)
 
[QUOTE=juiceme;1532806]What I meant; what is the debian rootfs you installed to your mmcblk0p4 partition?
When your kernel boots does it find all it needs on the rootfs?[/code]
I created an empty ext4 partition and bootstrapped latest Debian Stretch onto it using `debootstrap`.


Quote:

Originally Posted by juiceme (Post 1532806)
And you still did not answer; how far does the boot go, do you see anything at all on your device screen after ubiboot hands the execution to the debian kernel?

I don't know. I have no journal logs in /var/log, even though I use persistent storage mode in journald.conf


Quote:

Originally Posted by juiceme (Post 1532806)
And another thing; have you checked that the debian kernel handles the CPU L2 cache initialization correctly? (See the section 4. of ubiboot README file...)

How can I check it?

Here's my kernel config, I don't really know what to look for: https://pastebin.com/1T9DBbbb

Maybe the problem is that I didn't append the device tree part manually?

n950 2018-03-01 16:56

Re: Introducing ubiboot N9 (multiboot OS loader)
 
I would like to telnet with ubiboot small on my Ubuntu 17.10 i386.
when i run telnet 192.168.2.15 not work.
Unable to connect to remote host...
when i run ifconfig -a i have no usb0 in the list
my n9 is named enp0s29....
Do i need to set up something before run telnet command

wicket 2018-03-01 19:15

Re: Introducing ubiboot N9 (multiboot OS loader)
 
Quote:

Originally Posted by n950 (Post 1541842)
I would like to telnet with ubiboot small on my Ubuntu 17.10 i386.
when i run telnet 192.168.2.15 not work.
Unable to connect to remote host...
when i run ifconfig -a i have no usb0 in the list
my n9 is named enp0s29....
Do i need to set up something before run telnet command

Try the following:

Code:

ifconfig enp0s29 up 192.168.2.1
That ought to bring up the USB interface on the same subnet as the N9.

juiceme 2018-03-02 11:13

Re: Introducing ubiboot N9 (multiboot OS loader)
 
Quote:

Originally Posted by wicket (Post 1541848)
That ought to bring up the USB interface on the same subnet as the N9.

Yes.

0.3.6-tiny is a stripped/limited version that does not have dhcpd enabled.
The tiny version was made specifically for the people who have bad kernel partition so that it can fit in there... It's recommended to use 0.3.7 for everybody else.

wicket 2018-03-02 17:06

Re: Introducing ubiboot N9 (multiboot OS loader)
 
Quote:

Originally Posted by juiceme (Post 1541887)
Yes.

0.3.6-tiny is a stripped/limited version that does not have dhcpd enabled.
The tiny version was made specifically for the people who have bad kernel partition so that it can fit in there... It's recommended to use 0.3.7 for everybody else.

There are versions 0.3.6 and 0.3.7? What??? Where does one even find these? They are not mentioned in the README, nor wiki page, nor can they be found under http://www.swagman.org/juice/ubiboot/ubiboot-02/. I just took ubiboot-02_0.3.5_301013.tar and flashed zImage_2.6.32.54-ubiboot-02-small_060114 as it seemed to be the latest.

If I'm honest, I found the documentation (README and wiki) to be out of date and incomplete. After a lot of pain, I eventually figured it out.

Parts of the README I found confusing:

Quote:

The corresponding "G_OS<x>_<y>_FILE" is the path to the bootable kernel.
Only in the comment in the ubiboot.conf file does it say that the path should be relative to the ubiboot FS but there was nothing to explain the layout of ubiboot FS and no way of knowing the layout without telneting in (which telneting itself may not be obvious to some if they used the "small" kernel which appears to be the latest, as I did).

Quote:

The G_OS<x>_PARTITION and G_OS<x>_NAME identifiers define the partition
where the boot kernels are searched for.
For example, Harmattan kernels are by default located on mmcblk0p2 in the
/boot/ directory, which resolves to "/boot/Harmattan/boot/" in the script.
When you are running Harmattan, this dame directory resolves to /boot/
It's not clear that the "Harmattan" name is taken from the value of G_OS<x>_NAME. Again, I needed to telnet in to understand this properly.

It's not clear that each rootfs should be copied/unpacked to a dedicated partition unless handled by a preinit script. This really confused me. Combined with the problems mentioned above, I incorrectly thought that maybe G_OS<x>_<y>_FILE was being used to specify the rootfs location as well as the kernel.

I don't want to sound like I'm complaining, I just hope this will help others to avoid the problems I had. Although it would also be nice if you would fix the documentation juiceme. ;)

It might also be nice to have a new ubiboot with a recent kernel and recent kexec tools. ;)

EDIT: One more thing, my experience would have been far less painful if ubiboot had printed an error message to tell me that my kernel image was not found before running kexec. I had no idea why it was failing and thought there was a problem with the kernel I built.

juiceme 2018-03-02 18:44

Re: Introducing ubiboot N9 (multiboot OS loader)
 
Ya @wicket!

These are all valid critique points, I admit that I have always been somewhat lazy to document things!
Indeed I should at some point take time to tidy up things a bit... :D:D

The fact is that ubiboot is a bit of work-in-progress-stalled-indefinetely when my attention turned to other things, sadly. I kind of was in the middle of updating some new functionality into it (device charging, wlan set-up, etc...) when I stopped working on it.

Most if not all sources are in my github, except some experimental stuff still in my personal svn repo.

juiceme 2018-03-02 18:49

Re: Introducing ubiboot N9 (multiboot OS loader)
 
Quote:

Originally Posted by wicket (Post 1541910)
EDIT: One more thing, my experience would have been far less painful if ubiboot had printed an error message to tell me that my kernel image was not found before running kexec. I had no idea why it was failing and thought there was a problem with the kernel I built.

Ah, sorry about that!
Actually 0.3.7 has a lot better logging, it will tell you if the kernel is not loaded correctly and also check and log the init script correctness...

wicket 2018-03-02 19:13

Re: Introducing ubiboot N9 (multiboot OS loader)
 
Thanks juiceme!

Quote:

Originally Posted by juiceme (Post 1541916)
Most if not all sources are in my github, except some experimental stuff still in my personal svn repo.

I didn't even realise there were Git or Subversion repositories. I found the source directory and thought that was all there was! Now I know that there's a Git repo, you may see some patches coming your way. ;)

I assume this is what you are referring to. It seems to contain ubifs and kernel patches so I guess this is the main repo (not just animatronics) that I should be looking at.

n950 2018-03-03 07:41

Re: Introducing ubiboot N9 (multiboot OS loader)
 
@Juiceme:

Hello,

It would be necessary to bring initrd support to ubiboot to be usable without serial console.

Can you make update for that?
It will help for new pmOS.

juiceme 2018-03-03 14:12

Re: Introducing ubiboot N9 (multiboot OS loader)
 
Quote:

Originally Posted by n950 (Post 1541938)
@Juiceme:

Hello,

It would be necessary to bring initrd support to ubiboot to be usable without serial console.

Can you make update for that?
It will help for new pmOS.

So you mean possibility to load a separate initrd file with the kernel, instead of just booting the kernel directly on a partition?
Sure, I see no problems with that really; it's just a kernel boot option to load the initrd.

n950 2018-03-03 14:17

Re: Introducing ubiboot N9 (multiboot OS loader)
 
Quote:

Originally Posted by juiceme (Post 1541952)
So you mean possibility to load a separate initrd file with the kernel, instead of just booting the kernel directly on a partition?
Sure, I see no problems with that really; it's just a kernel boot option to load the initrd.

Correct.
To boot pmOS i need to go on Ubuntu, open terminal run kexec command via telnet.
I would like to make it auto when i push on pmOS icon for exemple.
Like running kexec command behind that without my pc.
you can do it?

juiceme 2018-03-03 14:21

Re: Introducing ubiboot N9 (multiboot OS loader)
 
Yes, it could be done.
However, as you see I have not worked with new releases since 2014, I kind of stopped development on ubiboot when I moved to SFOS :D

n950 2018-03-03 14:31

Re: Introducing ubiboot N9 (multiboot OS loader)
 
Quote:

Originally Posted by juiceme (Post 1541954)
Yes, it could be done.
However, as you see I have not worked with new releases since 2014, I kind of stopped development on ubiboot when I moved to SFOS :D

When you will update it?

juiceme 2018-03-03 15:22

Re: Introducing ubiboot N9 (multiboot OS loader)
 
Quote:

Originally Posted by n950 (Post 1541955)
When you will update it?


When I have time and interest to do it (= maybe never...?)

wicket 2018-03-03 22:51

Re: Introducing ubiboot N9 (multiboot OS loader)
 
I've added support for additional kexec options. That will allow you to specify an initrd image in ubiboot.conf.

I also replaced the Ubuntu graphic for a Maemo Leste graphic. ;)

Let's see if juiceme likes it. :D

https://github.com/juiceme/ubiboot-animatronics/pull/1

juiceme 2018-03-03 23:33

Re: Introducing ubiboot N9 (multiboot OS loader)
 
Quote:

Originally Posted by wicket (Post 1541980)
I've added support for additional kexec options. That will allow you to specify an initrd image in ubiboot.conf.

I also replaced the Ubuntu graphic for a Maemo Leste graphic. ;)

Let's see if juiceme likes it. :D

https://github.com/juiceme/ubiboot-animatronics/pull/1

PR accepted :D


All times are GMT. The time now is 04:27.

vBulletin® Version 3.8.8