Преглед изворни кода

fix(deps): add detection for lxc container add hostname dependency (#3350)

Christian пре 5 година
родитељ
комит
7a30e36de4
1 измењених фајлова са 18 додато и 0 уклоњено
  1. 18 0
      lgsm/functions/check_deps.sh

+ 18 - 0
lgsm/functions/check_deps.sh

@@ -454,6 +454,15 @@ fn_deps_build_debian(){
 	elif [ "${shortname}" == "pvr" ]; then
 		array_deps_required+=( libc++1 )
 	fi
+
+	# check if system is a lxc container and the hostname dependency.
+	if command -v systemd-detect-virt &> /dev/null; then
+		systemd_virt=$(systemd-detect-virt)
+		if [ "${systemd_virt}" == "lxc" ]||[ "${systemd_virt}" == "lxc-libvirt" ]; then
+			array_deps_required+=( hostname )
+		fi
+	fi
+
 	fn_deps_email
 	fn_check_loop
 }
@@ -557,6 +566,15 @@ fn_deps_build_redhat(){
 	elif [ "${shortname}" == "pvr" ]; then
 		array_deps_required+=( libcxx )
 	fi
+
+	# check if system is a lxc container and the hostname dependency.
+	if command -v systemd-detect-virt &> /dev/null; then
+		systemd_virt=$(systemd-detect-virt)
+		if [ "${systemd_virt}" == "lxc" ]||[ "${systemd_virt}" == "lxc-libvirt" ]; then
+			array_deps_required+=( hostname )
+		fi
+	fi
+
 	fn_deps_email
 	fn_check_loop
 }