Explore the Kernel make install secret
I have used Linux for quite some years but SBC is new to me.
I have an Atheros AR9271 network card which is plug-n-play on RPi.  On rock64, lsusb recognize it out of the box.  Google says I need the following in my kernel to make it works.

I use ayufan's stretch-minimal-rock64-0.5.15-136-arm64.img
I use sdcard (instead of emmc)
I use serial console
To take advantage of the 4G ram, I compile the kernel on board instead of using CC.
A brief summary of steps I take, after apt update upgrade
Quote:$ sudo apt-get install python2.7-minimal
$ sudo ln -s python2.7 python      ... at /usr/bin
$ sudo apt-get install libncurses5-dev bc
$ git clone --depth 1 --single-branch -b release-4.4 https://github.com/ayufan-rock64/linux-kernel
$ cd linux-kernel
$ make rockchip_linux_defconfig
$ make menuconfig     ... to config ATH9K
$ make -j 5

then ...

I had tried a couple of combinations of
Quote:sudo cp ./arch/arm/boot/*(u)*(z)Image ./arch/arm/boot/dts/*.dtb <boot-partition>
sudo make modules_install
sudo make firmware_install
from https://github.com/umiddelb/armhf/wiki/H...ARM-device (a copy from ODROID Magazine)
No luck.  But it took almost 3 hours every time I dd back the pre-make-install image onto my 32G sdcard.

I read
referred by Port Arch Linux to Rock64
On which, after kernel compilation, it is rootfs compilation.  Not apply on my case, but directs me to think that my problem is very rock64 specific.

I enter the freshly learned u-boot shell, run printenv
I trace bootcmd -> distro_bootcmd -> list of boot_targets (mmc0 mmc1 usb0 pxe dhcp) and some how I noted from somewhere that sdcard is mmc1 -> setenv devnum (what is it relevant to?) 1 -> mmc_boot ... ... where should I refer to in order to understand what they are?  Should it be from u-boot or rock64?  Must I learn it all in order to do a "make install"?

Luke had responsed to a similar question on https://forum.pine64.org/showthread.php?...9#pid35059
For the IRC Log
I searched "make install" in #Rock64 channel, it appears 10 times only.
The only one that is about kernel installation is in a conversation between ayufan and xalius.
ayufan asked xalius how he install the kernel, xalius answered "copy".  Of course, why should they detail the details in their conservation.  Good to know "copy" works.
For the link to "all you need to know"
which is in fact https://github.com/ayufan-rock64/linux-build
docker? okay, why not give it a try if it works, I can learn something new too.  I set up a Ubuntu 17.10 vm, installed docker-ce and binfmt support, tested work.
the _Next_ step is "make shell".  What I get is >> make: *** No rule to make target 'shell'.  Stop.
I should expect this because rock64 is for developer.  What is broken is my knowledge, not the document.

By the end of the day, I only need to know how to put/link correctly Image, initrd, dtb in rock64 way, am I?  Must I get familiar with those developer's stuffs before I can work back those basic/simples?

Rock64 mounts mmcblk1p6 to /boot/efi instead of /boot; with similar set of files named differently at both locations.  This is not a secret.  But rock64 uses which set to boot; and which is the correct original file to copy?

Any advice on how should I proceed?

Thanks in advance for your help after 10 days of reading in vain.

Hope my experience won't scare away much potential rock64 customers who search and read.
@ xalius,  Thanks for your reply on another post (quote below) I just saw.

Quote:The 'correct' way to do this is like ayufan does to make a debian package and then use flash-kernel to update the things in /boot and /lib/modules... I usually do it quick and dirty when I try things out and just copy Image to /boot/efi and the modules to /lib/modules manually... but make backups before you do that in case your new kernel doesn't work as expected or something goes wrong while moving the files around...

I guess with more and more people building their own configs and kernel versions, we need to write some tutorial on how to do that on ARM boards, but it's not really different from PC's, just that usually there is u-boot instead of grub and the additional issue of updating the dtb (devicetree) in case there were changes in the hardware config...

I use your quick and dirty approach, following the "make -j 5", I
$ sudo make modules_install        # it creates /lib/modules/4.4.112-g4865855c/...
$ sudo make firmware_install
$ sudo cp /home/me/linux-kernel/arch/arm64/boot/Image /boot/efi/Image
$ sudo cp /home/me/linux-kernel/drivers/net/wireless/ath/ath9k/{ath9k.ko, ath9k_common.ko, ath9k_htc.ko, ath9k_hw.ko} /lib/modules/4.4.112-g4865885c/kernel/net/wireless/ath/ath9k/.

I ignore the arch/arm64/boot/dts/rockchip/rk3328-rock64.dtb this time

I can now modprobe ath9k.
But "ip a" does not show the new device, I check dmesg
[email protected]:~$ dmesg | grep ath                                               
[    4.825180] systemd[1]: Reached target Paths.                                
[    6.620774] usb 4-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested
[    6.637612] usb 4-1: Direct firmware load for ath9k_htc/htc_9271-1.4.0.fw fai
led with error -2                                                               
[    6.637638] usb 4-1: ath9k_htc: Firmware htc_9271.fw requested               
[    6.637722] usb 4-1: ath9k_htc: Failed to get firmware htc_9271.fw           
[    6.648731] usb 4-1: ath9k_htc: USB layer deinitialized                      
[    6.648988] usbcore: registered new interface driver ath9k_htc
all three usb ports give same error.

Is it dtb related?
I better try other kernel source (mainline, vanilla, etc)
You need to install the ubuntu/debian firmware packages...

Come have a chat in the Pine A64 IRC channel >>
(02-27-2018, 08:57 AM)xalius Wrote: You need to install the ubuntu/debian firmware packages...


Million Thanks.  I have it be forgot completely.

It works now. Heart

Still look forward to the tutorial of the "correct" way. Big Grin
Hope will see it before I forget all those hard-to-digest readings.

Possibly Related Threads...
Thread Author Replies Views Last Post
  Does anybody run the mainline kernel? CameronNemo 1 60 08-17-2019, 07:27 PM
Last Post: suberimakuri
  Can Anyone help me install Wine latest on Rock64 Rock90 1 183 08-10-2019, 06:18 AM
Last Post: OnyxxOr
  ROCK64 Kernel compilation problem cao 0 251 01-21-2019, 01:21 AM
Last Post: cao
  LibreELEC Krypton/Leia/Agile 64bit kernel 32bit libs Raybuntu 193 45,497 01-17-2019, 05:25 AM
Last Post: [email protected]
Smile Adding a new kernel module a1w.ca 1 233 01-07-2019, 01:57 AM
Last Post: tllim
  apt --fix-broken install KC7NOA 1 252 10-29-2018, 09:17 PM
Last Post: KC7NOA
  HELP I want install a desktop but I don't Know how can I do gedas07 11 1,179 10-02-2018, 01:34 PM
Last Post: jovval
  How to choose kernel to boot mjd 6 469 10-02-2018, 12:28 PM
Last Post: mjd
  Freeze/reboot/errors when compiling - unable to make - reproducible and not isolated jovval 2 265 10-02-2018, 08:10 AM
Last Post: jovval
  Managed to install Kubernetes digitaldaz 2 592 09-29-2018, 09:05 PM
Last Post: suberimakuri

Forum Jump:

Users browsing this thread: 1 Guest(s)