ophub / amlogic-s9xxx-openwrt

Support for OpenWrt 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
1.89k stars 1.68k forks source link

Make OpenWrt Using the Image Builder #268

Closed rapdodge closed 2 years ago

rapdodge commented 2 years ago

Dear ophub,

Can you make an workflows for github actions to rebuild openwrt using vanilla openwrt that downloaded like from https://downloads.openwrt.org/releases/21.02.3/targets/armvirt/64/ <- here

I'm requesting this, because i want to get stable openwrt (not snapshot) to make installing package that require kernel should be same is easier...

Ref: https://github.com/ophub/amlogic-s9xxx-openwrt/issues/241

Much thanks

ophub commented 2 years ago

https://github.com/ophub/amlogic-s9xxx-openwrt/tree/main/router-config#1011-required-options-for-openwrt

Since the official precompiled firmware lacks necessary dependencies, there are some problems in installation and use, and it cannot be used. You need to add these dependencies yourself to compile the appropriate crab

rapdodge commented 2 years ago

Noted, there is an imagebuilder official from openwrt to making rootfs

https://downloads.openwrt.org/releases/21.02.3/targets/armvirt/64/openwrt-imagebuilder-21.02.3-armvirt-64.Linux-x86_64.tar.xz

Can you please translating it to can be use github actions?

ophub commented 2 years ago

Implementing your needs is simple. You send the official configuration, I will see if these dependencies are met, otherwise the firmware produced cannot be used normally. Not everyone will read the documentation, and making firmware that doesn't work can cause a lot of problems.

rapdodge commented 2 years ago

Trying to get really vanilla openwrt

wget https://downloads.openwrt.org/releases/21.02.3/targets/armvirt/64/openwrt-imagebuilder-21.02.3-armvirt-64.Linux-x86_64.tar.xz

tar -J -x -f openwrt-imagebuilder-21.02.3-armvirt-64.Linux-x86_64.tar.xz

cd openwrt-imagebuilder-21.02.3-armvirt-64.Linux-x86_64

make image PROFILE="Default" PACKAGES="\ perl-http-date perlbase-getopt perlbase-time perlbase-unicode perlbase-utf8 \ blkid fdisk lsblk parted attr btrfs-progs chattr dosfstools e2fsprogs f2fs-tools \ f2fsck lsattr mkf2fs xfs-fsck xfs-mkfs bsdtar pigz bash gawk getopt losetup pv tar \ uuidgen coremark coreutils coreutils-base64 coreutils-nohup kmod-brcmfmac kmod-brcmutil \ kmod-cfg80211 kmod-mac80211 hostapd-common wpa-cli wpad-basic iw" FILES="files"

^Ref

image

Rootfs file https://transfer.sh/MOqJcr/openwrt-21.02.3-armvirt-64-default-rootfs.tar.gz

Github link: https://github.com/rapdodge/amlogic-s9xxx-openwrt/releases/tag/openwrt_s9xxx_official_06.17.2224

Above is just an barebone openwrt from Ref, but its nice to having other packages like luci, wireguard, etc

Will testing it right now...

ophub commented 2 years ago

This is the first time I see this operation. Can I directly add dependency packages and plug-ins to the firmware? How long does it take you to append these dependencies?

Do you want one like this? https://github.com/ophub/amlogic-s9xxx-armbian/blob/main/.github/workflows/rebuild-armbian.yml

Download and compile directly from the given address?

Snip20220617_7

rapdodge commented 2 years ago

Its on, and its working, STB can detect NIC plugged and unplug, but i cant setting for the internet, because i'm not familiar with the CLI...

image

image

image

ophub commented 2 years ago

How to set up the network: ssh, vi /etc/config/network

rapdodge commented 2 years ago

This is the first time I see this operation. Can I directly add dependency packages and plug-ins to the firmware? How long does it take you to append these dependencies?

Do you want one like this? https://github.com/ophub/amlogic-s9xxx-armbian/blob/main/.github/workflows/rebuild-armbian.yml

Download and compile directly from the given address?

Snip20220617_7

its not long, it just downloading it and configuring it...

Some screenshot image

image

image

rapdodge commented 2 years ago

let me rebuilding it with luci... will keep you update

ophub commented 2 years ago

I asked you the question above, is the function you want the same as the one I posted?

rapdodge commented 2 years ago

I asked you the question above, is the function you want the same as the one I posted?

yes, i'd like to have workflow like rebuild armbian :D it's really nice

ophub commented 2 years ago

ok, very simple

ophub commented 2 years ago

https://github.com/ophub/amlogic-s9xxx-openwrt/blob/dae03484c52b1d88c4b8334bca917647a506d532/.github/workflows/use-releases-file-to-packaging.yml#L61-L64

      openwrt_size:
        description: "Set the rootfs size(Unit: MiB)."
        required: false
        default: "960"
      openwrt_download:
        description: "Set the rootfs download path."
        required: true
        default: ""

https://github.com/ophub/amlogic-s9xxx-openwrt/blob/dae03484c52b1d88c4b8334bca917647a506d532/.github/workflows/use-releases-file-to-packaging.yml#L104-L105

With these 2 modifications, you can enter the compiled xxx-rootfs.tar.gz to make OpenWrt by yourself. You just need to make sure your tar.gz file is usable and the rebuild OpenWrt file will work fine.

rapdodge commented 2 years ago

Btw, if just rootfs without depedency that should be included on ref if im not forgot, it cant be detect the NIC is plug or unplug...

I already doing this https://github.com/rapdodge/amlogic-s9xxx-openwrt/blob/fd6781416d848c510da91fe809925227880d9dc6/.github/workflows/use-releases-file-to-packaging.yml#L112

rapdodge commented 2 years ago

let me try again... direct using openwrt default rootfs... but, before that, let me check using latest imagebuild with luci

rapdodge commented 2 years ago

Testing using: https://github.com/rapdodge/amlogic-s9xxx-openwrt/releases/tag/openwrt_s9xxx_official_06.17.2314

192 168 1 1_cgi-bin_luci_admin_status_overview

Its working perfectly... And can connect to the internet...

And it's hassle free to installing new packages like wireguard

image

Some log about NIC image

rapdodge commented 2 years ago

Ok @ophub, i tested it with just openwrt base rootfs without customization, and it booting, but, NIC didnt respond..

https://github.com/rapdodge/amlogic-s9xxx-openwrt/releases/tag/openwrt_s9xxx_official_06.17.2338

https://user-images.githubusercontent.com/33513626/174333679-dad4c3b0-1416-4a64-bd5c-ec80aeb5856b.mp4

rapdodge commented 2 years ago

An summary

For build the rootfs, we can use openwrt imagebuilder

image

Page: https://downloads.openwrt.org/releases/21.02.2/targets/armvirt/64/

And then do this. You can customizing it what packages that you want to add, but dont delete anything that already there, its must be installed! (Ref)

After that you can go to bin/targets/armvirt/64 and save default rootfs to your system and, you can adding ophub firmware using they tutorial here

And voila, you can get non snapshot images of openwrt :D

ophub commented 2 years ago

This is the first time I have seen your compilation method. I used to build the tar.gz file completely from scratch. I have to learn to use this method, it seems very convenient, at least 3 hours of compilation time is omitted. If it's reliable, it's a great way.

rapdodge commented 2 years ago

Some other reference https://openwrt.org/docs/guide-user/additional-software/imagebuilder https://openwrt.org/docs/guide-developer/imagebuilder_frontends

Looking forward into it :D

And i think it more nice when the workflows can be added multi options what we want to build like just 21.02.3, 21.02.2, 21.02.1, etc...

Because the link its likely same https://downloads.openwrt.org/releases/ **version**/targets/armvirt/64/openwrt-imagebuilder...tar.xz

zakeru46 commented 2 years ago

do you have amlogic service included? tried this imagebuilder method it seems need to be compiled first. I thought ophub's repack script has taken care of it.


i didnt see precompiled ipk in the release before. so, either manually download and place in packages folder or included in the repack script.

ophub commented 2 years ago

The process of installing dependencies, does it support downloading third-party ipk installation?

rapdodge commented 2 years ago

Actually, I don't know... Let me test it...

curl -fsSL git.io/luci-app-amlogic | bash

Right?

ophub commented 2 years ago

yes Or download ipk to the current directory and install: opkg --force-reinstall install *.ipk

rapdodge commented 2 years ago

Ok, let me test it with my build openwrt barebone with luci, will update you asap

rapdodge commented 2 years ago

It's ok, no problem when installing it

image

image

ophub commented 2 years ago

Can a third-party ipk be installed during imagebuild?

rapdodge commented 2 years ago

Can a third-party ipk be installed during imagebuild?

I dont know, to be honest...

Maybe adding an information to adding amlogic service it would be good

There is an ref too about custom packages https://openwrt.org/docs/guide-user/additional-software/imagebuilder#custom_packages

Let me try to build custom rootfs again... ....building new vps again....

ophub commented 2 years ago

And i think it more nice when the workflows can be added multi options what we want to build like just 21.02.3, 21.02.2, 21.02.1, etc...

Because the link its likely same https://downloads.openwrt.org/releases/ version/targets/armvirt/64/openwrt-imagebuilder...tar.xz

Send a few addresses like yours, let me see the rules, how to add a suitable drop-down list

rapdodge commented 2 years ago

Dear @ophub,

I think its 3rdparty ipk can be installed during imagebuild

Screenshot:

image

You should place custom ipk on packages folder inside the imagebuilder directory and adding it on make

image

make image PROFILE="Default" PACKAGES="\
perl-http-date perlbase-getopt perlbase-time perlbase-unicode perlbase-utf8 \
blkid fdisk lsblk parted attr btrfs-progs chattr dosfstools e2fsprogs f2fs-tools \
f2fsck lsattr mkf2fs xfs-fsck xfs-mkfs bsdtar pigz bash gawk getopt losetup pv tar \
uuidgen coremark coreutils coreutils-base64 coreutils-nohup kmod-brcmfmac kmod-brcmutil \
kmod-cfg80211 kmod-mac80211 hostapd-common wpa-cli wpad-basic iw \
liblucihttp liblucihttp-lua luci luci-app-firewall luci-app-opkg luci-base luci-lib-base \
luci-lib-ip luci-lib-jsonc luci-lib-nixio luci-mod-admin-full luci-mod-network \
luci-mod-status luci-mod-system luci-proto-ipv6 luci-proto-ppp \
luci-theme-bootstrap luci-compat luci-app-amlogic" FILES="files"
rapdodge commented 2 years ago

And i think it more nice when the workflows can be added multi options what we want to build like just 21.02.3, 21.02.2, 21.02.1, etc...

Because the link its likely same https://downloads.openwrt.org/releases/ version/targets/armvirt/64/openwrt-imagebuilder...tar.xz

Send a few addresses like yours, let me see the rules, how to add a suitable drop-down list

dropdown i mean is like this

image

And adding latest major version like: 21.02.3 -> https://downloads.openwrt.org/releases/21.02.3/targets/armvirt/64/openwrt-imagebuilder-21.02.3-armvirt-64.Linux-x86_64.tar.xz

19.07.10 -> https://downloads.openwrt.org/releases/19.07.10/targets/armvirt/64/openwrt-imagebuilder-19.07.10-armvirt-64.Linux-x86_64.tar.xz

18.06.9 -> https://downloads.openwrt.org/releases/18.06.9/targets/armvirt/64/openwrt-imagebuilder-18.06.9-armvirt-64.Linux-x86_64.tar.xz

image

...building new images...

rapdodge commented 2 years ago

Testing using: https://github.com/rapdodge/amlogic-s9xxx-openwrt/releases/tag/openwrt_s9xxx_official_06.18.0914

It's booting: yes It's can detect NIC: yes It's have amlogic service: yes

Screenshot:

image

I think it would be great if there is choosing minimal and normal on workflows

When choose minimal, it just installing barebone openwrt + amlogic service + luci

When choose normal, it installing like router-config do, minimal packages + docker, etc

ophub commented 2 years ago

https://github.com/ophub/amlogic-s9xxx-openwrt/tree/main/router-config/openwrt-imagebuilder

https://github.com/ophub/amlogic-s9xxx-openwrt/blob/main/.github/workflows/build-openwrt-with-imagebuilder.yml

You test, continue to add complete packages and luci-app, luci-theme

rapdodge commented 2 years ago

Noted, will testing it when I'm back home

ophub commented 2 years ago

https://github.com/ophub/amlogic-s9xxx-openwrt/blob/main/router-config/openwrt-imagebuilder/imagebuilder.sh

When using locally, just run ./imagebuilder.sh <branch> directly, for example: ./imagebuilder.sh 21.02.3

rapdodge commented 2 years ago

Building is under 20 mins

image

Wonderful!

...downloading build and testing it...

rapdodge commented 2 years ago

Testing: https://github.com/rapdodge/amlogic-s9xxx-openwrt/releases/tag/openwrt_s9xxx_imagebuilder_21.02.3_06.18.2012

It's booting: yes It's can detect NIC: yes It's have amlogic service: yes

Some screenshots

192 168 1 1_cgi-bin_luci_admin_status_overview (1)

image

image

This request i think can be closed

rapdodge commented 2 years ago

Thanks for your hardwork!