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
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
l33t
l33t


Joined: 01 Nov 2005
Posts: 653
Location: EU

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.
_________________
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
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
l33t
l33t


Joined: 01 Nov 2005
Posts: 653
Location: EU

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

Use the latest original dtb (or none) first.
_________________
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
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
l33t
l33t


Joined: 01 Nov 2005
Posts: 653
Location: EU

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
_________________
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
balbes150
n00b
n00b


Joined: 03 Dec 2016
Posts: 10

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
l33t
l33t


Joined: 01 Nov 2005
Posts: 653
Location: EU

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.
_________________
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
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
l33t
l33t


Joined: 01 Nov 2005
Posts: 653
Location: EU

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 ...
_________________
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: 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
l33t
l33t


Joined: 01 Nov 2005
Posts: 653
Location: EU

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 :-)
_________________
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: 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
l33t
l33t


Joined: 01 Nov 2005
Posts: 653
Location: EU

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
_________________
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
balbes150
n00b
n00b


Joined: 03 Dec 2016
Posts: 10

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: 54232
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
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2016
Posts: 111

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

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 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 generic gentoo stage3 in a chroot, included specific kernel+modules, is
one thing but for booting it needs the necessary u-boot scripts for amlogic.

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
The_Pope
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2016
Posts: 111

PostPosted: Mon Nov 19, 2018 1:16 pm    Post subject: Reply with quote

Ok, thank you for that!

The year old image is probably easy enough to update. It will probably have an older profile and an older portage version, those are the essentials. The rest of the things can get updated pretty easily. So I personally don't need an updated image, but others may.

I would prefer, however, to know how to create my own image. The device already has multi-boot, in fact the internal memory has a LibreElec install on it. I'd happily put Gentoo there, later on.

For now, I definitely need to make the USB drive boot on its' own. I like to have control over my own partition layout, which is mostly why I want to generate bootable Gentoo USB drives on my own.

I boot this machine with balbes150's Armbian 5.64 build. Then chroot into Gentoo. Then what do I do to make it bootable? This is what I need answers for, at the moment. Do I have to copy aml_autoscript and s905_autoscript from the Armbian /boot partition? Okay.

But you say I need:

initrd.img-4.19.0-gentoo
System.map-4.19.0-gentoo
uInitrd
zImage

How can I get Gentoo to generate them, or which /boot Gentoo files correspond to these?

Again, Gentoo has this:

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

I don't think I have to care about the mismatched kernel versions, but the rest? vmlinuz from the Gentoo /boot is to be renamed to what? To zImage?
The initrd.img-4.19.0-rc7-aml-s9xxx file, how can I get Gentoo to generate an equivalent file, like you say, initrd.img-4.19.0-gentoo? Same question for the file "uInitrd" which you say is needed. I believe you, that's not the issue, but how do I get Gentoo to provide/generate it?!
_________________
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: Mon Nov 19, 2018 2:23 pm    Post subject: Reply with quote

The_Pope wrote:
Ok, thank you for that!

The year old image is probably easy enough to update. It will probably have an older profile and an older portage version, those are the essentials. The rest of the things can get updated pretty easily. So I personally don't need an updated image, but others may.

I would prefer, however, to know how to create my own image. The device already has multi-boot, in fact the internal memory has a LibreElec install on it. I'd happily put Gentoo there, later on.

For now, I definitely need to make the USB drive boot on its' own. I like to have control over my own partition layout, which is mostly why I want to generate bootable Gentoo USB drives on my own.

I boot this machine with balbes150's Armbian 5.64 build. Then chroot into Gentoo. Then what do I do to make it bootable? This is what I need answers for, at the moment. Do I have to copy aml_autoscript and s905_autoscript from the Armbian /boot partition? Okay.

But you say I need:

initrd.img-4.19.0-gentoo
System.map-4.19.0-gentoo
uInitrd
zImage

How can I get Gentoo to generate them, or which /boot Gentoo files correspond to these?

Again, Gentoo has this:

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

I don't think I have to care about the mismatched kernel versions, but the rest? vmlinuz from the Gentoo /boot is to be renamed to what? To zImage?
The initrd.img-4.19.0-rc7-aml-s9xxx file, how can I get Gentoo to generate an equivalent file, like you say, initrd.img-4.19.0-gentoo? Same question for the file "uInitrd" which you say is needed. I believe you, that's not the issue, but how do I get Gentoo to provide/generate it?!


To make a Gentoo SD boot disk I start (all credits go to balbes150) from an Armbian SD boot disk and

- replace boot partition uInitrd zImage dtb.img by own built ones
(the files with extension -4.19.1-gentoo are not needed in /boot AFAIK but I put them there)
- replace entire root partition filesystem by a gentoo one (e.g. one maintained in chroot) including kernel modules, of course

You normally do not need to change the scripts in /boot, but if you do, there are ways to make image versions from source (with mkimage)

FYI : I uploaded Gentoo_8gb_20181119.img.xz (which I made from Armbian 5.64) it is work in progress.
[since it is Armbian 5.64 based it can perhaps even be used to install to eMMC
(I did not try myself, the Armbian install script must be adjusted a bit to work in Gentoo, and parted needs to be emerged)]
URL : https://drive.google.com/drive/folders/15R4uYNUgp4QYLcQyWh3rOVrVGdlA47db

root passwd 1234
gentoo passwd gentoo
dtb for VIM2

the image is a dd of the SD like:
dd if=/dev/sdd of=Gentoo_8gb_20181119.img bs=512

to build kernel (e.g. on running arm64 gentoo system) roughly I do

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
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 19, 2018 5:19 pm    Post subject: Reply with quote

Oh, excellent. Thank you so much. That's what I was after, really.

I have a few questions, though. An older Gentoo user who keeps writing howto files (but for some reason, never published any of them - I guess he believes they're too specific) told me, for x86 and x64, to run genkernel negating clean and mrproper. So my reflex is to not do make clean and make mrproper - is that good, bad, acceptable?

He says that, before chrooting into Gentoo, one should do zcat /proc/config.gz > /mnt/gentoo/usr/src/linux/.config
You say make oldconfig and then make prepare. Isn't it better if I do what he said, then inside the chroot, make oldconfig AND make menuconfig? It's faaar less tedious to check everything with that text-mode menu interface.

Thirdly, make -j7 Image (I didn't specify any j value so that it uses the one in make.conf) failed: "make: *** [Makefile:1032: vmlinux] Error 1" and before that, a lot of undefined reference errors.

EDIT: Right, I did make oldconfig but then also make menuconfig, was indeed far easier to set everything I needed, closed and saved, then make Image worked.
But, funnily, make modules didn't work because I hadn't set "enable loadable modules support" ... :mrgreen:
_________________
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: Mon Nov 19, 2018 7:41 pm    Post subject: Reply with quote

The_Pope wrote:
Oh, excellent. Thank you so much. That's what I was after, really.

I have a few questions, though. An older Gentoo user who keeps writing howto files (but for some reason, never published any of them - I guess he believes they're too specific) told me, for x86 and x64, to run genkernel negating clean and mrproper. So my reflex is to not do make clean and make mrproper - is that good, bad, acceptable?

He says that, before chrooting into Gentoo, one should do zcat /proc/config.gz > /mnt/gentoo/usr/src/linux/.config
You say make oldconfig and then make prepare. Isn't it better if I do what he said, then inside the chroot, make oldconfig AND make menuconfig? It's faaar less tedious to check everything with that text-mode menu interface.

Thirdly, make -j7 Image (I didn't specify any j value so that it uses the one in make.conf) failed: "make: *** [Makefile:1032: vmlinux] Error 1" and before that, a lot of undefined reference errors.

EDIT: Right, I did make oldconfig but then also make menuconfig, was indeed far easier to set everything I needed, closed and saved, then make Image worked.
But, funnily, make modules didn't work because I hadn't set "enable loadable modules support" ... :mrgreen:


@The_Pope

Having similar purpose, dracut differs from genkernel (which requires --no-clean to not make clean and mrproper).
Also, genkernel had no support for arm64 last time I checked.

If the working .config is from same major version (say: 4.19.x and 4.19.y y>x), then usually no manual intervention is needed, and I 'make oldconfig'.
But, indeed, to adjust .config, or, to bump major version 'make menuconfig' may be more convenient.

I do not build arm64 kernel in a chroot (anymore), I run Gentoo from SD (and from eMMC very recently) and build native under Gentoo itself. Main part of the instructions does not care how you build, sometimes I even cross build kernel on amd64 (but, of course, making the initramfs cannot (AFAIK) easily be done in cross dev way).

Linux kernel make does not consult distro specific portage make.conf. Typically when I have n cores and enough RAM, I use n+1 for manual make flag.
But for arm64 I started to use n-1. Because not so much RAM in these boxes, so, if one has so many gcc or g++ compiling, one may start to swap when together they exceed available memory.

Good luck.

PS: I re-up-loaded Gentoo_8gb_20181119 image (md5sum 2c9c82fdcecffffeba39d019edc734ed), I think something may have gone wrong first time. Also, this is WIP, so do not attempt to install in eMMC unless you consult and adjust balbes150 Armbian scripts for that purpose. I do provide updated adjusted scripts though, but I did not (yet) test them.


Last edited by mDup on Mon Nov 19, 2018 11:29 pm; edited 1 time in total
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 19, 2018 11:01 pm    Post subject: Reply with quote

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.
_________________
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 7 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