hexdump0815 / imagebuilder

velvet os - simple script framework to build ubuntu 22.04 lts jammy (in older versions also 20.04 lts focal) and debian 12 bookworm (in older versions also 11 bullseye) bootable usb / sd card images for some arm and intel devices - lots of prebuilt images as well
GNU General Public License v3.0
301 stars 44 forks source link

unable to boot 210321-01 veyron on asus c100 flip #16

Open cracket opened 3 years ago

cracket commented 3 years ago

Not sure if I have installed you image correctly, I have extracted via xz -d and flashed via dd if=.img of=/dev/sdc to sd card.

However asus c100 flip is not booting from it. I'm using developer mode and can boot different version of linux with ctrl-U, but from your image I see black screen and no error.

Did anyone succeeded booting veyron image on c100?

hexdump0815 commented 3 years ago

i think it might need its own u-boot (which the images boot instead of a kernel) - i'll try to build one for the flip in the next days and then you maybe can try again?

cracket commented 3 years ago

are you sure replacing u-boot is needed to boot from SD? I've already booted different distros from SD card without any issue, which contained cgpt partitions with kernel and rootfs only. I would't like to replace or wipe anything on built-in MMC memory as it contains the only working original chromeos kernel capable to support bluetooth and other devices, and in case I messed something up - I don't know how to bring back MMC if it will not boot.

hexdump0815 commented 3 years ago

no need to worry :) - the u-boot i mean is on the sd card and it is there on the kernel partition instead of the kernel - this way we get a nice boot selector and the u-boot then loads then the kernel we want from the /boot partition on the sd card ... so in the end the emmc will not be touched at all

cracket commented 3 years ago

ok, I found it in the sources: https://github.com/hexdump0815/imagebuilder/blob/master/boot/boot-chromebook_veyron-armv7l/extlinux/extlinux.conf the image is for 3 different machines, but the default one is veyron-jaq and no minnie at all.

You are using DTB from mainline kernel? Just curious because I've compared DTS from mainline and shipped with chromeos, and there are small differences which I don't exactly understand if they are relevant, as I'm newbie to DTS

hexdump0815 commented 3 years ago

i did not include the minnie (flip) dtb yet as i do not have a device to test it, but the dtb for minnie should be installed in /boot/dtb-kernel-version i think (if not please let me know) - can you please create another entry for it in your /boot/extlinux/extlinux.conf ... and then gunzip this file: https://github.com/hexdump0815/u-boot-chainloading-for-arm-chromebooks/releases/download/v2021.01-cbr/uboot.kpart.cbr-minnie.gz and dd it to the first partition of your sd card ... in case this will boot we are done, otherwise i'll have to build minnie versions for older u-boots too, as for some others the latest version from 2021 did not work anymore ...

regarding the dtb files: chromeos and mainline kernel are completely different and thus the dtb files are not interchangable

hexdump0815 commented 3 years ago

i have created a new veyron image here: https://github.com/hexdump0815/imagebuilder/releases/tag/210509-01 ... it contains some changes for the flip - maybe you can give it a try ... you still have to write the proper u-boot (see above) to the first partition and maybe change the default boot target in extlinux.conf on the third partition to minnie ... good luck :)

cracket commented 3 years ago

So - good news: veyron minnie image is working on c100. I have followed your steps and ubuntu has started including xfce. What didn't work (just briefly because I didn't have much time to test) - bluetooth, wifi and battery was not recognized. What else worked - sd and touch screen. I had to choose system image during boot by pressing the number (in my case it was 4), so looks like didn't have to change much except extlinux.conf contents. Feel free to add entry for veyron minnie into your repo.

Regarding dtb - how do you know if chromeos & mainline are completly different? I have compared dtb ripped out from my chromebook (kernel 4.x) to mainline one (5.x) there were maybe 4 or 5 differences, the rest is almost the same. I'm not an dts expert, so it should be reviewed by someone who could tell if the differences are relevant or cosmetic, but still look pretty similar.

hexdump0815 commented 3 years ago

that sounds good ... i'm surprised that battery and wifi did not work as i extra added those in the new image - which kernel version do you have running there? it should be 5.10.35 - at least this is the version with the additions. did you have the menu entry in u-boot already there for minnie? (as that should also already be part of the new image)

regarding the dtb differences: if it is the case as you describe then i assume google is porting back a lot of stuff from mainline into their 4.x kernel tree so that the differences are that small.

cracket commented 3 years ago

Looks like the filename for nvram was wrong, I have renamed brcmfmac4354-sdio.google,veyron-speedy-rev9.txt to brcmfmac4354-sdio.txt and it started working. But kernel version is 5.10.25-stb-cbr+, all entries in extlinux.conf are related to 5.10.25 and menu entry was for minnie. Your dts is correct, as in /proc/device-tree/compatible shows veyron-minnie list. Anyway thank you for your misleading comment - I've packed mainline kernel 5.10.34 with chromiumOS (4.19.113) dtb and this combination has made my bluetooth working. Without your note I would have never tried "interchangeable dtb" I'll try to test more flip hardware as there are more people interested in working c100 devices and I'll probably compare your kernel settings with mainline&chromium to see the difference.

hexdump0815 commented 3 years ago

it gets better step by step :) ... if its kernel 5.10.25 then something went wrong with my image build - can you try to install (untar in /) this one: https://github.com/hexdump0815/linux-mainline-and-mali-generic-stable-kernel/releases/download/5.10.35-stb-cbr%2B/5.10.35-stb-cbr+.tar.gz ? - it should most probably give you battery too ...

cracket commented 3 years ago

kernel installed fine, just haven't used .kpart file - I assume with u-boot on first partition it's not needed (second partition is filled with zeros, so kernel is in /boot only). Indeed - this kernel gives battery, but no bluetooth again. During boot - kernel freezed for about 30 seconds to check BTRFS rootpart - not sure if this is normal, as I have no experience with BTRFS. I will try using it now, if you want me to check anything special - just let me know

hexdump0815 commented 3 years ago

that sounds good ... the kpart kernel is just there in case someone does not want to use the u-boot option ... i'm using btrfs as root fs in those images as this gives a lot of extra space due to zstd compression without any negative side effects - i guess the freeze is when it checks all the emmc partitions for btrfs maybe

it might be interesting to see if swapping the dtb with your chromeos one will give you bluetoothere as well - i guess it should work again

hexdump0815 commented 3 years ago

i think the 30 sec hang on boot is not the btrfs scanning - it is the initramfs searching for the resume device - running a "update-initramfs -c -k 5.10.35-stb-cbr+" should solve that

cracket commented 3 years ago

swapping dtb does not provide bluetooth, probably you need to add couple of extra config items in kernel config. Hanging is not a problem anymore. However my concern poor performance during video play (worse than with PrawnOS image). Did you set up any hardware acceleration for 3288?

hexdump0815 commented 3 years ago

i just checked and looks like prawnos has some additional userspace in place for hantro hw accel ... i'll for sure add the CONFIG_VIDEO_HANTRO kernel option to future kernels, userland might have to wait until it arrives in newer ubuntu/debian versions - but maybe i find the time to look at it even before that, but its lower prio for me

cracket commented 3 years ago

indeed - to have a good hardware support system needs userland libraries configured to use hw features, it's needed not only for video acceleration, but even for crypto hw acceleration. But coming back to kernel options for imagebuilder - as I understand to build system image you are building kernel from linux-mainline-and-mali-generic-stable-kernel repo with config.cbr-5.10.35-stb-cbr+ config - which should support both tinkerboard and veyron? If so - I have compared my config with this one, and looks like to support bluetooth from bcm4354 following option is missing: CONFIG_SERIAL_DEV_CTRL_TTYPORT there is a discussion about bt and veyron chromebooks explaining it: https://unix.stackexchange.com/questions/498473/why-is-bluetooth-not-working-on-my-chromebook-arch-linux-arm and chromiumos device tree. Not sure if this can cause any problems to other boards like tinkerboard.

I will be checking hantro support for 5.x - however it's still very limited. I'll let you know if I find out something usable.

hexdump0815 commented 3 years ago

cool - thanks a lot for this info - i have added it so that it will not be forgotten for the next version: https://github.com/hexdump0815/linux-mainline-and-mali-generic-stable-kernel/commit/e41f6826a7012c3b465a6e3117c276f41673f9e3

cbr is for veyron chromebooks only (as they seem to require quite a few special options beyond defconfig), so that should be fine - tinkerboard etc. are supposed to be handled by the generic armv7l kernel av7

vfonov commented 11 months ago

Just tried installing the https://github.com/hexdump0815/imagebuilder/releases/tag/230218-05 on Asus C100P . Made an SD card, put /extra/uboot.kpart.cbr-minnie into the first partition, updated the extlinux.conf to boot minnie. Unfortunately, behaviour is strange, after uboot prompt linux starts booting and then there is a black screen , but sometimes the linux boot console would suddenly work and linux would boot. Putting vmlinux.kpart-6.1.11-stb-cbr+ on the first partition seem to work always. After booting wifi works , bluetooth doesn't.

hexdump0815 commented 11 months ago

@vfonov - could you maybe try a different sd card? - the minnie u-boot should in theory work for your device and the fact that it seems to work from time to time might maybe be related to problems with the sd card ... bluetooth is sometimes complicated on veyron chromebooks

vfonov commented 11 months ago

ok, will try

vfonov commented 11 months ago

I tried on a different SD card, and got same result. I didn't try too many times, uboot.kpart.cbr-minnie - I got a black screen after u-boot prompt, vmlinux.kpart-6.1.11-stb-cbr+ - works fine.

hexdump0815 commented 11 months ago

no real idea then what it could be - you might try the other u-boot.kpart files from the /boot/extra dir - maybe one of them is working better?

vfonov commented 11 months ago

So, i tried all the bootloaders in the extra , the uboot.kpart.cbr-speedy was showing boot screen and started booting the kernel, but black screen after.

hexdump0815 commented 10 months ago

did you try all possible options in the menu with the working boot block then?

vfonov commented 10 months ago

did you try all possible options in the menu with the working boot block then?

no, was trying options only for minnie

michelberger commented 9 months ago

Continuing from #130: I was able to recompile kernel 6.1.51.stb-cbr+ with the lts branch of https://github.com/hexdump0815/linux-mainline-and-mali-generic-stable-kernel/. Copied the new vmlinux.kpart-6.1.51-stb-cbr+ and dd'd it to mmcblk1p1 (microsd) and the kernel now reads veyron's emmc partitions.

dd'd it over to mmcblk0p1 (emmc) and the image now boots 100% of the time on the Asus C201P speedy!

Still curious why u-boot doesn't play nicely with veyron, but I suppose it's not strictly necessary to have it in place.