Overhauling the boot process #225
Replies: 14 comments
-
OK got good a pretty nice simplification (if I can say so myself). We can use u-boot's boot.scr to load handheld variant directly - so we do not need to copy In practice this means that switching kernels simplifies to: a) creating a subfolder in This also means that depending on how much non-boot configs we need to copy to the main partition that differ between handhelds, we may be able to completely forego the (Oh and the v90_q90 kernel in the attachment has the fixed L2/R2 support enabled.) |
Beta Was this translation helpful? Give feedback.
-
I made an image if anyone wants to test, it is here. How to use:
On the first boot, it should do a few things, like copy some config files and write the correct u-boot. Please wait until it turns itself off. On BB3.5, V90/Q90, PocketGo you should see the progress on the screen, however on the older ones the screen will be most likely blank, so please wait about 1 minute (for safety) turning the handheld off. If you want to swap the micro sd into another handheld, edit the If you want to test another kernel, just create a new directory inside Any tests, especially on older handhelds are appreciated. |
Beta Was this translation helpful? Give feedback.
-
Ok ive tried the latest test image on a bb v3.5 Theres my check:
This is my thoughts for now. Very nice job! |
Beta Was this translation helpful? Give feedback.
-
Ok now tested on a powkiddy V90.
|
Beta Was this translation helpful? Give feedback.
-
Thank you!
The image is embedded in u--boot and it is the first thing of code that runs off of the micro sd, without any external configuration... so the image is going to be upside-down on either bb3.5 or pg/v90/q90. We can perhaps do a symmetric image... This could also be specifically for the first run, because the firstbot scripts overwrite the whole u-boot anyway.
It should have written out some messages in green, then wait for 5 seconds, and then power off (black screen). If the screen was black right after the splash screen then it could be a brightness issue.
Yes that's a good idea. (EDIT: it's now in a new branch, i will switch to it for new test images.)
The boot stuff is in this repo for now including some of the kernels as well. |
Beta Was this translation helpful? Give feedback.
-
I've had that happen to me once. I do not know what's causing it. It may be that it's something with the new kernel. There is also (EDIT: if the keyboard is "messed up", it means that the miyoo_kbd driver doesn't get correctly set to "version 4" here. To shut down cleanly hold "D-pad down" (shows the shutdown popup), then press "X button" to confirm.)
👍
My V90 has no motor (one of the later ones); this is likely to be a kernel config thing - I do get 'could not configure motor' message in dmesg. |
Beta Was this translation helpful? Give feedback.
-
I am also getting random "hiccups" (the handheld seems to freeze for a fraction of a second) on the new kernel on a V90 ( |
Beta Was this translation helpful? Give feedback.
-
Ive checked the script now, ure right... also that reminds me to merge my updates with the current miyoo logo on uboot source...
i also was thinking to add some delay between some important messages, a regular user may not notice about them because the process is fast sometime (atleast in the bb v3.5)
thanks i already checked now. btw we may think in a proper repo to have this under miyoo stuff (or maybe on a current of its repos)
The v90 where was tested has a motor working, mmm, maybe something was messed on the current source? idk, i will check the motor code later.
mmm, same as the other bb v2 white screen, the motor problem, and the hiccups, clearly the compiled kernel files included on the latest cfw was not taken from the latest source at that moment... and we have to deal with this now, nice lol. if you see more weird stuff take notes please. |
Beta Was this translation helpful? Give feedback.
-
New image here.
I am hoping that some of the issues may go away. I think some of the problems stemmed from the fact that the original So I messed with daemon and miyooctl code. I removed the keypad and motor initialisation parts from |
Beta Was this translation helpful? Give feedback.
-
That would be great! The current sources "sort of" work, in that they boot, but they don't have the screen driver enabled, and even when enabled the init code is a little different from the r61520fb driver...
Yes, that's certainly possible...
I think it needs to mature somewhat for any official support. Once the setup stabilises, perhaps...
Hopefully the new image will resolve some of this. Although I do not understand what's wrong with v2 - that should be functionally equivalent to cfw 1.3.3 - the same kernel+driver, the same daemon - i just took the files from cfw 1.3.3 image. Just the boot scripts are reshuffled a bit. |
Beta Was this translation helpful? Give feedback.
-
Another image for testing here (this is wetransfer, so only valid for a week).
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Thank you for the test - I don't have windows to test on ;) Fsck on my linux after resize always gives "There is no label in boot sector, but there is volume label 'MAIN' stored in root directory" (which it fixes), so I suppose this is the issue. (My linux works with the partition no problem even without fixing it, I was hoping windows will as well.) The fsck in rootfs does not catch it however, so I will put a new fsck.vfat on the BOOT partition. So hopefully this issue will be fixed on the next image.
I had the same thing on my bittboy3.5, same glitch on the first boot after firstboot ;) Don't know, something in (EDIT: formatting) |
Beta Was this translation helpful? Give feedback.
-
I will just left this info as a reminder. To solve the the issue of the resized partition not accesible on windows, this linkes must be added to the firstboot script: It worked on bittboy v3.5 and windows 10 |
Beta Was this translation helpful? Give feedback.
-
(Apologies for the verbosity/lack of organisation.)
A suggestion for a "new" booting setup for CFW
The goal of this suggested overhaul of Miyoo CFW boot process is to:
Overview
All the changes compared to CFW 1.3.3 happen in the
boot
partition, and in therootfs
/etc/main
script.On of my goals was to have all the files that relate to boot up until running GUI (gmenu2x) in one place - meaning the kernel image (
zImage
), kernel modules,daemon
program,miyooctl
program, etc... Since they may differ between different handhelds, each handheld gets its own subdirectory inboot/variants/
. Which one gets used is controlled by the contents ofboot/handheld.txt
file. (The only file outside this structure that needs to be copied over when switching kernel/handheld isboot/zImage
.)To make an image which would "work" on different handhelds, there is "firstboot" mechanism: if there exists a
boot/firstboot
script, it gets run instead of the "normal" boot. By default this script readshandheld.txt
, copieszImage
to the right place, then also copies some configuration files into themain
partition, and then disables itself (so that it doesn't get run again). The point is that any of the kernels themselves actually boot without problems on every handheld (well - I hope. really not sure about the older ones, like bb v1) (but of course screen/keypad/sound/etc may not work). So the idea is that the image would boot (no screen) and fix up the image itself. All the subsequent boots then use the correct kernel and modules and configs.So - to switch to another kernel/handheld, just create another subdirectory in
boot/variants
, copy the relevant files in, changehandheld.txt
to it, and renamefirstboot.done
tofirstboot
. Then boot and wait about ~30 secs (for the firstboot script to it its thing). Turn off. Turn on - should boot into the new kernel. (Alternatively, instead of runningfirstboot
, just overwrite alsoboot/zImage
and adjust any configs in themain
partition manually.)As far as a "single image" goes, the procedure would go: a) write the universal image, b) mount
boot
(it's FAT16 so it should work on windows as well), c) edithandheld.txt
to the right handheld, d) turn on, wait ~30 secs, e) turn off. Done.(Or perhaps whip up some windows program that would do the above and have a drop-down for handheld. Or something.)
Installation
I haven't produced full images yet - there is no point until we also get a new
rootfs
(well maybe for L2/R2 support...)So for the moment, grab the attached archive miyooboot.zip, which contains the new contents of the
boot
partition (it has the boot script(s) and kernels/modules harvested from several CFW 1.3.3 images). Get a CFW 1.3.3 image, write it to a micro SD card. Mount the boot partition, erase everything there, and copy everything from themiyooboot
directory that you get by unpacking the boot pack you just downloaded from here. Edit thehandheld.txt
file so that it contains only the name of a subdirectory ofvariants
that you want to use. (Case matters.) (I can make this a little more damage-proof if needed...)Now the tricky bit. You will need to replace also the
etc/main
file on the ext4 partition calledrootfs
, by the one of the files from the boot pack, namelyvariants/backup/main
. I have no idea how can one do this on windows.I would appreciate if anyone could test this, but it does require messing with the existing image...
I tested both firstboot and normal boots with this on my V90 and Bittboy V3.5, but I have no other handhelds from this line.
Please also audit the whole boot process (i.e.
etc/main
andfirstboot
) if you can.If you just want to have a look at
main
andfirstboot
, I made a temporary repository here - this one doesn't contain the binaries (meaningzImage
s, modules,daemon
s, etc).Going forward
Need to find out what other config files differ between handhelds, and add them to
variants/*
andfirstboot
.Currently there is a lot of duplication in
variants/*
- every subdir contains everything. Perhaps could move some of those tovariants/common
.Check if this approach could be accepted.
Either build a whole image, or (better) see if I can create a working rootfs from sauce's buildroot.
Clear up kernel image building for various handhelds.
Automate automate automate.
Beta Was this translation helpful? Give feedback.
All reactions