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 2018-03-07 17:42

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

Originally Posted by n950 (Post 1542123)
It's N9.
How can i do now? to flash new ubiboot kernel.
nb. i try with n9 16GB it's the same error :(
perhaps your ubiboot is for N950 kernel...

Works for me;

Code:

juice@firefly:~/n9_stuff/PR1.3$
juice@firefly:~/n9_stuff/PR1.3$
juice@horseye:~/n9_stuff/PR1.3$ sudo flasher -a firmware.bin -k zImage_2.6.32.54-ubiboot-02_06032018 --flash-only=kernel --suppress-warranty-warning -f -R
flasher 3.12.1 (Oct  5 2011) Harmattan

Picked ape-algo from a FIASCO file
Suitable USB interface (bootloader/phonet) not found, waiting...
USB device found at bus 001, device address 015.
Device identifier: 357923042386401 (SN: N/A)
Found device RM-696, hardware revision 1603
NOLO version 2.3.6
Version of 'sw-release': DFL61_HARMATTAN_40.2012.21-3_PR_001
Sending ape-algo image (7096 kB)...
100% (7096 of 7096 kB, avg. 14815 kB/s)
Suitable USB interface (phonet) not found, waiting...
USB device found at bus 001, device address 016.
Device identifier: 357923042386401 (SN: N/A)
Raw data transfer EP found at EP2.
Ping attempt 1 (250 ms)
Server application: 1.7.2
Found product RM-696 rev. 1603
Server implements softupd protocol version 1.8
Image SW version <none>
Image cert-sw not present
Image cmt-2nd skipped
Image cmt-algo skipped
Image cmt-mcusw skipped
Image xloader skipped
Image secondary skipped
Image moslo skipped
Image rootfs skipped
Image mmc skipped
Image tar skipped
Image config skipped
Charging battery, 10 % battery level (11 % required). Ctrl-c to exit
Battery level 11 %, continuing.

    image        [state    progress        transfer    flash speed]
---------------------------------------------------------------------
[x] kernel      [finished  100 %  11848 /  11848 kB    5631 kB/s]
Updating SW release
Success
juice@horseye:~/n9_stuff/PR1.3$


filip.pz 2018-03-08 15:40

Re: Introducing ubiboot N9 (multiboot OS loader)
 
I've upgraded to 0.3.8 (copied over new cpio, updated conf and flashed kernel) and I'm experiencing an issue with g_multi.ko kernel module:
Code:

/ # modprobe g_multi
[  91.806549] g_multi: no symbol version for module_layout
[  91.818725] g_multi: no symbol version for module_layout
modprobe: 'g_multi.ko': invalid module format

Because of that maintenance mode doesn't export partitions via USB (other stuff seem to be working). Can anyone confirm an issue or maybe even offer a solution?

I'm in need of initrmafs support so I can boot postmarketOS w/o using command line, but I'm facing an issue due to a fact that pmOS uses 2 partitions - one for kernel + initramfs, and another for rootfs. If I specify ubiboot to use the partition with kernel + initramfs ubiboot fails while checking for existatnce of /sbin/init script since that partition doesn't contain init (Checking 2nd stage kernel init file:...). Is there any way around that?
Using command line I'm able to load pmOS with:
Code:

mount /dev/mmcblk0p5 /mnt/5 && /usr/bin/disable_pm  && kexec -l /mnt/5/vmlinuz-nokia-n9 --initrd=/mnt/5/initramfs-nokia-n9 --append=cma=24M\ debug\ ignore_loglevel\ log_buf_len=1M\ console=ttyO2\ PMOS_NO_OUTPUT_REDIRECT && kexec -e
In any case thanks for keeping ubiboot alive!

juiceme 2018-03-08 17:18

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

Originally Posted by filip.pz (Post 1542159)
I've upgraded to 0.3.8 (copied over new cpio, updated conf and flashed kernel) and I'm experiencing an issue with g_multi.ko kernel module:
Code:

/ # modprobe g_multi
[  91.806549] g_multi: no symbol version for module_layout
[  91.818725] g_multi: no symbol version for module_layout
modprobe: 'g_multi.ko': invalid module format

Because of that maintenance mode doesn't export partitions via USB (other stuff seem to be working). Can anyone confirm an issue or maybe even offer a solution?

What's the HW revision of your device?


Quote:

Originally Posted by filip.pz (Post 1542159)
I'm in need of initrmafs support so I can boot postmarketOS w/o using command line, but I'm facing an issue due to a fact that pmOS uses 2 partitions - one for kernel + initramfs, and another for rootfs. If I specify ubiboot to use the partition with kernel + initramfs ubiboot fails while checking for existatnce of /sbin/init script since that partition doesn't contain init (Checking 2nd stage kernel init file:...). Is there any way around that?
Using command line I'm able to load pmOS with:
Code:

mount /dev/mmcblk0p5 /mnt/5 && /usr/bin/disable_pm  && kexec -l /mnt/5/vmlinuz-nokia-n9 --initrd=/mnt/5/initramfs-nokia-n9 --append=cma=24M\ debug\ ignore_loglevel\ log_buf_len=1M\ console=ttyO2\ PMOS_NO_OUTPUT_REDIRECT && kexec -e

Yes, that is also solvable of course.
When ubiboot first was designed there was no need for using separate partitions for system and kernel & initramfs, however implementing that is not too difficult.
I think it ought to be done so that widest possible set of configurations is easy to handle, I'll have to think about it a bit.


Quote:

Originally Posted by filip.pz (Post 1542159)
In any case thanks for keeping ubiboot alive!

hehe, I had ignored it for a long time; only now as these new alternate OS'es start appearing it's worth continuing work on it :)

filip.pz 2018-03-08 18:16

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

Originally Posted by juiceme (Post 1542164)
What's the HW revision of your device?

1601. Previous version worked fine, and I'd say that it's and build/install issue rather than something HW related - but I guess you have something in mind :)


Quote:

Originally Posted by juiceme (Post 1542164)
I think it ought to be done so that widest possible set of configurations is easy to handle, I'll have to think about it a bit.

I was thinking of skipping the check (and passing and empty value to kernel) when G_OSX_INITSCRIPT is not set.

wicket 2018-03-09 02:00

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

Originally Posted by filip.pz (Post 1542159)
I've upgraded to 0.3.8 (copied over new cpio, updated conf and flashed kernel) and I'm experiencing an issue with g_multi.ko kernel module:
Code:

/ # modprobe g_multi
[  91.806549] g_multi: no symbol version for module_layout
[  91.818725] g_multi: no symbol version for module_layout
modprobe: 'g_multi.ko': invalid module format


Sounds to me like a mismatch between the kernel and the module. I couldn't find any kernel modules within the cpio archive or ubifs so my guess is that these are coming from the rootfs of Harmattan (is that right juiceme?). If this is the case, the new kernel probably differs sufficiently that it would cause the problem. One possible solution could be to bundle the newly built modules with ubiboot and mount them over the top the rootfs.

juiceme, what's the reason for the new ubiboot kernel? Has anything changed there? I never bothered to flash the new ubiboot kernel as the changes I submitted didn't require them so I'm still on the previous kernel (0.3.6 tiny) and have no problems with loading g_multi.

EDIT:
P.S. I haven't been able to get any recent (patched) mainline kernel to boot at all via ubiboot, not even by entering the kexec command manually via telnet. It's very difficult to debug without a serial console and can't find any info on how to build a cable for the N950 (I don't have an N9). One option I was hoping for was to build a ubiboot kernel with the serial USB gadget but as juiceme knows, it's broken and doesn't build right now.

My only (semi) success with booting patched mainline has been with Pali's 0xFFFF with the default (NULL?) kernel cmdline. With that I'm able to bring up initrd and the display comes up. The strange thing is that if I try to specify a cmdline, it breaks it.

juiceme 2018-03-09 06:43

Re: Introducing ubiboot N9 (multiboot OS loader)
 
I have to admit I did not test that so extensively, just that it launched harmattan correctly on my device. Indeed something mus have gone amiss when I built and packaged it.

Quote:

Originally Posted by wicket (Post 1542181)
Sounds to me like a mismatch between the kernel and the module. I couldn't find any kernel modules within the cpio archive or ubifs so my guess is that these are coming from the rootfs of Harmattan (is that right juiceme?). If this is the case, the new kernel probably differs sufficiently that it would cause the problem. One possible solution could be to bundle the newly built modules with ubiboot and mount them over the top the rootfs.

Yes, modules are built in the initramfs, if you check the ubifs.list file you see how it populates the filesystem when kernel is built


Quote:

Originally Posted by wicket (Post 1542181)
juiceme, what's the reason for the new ubiboot kernel? Has anything changed there? I never bothered to flash the new ubiboot kernel as the changes I submitted didn't require them so I'm still on the previous kernel (0.3.6 tiny) and have no problems with loading g_multi.

Technically there was no forced reason to update the kernel but I wanted to do that, to check that my toolchain still works :D
Also as there was new functional interface to kexec I pushed up the internal version number which needs to match between the kernel, the cpio and the configuration file.

I'll have to recheck what went wrong with the build.

juiceme 2018-03-20 21:18

Re: Introducing ubiboot N9 (multiboot OS loader)
 
There is something here that I am not seeing now; I build the modules in the same kernel tree as the kernel itself, and install them correctly. Nothing has changed since the last time I built these, and the version strings and everytihing match, yet I still get the "g_multi: no symbol version for module_layout" error...

juice@ahma:~/kernel_dev/new_work/kernel-adaptation-n950-n9$
juice@ahma:~/kernel_dev/new_work/kernel-adaptation-n950-n9$ grep g_multi ubifs/ubifs_list
file /lib/modules/2.6.32.54-ubiboot-02-b/g_multi.ko drivers/usb/gadget/g_multi.ko 744 0 0
juice@ahma:~/kernel_dev/new_work/kernel-adaptation-n950-n9$
juice@ahma:~/kernel_dev/new_work/kernel-adaptation-n950-n9$
juice@ahma:~/kernel_dev/new_work/kernel-adaptation-n950-n9$ strings ./drivers/usb/gadget/g_multi.ko | grep ubiboot
vermagic=2.6.32.54-ubiboot-02-b preempt mod_unload modversions ARMv7
juice@ahma:~/kernel_dev/new_work/kernel-adaptation-n950-n9$

juiceme 2018-03-23 09:32

Re: Introducing ubiboot N9 (multiboot OS loader)
 
OK search me, just how stupid can one be... :)

I realized the reason my modules were incompatible, and now I remembered I actually knew this 4 years ago but had forgotten it. Woot, me growing old or what???

So; this is the problem/solution; I'll note it down here so when in another 4 years I forget it again someone can point me to this and call me a bloody feather-head... :eek:

When building a kernel with modules that are to be included in the built-in-initramfs there is a slight inconsistancy in the build mechanics; the initramfs image is built in "make" phase but the modules are built in "make modules"; this means that you have to build modules before zImage, else your make will of course fail due to the missing modules.
Now, when you do "make modules" before "make", you get the modules but there are some dependencies missing and the build system will not warn you about it....

The correct procedure to do it is this;
  • make clean; make mrprop
  • ARCH=arm make ubiboot-02_defconfig
  • [edit your ubifs/ubifs.list so that you comment out all modules-to-be-included]
  • ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make
  • ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make modules
  • rm -rf ./usr/built-in.o usr/initramfs_data.cpio ./usr/initramfs_data.o ./arch/arm/boot/zImage ./arch/arm/boot/Image
  • [edit your ubifs/ubifs.list so that you re-enable all modules-to-be-included]
  • ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make

And now Bob's your uncle and you will have a new shiny working combined kernel image in ./arch/arm/boot/zImage

Note to self; I need to write a sedscript to do the comment/uncomment thingy...

peterleinchen 2018-03-23 10:06

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


I realized the reason my modules were incompatible, and now I remembered I actually knew this 4 years ago but had forgotten it. Woot, me growing old or what???

He he,
it feels good not to be the only one! :D

juiceme 2018-03-23 19:32

Re: Introducing ubiboot N9 (multiboot OS loader)
 
Released ubiboot-02 (integrated) version, rev. 0.3.9

New features:
N/A
Bug fixes:
Fix login to device in repair mode
General enhancements:
N/A
Work in progress:
N/A
Get it fresh from HERE
See the README file
See the Changelog file

Installation notes:
This version uses internal interface version 5 which was introduced in version 0.3.8. If you have 0.3.8 it is enough to just flash the kernel. If you are updating from older version you need to update the kernel, config file and cpio to be of the new version.


All times are GMT. The time now is 22:57.

vBulletin® Version 3.8.8