ophub / amlogic-s9xxx-armbian

Support for Armbian in Amlogic, Rockchip and Allwinner boxes. Support a311d, s922x, s905x3, s905x2, s912, s905d, s905x, s905w, s905, s905l, rk3588, rk3568, rk3399, rk3328, h6, etc.
GNU General Public License v2.0
5.45k stars 1.74k forks source link

Build error #21

Closed pulpoff closed 2 years ago

pulpoff commented 2 years ago

root@mac:/usr/src/amlogic-s9xxx-armbian-main# ./make -d -b s922x -k 5.15.2 Welcome to build armbian for amlogic s9xxx STB!

Server space usage before starting to compile: Filesystem Type Size Used Avail Use% Mounted on /dev/mapper/vgubuntu-root ext4 915G 852G 17G 99% /

(1) Auto query the latest kernel version of the same series for [ 5.15.2 ] (1) [ 5.15.2 ] is latest kernel.

(1) [ 5.15.2 ] Kernel is in the local directory. Armbian SoC List: [ s922x ] Kernel List: [ 5.15.2 ] Ready, start build armbian...

(1.1) Start build armbian [ s922x - 5.15.2 ]. Remaining space is 17G. [ s922x - 5.15.2 ] (1/5) make new armbian image. [ Error ] Invalid file: /usr/src/amlogic-s9xxx-armbian-main/build/output/images/-trunk_.img root@mac:/usr/src/amlogic-s9xxx-armbian-main#

How can I compile the kernel from this ??

pulpoff commented 2 years ago

i tried to fix it, but its still like this : `root@mac:/usr/src/amlogic-s9xxx-armbian-main# ./make -d -b s922x -v beta -k 5.12.19 Welcome to build armbian for amlogic s9xxx STB!

Server space usage before starting to compile: Filesystem Type Size Used Avail Use% Mounted on /dev/mapper/vgubuntu-root ext4 915G 853G 16G 99% /

(1) Auto query the latest kernel version of the same series for [ 5.12.19 ] (1) [ 5.12.19 ] is latest kernel.

(1) [ 5.12.19 ] Kernel is in the local directory. Armbian SoC List: [ s922x ] Kernel List: [ 5.12.19 ] Ready, start build armbian...

(1.1) Start build armbian [ s922x - 5.12.19 ]. Remaining space is 16G. [ s922x - 5.12.19 ] (1/5) make new armbian image. [ s922x - 5.12.19 ] (2/5) extract old armbian files. cp: missing destination file operand after '/usr/src/amlogic-s9xxx-armbian-main/tmp_aml_image/armbian_s922x_5.12.19.img' Try 'cp --help' for more information. losetup: /usr/src/amlogic-s9xxx-armbian-main/tmp_aml_image/armbian_s922x_5.12.19.img: failed to set up loop device: No such file or directory [ Error ] losetup /usr/src/amlogic-s9xxx-armbian-main/tmp_aml_image/armbian_s922x_5.12.19.img failed. `

pulpoff commented 2 years ago
                     0     512

/dev/loop12 0 0 0 0 /usr/src/amlogic-s9xxx-armbian-main/tmp_out/ArmbianAml_s922x_buster_5.12.19_2021.11.13.2341.img (deleted) 0 512 /dev/loop3 0 0 1 1 /var/lib/snapd/snaps/qt513_24.snap 0 512 /dev/loop10 0 0 0 0 /usr/src/amlogic-s9xxx-armbian-main/tmp_out/ArmbianAml_s922x_buster_5.12.19_2021.11.13.2338.img (deleted)

ophub commented 2 years ago

https://github.com/ophub/amlogic-s9xxx-armbian#local-make-instructions

Create the build/output/images folder, and upload the Armbian image of the lepotato board ( Eg: Armbian_21.11.0-trunk_Lepotato_buster_current_5.10.67.img ) to this ~/amlogic-s9xxx-armbian/build/output/images directory.

https://github.com/ophub/amlogic-s9xxx-armbian/releases/download/Armbian_Aml_buster_2021.11.14.0114/Armbian_21.11.0-trunk_Lepotato_buster_current_5.10.79.img.gz

Are you compiling locally? Download, unzip it as .img, and put it in a fixed directory

ophub commented 2 years ago

Are you a mac computer?

Use the ubuntu system and install the local environment according to the instructions.

Or directly use github online compilation

pulpoff commented 2 years ago

i am on ubuntu, and i can build armbian from their src and kernel from flippy. question is how to package kernel from flippy for your armbian-update tool i have changed armbian-update tool to install from local files, now need to create those files . Screenshot from 2021-11-14 00-26-05 .

pulpoff commented 2 years ago

Now managed to build armbian with your script, next to make sure kernel is compiled with new config .. Screenshot from 2021-11-14 00-31-47

pulpoff commented 2 years ago

Can you tell me how to compile the required kernel files for armbian-update please? I mean these files : boot-5.15.2-flippy-67+.tar.gz

dtb-allwinner-5.15.2-flippy-67+.tar.gz

dtb-amlogic-5.15.2-flippy-67+.tar.gz

dtb-rockchip-5.15.2-flippy-67+.tar.gz

modules-5.15.2-flippy-67+.tar.gz

i tried to run like this ./make -d -b s922x -k 5.15.2 -a false but it did not help

ophub commented 2 years ago

You first build armbian with my script. After installation, directly compile the kernel on armbian and install it to use.

No need to make a kernel package, and use armbian-config.

pulpoff commented 2 years ago

i built armbian with your script .. but it uses kernel from binary from your website .. how to compile custom kernel and package it ? where should i install the kernel after i compile it with armbian ?

root@mac:/usr/src/amlogic-s9xxx-armbian-main/build/output/images# ls -lah total 3,1G drwxr-xr-x 2 root root 4,0K Nov 14 00:31 . drwxr-xr-x 3 root root 4,0K Nov 13 23:30 .. -rw-r--r-- 1 root root 657M Nov 14 00:30 Armbian_21.11.0_Aml_s922x_buster_5.12.19_2021.11.14.0028.img.gz -rw-r--r-- 1 root root 2,0G Nov 13 18:19 Armbian_21.11.0-trunk_Lepotato_buster_current_5.10.79.img -rw-r--r-- 1 root root 460M Nov 12 15:31 Armbian_21.11.0-trunk_Station-m1_impish_current_5.10.78.img.xz root@mac:/usr/src/amlogic-s9xxx-armbian-main/build/output/images# cd .. root@mac:/usr/src/amlogic-s9xxx-armbian-main/build/output# cd .. root@mac:/usr/src/amlogic-s9xxx-armbian-main/build# ls output root@mac:/usr/src/amlogic-s9xxx-armbian-main/build# cd .. root@mac:/usr/src/amlogic-s9xxx-armbian-main# ls amlogic-s9xxx build LICENSE make README.cn.md README.md root@mac:/usr/src/amlogic-s9xxx-armbian-main# cd amlogic-s9xxx/ root@mac:/usr/src/amlogic-s9xxx-armbian-main/amlogic-s9xxx# ls amlogic-armbian amlogic-dtb amlogic-kernel amlogic-u-boot common-files root@mac:/usr/src/amlogic-s9xxx-armbian-main/amlogic-s9xxx# cd amlogic-kernel/ root@mac:/usr/src/amlogic-s9xxx-armbian-main/amlogic-s9xxx/amlogic-kernel# ls 5.10.70 5.12.19 5.14.11 5.15.2 5.4.150 root@mac:/usr/src/amlogic-s9xxx-armbian-main/amlogic-s9xxx/amlogic-kernel# cd 5.12.19/ root@mac:/usr/src/amlogic-s9xxx-armbian-main/amlogic-s9xxx/amlogic-kernel/5.12.19# ls boot-5.12.19-flippy-62+.tar.gz dtb-amlogic-5.12.19-flippy-62+.tar.gz modules-5.12.19-flippy-62+.tar.gz dtb-allwinner-5.12.19-flippy-62+.tar.gz dtb-rockchip-5.12.19-flippy-62+.tar.gz

pulpoff commented 2 years ago

kernel 5.12.19 works at 2.2Ghz , i also see that odroid n2+ runs with same cpu at 2.4 ghz. I would like to add those overclock speeds to 5.15.2 .. can u help me ? thanks

pulpoff commented 2 years ago

the raw speed difference is quite a game changer see my benchmark with 5.12.19 here Screenshot from 2021-11-14 01-36-24 :

this shows that S922 can be much faster than RK3399

ophub commented 2 years ago

Download the source code from kernel.org, make menuconfig custom configuration. make -j4 compile...For related operations, please refer to the official documentation. After completion, make modules_install && make install

ophub commented 2 years ago

flippy provides optimized source code, you can customize the configuration to compile.

https://github.com/unifreq/linux-5.12.y

pulpoff commented 2 years ago

but make modules_install and make install won't generate the files for armbian-update how can i generate files and use armbian-update?

pulpoff commented 2 years ago

i have compiled unifreq kernel 5.15.2, but it does not produce files for armbian-update that i want to use ..

these : boot-5.12.19-flippy-62+.tar.gz dtb-amlogic-5.12.19-flippy-62+.tar.gz modules-5.12.19-flippy-62+.tar.gz dtb-allwinner-5.12.19-flippy-62+.tar.gz dtb-rockchip-5.12.19-flippy-62+.tar.gz

how do u create them ??

pulpoff commented 2 years ago

see this link please to understand the issue

normal s922x vs overclocked

ophub commented 2 years ago

After completion, make modules_install && make install

In this way, the kernel compiled by yourself has been installed. No need to use armbian-update.

pulpoff commented 2 years ago

but i want to use armbian-update .. why not just tell me how to create those files ? please, it will help me a lot ..

ophub commented 2 years ago

https://github.com/ophub/script/blob/main/sh/extract-kernel.sh

This is a method of extracting the kernel file from the official compiled armbian and generating several kernel files according to the flippy kernel package organization.

Corresponding file:

https://github.com/ophub/amlogic-s9xxx-armbian/releases/download/Armbian_Aml_buster_2021.11.14.0114/Armbian_21.11.0-trunk_Lepotato_buster_current_5.10.79.img.gz

Unzip to .img

Only the officially generated armbian...img original file is placed in the build/output/images directory

extract-kernel.sh is placed in the root directory (the same directory as make)

chmod +x extract-kernel.sh sudo ./extract-kernel.sh

pulpoff commented 2 years ago

would it be possible for u to make 5.15.2 custom kernel with overclocking freqs from 5.12.19 ? even 2.2ghz would make a big difference, currently it tops at 1.8Ghz

pulpoff commented 2 years ago

./extract-kernel.sh Start build kernel for amlogic-s9xxx-openwrt ... copy armbian to tmp folder ... armbian: Armbian_21.11.0-trunk_Lepotato_buster_current_5.10.79.img mount armbian ... Copy modules files armbian_version: 5.10.79-meson64 kernel_version: 5.10.79 Copy five boo kernel files supplement .dtb file from github.com ... Copy .dtb files Package modules-5.10.79-meson64.tar.gz Package dtb-amlogic-5.10.79-meson64.tar.gz Package boot-5.10.79-meson64.tar.gz umount old armbian ... mv 5.10.79 folder to /usr/src/amlogic-s9xxx-armbian-main/build/output/images kernel save path: /usr/src/amlogic-s9xxx-armbian-main/build/output/images/5.10.79.tar.gz delete tmp folders ... build kernel complete ... root@mac:/usr/src/amlogic-s9xxx-armbian-main# root@mac:/usr/src/amlogic-s9xxx-armbian-main# ls build/output/images/ amlogic-s9xxx-kernel-5.10.79.tar.gz Armbian_21.11.0_Aml_s905x2_buster_5.10.79_2021.11.14.0310.img.gz Armbian_21.11.0_Aml_s905x3_buster_5.10.79_2021.11.14.0308.img.gz Armbian_21.11.0_Aml_s922x_buster_5.10.79_2021.11.14.0305.img.gz Armbian_21.11.0_Aml_s922x_buster_5.12.19_2021.11.14.0028.img.gz Armbian_21.11.0_Aml_s922x_buster_5.12.19_2021.11.14.0033.img.gz Armbian_21.11.0_Aml_s922x_buster_5.15.2_2021.11.14.0039.img.gz Armbian_21.11.0_Aml_s922x-n2_buster_5.10.79_2021.11.14.0307.img.gz Armbian_21.11.0-trunk_Lepotato_buster_current_5.10.79.img Armbian_21.11.0-trunk_Station-m1_impish_current_5.10.78.img.xz root@mac:/usr/src/amlogic-s9xxx-armbian-main#

How do i select 5.15.2 kernel to extract?

ok, i looked at the file, and it extracts any .img file .. now its .. still not working. root@mac:/usr/src/amlogic-s9xxx-armbian-main# ./extract-kernel.sh Start build kernel for amlogic-s9xxx-openwrt ... copy armbian to tmp folder ... armbian: Armbian_21.11.0_Aml_s922x_buster_5.12.19_2021.11.14.0033.img mount armbian ... Copy modules files cp: cannot stat '/usr/src/amlogic-s9xxx-armbian-main/tmp_kernel/armbian_tmp/lib/modules/': No such file or directory armbian_version: 5.10.79-meson64 kernel_version: 5.10.79 Copy five boo kernel files cp: cannot stat '/usr/src/amlogic-s9xxx-armbian-main/tmp_kernel/armbian_tmp/boot/config-': No such file or directory cp: cannot stat '/usr/src/amlogic-s9xxx-armbian-main/tmp_kernel/armbian_tmp/boot/initrd.img-': No such file or directory cp: cannot stat '/usr/src/amlogic-s9xxx-armbian-main/tmp_kernel/armbian_tmp/boot/System.map-': No such file or directory cp: cannot stat '/usr/src/amlogic-s9xxx-armbian-main/tmp_kernel/armbian_tmp/boot/uInitrd-': No such file or directory cp: cannot stat '/usr/src/amlogic-s9xxx-armbian-main/tmp_kernel/armbian_tmp/boot/vmlinuz-': No such file or directory supplement .dtb file from github.com ... Copy .dtb files cp: cannot stat '/usr/src/amlogic-s9xxx-armbian-main/tmp_kernel/armbian_tmp/boot/dtb-/amlogic/.dtb': No such file or directory Package modules-5.10.79-meson64.tar.gz Package dtb-amlogic-5.10.79-meson64.tar.gz Package boot-5.10.79-meson64.tar.gz umount old armbian ... mv 5.10.79 folder to /usr/src/amlogic-s9xxx-armbian-main/build/output/images kernel save path: /usr/src/amlogic-s9xxx-armbian-main/build/output/images/5.10.79.tar.gz delete tmp folders ... rm: cannot remove '/usr/src/amlogic-s9xxx-armbian-main/tmp_kernel/armbian_tmp': Device or resource busy build kernel complete ...

The question on how to build the custom kernel with overclock remains ..

ophub commented 2 years ago

https://github.com/ophub/script/blob/41c6a2b8847083569fa49ba9e3e2a05bce57be5b/sh/extract-kernel.sh#L40-L42

change to:

    if ! mount ${loop_old}p2 ${armbian_tmp}; then
        die "mount ${loop_old}p2 failed!"
    fi
    if ! mount ${loop_old}p1 ${armbian_tmp}/boot; then
        die "mount ${loop_old}p1 failed!"
    fi

Only one packaged img file is left in the build/output/images directory

pulpoff commented 2 years ago

i just did, still the same : ./extract-kernel.sh Start build kernel for amlogic-s9xxx-openwrt ... copy armbian to tmp folder ... armbian: Armbian_21.11.0_Aml_s922x_buster_5.12.19_2021.11.14.0033.img mount armbian ... Copy modules files armbian_version: 5.12.19-flippy-62+ kernel_version: 5.12.19 Copy five boo kernel files supplement .dtb file from github.com ... Copy .dtb files cp: cannot stat '/usr/src/amlogic-s9xxx-armbian-main/tmp_kernel/armbian_tmp/boot/dtb-/amlogic/.dtb': No such file or directory Package modules-5.12.19-flippy-62+.tar.gz Package dtb-amlogic-5.12.19-flippy-62+.tar.gz Package boot-5.12.19-flippy-62+.tar.gz umount old armbian ... mv 5.12.19 folder to /usr/src/amlogic-s9xxx-armbian-main/build/output/images kernel save path: /usr/src/amlogic-s9xxx-armbian-main/build/output/images/5.12.19.tar.gz delete tmp folders ... rm: cannot remove '/usr/src/amlogic-s9xxx-armbian-main/tmp_kernel/armbian_tmp/boot': Device or resource busy build kernel complete ... root@mac:/usr/src/amlogic-s9xxx-armbian-main# root@mac:/usr/src/amlogic-s9xxx-armbian-main/1/5.12.19# ls boot-5.12.19-flippy-62+.tar.gz modules-5.12.19-flippy-62+.tar.gz dtb-amlogic-5.12.19-flippy-62+.tar.gz

ophub commented 2 years ago

https://github.com/ophub/script/blob/41c6a2b8847083569fa49ba9e3e2a05bce57be5b/sh/extract-kernel.sh#L65

change to:

cp -f ${armbian_tmp}/boot/dtb/amlogic/*.dtb ${dtb_tmp} && sync

pulpoff commented 2 years ago

now it works fine ! THANKS!!! ./extract-kernel.sh Start build kernel for amlogic-s9xxx-openwrt ... copy armbian to tmp folder ... armbian: Armbian_21.11.0_Aml_s922x_buster_5.12.19_2021.11.14.0033.img mount armbian ... Copy modules files armbian_version: 5.12.19-flippy-62+ kernel_version: 5.12.19 Copy five boo kernel files supplement .dtb file from github.com ... Copy .dtb files Package modules-5.12.19-flippy-62+.tar.gz Package dtb-amlogic-5.12.19-flippy-62+.tar.gz Package boot-5.12.19-flippy-62+.tar.gz umount old armbian ... mv 5.12.19 folder to /usr/src/amlogic-s9xxx-armbian-main/build/output/images kernel save path: /usr/src/amlogic-s9xxx-armbian-main/build/output/images/5.12.19.tar.gz delete tmp folders ... rm: cannot remove '/usr/src/amlogic-s9xxx-armbian-main/tmp_kernel/armbian_tmp/boot': Device or resource busy build kernel complete ... root@mac:/usr/src/amlogic-s9xxx-armbian-main#

pulpoff commented 2 years ago

please update the file in github, it is much improved!

ophub commented 2 years ago

We all use the kernel shared by flippy. He is familiar with these boxes and knows how to adapt.

Do you have any special needs for custom kernels? What research is used? Who are the specific groups for use?

pulpoff commented 2 years ago

this extracts the kernel from armbian image .. but to put it in armbian image from flippy 5.15.y tree, after compile, what do u use ?

pulpoff commented 2 years ago

also i don't see anywhere the src files for 5.12.19 kernel to check how overclocking is done ..

ophub commented 2 years ago

https://github.com/ophub/script/blob/41c6a2b8847083569fa49ba9e3e2a05bce57be5b/sh/extract-kernel.sh#L87-L88

change to:

umount -f ${armbian_tmp}/boot 2>/dev/null
umount -f ${armbian_tmp} 2>/dev/null
losetup -d ${loop_old} 2>/dev/null
ophub commented 2 years ago

Put these three kernel files in any directory of the armbian system (such as /root), and execute armbian-update 5.12.19 in the current directory to use the local kernel file update (the script first checks the local current directory, if there are files Will not download from github.com)

pulpoff commented 2 years ago

Screenshot from 2021-11-14 04-33-21

pulpoff commented 2 years ago

works

ophub commented 2 years ago

I don’t understand how the kernel is overclocked. I am a user and have not compiled a personalized kernel.

pulpoff commented 2 years ago

look , the mission is simple

  1. look at 5.12.19 sources and find the proper overclock freqs
  2. put those freqs in 5.15.2, recompile
  3. use armbian-update to install
pulpoff commented 2 years ago

for GT King there're 2 different dtb files in /BOOT : normal and -oc (overclock), that allows 2.2Ghz freq. The kernel should support this freq, as there're are no other places that limit freq. Only 5.12.19 supports 2.2, rest of kernels i tried all work at 1.8Ghz

ophub commented 2 years ago

Before doing this, find out how to rescue if you fail to install a custom kernel, and make sure that your continuous testing has a way to recover.

ophub commented 2 years ago

I don't understand the setting of kernel parameters, you can explore it yourself.

pulpoff commented 2 years ago

i cannot install the kernel with make install after building from flippy sources, thats why i need to use armbian-update ..

pulpoff commented 2 years ago

to rescue i will just rewrite /BOOT partition from your armbian image )))

ophub commented 2 years ago

The path and packaging method of the kernel file have been clearly written in the script just now.

You compile the kernel under the armbian system, install it, extract it from the corresponding location, and package it. This is the method of compiling the kernel locally.

pulpoff commented 2 years ago

why i can't extract with this tool kernel from another armbian image? root@mac:/usr/src/amlogic-s9xxx-armbian-main# ./extract-kernel.sh Start build kernel for amlogic-s9xxx-openwrt ... copy armbian to tmp folder ... armbian: Armbian_21.08.1_Odroidn2_hirsute_edge_5.13.12_xfce_desktop.img mount armbian ... mount: /usr/src/amlogic-s9xxx-armbian-main/tmp_kernel/armbian_tmp: special device /dev/loop11p2 does not exist. [ Error ] mount /dev/loop11p2 failed! root@mac:/usr/src/amlogic-s9xxx-armbian-main#

i can mount the img file with no problems from file manager..

ophub commented 2 years ago

Officially compiled firmware with only one partition uses the unmodified script.

The above modifications are suitable for the dual-partition firmware that I packaged.

Do your own research for other people.

pulpoff commented 2 years ago

ok, makes sense, thanks !

up to now i can't anyhow test my new kernel .. no way to install it ..

pulpoff commented 2 years ago

once i built new kernel with flippy, how to put it into armbian image or install it ?

ophub commented 2 years ago

https://github.com/ophub/amlogic-s9xxx-armbian/issues/21#issuecomment-968199362

pulpoff commented 2 years ago

there seems to be a way to integrate ZEN kernel patches and run with ZEN scheduler : here