hexdump0815 / linux-mainline-on-arm-chromebooks

running linux mainline on arm chromebooks - for example: samsung xe303c12 and xe503c12 (snow and peach), acer c100, c101 and c201 (veyron speedy, minnie etc. and gru bob and kevin), medion s2013 and s2015 (veyron jaq, mighty etc.), acer cb5 311 (nyan big), lenovo n23, acer r13 (oak elm and hana), lenovo duet (kukui krane) and most probably many many more over time ...
159 stars 10 forks source link

WOW! #1

Open N4IRS opened 3 years ago

N4IRS commented 3 years ago

I just booted a Lenovo Chromebook S330 from your elm-aarch64-focal image. The touchpad works, the screen works and the wifi works. I'm doing an update / upgrade now! I'll test more but this is COOL!

GREAT JOB! Thank you!

hexdump0815 commented 3 years ago

i'm happy to hear that and thank you for the positive feedback ...

best wishes and good luck - hexdump

N4IRS commented 3 years ago

Someone should tell you if things work. I'll be setting up an environment so I can build a customized image. As of right now, I don't have sound, so I'll have to dig into that. The video seems good to me. Thanks again for your work!

hexdump0815 commented 3 years ago

sound should - at least in theory - work, but maybe the s330 is different ... what does 'cat /proc/asound/cards' say on your system?

N4IRS commented 3 years ago

root@changeme:~# cat /proc/asound/cards 0 [mtkrt5650 ]: mtk-rt5650 - mtk-rt5650 mtk-rt5650

N4IRS commented 3 years ago

speaker-test worked as user linux. Did not work as root (should it?) Everything pointed to pulseaudio. I ended up commenting out in /etc/pulse/default.pa module-udev-detect module-detect

I added: load-module module-alsa-sink device=hw:0,0

Sound now works in Firefox. I have not tried anything else.

hexdump0815 commented 3 years ago

i just checked and my lenovo n23 has the same audio config - i thought that it was working for me out of the box, but i'll note down to retest it the next time i'll test new images on the n23 ... good that you have it working on your device somehow now

N4IRS commented 3 years ago

Is there a forum (BBS) redit etc where you discuss this work or just here on github?

hexdump0815 commented 3 years ago

no there is none and i'm not planning anything like that, as i do not have the time to keep track of it. for now i plan to slowly making progress in providing some good starting point in case someone wants to use a real linux on an arm chromebook. whenever someone runs into a problem or has an idea, github issues should be the way to go and i'm trying to respond as good as time permits.

N4IRS commented 3 years ago

Works for me. I've used Pi-Gen and the Armbian build system, so I have some experience. I'll post here if I run into issues or have suggestions / pull requests. I have at least 2 other people interested in ARM based notebooks.

N4IRS commented 3 years ago

I am able to create an image without errors but I can't boot from it. I get no errors when I run in this order as root: get-files.sh chromebook_oak aarch64 create-fs.sh chromebook_oak aarch64 focal create-image.sh chromebook_oak aarch64 focal The image looks good and I burn it to an SD card using the same process I use to burn your published image that does work.

When I do a CTRL U at the boot screen I get a beep and a quick flash of the screen. I using a RPi4 running PiOS (Raspbian) 64 bit to build the image (Linux build-arm64 5.10.17-v8+ #1403 SMP PREEMPT Mon Feb 22 11:37:54 GMT 2021 aarch64 GNU/Linux)

At this point on a SBC, I would be connected to the serial console looking for errors. Do you have any suggestions about how I should go about debugging?

hexdump0815 commented 3 years ago

maybe first try to write the corresponding vmlinux.kpart image to the first partition of the sd card. if that works somehow the kernel did not end up properly there, if that does not work it looks like the chromeos specific partition flags done via cgpt in the scripts did not work well. the beep means that the bootloader was not ableto find a proper kernel in the right format.

N4IRS commented 3 years ago

I used dd to pull partition 1 and 2 from the working and non working image. I used vbutil_kernel --verify to look at the .dd files. In the case of the non working image I got Error verifying keyblock on both partitions. On the working image, I got "Body verification succeeded" on partition 1 but failed on partition 2. I wrote your working partition to partition 1 and the card booted.

As you suggested, I wrote partition 1 with dd if=vmlinux.kpart-elm-5.10.25-stb-mt7+ of=/dev/sdd1 and the card boots. It LOOKS to me like there is a problem with the image creation script. I'm continuing to troubleshoot.

hexdump0815 commented 3 years ago

maybe it was a left over from the wrongly named file in the script (oak vs. elm) so that the kernel for the boot partition was not around and thus could not be written to the image?

just a heads up btw. - i have just comitted a bigger change to make the kernel config option handling more flexible, powerful and easy, so it might be good for you to pull the repo fresh if you are working with it right now ... a new shared repo will be used for the generic kernel options of all my kernel builds - https://github.com/hexdump0815/linux-mainline-mediatek-mt81xx-kernel/blob/master/readme.mt7#L5 ... at least it builds this way, i did not test the resulting kernel yet, but if i did not do a typo somewhere it should work

shelterx commented 1 year ago

Adding to the WOW here... :) Running good on Lenovo IdeaPad 3 Chromebook. However finding the linux username/password was a bit tricky, it wasn't on the main github project page, nor under chromebook_kukui. I eventually found it with Google. Maybe you should make it easier to find.

Anyway, good job, keep it up!

hexdump0815 commented 1 year ago

@shelterx - thanks a lot for the positive feedback ... i'm actually planning to improve the landing readme.md and add some first-steps.md to the doc dir to which i plan to point to from the readme. i hope to have both ready within the next weeks.

shelterx commented 1 year ago

@hexdump0815 Sounds great! BTW, I haven't looked into it but is it easy just to update the kernel once a new image is released. Is it done with apt upgrade or do I have to manually copy the kernel/mods from the new image and edit something? I mean, I don't want to reinstall an entire new image if it's not needed.

hexdump0815 commented 1 year ago

@shelterx - kernels are not packaged as this would make things a bit less flexible for me ... i would recommend https://github.com/hexdump0815/imagebuilder/blob/main/doc/building-own-kernels.md (its not that complicated and can be done on the system itself) or in case this is too much work then https://github.com/hexdump0815/imagebuilder/blob/main/doc/installing-a-newer-kernel.md ... please let me know if anything is unclear or if there are errors in those docs

good luck and best wishes - hexdump

shelterx commented 1 year ago

@hexdump0815 Thanks, another thing tho', the permissions isn't right for some system directories. This is a part of the output from ls -l /

drwxr-xr-x   1 linux linux 3564 Mar  4 13:56 etc
drwxrwxr-x   1 linux linux  832 Feb 18 08:48 scripts
drwxrwxr-x   1 linux linux   84 Jul 16  2021 usr

I guess a chown -R root:root would do but still...

hexdump0815 commented 1 year ago

@shelterx - oh - thats a very good hint ... i think this comes from me untaring the extra-files parts on top of the freshly created rootfs - i'll find a fix for it - thanks a lot for pointing this out, definitely not a good default permission ...

hexdump0815 commented 1 year ago

@shelterx - i checked and it looks this was due to the ownerships of my imagebuilder checkout on my image build machine was messed up (no real idea how that happend) ... i plan to add a "latest info" section to the upcoming new future top readme.md and will put a note on how to check and fix this issue soon. this should work if run as root to fix for all affected files:

# show all affected files
find /bin /boot /etc /lib /opt /root /sbin /scripts /usr -user linux -ls
# fix the ownership for them
find /bin /boot /etc /lib /opt /root /sbin /scripts /usr -user linux -exec chown root:root {} \;
# check again - nothing should be left
find /bin /boot /etc /lib /opt /root /sbin /scripts /usr -user linux -ls
hexdump0815 commented 1 year ago

@shelterx - fyi: some initial doc changes are online now ...

shelterx commented 1 year ago

I'm not sure if I messed something up, but is it possible to get video acceleration in the browsers? I tried chromium, it says it's HW Video Acceleration is enabled but no codecs are available as being HW accelerated.

hexdump0815 commented 1 year ago

@shelterx - i think this is a complicated one and from history it sometimes works and then breaks again if it once worked and highly depends on the platform - due to this i see this as a topic outside of those images, but if you find a way to get it working reliable, then i would of course be interested to know about it :)

on mt8183 i think there was some code recently added to support internal codec format call m2m or similar i think to ffmpeg and or the kernel i think ...

shelterx commented 1 year ago

@hexdump0815 yeah hw acceleration in Linux for browsers is still a nightmare. I'm not sure if I had any acceleration during the initial. I saw vp9 being a codec the that was accelerated but I'm not sure where I saw it and if it even works.

shelterx commented 1 year ago

One more observation, there are still symlinks that belongs to the linux user on the filesystem. You can't chown those, apt upgrade complains about it too (depending on which package that gets upgraded).

Regarding the touchpad that sometimes doesn't work when booting, apart from just rebooting the entire system to fix it, you can also restart lightdm through the console.

Also, dropping to the console and logging in tends to spam it with kernel messages for some reason, which's a bit odd, shouldn't these go directly to syslog?

hexdump0815 commented 1 year ago

@shelterx - i think the symlinks should be no problem, if desired one could remove them and recreate them the same way as root - i gues they are the ones in /usr/share/alsa/ucm2? ... future images will have this fixed for sure

thanks for the hint with the touchpad, at some point we will have to debug what the actual problem is - but better to have at least a workaround than none :) ... which lenovo ideapad 3 do you have - i guess the mt8183 one? i'm asking as the lenovo naming is sometimes not really clear: lenovo ideapad 3 coud match to the mt8173 11.6", to the mt8183 11.6", to the mt8183 14" and even to the snapdragon duet 3 ...

regarding the messages on the console: maybe they are at a level which routes them to both syslog and the console?

shelterx commented 1 year ago

@hexdump0815 I have the mt8381 version. Yes, the messages in console probably isnt being sent to syslog, I just find it a bit odd. And yes, it's the symlinks in /usr/share/alsa/ucm2

hexdump0815 commented 1 year ago

@shelterx - this: https://github.com/hexdump0815/imagebuilder/commit/0293bd3ec4c1ab358fec352c1a0aedc097566094 should take care of the symlinks as well

shelterx commented 1 year ago

@hexdump0815 / is also owned by linux

root@chromie:~# ls -la /
total 52
drwxrwxr-x   1 linux linux  144 Mar  3 19:51 .
drwxrwxr-x   1 linux linux  144 Mar  3 19:51 ..

Regarding the touchpad I read that psmouse can cause issues, but that seems to compiled in the kernal and not as a module? So I can't really blacklist it.

hexdump0815 commented 1 year ago

@shelterx - thanks once more, i added it to the important info as well: https://github.com/hexdump0815/imagebuilder/commit/40a3e67028dfa5990518676b04001dc74b6591c2

baybled commented 1 year ago

wanted to add, where reddit failed me, you lifted my spirits and gave me an exact solution for my chrome tablet. Thank you and starred!

EMLommers commented 1 year ago

I had serious good results on my OAK system. Indeed the user and privileges were bit messed up. I recommend to update the release version or explicitly mention '23-04-03 file ownership and privileges are incorrectly set on some aarch64 images' Surely hope next version is Kernel 6.5. On OAK, the best results ever achieved with this release. Everything worked, and smooth full screen videos! (I installed vulkan and vk) Hexdump, you did it again! Thank you!

However got some issues with /usr/bin/sudo,su,pkexec and files in /usr/lib/policykit-1/ Solved by: (as root) chmod 4755 (or 4555 for the paranoid) /usr/bin/sudo chmod -R 4755 (or 4555 for the paranoid) /usr/lib/policykit-1/ chmod 4755 /usr/lib/policykit-1/polkit-agent-helper-1 chmod 4755 /usr/bin/pkexec chmod 4755 /usr/bin/su

But on immediately running your image and executing your code, all was solved and above not necessary. Thanks again! Superb work!

Endermen1094 commented 1 year ago

question how do i build the kernel for kukui devices , specifically on gentoo

hexdump0815 commented 1 year ago

@Endermen1094 - this should give an idea about how to build an own kernel: https://github.com/hexdump0815/imagebuilder/blob/main/doc/building-own-kernels.md ... the mt8183 specific info can then be found here: https://github.com/hexdump0815/linux-mainline-mediatek-mt81xx-kernel/blob/lts/readme.mt8

Endermen1094 commented 1 year ago

Thank you