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, 8, 9, 10  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
mDup
Apprentice
Apprentice


Joined: 14 Apr 2006
Posts: 212

PostPosted: Mon Nov 19, 2018 11:44 pm    Post subject: Reply with quote

The_Pope wrote:
Too good to be true, as always.

Your image boots, at least. But it detects zero network interfaces! This box appears to have a Broadcomm Wi-Fi adapter and some wired adapter that never worked. I think Armbian detects it but can't use it, or something like that. This particular version of Armbian also can't use the integrated wi-fi adapter so I had to plug in another, external one, with an Atheros chip. That one worked (I also couldn't, for the life of me, set it up in text mode, had to start X just to connect to the Wi-Fi network) and that's how I managed to maintain the Gentoo install in the chroot.
Your Gentoo image can't detect any of those. Maybe I can recompile the kernel and just check all the possible network drivers, as I should have everything I need. By the way, LibreElec detects both wired and wireless network interfaces just fine. How in the world do they manage to do that, I wonder.

The image I made, however, that one does disk activity, restarts by itself during it, then repeats the same process. I checked everywhere, I pasted the root partition UUID and label in both /boot/uEnv.ini and /boot/extlinux/extlinux.conf, I copied the proper dtb file as dtb.img in /boot ... nothing.

If you want, we could switch to PMs and maybe post how to get out of the problem, or what in the world I did wrong.


Thanks for trying.

LibreElec will typically use older vendor source (if available) sometimes with code that has never reached (and might never reach) mainline linux kernel. That's more or less fine, but not future proof (even if open source, because porting is hard). Recent mainline 4.19.x kernel tries to cover as many as possible amlogic HW drivers for the future. Your box may have some not yet (or never will) supported HW. Only recently my box received USB support and it has no BT support yet. For me the point of a Gentoo stage3 is to allow for certain minimal appliances (say a server or htpc or router or workstation) to be configured and built incrementally with personal taste.
Of course, without decent network most of these will fail. There may be missing drivers in this kernel. If so maybe you can ask @balbes150 to add a CONFIG if you know which one.

I have no problem going PM. I will give you my email address.

PS: consider trying khadas HW. It is cool DIY stuff.
Back to top
View user's profile Send private message
erm67
l33t
l33t


Joined: 01 Nov 2005
Posts: 653
Location: EU

PostPosted: Tue Nov 20, 2018 11:37 am    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 problem using a mainline kernel is the dtb, try all of them and if you are lucky one of the dtbs will work otherwise you'll have to hack a dtb for your device. I gave up using mailine since the eth was crashing every other day, I am back using libreelec kernel and for the moment it works fine. As mDup said it is the sources released by amlogic and hacked by a lot of people @ libreelec now that kszaq gave up development, it works as long as you don't desire recent linux kernel features like btrfs. The logs filling with exception traces caused by missing syscalls (emerge & systemd) can be fixed by:
Code:
echo 0 > /proc/sys/debug/exception-trace

_________________
Ok boomer
True ignorance is not the absence of knowledge, but the refusal to acquire it.
Ab esse ad posse valet, a posse ad esse non valet consequentia

My fediverse account: @erm67@erm67.dynu.net
Back to top
View user's profile Send private message
The_Pope
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2016
Posts: 111

PostPosted: Tue Nov 20, 2018 11:45 am    Post subject: Reply with quote

erm67 wrote:
I gave up using mailine since the eth was crashing every other day, I am back using libreelec kernel and for the moment it works fine.


Wow, if only I knew how to import that other kernel. I can find one LE version that works on this box quite easily, also it already has a working version installed on the internal eMMC. I couldn't care less what kernel version it is, I only need the hardware to be recognized and the hardware acceleration.

EDIT: I have booted Libreelec and tried to use it as a live medium from which to setup Gentoo. It failed because I couldn't chroot from it. I did the following:

- enabled ssh access to Libreelec
- logged in remotely via ssh, as root
- essentially followed the Gentoo handbook
- when trying to chroot into the Gentoo medium, it returned an error

iirc I had to set up the partitions on a different computer, too
_________________
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: 212

PostPosted: Tue Nov 20, 2018 6:34 pm    Post subject: Reply with quote

erm67 wrote:
The_Pope wrote:
Hi again,

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


The problem using a mainline kernel is the dtb, try all of them and if you are lucky one of the dtbs will work otherwise you'll have to hack a dtb for your device. I gave up using mailine since the eth was crashing every other day, I am back using libreelec kernel and for the moment it works fine. As mDup said it is the sources released by amlogic and hacked by a lot of people @ libreelec now that kszaq gave up development, it works as long as you don't desire recent linux kernel features like btrfs. The logs filling with exception traces caused by missing syscalls (emerge & systemd) can be fixed by:
Code:
echo 0 > /proc/sys/debug/exception-trace

@erm67

I have 3 dtb's where adding 'eee-broken-1000t' to "eth_phy0: ethernet-phy@0" dts section may have helped
(I have no eth issues anymore)
meson-gxbb-p200 [for s905 minimx-g]
meson-gxm-khadas-vim2 or meson-gxm-q200 [for vim2]
Mainline 4.19.x works fine for me. But, of course, no HW accelerated gfx for s912.
It looks like more and more amlogic (in particular meson) support enters mainline linux.


Last edited by mDup on Tue Nov 20, 2018 6:43 pm; edited 1 time in total
Back to top
View user's profile Send private message
mDup
Apprentice
Apprentice


Joined: 14 Apr 2006
Posts: 212

PostPosted: Tue Nov 20, 2018 6:41 pm    Post subject: Reply with quote

The_Pope wrote:
erm67 wrote:
I gave up using mailine since the eth was crashing every other day, I am back using libreelec kernel and for the moment it works fine.


Wow, if only I knew how to import that other kernel. I can find one LE version that works on this box quite easily, also it already has a working version installed on the internal eMMC. I couldn't care less what kernel version it is, I only need the hardware to be recognized and the hardware acceleration.

EDIT: I have booted Libreelec and tried to use it as a live medium from which to setup Gentoo. It failed because I couldn't chroot from it. I did the following:

- enabled ssh access to Libreelec
- logged in remotely via ssh, as root
- essentially followed the Gentoo handbook
- when trying to chroot into the Gentoo medium, it returned an error

iirc I had to set up the partitions on a different computer, too


@The_Pope
If you build LE for your device yourself you should find the kernel and modules (in kernel source directory).
Note that LE is a bit special because it overlays modules from some dedicated repository.
But again, once built, kernel and modules are there.
There you should find what's needed to make your Gentoo SD card (combined with some existing gentoo stage3).
Which Gentoo handbook do you refer to? Perhaps arm64 is a bit wild west still.

@erm67
You are 'back using libreelec kernel' perhaps you can tell The_Pope how to use it and where to find it?
Back to top
View user's profile Send private message
The_Pope
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2016
Posts: 111

PostPosted: Tue Nov 20, 2018 8:54 pm    Post subject: Reply with quote

mDup wrote:

If you build LE for your device yourself you should find the kernel and modules (in kernel source directory).
Note that LE is a bit special because it overlays modules from some dedicated repository.
But again, once built, kernel and modules are there.
There you should find what's needed to make your Gentoo SD card (combined with some existing gentoo stage3).
Which Gentoo handbook do you refer to? Perhaps arm64 is a bit wild west still.


If I can download the sources somewhere easily (like git clone or svn or whatever) and I don't need to set up overlays myself, I should be fine.

I tend to follow the x86 / x64 handbook (pretty much the same thing, really) and try to find workarounds when things aren't ready on arm64. For arm there is just one "handbook" - https://wiki.gentoo.org/wiki/Embedded_Handbook but it doesn't say much, except "U-boot has its' own documentation that we won't duplicate here, go read it at the source directly" without any warning about how cryptic it is. EDIT: It also says how to set up a cross compiler, but I personally find that way too complicated, as there's always some sort of Linux build for a lot of devices, that you can use as the initial boot media.

mDup wrote:

@erm67
You are 'back using libreelec kernel' perhaps you can tell The_Pope how to use it and where to find it?


That would be fantastic, although trying to pull the sources within a Gentoo installation may work, as well. Still, this particular option is not to be ignored. You never know who would need it and in what circumstances.
_________________
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: 212

PostPosted: Tue Nov 20, 2018 9:43 pm    Post subject: Reply with quote

The_Pope wrote:
If I can download the sources somewhere easily (like git clone or svn or whatever) and I don't need to set up overlays myself, I should be fine.


The (cross) building arm LE on Intel is easy (on linux), but needs a decent computer and CPU time and disk space,
as it first sets up a self contained cross build environment.
I never bothered figuring out the LE build magic to add the extra (often media device related) kernel modules and patches from various repositories.
This topic deviates a bit from arm Gentoo in general. You can find LE build instructions on LE forums.
Back to top
View user's profile Send private message
The_Pope
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2016
Posts: 111

PostPosted: Tue Nov 20, 2018 11:21 pm    Post subject: Reply with quote

Heh, no, I don't want cross building. I want to build on the target machine. I never use make.conf values like -march=native, it's always as exact as I can find. I take the time to read lists of possible values for that. I also was advised to run

Code:
gcc -### -march=native -E /usr/include/stdlib.h 2>&1 | grep "/usr/libexec/gcc/.*cc1"


in order to find out what I can safely use. Also, cpuid2cpuflags is very useful.

As a result, I use:

Code:
CFLAGS="-march=armv8-a+crc -mtune=cortex-a53 -mlittle-endian -mabi=lp64 -O2 -pipe


What I'd need is to compile the LE kernel inside the Gentoo chroot. Or, copy it directly somehow, if that's possible.
_________________
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: 212

PostPosted: Wed Nov 21, 2018 12:58 pm    Post subject: Reply with quote

The_Pope wrote:
Heh, no, I don't want cross building. I want to build on the target machine. I never use make.conf values like -march=native, it's always as exact as I can find. I take the time to read lists of possible values for that. I also was advised to run

Code:
gcc -### -march=native -E /usr/include/stdlib.h 2>&1 | grep "/usr/libexec/gcc/.*cc1"


in order to find out what I can safely use. Also, cpuid2cpuflags is very useful.

As a result, I use:

Code:
CFLAGS="-march=armv8-a+crc -mtune=cortex-a53 -mlittle-endian -mabi=lp64 -O2 -pipe


What I'd need is to compile the LE kernel inside the Gentoo chroot. Or, copy it directly somehow, if that's possible.


I understand march=native may not be perfect for your machine, but the purpose of a universal stage 3 is to be generic.
Feel free to rebuild with flags and settings that meet your specific requirements.
To compile the LE kernel inside the Gentoo chroot you may need to study the LE build scripts.
For me they are a bit of a black box I hardly ever open.
Because cross building LE is so easy.
Directly copying from LE may be possible. The kernel is in /flash and the modules are in /lib/modules/.
I am not sure though what format kernel is in and if it boots with balbes150 Armbian /boot scripts. erm67 might know.
Back to top
View user's profile Send private message
erm67
l33t
l33t


Joined: 01 Nov 2005
Posts: 653
Location: EU

PostPosted: Fri Nov 23, 2018 9:44 pm    Post subject: Reply with quote

@The_Pope
Sorry for the late answer, I am a bit busy lately ...
As you might know now wrxtasy is maintainig the s9xx port (he also contributes lots of patches previously)
https://github.com/wrxtasy/LibreELEC.tv/blob/master/packages/linux/package.mk

I just use the package make file to find the correct sources, currently it is this one for the 3.14 release (the most stable)
https://github.com/LibreELEC/linux-amlogic/archive/eb7e852.tar.gz
There are than a few patches and the media build if you need updated dvb drivers
_________________
Ok boomer
True ignorance is not the absence of knowledge, but the refusal to acquire it.
Ab esse ad posse valet, a posse ad esse non valet consequentia

My fediverse account: @erm67@erm67.dynu.net


Last edited by erm67 on Fri Nov 23, 2018 10:01 pm; edited 1 time in total
Back to top
View user's profile Send private message
erm67
l33t
l33t


Joined: 01 Nov 2005
Posts: 653
Location: EU

PostPosted: Fri Nov 23, 2018 9:46 pm    Post subject: Reply with quote

mDup wrote:
erm67 wrote:
The_Pope wrote:
Hi again,

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


The problem using a mainline kernel is the dtb, try all of them and if you are lucky one of the dtbs will work otherwise you'll have to hack a dtb for your device. I gave up using mailine since the eth was crashing every other day, I am back using libreelec kernel and for the moment it works fine. As mDup said it is the sources released by amlogic and hacked by a lot of people @ libreelec now that kszaq gave up development, it works as long as you don't desire recent linux kernel features like btrfs. The logs filling with exception traces caused by missing syscalls (emerge & systemd) can be fixed by:
Code:
echo 0 > /proc/sys/debug/exception-trace

@erm67

I have 3 dtb's where adding 'eee-broken-1000t' to "eth_phy0: ethernet-phy@0" dts section may have helped
(I have no eth issues anymore)
meson-gxbb-p200 [for s905 minimx-g]
meson-gxm-khadas-vim2 or meson-gxm-q200 [for vim2]
Mainline 4.19.x works fine for me. But, of course, no HW accelerated gfx for s912.
It looks like more and more amlogic (in particular meson) support enters mainline linux.

I will try this asap :-)
My server is headless but there is a driver called panfrost coming for accelerated graphics that could support the S912 as well
https://gitlab.freedesktop.org/panfrost
that is being developed by this fine lady
https://rosenzweig.io/blog/
I have not tested if is works
_________________
Ok boomer
True ignorance is not the absence of knowledge, but the refusal to acquire it.
Ab esse ad posse valet, a posse ad esse non valet consequentia

My fediverse account: @erm67@erm67.dynu.net
Back to top
View user's profile Send private message
mDup
Apprentice
Apprentice


Joined: 14 Apr 2006
Posts: 212

PostPosted: Sat Nov 24, 2018 12:08 am    Post subject: Reply with quote

erm67 wrote:
[...]
I will try this asap :-)
My server is headless but there is a driver called panfrost coming for accelerated graphics that could support the S912 as well
https://gitlab.freedesktop.org/panfrost
that is being developed by this fine lady
https://rosenzweig.io/blog/
[...]


Thanks for panfrost suggestion.
Which dts file do you need for your server box?
The meson-gxbb-p200 patch for my minimx-g was

Code:
-               eth_phy0: ethernet-phy@3 {
-                       /* Micrel KSZ9031 (0x00221620) */
-                       reg = <3>;
+               eth_phy0: ethernet-phy@0 {
+                       reg = <0>;
+                       eee-broken-1000t;


note the @3 became @0
Back to top
View user's profile Send private message
erm67
l33t
l33t


Joined: 01 Nov 2005
Posts: 653
Location: EU

PostPosted: Sat Nov 24, 2018 11:15 am    Post subject: Reply with quote

I use the q200 or vim2 dtb ....

You shouldn't use -march=native to compile binaries that you intend to distribute because they will probably not work on every Amlogic S9xx cpu. I know because some binaries compiled with -march=native on the old beelink segafaults on the S912, I never investigated the reasons.

EDIT:

Code:

kvim2-extra ~ # dd if=/dev/urandom of=/mnt/test bs=256k count=1000000
^C6756+0 records in
6756+0 records out
1771044864 bytes (1.8 GB, 1.6 GiB) copied, 35.603 s, 50.0 MB/s


It looks good, probably that was the problem, thank you.
_________________
Ok boomer
True ignorance is not the absence of knowledge, but the refusal to acquire it.
Ab esse ad posse valet, a posse ad esse non valet consequentia

My fediverse account: @erm67@erm67.dynu.net
Back to top
View user's profile Send private message
The_Pope
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2016
Posts: 111

PostPosted: Mon Nov 26, 2018 6:33 pm    Post subject: Reply with quote

erm67 wrote:
@The_Pope
Sorry for the late answer, I am a bit busy lately ...
As you might know now wrxtasy is maintainig the s9xx port (he also contributes lots of patches previously)
https://github.com/wrxtasy/LibreELEC.tv/blob/master/packages/linux/package.mk

I just use the package make file to find the correct sources, currently it is this one for the 3.14 release (the most stable)
https://github.com/LibreELEC/linux-amlogic/archive/eb7e852.tar.gz
There are than a few patches and the media build if you need updated dvb drivers


Thank you, that does answer some questions. No, I don't need updated dvb drivers so that's less complications.

But how do I do this? I need explanations like I was a kid. Do I prepare a USB stick with a bootable Linux (maybe Libreelec?) and erase the data partition, extract Gentoo stage3 there and when I get to the kernel, I should use those "linux-amlogic" sources off github? The only way I can imagine using them is just to unpack them in /usr/src/whatever and then create a symlink to /usr/src/linux and then use make to build the kernel. That, however, won't make the stick bootable, I'd then have to use the mDup method to make it bootable?

Code:
export ARCH=arm64
export LINUX=4.19.1-gentoo

make clean
make mrproper
make distclean

copy .config
make oldconfig
make prepare

make -j7 Image
make -j7 modules
make dtbs

cp -p arch/$ARCH/boot/dts/amlogic/*.dtb /boot/dtb
make modules_install

eselect kernel set linux-$LINUX
dracut initramfs-dracut-arm64-$LINUX $LINUX

cp -p initramfs-dracut-arm64-$LINUX initrd.img
mkimage -A $ARCH -O linux -T ramdisk -C none -a 0 -e 0 -n uinitrd -d initrd.img uInitrd

cp -p arch/$ARCH/boot/Image /boot/zImage
cp -p uInitrd /boot

cp -p .config /boot/config-$LINUX
cp -p System.map /boot/System.map-$LINUX

cp -p initramfs-dracut-arm64-$LINUX /boot
cp -p initrd.img /boot/initrd.img-$LINUX

unset LINUX
unset ARCH

_________________
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: 212

PostPosted: Tue Nov 27, 2018 9:44 am    Post subject: Reply with quote

The_Pope wrote:

[...]
Thank you, that does answer some questions. No, I don't need updated dvb drivers so that's less complications.
That, however, won't make the stick bootable, I'd then have to use the mDup method to make it bootable?


How you make a kernel should be standard. For arm64 you also make dtbs.
3.14 IIRC needs gcc-4 to easily compile.
I don't make a stick or SD bootable myself.
I use one made from balbes150 image and replace few own made (zImage uInitrd ...) files in /boot [and modules in other partition].
I never tried a stick (only SD). For kvim2 I do have commands to make any SD bootable (by writing kvim2 u-boot to it):
Code:
dd if=u-boot.bin.sd.bin of=/dev/sdb conv=fsync,notrunc bs=1 count=444
dd if=u-boot.bin.sd.bin of=/dev/sdb conv=fsync,notrunc bs=512 skip=1 seek=1

Not sure though if that works for any device and, of course, you need the u-boot.bin.sd.bin of the device.
In any case : balbes150 Armbian images boot when written to SD (and using correct dtb) so one can simply reuse the SD for gentoo.
The partitions have labels that are used in scripts to find boot and root.
Back to top
View user's profile Send private message
erm67
l33t
l33t


Joined: 01 Nov 2005
Posts: 653
Location: EU

PostPosted: Tue Nov 27, 2018 2:59 pm    Post subject: Reply with quote

Well we should write some howto in the wiki now that the stable kernel works well :-)

You should use gcc 5.4 to compile but IIRC libreelec/odroid patched the 3.14 to compile with gcc 6.x.
Since you compile a dedicated kernel probably all drivers required to boot are compiled-in and recreate the initrd is not absolutely required, what you need is a kernel image with the name zImage in the boot directory.
The board uses the uboot bootloader that will execute the s905_autoscript that will:
load a file named 'zImage' as kernel
load a file named 'uInitrd' as initrd
load a file named 'uEnv.ini' that contains some useful variables like kernel parameters (like scsi_mod.use_blk_mq=1) and dtb name

at this point it will boot the kernel using initrd, dtb, and parameters .

uboot doesn't support all compression methods for the kernel and initrd, just stick to gzip or uncompressed (slow).

To compile get a .config from LE and than
Code:

odroid@odroid64:~/linux$ make -j4
odroid@odroid64:~/linux$ sudo make modules_install
odroid@odroid64:~/linux$ sudo cp -f arch/arm64/boot/Image /boot/zImage
odroid@odroid64:~/linux$ sudo sync
odroid@odroid64:~/linux$ sudo reboot

Even if you have 8 CPUs 2Gb ram is most of the time not enough to run 8 compile threads, j4 works for the kernel but emerge sometime fails (i.e boost).

A lot of thing do not work on the 3.14 kernel: blk_mq, irqbalance, swap over iscsi, btrfs and a lot I don't remember atm.
_________________
Ok boomer
True ignorance is not the absence of knowledge, but the refusal to acquire it.
Ab esse ad posse valet, a posse ad esse non valet consequentia

My fediverse account: @erm67@erm67.dynu.net
Back to top
View user's profile Send private message
The_Pope
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2016
Posts: 111

PostPosted: Wed Nov 28, 2018 2:19 am    Post subject: Reply with quote

Great news. I managed to chroot from inside Libreelec. Easy:

- Boot Libreelec (needs proper dtb file to be renamed as dtb.img as you'd imagine - at least I appear to use the exact same one, gxbb_p200_2G_1Gbit.dtb, have no idea how to modify it so that my wired ethernet port works properly)
- enable ssh
- log in remotely from a different computer
- I use a second USB stick, where I also had Libreelec installed, but with the data partition erased (not formatted, just "rm -rf *") and mount it to be the future Gentoo data partition
- I also mounted the second stick's boot partition into, predictably, /boot
- Get stage three tarball and unpack it in the freshly emptied data partition
- create/edit make.conf (including the line GENTOO_MIRRORS="...")
- mkdir /mnt/gentoo/etc/portage/repos.conf (in my case the path actually started with ~/mnt/gentoo)
- cp /mnt/gentoo/usr/share/portage/config/repos.conf /mnt/gentoo/etc/portage/repos.conf/gentoo.conf
- cp /etc/resolv.conf /mnt/gentoo/etc/
- mount -t proc /proc /mnt/gentoo/proc (this command was what I didn't do before and why chrooting didn't work! The Gentoo tutorial says "mount --types" which doesn't work on Libreelec, as it's an older version)
- mount --rbind /sys /mnt/gentoo/sys
- mount --rbind /dev /mnt/gentoo/dev
- chroot /mnt/gentoo /bin/bash

From now on, things are pretty much the same as if booting some Gentoo CD on a normal system.

I will report back to when I get to the kernel sources - will download the exact tar.gz file provided by erm67, unpack it in /usr/src and then make the symlink manually, like they say here.

After that, I will probably need some guidance.

Also, my threads count is set to 4. In other words, 3 cores plus 1. This machine supposedly has an 8-core processor, but I read somewhere that the Mali-450 GPU is 5-core.

Now doing the first emerge @world.
_________________
Stop the world. I want to descend.
Back to top
View user's profile Send private message
erm67
l33t
l33t


Joined: 01 Nov 2005
Posts: 653
Location: EU

PostPosted: Wed Nov 28, 2018 7:53 am    Post subject: Reply with quote

use /proc/config.gz as .config
_________________
Ok boomer
True ignorance is not the absence of knowledge, but the refusal to acquire it.
Ab esse ad posse valet, a posse ad esse non valet consequentia

My fediverse account: @erm67@erm67.dynu.net
Back to top
View user's profile Send private message
The_Pope
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2016
Posts: 111

PostPosted: Wed Nov 28, 2018 4:42 pm    Post subject: Reply with quote

erm67 wrote:
use /proc/config.gz as .config


Eeeexcept there isn't such a file there. Should I go make menuconfig... ?

EDIT: wait, that doesn't work, either:

Code:
Makefile:515: /usr/src/linux-3.14-amlogic/arch//Makefile: No such file or directory
make: *** No rule to make target '/usr/src/linux-3.14-amlogic/arch//Makefile'.  Stop.

_________________
Stop the world. I want to descend.
Back to top
View user's profile Send private message
erm67
l33t
l33t


Joined: 01 Nov 2005
Posts: 653
Location: EU

PostPosted: Wed Nov 28, 2018 7:53 pm    Post subject: Reply with quote

The_Pope wrote:
erm67 wrote:
use /proc/config.gz as .config


Eeeexcept there isn't such a file there. Should I go make menuconfig... ?

EDIT: wait, that doesn't work, either:

Code:
Makefile:515: /usr/src/linux-3.14-amlogic/arch//Makefile: No such file or directory
make: *** No rule to make target '/usr/src/linux-3.14-amlogic/arch//Makefile'.  Stop.

You are missing the ARCH env variable ...

You don't need to compile a kernel if you are satisfied with the binary one from LE, I used it this way with LE installed on the emmc and gentoo in a usb stick for some time.
Just copy the /lib/modules/* from LE partition to the gentoo partition (always in /lib/modules/) than use
Code:
systemd switch-root /mnt/gentoo

I remember I set this command in a script that was executed after boot :-)
_________________
Ok boomer
True ignorance is not the absence of knowledge, but the refusal to acquire it.
Ab esse ad posse valet, a posse ad esse non valet consequentia

My fediverse account: @erm67@erm67.dynu.net
Back to top
View user's profile Send private message
The_Pope
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2016
Posts: 111

PostPosted: Wed Dec 05, 2018 10:53 am    Post subject: Reply with quote

erm67 wrote:

You don't need to compile a kernel if you are satisfied with the binary one from LE, I used it this way with LE installed on the emmc and gentoo in a usb stick for some time.
Just copy the /lib/modules/* from LE partition to the gentoo partition (always in /lib/modules/) than use
Code:
systemd switch-root /mnt/gentoo

I remember I set this command in a script that was executed after boot :-)


Oh, I'd rather not compile a new kernel, yes, thank you for that. But again, please break it into steps.

I booted off a LE USB stick and, again, I installed Gentoo on the data partition of a second LE USB stick. I literally boot from one stick and after it boots, insert the second one. All the Gentoo stuff is done as root via ssh, in my case Putty.

Now, when I get to the kernel, you say I should copy the modules to the Gentoo partition. Yes, I did that. But, for instance, it will still unpack that LE filesystem from the boot partition. It won't boot the Gentoo partition.
The command systemd switch-root /mnt/gentoo - I use openrc in Gentoo. But it looks like I should do that outside the chroot. Libreelec, so outside the Gentoo chroot, doesn't have that command. It only has:

Code:
systemd-analyze                 systemd-machine-id-setup
systemd-ask-password            systemd-mount
systemd-cat                     systemd-notify
systemd-cgls                    systemd-path
systemd-cgtop                   systemd-run
systemd-delta                   systemd-socket-activate
systemd-detect-virt             systemd-stdio-bridge
systemd-escape                  systemd-tmpfiles
systemd-hwdb                    systemd-tty-ask-password-agent
systemd-inhibit


I'm aiming for an independent Gentoo install, that boots on its' own. I copied the modules. Now should I look for a "switch root" command for openrc, to run inside the Gentoo chroot?
_________________
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: 212

PostPosted: Fri Dec 07, 2018 1:17 am    Post subject: Reply with quote

The_Pope wrote:
[...]It won't boot the Gentoo partition.[...]

Start from an SD or USB stick that already boots gentoo (if such exists for your device).
It will have the u-boot installed and its aml scripts in /boot.
Recently balbes comes with a 2018 flavor but 2015 is fine certainly if you want 3.x kernel.
Then, once booted into that gentoo. Modify it at your imagination. The kernel, init ram fs and modules are what can make you downgrade to 3.x.
You may need to build some yourself. The LE and Armbian boot is different. I have almost always made Gentoo boot media from existing, working Armbian ones.
If you do not find a Gentoo SD that boots and has, say, network working, then search for an Armbian.
If no Armbian boots as you would want, perhaps your HW is not common.
By the way: sorry to ask, most probably you told so: which HW are you targeting?
Later I also went to boot gentoo from eMMC but that's another story.
It works on khadas vim2 but, first test on minimx-g did not succeed, probably my bad.
fwiw, the gentoo I use is openrc, not systemd, centric.
Good luck.
Back to top
View user's profile Send private message
The_Pope
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2016
Posts: 111

PostPosted: Fri Dec 07, 2018 10:54 am    Post subject: Reply with quote

I tried to boot from an Armbian. That one detects both network interfaces but neither of them actually work - one wifi and one wired networking adapter.
LibreElec detects both and while the wired one doesn't get an IP properly, at least wi-fi works fine.
With Armbian, I had to use a USB wifi adapter. Not to mention the Mali GPU barely supported, which works fine under LE.

Neither Armbian nor Libreelec are good as boot media, since booting from a USB stick with either of them and trying to create another bootable USB stick with Gentoo on it fails miserably. Again, the second USB stick is a LE or Armbian stick itself, just that the root partition is emptied and a Gentoo stage3 unpacked in it. So it will have u-boot and the exact same boot partition, which I religiously mount into Gentoo's /boot before chrooting.

The hardware looks exactly like this one. So I'm assuming the specs on that page match my hardware.

I vaguely remember trying the 2018 Gentoo image and that one also didn't detect the network interfaces. I try Armbian, someone tells me that uses dtb files and that's limited so why not use the Libreelec kernel. I try LE, someone else tells me to try Armbian.

If I'm going through this hell, at least I'd like to try a kernel + modules that work, so I prefer Libreelec.

The latest wonderful development is that llvm, version 6.0.1, doesn't compile and it's needed in an emerge (using Libreelec as boot media). It either freezes somewhere at the 180th compilation step (out of 1000+) or fails during compilation, at one of two possible points. I'm going to try to reduce the number of threads for now.
_________________
Stop the world. I want to descend.
Back to top
View user's profile Send private message
erm67
l33t
l33t


Joined: 01 Nov 2005
Posts: 653
Location: EU

PostPosted: Fri Dec 07, 2018 2:23 pm    Post subject: Reply with quote

The_Pope wrote:
I tried to boot from an Armbian. That one detects both network interfaces but neither of them actually work - one wifi and one wired networking adapter.
LibreElec detects both and while the wired one doesn't get an IP properly, at least wi-fi works fine.
With Armbian, I had to use a USB wifi adapter. Not to mention the Mali GPU barely supported, which works fine under LE.

Neither Armbian nor Libreelec are good as boot media, since booting from a USB stick with either of them and trying to create another bootable USB stick with Gentoo on it fails miserably. Again, the second USB stick is a LE or Armbian stick itself, just that the root partition is emptied and a Gentoo stage3 unpacked in it. So it will have u-boot and the exact same boot partition, which I religiously mount into Gentoo's /boot before chrooting.

The hardware looks exactly like this one. So I'm assuming the specs on that page match my hardware.

I vaguely remember trying the 2018 Gentoo image and that one also didn't detect the network interfaces. I try Armbian, someone tells me that uses dtb files and that's limited so why not use the Libreelec kernel. I try LE, someone else tells me to try Armbian.

If I'm going through this hell, at least I'd like to try a kernel + modules that work, so I prefer Libreelec.

The latest wonderful development is that llvm, version 6.0.1, doesn't compile and it's needed in an emerge (using Libreelec as boot media). It either freezes somewhere at the 180th compilation step (out of 1000+) or fails during compilation, at one of two possible points. I'm going to try to reduce the number of threads for now.


Are you using the original dtb?
_________________
Ok boomer
True ignorance is not the absence of knowledge, but the refusal to acquire it.
Ab esse ad posse valet, a posse ad esse non valet consequentia

My fediverse account: @erm67@erm67.dynu.net
Back to top
View user's profile Send private message
The_Pope
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2016
Posts: 111

PostPosted: Fri Dec 07, 2018 4:54 pm    Post subject: Reply with quote

erm67 wrote:

Are you using the original dtb?


The original as in the dtb.img file in the original 8.2.3.1 image from kszaq? No, I'm using... gxbb_p200_2G_1Gbit.dtb.
_________________
Stop the world. I want to descend.
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, 8, 9, 10  Next
Page 8 of 10

 
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