friendlyarm / Actions-FriendlyWrt

Build FriendlyWrt using GitHub Actions
314 stars 132 forks source link

Can I Change The Default Kernel? #52

Open adibindrianto opened 6 months ago

adibindrianto commented 6 months ago

Can I change the default kernel from 5.4-6.6? for openwrt 21-23? what scripts need to be changed or added?

friendlyarm commented 6 months ago

If you want to use openwrt's built-in kernel, you can just compile openwrt directly, If you just want to use an older version of the rockchip kernel, you can switch the script/sd-fuse branch to do so.

adibindrianto commented 6 months ago

but how can change the kernel of existing rockchip in script/sd-fuse? please give me an example of the script to change

lawrencetg commented 6 months ago

for example, switch to kernel 5.10 for rk3568/rk3588:

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index bf5312f..1710052 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -185,6 +185,8 @@ jobs:
         repo sync -c scripts --no-clone-bundle
         repo sync -c scripts/sd-fuse  --no-clone-bundle
         repo sync -c toolchain  --no-clone-bundle
+        (cd kernel && git checkout nanopi5-v5.10.y_opt)
+        (cd scripts/sd-fuse && git checkout master)

     - name: Download friendlywrt rootfs (non-docker)
       if: matrix.SET == 'non-docker'
adibindrianto commented 6 months ago
- name: Download source
  run: |
    mkdir project
    cd project
    repo init --depth=1 -u https://github.com/friendlyarm/friendlywrt_manifests -b master-v${{ matrix.VERSION }} \
            -m rk3399.xml --repo-url=https://github.com/friendlyarm/repo  --no-clone-bundle

    repo sync -c friendlywrt --no-clone-bundle
    repo sync -c configs --no-clone-bundle
    repo sync -c device/common --no-clone-bundle
    repo sync -c device/friendlyelec --no-clone-bundle
    repo sync -c scripts --no-clone-bundle
    repo sync -c scripts/sd-fuse  --no-clone-bundle
    repo sync -c toolchain  --no-clone-bundle
    (cd kernel && git checkout nanopi5-v5.15.y_opt)
    (cd scripts/sd-fuse && git checkout master)

like this for kernel 5.15?

lawrencetg commented 6 months ago
- name: Download source
  run: |
    mkdir project
    cd project
    repo init --depth=1 -u https://github.com/friendlyarm/friendlywrt_manifests -b master-v${{ matrix.VERSION }} \
            -m rk3399.xml --repo-url=https://github.com/friendlyarm/repo  --no-clone-bundle

    repo sync -c friendlywrt --no-clone-bundle
    repo sync -c configs --no-clone-bundle
    repo sync -c device/common --no-clone-bundle
    repo sync -c device/friendlyelec --no-clone-bundle
    repo sync -c scripts --no-clone-bundle
    repo sync -c scripts/sd-fuse  --no-clone-bundle
    repo sync -c toolchain  --no-clone-bundle
    (cd kernel && git checkout nanopi5-v5.15.y_opt)
    (cd scripts/sd-fuse && git checkout master)

like this for kernel 5.15?

No, the rk3568/rk3588 platforms have never offered kernel 5.15, so it doesn't exist, and there are only two options at the moment: 5.10 and 6.1.

adibindrianto commented 6 months ago

is it also for soc rk3288? only change 5.10 and 6.1?

adibindrianto commented 6 months ago

i try your script not working for r2s

lawrencetg commented 6 months ago

is it also for soc rk3288? only change 5.10 and 6.1?

rk3328 kernel 5.15:

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index bf5312f..49fda10 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -185,6 +185,8 @@ jobs:
         repo sync -c scripts --no-clone-bundle
         repo sync -c scripts/sd-fuse  --no-clone-bundle
         repo sync -c toolchain  --no-clone-bundle
+        (cd kernel && git checkout nanopi-r2-v5.15.y)
+        (cd scripts/sd-fuse && git checkout kernel-5.15.y)

     - name: Download friendlywrt rootfs (non-docker)
       if: matrix.SET == 'non-docker'
adibindrianto commented 6 months ago
- name: Download source
  run: |
    mkdir project
    cd project
    repo init --depth=1 -u https://github.com/friendlyarm/friendlywrt_manifests -b master-v${{ matrix.VERSION }} \
            -m ${{ matrix.CPU }}.xml --repo-url=https://github.com/friendlyarm/repo  --no-clone-bundle

    repo sync -c kernel --no-clone-bundle
    repo sync -c u-boot --no-clone-bundle
    repo sync -c rkbin --no-clone-bundle
    repo sync -c configs --no-clone-bundle
    repo sync -c device/common --no-clone-bundle
    repo sync -c device/friendlyelec --no-clone-bundle
    repo sync -c scripts --no-clone-bundle
    repo sync -c scripts/sd-fuse  --no-clone-bundle
    repo sync -c toolchain  --no-clone-bundle
    (cd kernel && git checkout nanopi-r2-v5.15.y)
    (cd scripts/sd-fuse && git checkout kernel-5.15.y)

Screenshot_20240423-150719_Chrome

lawrencetg commented 6 months ago

i think it should work :)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index bf5312f..ae97b2b 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -142,7 +142,7 @@ jobs:
     strategy:
       matrix:
         VERSION: [21.02, 23.05]
-        CPU: [rk3328, rk3399, rk3568, rk3588]
+        CPU: [rk3328]
         SET: [docker, non-docker]
     steps:
     - name: Checkout
@@ -176,15 +176,15 @@ jobs:
         repo init --depth=1 -u https://github.com/friendlyarm/friendlywrt_manifests -b master-v${{ matrix.VERSION }} \
                 -m ${{ matrix.CPU }}.xml --repo-url=https://github.com/friendlyarm/repo  --no-clone-bundle

-        repo sync -c kernel --no-clone-bundle
         repo sync -c u-boot --no-clone-bundle
         repo sync -c rkbin --no-clone-bundle
         repo sync -c configs --no-clone-bundle
         repo sync -c device/common --no-clone-bundle
         repo sync -c device/friendlyelec --no-clone-bundle
         repo sync -c scripts --no-clone-bundle
-        repo sync -c scripts/sd-fuse  --no-clone-bundle
         repo sync -c toolchain  --no-clone-bundle
+        git clone https://github.com/friendlyarm/kernel-rockchip -b nanopi-r2-v5.15.y --depth 1 kernel
+        (cd scripts && git clone https://github.com/friendlyarm/sd-fuse_rk3328 -b kernel-5.15.y --depth 1 sd-fuse)
+        ln -s scripts/sd-fuse/out .

     - name: Download friendlywrt rootfs (non-docker)
       if: matrix.SET == 'non-docker'
adibindrianto commented 6 months ago
- name: Download source
  run: |
    mkdir project
    cd project
    repo init --depth=1 -u https://github.com/friendlyarm/friendlywrt_manifests -b master-v${{ matrix.VERSION }} \
            -m ${{ matrix.CPU }}.xml --repo-url=https://github.com/friendlyarm/repo  --no-clone-bundle

    repo sync -c kernel --no-clone-bundle
    repo sync -c u-boot --no-clone-bundle
    repo sync -c rkbin --no-clone-bundle
    repo sync -c configs --no-clone-bundle
    repo sync -c device/common --no-clone-bundle
    repo sync -c device/friendlyelec --no-clone-bundle
    repo sync -c scripts --no-clone-bundle
    repo sync -c scripts/sd-fuse  --no-clone-bundle
    repo sync -c toolchain  --no-clone-bundle
    git clone https://github.com/friendlyarm/kernel-rockchip -b nanopi-r2-v5.15.y --depth 1 kernel
    cd scripts && git clone https://github.com/friendlyarm/sd-fuse_rk3328 -b kernel-5.15.y --depth 1 sd-fuse

Screenshot_20240423-174741_Chrome

i just copied your script, added bottom 2 lines but it doesn't work, check my image

adibindrianto commented 6 months ago

friendlywrt official script that I changed a little, please how can I change the default kernel?

name: FriendlyWrt on: watch: types: started workflow_dispatch: jobs: prepare_release: runs-on: ubuntu-20.04 if: github.event.repository.owner.id == github.event.sender.id steps:

friendlyarm commented 6 months ago

Notice if there is a "-" in front of the line, you need to delete the following two lines

-        repo sync -c kernel --no-clone-bundle
-        repo sync -c scripts/sd-fuse  --no-clone-bundle
adibindrianto commented 6 months ago

I'll trying, it's compiling now

adibindrianto commented 6 months ago

not working, kernel 5.10 and 5.15

Screenshot_20240424-202229_Chrome

    repo sync -c u-boot --no-clone-bundle
    repo sync -c rkbin --no-clone-bundle
    repo sync -c configs --no-clone-bundle
    repo sync -c device/common --no-clone-bundle
    repo sync -c device/friendlyelec --no-clone-bundle
    repo sync -c scripts --no-clone-bundle
    repo sync -c toolchain  --no-clone-bundle
    git clone https://github.com/friendlyarm/kernel-rockchip -b nanopi-r2-v5.10.y --depth 1 kernel
    cd scripts && git clone https://github.com/friendlyarm/sd-fuse_rk3328 -b kernel-5.10.y --depth 1 sd-fuse
lawrencetg commented 6 months ago

I found that I missed the symbolic link to the out directory, the last lines should be:

        git clone https://github.com/friendlyarm/kernel-rockchip -b nanopi-r2-v5.15.y --depth 1 kernel
        (cd scripts && git clone https://github.com/friendlyarm/sd-fuse_rk3328 -b kernel-5.15.y --depth 1 sd-fuse)
        ln -s scripts/sd-fuse/out .

I've tested it: https://github.com/lawrencetg/Actions-FriendlyWrt-Test/commit/0f18dd4ef4433901e7ffc4757dd59a9d65112f7a

root@FriendlyWrt:~# cat /proc/version
Linux version 5.15.78 (runner@fv-az713-412) (aarch64-linux-gnu-gcc (ctng-1.25.0-119g-FA) 11.3.0, GNU l
d (GNU Binutils) 2.38) #1 SMP PREEMPT Thu Apr 25 05:13:35 UTC 2024
root@FriendlyWrt:~# ls /lib/modules/
5.15.78
adibindrianto commented 6 months ago

I tried kernel 5.15 and it could compile but didn't get internet, didn't get ip dhcp, the wan and lan led indicators didn't light up then kernel 5.10 couldn't compile in the same way or changed from 5.15 to 5.10

lawrencetg commented 6 months ago

I tried kernel 5.15 and it could compile but didn't get internet, didn't get ip dhcp, the wan and lan led indicators didn't light up then kernel 5.10 couldn't compile in the same way or changed from 5.15 to 5.10

What is your hardware model, older kernels usually lack support for newer model

adibindrianto commented 6 months ago

my device is nanopi r2s but when I compile it using the latest 6.1 kernel it runs normally, I use a kernel other than 6.1 to use qos limit, does it work or not

adibindrianto commented 2 months ago

any updates solution? how downgrade kernel from 6.x.x to 5.15 or 5.10