summarylogtreecommitdiffstats
path: root/archlinux.patch
blob: 6bb792b78b22ce17b8c0c629cb25eb02735e8924 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
diff --color -ruN --no-dereference orig/bin/ci-toolbox src/bin/ci-toolbox
--- orig/bin/ci-toolbox	2021-11-26 12:31:26.000000000 +0100
+++ src/bin/ci-toolbox	2021-12-30 11:12:47.342611768 +0100
@@ -34,7 +34,7 @@
 
 CI_PROJECT_DIR="$(git rev-parse --show-toplevel 2>/dev/null || true)"
 
-CITBX_SEARCH_PATH=${CITBX_SEARCH_PATH:-"tools/ci-toolbox:tools/gitlab-ci:/usr/local/lib/ci-toolbox:/usr/lib/ci-toolbox"}
+CITBX_SEARCH_PATH=${CITBX_SEARCH_PATH:-"$(dirname $(readlink -f "$0"))"}
 
 _IFS=$IFS
 IFS=':'
diff --color -ruN --no-dereference orig/lib/ci-toolbox/common.sh src/lib/ci-toolbox/common.sh
--- orig/lib/ci-toolbox/common.sh	2021-11-26 12:31:26.000000000 +0100
+++ src/lib/ci-toolbox/common.sh	2021-12-30 09:58:06.174234676 +0100
@@ -46,15 +46,12 @@
 
 # Get the real core number
 ncore() {
-    lscpu | awk -F ':' '
-        /^Core\(s\) per socket/ {
+    cat /proc/cpuinfo | grep '^core id' | sort | awk -F ':' '
+        /./ {
             nc=$2;
         }
-        /^Socket\(s\)/ {
-            ns=$2;
-        }
         END {
-            print nc*ns;
+            print nc + 1;
         }'
 }
 
diff --color -ruN --no-dereference orig/lib/ci-toolbox/env-setup/archlinux.sh src/lib/ci-toolbox/env-setup/archlinux.sh
--- orig/lib/ci-toolbox/env-setup/archlinux.sh	1970-01-01 01:00:00.000000000 +0100
+++ src/lib/ci-toolbox/env-setup/archlinux.sh	2021-12-30 09:24:55.080856864 +0100
@@ -0,0 +1,31 @@
+. $CITBX_TOOL_DIR/env-setup/common.sh
+arch_is_installed() {
+    /usr/bin/pacman -Q "$1" >/dev/null 2>&1
+}
+arch_install() {
+    _sudo /usr/bin/pacman -Sy "$@"
+}
+INSTALL_PKGS=()
+if setup_component_enabled base-pkgs; then
+    INSTALL_PKGS+=(curl docker gawk python-yaml jq)
+fi
+if setup_component_enabled git-lfs; then
+    INSTALL_PKGS+=(git-lfs)
+fi
+if [ "${#INSTALL_PKGS[@]}" -gt 0 ]; then
+    print_info "Installing packages..."
+    arch_install "${INSTALL_PKGS[@]}"
+fi
+if setup_component_enabled base-pkgs; then
+    # add user to docker group
+    install_pkgs_postinst
+fi
+if setup_component_enabled docker-cfg; then
+    print_info "Configuring docker..."
+    write_daemon_json
+    _sudo ip link del docker0 2>/dev/null || true
+    _sudo systemctl restart docker
+fi
+if setup_component_enabled ci-toolbox; then
+    print_info "Don’t use this command to update the tool, use your package manager"
+fi