Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo for Amlogic S9xx (TV box S905\S905X\S912)
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4, 5, 6, 7  
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
fanthom
n00b
n00b


Joined: 31 May 2007
Posts: 60

PostPosted: Sun Feb 11, 2018 12:19 pm    Post subject: Reply with quote

@mDup
Yes - I given up with upstream kernel for now. Will use 3.14.29 kernel from LibreELEC till upstream support gets better.

BTW: I even mailed BayLibre (they seems to maintain most of Amlogic code in the kernel) and asked them if they would be interested in Kickstarter campaign like Bootlin did for Allwinner VPU support:
https://www.kickstarter.com/projects/bootlin/allwinner-vpu-support-in-the-official-linux-kernel

Would be happy to pledge some money myself. Sadly i got no response ....
I guess we can only wait.

Thanks
Back to top
View user's profile Send private message
erm67
Apprentice
Apprentice


Joined: 01 Nov 2005
Posts: 238
Location: Where the black men cannot enter

PostPosted: Wed Feb 14, 2018 8:51 pm    Post subject: Reply with quote

I don't know what box you own, and how propense you are to risk, but there might be another option:
the official 4.9 kernel from amlogic.
It is shipped with boxes that run Android 7, the board inside them is (most of the times) identical to that of boxes running Android 6 but with a different firmware. If your box came with Android <7 the 4.9 kernel might or might not boot with th old firmware, hdmi won't almost certainly work.
Well it is unlikely that the vendor offers upgrades to Andoid 7 for your box, but if look carefully in some questionable forums you might find that someone has cooked an Andoid 7 update of dubious provenance for your box. If you are lucky enough to update the box (and the firmware) to Android 7 you can use kernel 4.9, which is certainly a big upgrade over 3.14.xx.
Needless to say the probability that you brick your box upgrading the firmware is very high :-) but you will certainly be able to use kernel 4.9 if you do, just buy a new box that ships with Android 7 if you brick it :lol: :lol:

just booting the 4.9 on the old firmware should be safe instead, but remember hdmi will almost certainly not work..

Use the khadas VIM2 git for the 4.9 Amlogic kernel.
_________________
True ignorance is not the absence of knowledge, but the refusal to acquire it.
A posse ad esse non valet consequentia
Πάντα ῥεῖ
Back to top
View user's profile Send private message
fanthom
n00b
n00b


Joined: 31 May 2007
Posts: 60

PostPosted: Thu Feb 15, 2018 9:29 pm    Post subject: Reply with quote

@erm67
My box is running Android 7 by default so i have high hopes.
Will try 4.9 kernel now :)

Thank you for the tip.
Back to top
View user's profile Send private message
erm67
Apprentice
Apprentice


Joined: 01 Nov 2005
Posts: 238
Location: Where the black men cannot enter

PostPosted: Fri Feb 16, 2018 12:41 am    Post subject: Reply with quote

Use the latest original dtb (or none) first.
_________________
True ignorance is not the absence of knowledge, but the refusal to acquire it.
A posse ad esse non valet consequentia
Πάντα ῥεῖ
Back to top
View user's profile Send private message
fanthom
n00b
n00b


Joined: 31 May 2007
Posts: 60

PostPosted: Fri Feb 16, 2018 12:42 pm    Post subject: Reply with quote

I have S905W box (and kvim2 is S912) so i tried latest firmware for vim1:
http://docs.khadas.com/basics/FirmwareResources/
http://www.mediafire.com/file/85n5qnc9om0xg3t/VIM_Ubuntu-mate-16.04_Linux-4.9_SD-USB_V180207.7z

HDMI does not work.
I also tried Armbian with same kernel version by balbes150 and got same result.

Without dtb booting does not start.

Thanks
Back to top
View user's profile Send private message
erm67
Apprentice
Apprentice


Joined: 01 Nov 2005
Posts: 238
Location: Where the black men cannot enter

PostPosted: Fri Feb 16, 2018 9:16 pm    Post subject: Reply with quote

The kernel is the same for all Amlogic chipsets, but I cannot find the sources for 4.9 anymore in the khadas git, maybe they switched back to 3.14?

The dtb required is the original from your vendor, not from the opensource linux meson.

Without a serial is very hard to know what is going on :-)

Wait at least 10 minutes and try to see if the eth gets an IP from the dhcp server and comes up (answers to ping) wait some more time and the ssh port should be open.

Maybe an S905X dtb will work (some people uses it with libreelec)

https://sx05.eu/s905/8.2/device_trees/S905X/

kernel 4.9 uses the same dtb.

I see that S905W is a bit problematic
_________________
True ignorance is not the absence of knowledge, but the refusal to acquire it.
A posse ad esse non valet consequentia
Πάντα ῥεῖ
Back to top
View user's profile Send private message
balbes150
n00b
n00b


Joined: 03 Dec 2016
Posts: 9

PostPosted: Sat Feb 17, 2018 8:01 am    Post subject: Reply with quote

erm67 wrote:
but I cannot find the sources for 4.9 anymore in the khadas git, maybe they switched back to 3.14?



kernel 4.9 uses the same dtb.



1.

branch 4.9
https://github.com/khadas/linux/tree/ubuntu-4.9

2.
The structure of the dtb in the kernel 4.9 different from 3.14. Files from 3.14 are not suitable for 4.9
Back to top
View user's profile Send private message
erm67
Apprentice
Apprentice


Joined: 01 Nov 2005
Posts: 238
Location: Where the black men cannot enter

PostPosted: Sat Feb 17, 2018 8:04 pm    Post subject: Reply with quote

Ahh thank you, but it got only one commit in the last few months...... apart the dts of course.

It locks randomly after a while, I was hoping for some real development :-)
Unless the problem was really fs/aufs/vdir.c

I guess I stay with 3.14 until things improve, the few syscalls missing are not blockers yet.
_________________
True ignorance is not the absence of knowledge, but the refusal to acquire it.
A posse ad esse non valet consequentia
Πάντα ῥεῖ
Back to top
View user's profile Send private message
fanthom
n00b
n00b


Joined: 31 May 2007
Posts: 60

PostPosted: Sun Feb 18, 2018 9:22 am    Post subject: Reply with quote

Got no IP assigned but i guess that system must be setup first (at least its the Armbian case).
Lack of HDMI is a deal breaker anyway. Going back to 3.14.29 as well.
Back to top
View user's profile Send private message
fanthom
n00b
n00b


Joined: 31 May 2007
Posts: 60

PostPosted: Tue Mar 13, 2018 6:45 am    Post subject: Reply with quote

USB support seems to be coming to the mainline 4.17.x kernel :D
https://patchwork.kernel.org/patch/10277529/
https://patchwork.kernel.org/patch/10277537/

Now only sound left (have no hopes for the SSV6051 wifi chip) and i'm set :)
Back to top
View user's profile Send private message
erm67
Apprentice
Apprentice


Joined: 01 Nov 2005
Posts: 238
Location: Where the black men cannot enter

PostPosted: Thu Mar 29, 2018 7:09 am    Post subject: Reply with quote

usb2 is a terrible interface anyway.
ome board have USB3.1 instead that is a lot better, like the ROCK64, even the next raspi will allegedly support USB3...


with kernel 4.15 everything I use works on my board ...
_________________
True ignorance is not the absence of knowledge, but the refusal to acquire it.
A posse ad esse non valet consequentia
Πάντα ῥεῖ
Back to top
View user's profile Send private message
mDup
Apprentice
Apprentice


Joined: 14 Apr 2006
Posts: 169

PostPosted: Thu Mar 29, 2018 9:37 pm    Post subject: Reply with quote

erm67 wrote:
[...] with kernel 4.15 everything I use works on my board ...

is that an s912 board?
Back to top
View user's profile Send private message
fanthom
n00b
n00b


Joined: 31 May 2007
Posts: 60

PostPosted: Fri Mar 30, 2018 7:59 am    Post subject: Reply with quote

@erm67
Please provide your box model name. Is internal eMMC supported, wifi, sound and everything? Does it have RTC chip?

Thanks
Back to top
View user's profile Send private message
erm67
Apprentice
Apprentice


Joined: 01 Nov 2005
Posts: 238
Location: Where the black men cannot enter

PostPosted: Mon Apr 02, 2018 7:26 am    Post subject: Reply with quote

It is a S912 board with 2G ram, and I have no eMMC on board (I should have a bought a slightly cheaper one) the NAND is not supported but even it was it's unusable...
It boots only with the khadas-vim2 dtb (only the led give some error, but....) and I am using balbes150 4.14.11+ kernel from git (ATM). Also 4.16 boots but I haven't tested it.
USB works very well (for a USB2 host anyway), eth is very stable, no problems with root on iscsi and iscsi swap. It is a nextcloud headless server so I don't really care about hdmi and sound.

I plan to replace it with something else that has a usb3 host or 2 gbit eth soon :-)
_________________
True ignorance is not the absence of knowledge, but the refusal to acquire it.
A posse ad esse non valet consequentia
Πάντα ῥεῖ
Back to top
View user's profile Send private message
mDup
Apprentice
Apprentice


Joined: 14 Apr 2006
Posts: 169

PostPosted: Tue Apr 03, 2018 12:48 am    Post subject: Reply with quote

erm67 wrote:
It is a S912 board with 2G ram, and I have no eMMC on board (I should have a bought a slightly cheaper one) the NAND is not supported but even it was it's unusable...
It boots only with the khadas-vim2 dtb (only the led give some error, but....) and I am using balbes150 4.14.11+ kernel from git (ATM). Also 4.16 boots but I haven't tested it.
USB works very well (for a USB2 host anyway), eth is very stable, no problems with root on iscsi and iscsi swap. It is a nextcloud headless server so I don't really care about hdmi and sound.

I plan to replace it with something else that has a usb3 host or 2 gbit eth soon :-)


Which replacement hardware do you have in mind? Sounds interesting!
Also is 4.14.11+ kernel amlogic or mainline linux based? I think amlogic but I am not sure.
Finally, I assume you boot from external medium?
Back to top
View user's profile Send private message
erm67
Apprentice
Apprentice


Joined: 01 Nov 2005
Posts: 238
Location: Where the black men cannot enter

PostPosted: Tue Apr 03, 2018 5:53 am    Post subject: Reply with quote

mainline + some patches probably:
https://www.cnx-software.com/2018/01/24/mainline-linux-on-amlogic-s905-s905x-s912-soc-2018-status-update/

I boot from SD card since the board doesn't have an emmc, I optimized the ext4 filesystem on it with flashbench from linaro and it's a lot faster now:

https://blogofterje.wordpress.com/2012/01/14/optimizing-fs-on-sd-card/
https://git.linaro.org/people/arnd.bergmann/flashbench.git

I used to boot from iscsi but having a small root on a local media is better. Network is as fast as the EMMC I had on the 905X board I had previously.

This is the kernel:
https://github.com/150balbes/Amlogic_s905-kernel
_________________
True ignorance is not the absence of knowledge, but the refusal to acquire it.
A posse ad esse non valet consequentia
Πάντα ῥεῖ
Back to top
View user's profile Send private message
balbes150
n00b
n00b


Joined: 03 Dec 2016
Posts: 9

PostPosted: Sat Jul 21, 2018 10:35 am    Post subject: Reply with quote

To run the kernel without an initrd, use "root=UUID=PARTUID"in the kernel command line parameters. Please note that this is not a UUID, it is a PARTUID. It can be recognized by the command

partx --show /dev/sda


https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b5af921ec02333e943efb59aca4f56b78fc0e100
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 41565
Location: 56N 3W

PostPosted: Sat Jul 21, 2018 11:48 am    Post subject: Reply with quote

balbes150,

Check your syntax.
Your link says
Code:
root=PARTUUID=hex-uuid

_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
The_Pope
n00b
n00b


Joined: 03 Jul 2016
Posts: 55

PostPosted: Sat Nov 17, 2018 5:36 pm    Post subject: Reply with quote

Hi again,

I'm now trying to install Gentoo on a USB drive attached to this media box.

The setup is:

- I boot from a different USB drive which has your Armbian 5.64 build (essentially that's my Gentoo boot CD)
- I just follow the Gentoo handbook - partition the other drive, download stage3, chroot, etc.

The problem is the bootloader. Grub tries to install for arm64-efi, but then says "EFI variables are not supported on this system."

I looked for this problem and found that if you exit chroot, so into Armbian, you should be able to see a module called efivars.
From inside the Armbian console, logged as root, lsmod doesn't show any efivars.
modprobe efivars returns "modprobe: FATAL: Module efivars not found in directory /lib/modules/4.19.0-rc7-aml-s9xxx"
/sys/firmware doesn't contain anything that reads efi
modprobe -r efivars (which would remove the existing efivars module) returns "modprobe: FATAL: Module efivars not found."

So this box runs some weird, non-standard EFI? Which Armbian somehow manages to match, with U-boot?

Inside the chroot, I managed to compile a kernel from gentoo-sources (using make, as there's no genkernel willing to work on arm64)

I would just clone the Armbian boot partition on the Gentoo drive, then replace files like the kernel, initrd or initramfs. But they're not the same!

Armbian boot partition contains:

System.map-4.19.0-rc7-aml-s9xxx
aml_autoscript
aml_autoscript.cmd
aml_autoscript.zip
armbianEnv.txt
armbian_first_run.txt.template
boot-desktop.png
boot.bmp
config-4.19.0-rc7-aml-s9xxx
emmc_autoscript
emmc_autoscript.cmd
initrd.img-4.19.0-rc7-aml-s9xxx
s905_autoscript
s905_autoscript.cmd
s905x-uboot.img
s912-uboot.img
uEnv.ini
uInitrd
uInitrd-4.19.0-rc7-aml-s9xxx
vmlinuz-4.19.0-rc7-aml-s9xxx
zImage

Gentoo boot partition contains just:

config-4.19.1-gentoo
System.map-4.19.1-gentoo
vmlinuz-4.19.1-gentoo

My Gentoo /etc/fstab file already contains the correct UUIDs for all the partitions I use.

Now, maybe this "bootloader hacking" is a bad idea and I can install a bootloader the normal way. I can't understand much of the U-boot documentation, which I believe is what Armbian uses.
_________________
Stop the world. I want to descend.
Back to top
View user's profile Send private message
mDup
Apprentice
Apprentice


Joined: 14 Apr 2006
Posts: 169

PostPosted: Sun Nov 18, 2018 9:17 pm    Post subject: Reply with quote

The_Pope wrote:
Hi again,

I'm now trying to install Gentoo on a USB drive attached to this media box.

The setup is:

- I boot from a different USB drive which has your Armbian 5.64 build (essentially that's my Gentoo boot CD)
- I just follow the Gentoo handbook - partition the other drive, download stage3, chroot, etc.

The problem is the bootloader. Grub tries to install for arm64-efi, but then says "EFI variables are not supported on this system."

I looked for this problem and found that if you exit chroot, so into Armbian, you should be able to see a module called efivars.
From inside the Armbian console, logged as root, lsmod doesn't show any efivars.
modprobe efivars returns "modprobe: FATAL: Module efivars not found in directory /lib/modules/4.19.0-rc7-aml-s9xxx"
/sys/firmware doesn't contain anything that reads efi
modprobe -r efivars (which would remove the existing efivars module) returns "modprobe: FATAL: Module efivars not found."

So this box runs some weird, non-standard EFI? Which Armbian somehow manages to match, with U-boot?

Inside the chroot, I managed to compile a kernel from gentoo-sources (using make, as there's no genkernel willing to work on arm64)

I would just clone the Armbian boot partition on the Gentoo drive, then replace files like the kernel, initrd or initramfs. But they're not the same!

Armbian boot partition contains:

System.map-4.19.0-rc7-aml-s9xxx
aml_autoscript
aml_autoscript.cmd
aml_autoscript.zip
armbianEnv.txt
armbian_first_run.txt.template
boot-desktop.png
boot.bmp
config-4.19.0-rc7-aml-s9xxx
emmc_autoscript
emmc_autoscript.cmd
initrd.img-4.19.0-rc7-aml-s9xxx
s905_autoscript
s905_autoscript.cmd
s905x-uboot.img
s912-uboot.img
uEnv.ini
uInitrd
uInitrd-4.19.0-rc7-aml-s9xxx
vmlinuz-4.19.0-rc7-aml-s9xxx
zImage

Gentoo boot partition contains just:

config-4.19.1-gentoo
System.map-4.19.1-gentoo
vmlinuz-4.19.1-gentoo

My Gentoo /etc/fstab file already contains the correct UUIDs for all the partitions I use.

Now, maybe this "bootloader hacking" is a bad idea and I can install a bootloader the normal way. I can't understand much of the U-boot documentation, which I believe is what Armbian uses.



@The_Pope

To run gentoo on S905 from external medium one can use a prepared
image to burn to SD card or USB stick. Personally I did not try USB
stick.

One such (1 year old) image is stage3 Gentoo_8gb_20171130.img.xz from
this thread.

https://drive.google.com/drive/folders/15R4uYNUgp4QYLcQyWh3rOVrVGdlA47db

You do need to have to activated multi boot on your device as explained
in Freaktab forum called

Running Linux From SD Card or USB Flash Drive -
Using Balbes150 Method And Files.

on

https://forum.freaktab.com

Maintaining a gentoo stage3 in a chroot, included kernel+modules, is
one thing but booting it needs the necessary u-boot scripts.

Here is how such /boot might look like for such image

minimx-g ~ # ls /boot/ | sort
aml_autoscript
aml_autoscript.zip
boot.bmp
config-4.19.0-gentoo
dtb
dtb.img
initrd.img-4.19.0-gentoo
LOST.DIR
s905_autoscript
s905_autoscript.cmd
s905.start
System.map-4.19.0-gentoo
uInitrd
zImage

The recent Armbian /boot directory looks a bit different typically
when you choose more recent u-boot (2018).

Once you boot and run image (I would suggest from SD card) you can
adjust and update Gentoo with portage the usual way.

I agree that 1 year is a bit old perhaps but updating world and system
on a stage3 is not that much work.

I will however try to provide an updated Gentoo_8gb_2018mmdd.img.xz
soon.

Let me know if you need such update or of you can go from previous
image.

Next, -maybe- one day, you may want to try to run Gentoo from internal
eMMC.

I managed to do so but there is no written down recipe.

Not for the faint of heart...

Basically I did so on S912 Khadas VIM2 as follows :

(note: I did not try any other S912 device (I do not have one) or S905
(like MINIMX-G) yet).

- boot 4.19.0-rc7-aml-s9xxx from SD
- install 4.19.0-rc7-aml-s9xxx to eMMC (I used u-boot 2018)

Now you can boot, say, Armbian Ubuntu from eMMC.

Next I have a second Khadas VIM2 (but the MINIMX-G is fine as well)
booted into Gentoo from SD. I boot first Khadas VIM2 into Armbian
again and mount eMMC and rsync the second Khadas VIM2 filesystem there.

/etc/fstab must be excluded. And maybe kernel modules too.

By the way: in my case I had to build gentoo kernel using Balbes Armbian .config
so I copied those modules to eMMC.

As for boot: it is like Armbian boot but in my case it has gentoo kernel :

kvim2-extra ~ # ls /boot/ | sort
aml_autoscript
aml_autoscript.cmd
aml_autoscript.zip
armbianEnv.txt
armbian_first_run.txt.template
boot.bmp
boot-desktop.png
config-4.19.1-gentoo
dtb
dtb-4.19.1-gentoo
dtb.img
dtb.img-4.19.1-gentoo
emmc_autoscript
emmc_autoscript.cmd
extlinux
Image-4.19.1-gentoo
initramfs-dracut-arm64-4.19.1-gentoo
rsync-test
s905_autoscript
s905_autoscript.cmd
s905x-uboot.img
s912-uboot.img
System.map-4.19.1-gentoo
uboot.img
uEnv.ini
uInitrd
uInitrd-dracut-arm64-4.19.1-gentoo
zImage

zImage is arch/arm64/boot/Image

and uInitrd is made from dracut initramfs with

# mkimage -A $ARCH -O linux -T ramdisk -C none -a 0 -e 0 -n uinitrd -d initramfs-dracut-arm64-4.19.1-gentoo uInitrd

where dracut initramfs was made as

# dracut initramfs-dracut-arm64-4.19.1-gentoo 4.19.1-gentoo

because u-boot 2018 one needs to edit

/boot/extlinux/extlinux.conf to have correct dtb image

I also adjusted uEnv.ini and dtb.img for legacy purpose

there are duplicate files and directories in /boot, just in case for
when one upgrades to keep previous

dtb = dtb-4.19.1-gentoo
dtb.img = dtb.img-4.19.1-gentoo
zImage = Image-4.19.1-gentoo
uInitrd = uInitrd-dracut-arm64-4.19.1-gentoo

note when I installed Armbian to eMMC for u-boot 2018 I copied

s912-uboot.img to uboot.img
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6, 7
Page 7 of 7

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum