[PATCH v2 compass-ci] container: fix failed to build archlinux images

[why] when build archlinux images in x86_64 machine error: error: failed retrieving file 'core.db' from mirrors.tuna.tsinghua.edu.cn : The requested URL returned error: 404 error: failed retrieving file 'core.db' from mirrors.163.com : The requested URL returned error: 404 error: failed retrieving file 'core.db' from mirror.archlinuxarm.org : The requested URL returned error: 404 error: failed to update core (failed to retrieve some files) error: failed retrieving file 'extra.db' from mirrors.tuna.tsinghua.edu.cn : The requested URL returned error: 404 error: failed retrieving file 'extra.db' from mirrors.163.com : The requested URL returned error: 404 error: failed retrieving file 'extra.db' from mirror.archlinuxarm.org : Resolving timed out after 10000 milliseconds error: failed to update extra (download library error) error: failed retrieving file 'community.db' from mirrors.tuna.tsinghua.edu.cn : The requested URL returned error: 404 error: failed retrieving file 'community.db' from mirrors.163.com : The requested URL returned error: 404 error: failed retrieving file 'community.db' from mirror.archlinuxarm.org : The requested URL returned error: 404 error: failed to update community (failed to retrieve some files) error: failed to synchronize all databases The command '/bin/sh -c pacman --needed --noprogressbar --noconfirm -Syu && pacman --needed --noprogressbar --noconfirm -S bash zsh git openssh rsync make gcc tzdata sudo coreutils util-linux vim gawk' returned a non-zero code: 1 becaue archlinux mirror not support x86_64 machine. [how] when deploy in x86_64 machine, change mirror http://mirrors.tuna.tsinghua.edu.cn/archlinuxarm/$arch/$repo => http://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch Signed-off-by: Liu Yinsi <liuyinsi@163.com> --- container/archlinux/build | 3 +++ 1 file changed, 3 insertions(+) diff --git a/container/archlinux/build b/container/archlinux/build index 81feda2..f96ad40 100755 --- a/container/archlinux/build +++ b/container/archlinux/build @@ -2,4 +2,7 @@ # SPDX-License-Identifier: MulanPSL-2.0+ # Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. +[ "$(arch)" == "x86_64" ] && + sed -i 's#archlinuxarm/$arch/$repo#archlinux/$repo/os/$arch#g' root/etc/pacman.d/mirrorlist + docker build -t archlinux:testbed . -- 2.23.0

On Mon, Nov 02, 2020 at 11:15:15AM +0800, Liu Yinsi wrote:
[why] when build archlinux images in x86_64 machine error:
error: failed retrieving file 'core.db' from mirrors.tuna.tsinghua.edu.cn : The requested URL returned error: 404 error: failed retrieving file 'core.db' from mirrors.163.com : The requested URL returned error: 404 error: failed retrieving file 'core.db' from mirror.archlinuxarm.org : The requested URL returned error: 404 error: failed to update core (failed to retrieve some files) error: failed retrieving file 'extra.db' from mirrors.tuna.tsinghua.edu.cn : The requested URL returned error: 404 error: failed retrieving file 'extra.db' from mirrors.163.com : The requested URL returned error: 404 error: failed retrieving file 'extra.db' from mirror.archlinuxarm.org : Resolving timed out after 10000 milliseconds error: failed to update extra (download library error) error: failed retrieving file 'community.db' from mirrors.tuna.tsinghua.edu.cn : The requested URL returned error: 404 error: failed retrieving file 'community.db' from mirrors.163.com : The requested URL returned error: 404 error: failed retrieving file 'community.db' from mirror.archlinuxarm.org : The requested URL returned error: 404 error: failed to update community (failed to retrieve some files) error: failed to synchronize all databases The command '/bin/sh -c pacman --needed --noprogressbar --noconfirm -Syu && pacman --needed --noprogressbar --noconfirm -S bash zsh git openssh rsync make gcc tzdata sudo coreutils util-linux vim gawk' returned a non-zero code: 1
becaue archlinux mirror not support x86_64 machine.
[how] when deploy in x86_64 machine, change mirror http://mirrors.tuna.tsinghua.edu.cn/archlinuxarm/$arch/$repo => http://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch
Signed-off-by: Liu Yinsi <liuyinsi@163.com> --- container/archlinux/build | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/container/archlinux/build b/container/archlinux/build index 81feda2..f96ad40 100755 --- a/container/archlinux/build +++ b/container/archlinux/build @@ -2,4 +2,7 @@ # SPDX-License-Identifier: MulanPSL-2.0+ # Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.
+[ "$(arch)" == "x86_64" ] && + sed -i 's#archlinuxarm/$arch/$repo#archlinux/$repo/os/$arch#g' root/etc/pacman.d/mirrorlist +
how about use $arch directly no need judge sed -i 's#archlinuxarm/$arch/$repo#archlinux/$repo/os/$arch#g' root/etc/pacman.d/mirrorlist Thanks, Shenwei
docker build -t archlinux:testbed . -- 2.23.0

@@ -2,4 +2,7 @@ # SPDX-License-Identifier: MulanPSL-2.0+ # Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.
+[ "$(arch)" == "x86_64" ] && + sed -i 's#archlinuxarm/$arch/$repo#archlinux/$repo/os/$arch#g' root/etc/pacman.d/mirrorlist +
how about use $arch directly no need judge
aarch64 also support this mirror,but will show too much error message when build archlinux images as follows, so judge to change in x84. downloading zsh-5.8-1-aarch64.pkg.tar.xz... error: failed retrieving file 'perl-error-0.17029-2-any.pkg.tar.xz' from mirrors.tuna.tsinghua.edu.cn : The requested URL returned error:404 downloading perl-error-0.17029-2-any.pkg.tar.xz... error: failed retrieving file 'perl-timedate-2.33-2-any.pkg.tar.xz' from mirrors.tuna.tsinghua.edu.cn : The requested URL returned error: 404 downloading perl-timedate-2.33-2-any.pkg.tar.xz... error: failed retrieving file 'perl-mailtools-2.21-4-any.pkg.tar.xz' from mirrors.tuna.tsinghua.edu.cn : The requested URL returned error: 404 downloading perl-mailtools-2.21-4-any.pkg.tar.xz... error: failed retrieving file 'git-2.29.2-1-aarch64.pkg.tar.xz' from mirrors.tuna.tsinghua.edu.cn : The requested URL returned error: 404 downloading git-2.29.2-1-aarch64.pkg.tar.xz... error: failed retrieving file 'rsync-3.2.3-1-aarch64.pkg.tar.xz' from mirrors.tuna.tsinghua.edu.cn : The requested URL returned error: 404 downloading rsync-3.2.3-1-aarch64.pkg.tar.xz... error: failed retrieving file 'gc-8.0.4-4-aarch64.pkg.tar.xz' from mirrors.tuna.tsinghua.edu.cn : The requested URL returned error: 404 downloading gc-8.0.4-4-aarch64.pkg.tar.xz... error: failed retrieving file 'guile-2.2.6-2-aarch64.pkg.tar.xz' from mirrors.tuna.tsinghua.edu.cn : The requested URL returned error: 404 downloading guile-2.2.6-2-aarch64.pkg.tar.xz... error: failed retrieving file 'vim-runtime-8.2.1704-1-aarch64.pkg.tar.xz' from mirrors.tuna.tsinghua.edu.cn : The requested URL returned error: 404
sed -i 's#archlinuxarm/$arch/$repo#archlinux/$repo/os/$arch#g' root/etc/pacman.d/mirrorlist
Thanks, Shenwei
docker build -t archlinux:testbed . -- 2.23.0

diff --git a/container/archlinux/build b/container/archlinux/build index 81feda2..f96ad40 100755 --- a/container/archlinux/build +++ b/container/archlinux/build @@ -2,4 +2,7 @@ # SPDX-License-Identifier: MulanPSL-2.0+ # Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.
+[ "$(arch)" == "x86_64" ] && + sed -i 's#archlinuxarm/$arch/$repo#archlinux/$repo/os/$arch#g' root/etc/pacman.d/mirrorlist
how about prepare the mirrorlist files for different arch, and copy different file for different arch? just like the follow: {CCI_SRC}/container/archlinux/ - aarch64/root/etc/pacman.d/mirrorlist - x86_64/root/etc/pacman.d/mirrorlist -------- Thanks Yu Chuan
+ docker build -t archlinux:testbed . -- 2.23.0

+[ "$(arch)" == "x86_64" ] && + sed -i 's#archlinuxarm/$arch/$repo#archlinux/$repo/os/$arch#g' root/etc/pacman.d/mirrorlist
how about prepare the mirrorlist files for different arch, and copy different file for different arch?
just like the follow: {CCI_SRC}/container/archlinux/ - aarch64/root/etc/pacman.d/mirrorlist - x86_64/root/etc/pacman.d/mirrorlist
good.
Thanks Yu Chuan
+ docker build -t archlinux:testbed . -- 2.23.0
participants (3)
-
Liu Yinsi
-
Xiao Shenwei
-
Yu Chuan