YunoHost / package_check

Shell script which check package actions: install, remove, upgrade, backup, restore…
GNU General Public License v3.0
21 stars 26 forks source link

Add extra alias #107

Closed navanchauhan closed 2 years ago

navanchauhan commented 3 years ago

My mind was going bonkers today while trying to get YunoRunner running on a Pi 4 (arm64), it all came down to these snippets:

https://github.com/YunoHost/package_check/blob/de4b5ee480ec2148019f4fbadab7955622a06bbf/lib/common.sh#L11

https://github.com/YunoHost/package_check/blob/de4b5ee480ec2148019f4fbadab7955622a06bbf/lib/build_base_lxc.sh#L7-L20

Because amd64 is hard coded, it goes to the then statement. In that, it is replacing arm64 with amd64

But, LXC_BASE is defined as:

https://github.com/YunoHost/package_check/blob/de4b5ee480ec2148019f4fbadab7955622a06bbf/lib/common.sh#L17

So, YunoRunner is expecting ynh-appci-buster-aarch64-stable-test but it'll never find it because the value of ARCH is hardcoded. A quick fix to this problem is to just add something like this command:

lxc image alias create ynh-appci-buster-$CURRENT_ARCH-stable-base ynh-appci-buster-$HARDCODED_ARCH-stable-base

It won't break anything that is already working.

yalh76 commented 2 years ago

amd64 is not hard coded.

It load a config file https://github.com/YunoHost/package_check/blob/de4b5ee480ec2148019f4fbadab7955622a06bbf/lib/common.sh#L9

if ARCH is defined, it will use it, if not, it use amd64

You can find an example of that config file at https://github.com/YunoHost/CI_package_check/blob/b32dbfcc0d5f8734c9bad50a129bdf089cb2b54c/install.sh#L219-L224