Explore the Kernel make install secret
#1
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.
Quote:CONFIG_ATH_COMMON=m
CONFIG_ATH9K_HW=m
CONFIG_ATH9K_COMMON=m
CONFIG_ATH9K_HTC=m

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
http://opensource.rock-chips.com/images/...170711.pdf
referred by Port Arch Linux to Rock64
https://me.m01.eu/blog/2017/12/rock64-arch-linux/
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.
  Reply
#2
@ xalius,  Thanks for your reply on another post (quote below) I just saw.

https://forum.pine64.org/showthread.php?...1#pid35801
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
reboot

I can now modprobe ath9k.
But "ip a" does not show the new device, I check dmesg
Code:
rock64@rock64:~$ 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?
or
I better try other kernel source (mainline, vanilla, etc)
or
....
  Reply
#3
You need to install the ubuntu/debian firmware packages...

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

https://wiki.debian.org/ath9k_htc

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


Possibly Related Threads…
Thread Author Replies Views Last Post
  Rock64 Debian 11 (Bullseye) install problem jbize 15 7,961 10-12-2023, 05:14 PM
Last Post: tpaul
  Managed to install Kubernetes digitaldaz 3 4,199 08-16-2022, 02:44 AM
Last Post: mmarkgilbert
  Linux 5.15 Kernel - openSuse mark1250 0 1,243 12-02-2021, 04:36 PM
Last Post: mark1250
  Security Patches for the Kernel kwinz 9 6,549 10-22-2021, 05:45 AM
Last Post: kwinz
  Debian kernel stuck at 4.4.167 Enig123 5 5,483 12-29-2020, 12:57 PM
Last Post: kwinz
  Arch Linux Arm --> Kernel 5.8 breaks installation as365n4 12 11,974 08-31-2020, 01:41 AM
Last Post: as365n4
  mainline kernel sound support Openwrt lucize 2 3,990 05-01-2020, 05:09 PM
Last Post: PakoSt
  5.3 kernel support? csrf 5 6,933 04-18-2020, 11:34 PM
Last Post: CameronNemo
  How Can Install Unify controller in rock64? gedas07 0 1,803 03-23-2020, 08:41 AM
Last Post: gedas07
  Help troubleshooting kernel panic gabrielfin 3 4,541 03-02-2020, 04:18 PM
Last Post: gabrielfin

Forum Jump:


Users browsing this thread: 1 Guest(s)