7Ji / archrepo

A pacman repo focusing on Arch as media center, for ArchLinux on x86_64 and ArchLinux ARM on aarch64, updated hourly
GNU Affero General Public License v3.0
22 stars 5 forks source link

Add packages for Khadas Edge 2? #8

Closed kwankiu closed 9 months ago

kwankiu commented 9 months ago

Hello, I am using your repo for https://github.com/kwankiu/archlinux-installer-rock5 and thanks for that. As I am receiving request to add support for the Khadas Edge 2, would you be interested in adding the required kernel and firmware for the Edge 2?

Kernel for the Edge 2 : https://github.com/BredOS/sbc-pkgbuilds/tree/main/linux-edge2 Wifi firmware for the Edge 2 : https://github.com/BredOS/sbc-pkgbuilds/tree/main/ap6275p-firmware

@DarkevilPT FYI

7Ji commented 9 months ago

I have a few questions:

kwankiu commented 9 months ago

I think that BredOS has its own repo, but I am worried about using both their repo and your repo at the same time, as there may be packages that conflicts, and I think that their repo is less up-to-date. So I am just thinking whether it would be a good idea to have Edge 2's kernel and firmware on your repo instead.

kwankiu commented 9 months ago
  • Can you share the link to the request you're receiving?

I got request for adding Edge 2 from Discord direct messaging, they hope that I could bring Arch Linux to the Edge 2 (instead of the current only option - BredOS)

kwankiu commented 9 months ago

https://docs.khadas.com/products/sbc/edge2/development/linux/linux-source-code points to https://github.com/khadas/linux/tree/khadas-edges-5.10.y-release-v1.0.0

So yes, the PKGBUILDs seems to be using the most upstream ones https://github.com/BredOS/sbc-pkgbuilds/blob/main/linux-edge2/PKGBUILD

7Ji commented 9 months ago

They do have conflicts, most notably they're hosting my linux-aarch64-orangepi5 package as linux-orangepi5 and it is the version I pushed to AUR long time ago: https://github.com/BredOS/sbc-pkgbuilds/blob/main/linux-orangepi5/PKGBUILD

But repos won't conflict on providing packages, even if they have the same packages. You can always prefix the package name with repo to force Pacman to choose which one to use, e.g. 7Ji/linux-aarch64-orangepi5, if not forced they it would choose the one from the one defined earlier in the config.

If we really are adding this then I want this to be:

7Ji commented 9 months ago

Another thing that makes it hard to add these packages was that the builder lacks the capability to handle PKGBUILDs from git repos that do not store PKGBUILD at the root tree on master branch. After some changes this is now possible. You can build those packages with the following config.yaml:

pkgbuilds:
  linux-edge2:
    url: https://github.com/BredOS/sbc-pkgbuilds.git
    branch: main
    subtree: linux-edge2
  ap6275p-firmware:
    url: https://github.com/BredOS/sbc-pkgbuilds.git
    branch: main
    subtree: ap6275p-firmware

To use the builder:

git clone https://github.com/7Ji/arch_repo_builder
mkdir repo
cd arch_repo_builder
cargo build --release && strip target/release/arch_repo_builder -o ../repo/arch_repo_builder
cd ../repo
echo '
pkgbuilds:
  linux-edge2:
    url: https://github.com/BredOS/sbc-pkgbuilds.git
    branch: main
    subtree: linux-edge2
  ap6275p-firmware:
    url: https://github.com/BredOS/sbc-pkgbuilds.git
    branch: main
    subtree: ap6275p-firmware' > config.yaml
sudo ./arch_repo_builder

The result packages would be stored under pkgs/latest

Please report if these packages work on actual hardware.

kwankiu commented 9 months ago

@andrebraga Could you help testing with your board?

7Ji commented 9 months ago

The firmware package is buildable: ap6275p-firmware-20231006-1-aarch64.pkg.tar.gz

The kernel package, however, is clearly broken and not buildable, it needs to be fixed and maintained outside of the bred repo:

==> Making package: linux-edge2 5.10.66-1 (Sat Oct  7 03:34:29 2023)
==> WARNING: Skipping dependency checks.
==> WARNING: Using existing $srcdir/ tree
==> Starting build()...
/home/nomad7ji/build/repo/build/linux-edge2/PKGBUILD: line 40: pkgver: No such file or directory
Makefile:669: include/config/auto.conf: No such file or directory
==> ERROR: A failure occurred in build().
    Aborting...

(also I doubt if that was even buildable in the first place, it is not broken due to source update, it was a broken PKGBUILD to begin with, maybe bred maintainers didn't push their actual PKGBUILDs?)

Someone with edge2 needs to fork their kernel package out, and test & debug to fix it up, before it is possible to add to my repo.