summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2020-03-23 15:15:31 +0100
committerMarkus Heiser <markus.heiser@darmarit.de>2020-03-23 15:15:31 +0100
commit103c542b374041c8b19e5867fbb32666bf23317b (patch)
tree97fa3871dcaf03849d97f9338a3d35e9d747bc8c /utils
parent95bed4910a2045d2f5884f9e32295d42de4c6672 (diff)
parent21ba25ebb8deba7ffa6537e6c1196546604de712 (diff)
downloadsearxng-103c542b374041c8b19e5867fbb32666bf23317b.tar.gz
searxng-103c542b374041c8b19e5867fbb32666bf23317b.zip
Merge branch 'filtron' of https://github.com/return42/searx into filtron
Diffstat (limited to 'utils')
-rwxr-xr-xutils/lib.sh22
-rwxr-xr-xutils/lxc.sh17
2 files changed, 34 insertions, 5 deletions
diff --git a/utils/lib.sh b/utils/lib.sh
index e9bfc929f..50f15a690 100755
--- a/utils/lib.sh
+++ b/utils/lib.sh
@@ -1090,6 +1090,28 @@ touch "/.lxcenv"
ls -l "/.lxcenv"
EOF
}
+
+# apt packages
+LXC_BASE_PACKAGES_debian="git build-essential"
+
+# pacman packages
+LXC_BASE_PACKAGES_arch="git base-devel"
+
+# dnf packages
+LXC_BASE_PACKAGES_fedora="git @development-tools"
+
+case $DIST_ID in
+ ubuntu|debian) LXC_BASE_PACKAGES="${LXC_BASE_PACKAGES_debian}" ;;
+ arch) LXC_BASE_PACKAGES="${LXC_BASE_PACKAGES_arch}" ;;
+ fedora) LXC_BASE_PACKAGES="${LXC_BASE_PACKAGES_fedora}" ;;
+ *) err_msg "$DIST_ID-$DIST_VERS: pkg_install LXC_BASE_PACKAGES not yet implemented" ;;
+esac
+
+lxc_install_base_packages() {
+ info_msg "install LXC_BASE_PACKAGES in container $1"
+ pkg_install "${LXC_BASE_PACKAGES}"
+}
+
lxc_exists(){
# usage: lxc_exists <name> || echo "container <name> does not exists"
diff --git a/utils/lxc.sh b/utils/lxc.sh
index 56450c4db..6070735ea 100755
--- a/utils/lxc.sh
+++ b/utils/lxc.sh
@@ -82,10 +82,10 @@ usage::
$_cmd [start|stop] [containers|<name>]
$_cmd show [info|config|suite|images]
$_cmd cmd [--|<name>] '...'
- $_cmd install [suite|buildhost]
+ $_cmd install [suite|base|buildhost]
build
- :containers: build & launch all LXC containers of the suite
+ :containers: build, launch and 'install basic' packages on 'containers'
copy:
:images: copy remote images of the suite into local storage
remove
@@ -105,7 +105,8 @@ cmd
:<name>: run command '...' in container <name>
install
:suite: install LXC suite; ${lxc_suite_install_info}
- :buildhost: prepare LXC; buildhost
+ :base: prepare LXC; install basic packages
+ :buildhost: prepare LXC; install buildhost packages
EOF
usage_images
@@ -217,6 +218,7 @@ main() {
esac
;;
__show)
+ # wrapped show commands, called once in each container
case $2 in
suite) lxc_suite_info ;;
esac
@@ -238,14 +240,17 @@ main() {
install)
sudo_or_exit
case $2 in
- suite) lxc_exec "${LXC_REPO_ROOT}/utils/lxc.sh" __install suite;;
- buildhost) lxc_exec "${LXC_REPO_ROOT}/utils/lxc.sh" __install buildhost;;
+ suite|base|buildhost)
+ lxc_exec "${LXC_REPO_ROOT}/utils/lxc.sh" __install $2
+ ;;
*) usage "$_usage"; exit 42 ;;
esac
;;
__install)
+ # wrapped install commands, called once in each container
case $2 in
suite) lxc_suite_install ;;
+ base) FORCE_TIMEOUT=0 lxc_install_base_packages ;;
buildhost) lxc_suite_prepare_buildhost ;;
esac
;;
@@ -269,6 +274,8 @@ build_instances() {
lxc_config_containers
lxc_boilerplate_containers
echo
+ lxc_exec "${LXC_REPO_ROOT}/utils/lxc.sh" __install base
+ echo
lxc list "$LXC_HOST_PREFIX"
}