Commit c5659747 authored by Philip Müller's avatar Philip Müller

Merge branch 'development'

parents f22aaa84 a3a8c480
Main developers:
Roland Singer <roland@manjaro.org>
Code refactoring:
Łukasz Matysiak <december0123@gmail.com>
......@@ -8,14 +8,7 @@ CHECKCONFIG="false"
SETGL=""
SETXORGCONF=""
ARCH=$(uname -m)
if [ -d /run/openrc ];then
IS_OPENRC=1
MODULES_LOAD="/etc/conf.d/modules"
else
IS_OPENRC=0
MODULES_LOAD="/etc/modules-load.d"
fi
MODULES_LOAD="/etc/modules-load.d"
# lib32 config true/false
MHWD64CONF="/etc/mhwd-x86_64.conf"
......@@ -44,40 +37,25 @@ set_modules() {
for module in $2
do
echo "blacklist ${module}" >> "/etc/modprobe.d/mhwd-gpu.conf"
# Unload module if X is not running
if [ ! "$(pgrep X)" ]; then
rmmod -f ${module}
fi
done
if (( $IS_OPENRC ));then
echo "##" > "${MODULES_LOAD}"
echo "## Generated by mhwd - Manjaro Hardware Detection" >> "${MODULES_LOAD}"
echo "##" >> "${MODULES_LOAD}"
echo " " >> "${MODULES_LOAD}"
echo 'modules="'$1'"' >> "${MODULES_LOAD}"
for module in $1
do
# Load module if X is not running
if [ ! "$(pgrep X)" ]; then
modprobe ${module}
fi
done
else
echo "##" > "${MODULES_LOAD}/mhwd-gpu.conf"
echo "## Generated by mhwd - Manjaro Hardware Detection" >> "${MODULES_LOAD}/mhwd-gpu.conf"
echo "##" >> "${MODULES_LOAD}/mhwd-gpu.conf"
echo " " >> "${MODULES_LOAD}/mhwd-gpu.conf"
for module in $1
do
echo "${module}" >> "${MODULES_LOAD}/mhwd-gpu.conf"
# Load module if X is not running
if [ ! "$(pgrep X)" ]; then
modprobe ${module}
fi
done
fi
echo "##" > "${MODULES_LOAD}/mhwd-gpu.conf"
echo "## Generated by mhwd - Manjaro Hardware Detection" >> "${MODULES_LOAD}/mhwd-gpu.conf"
echo "##" >> "${MODULES_LOAD}/mhwd-gpu.conf"
echo " " >> "${MODULES_LOAD}/mhwd-gpu.conf"
for module in $1
do
echo "${module}" >> "${MODULES_LOAD}/mhwd-gpu.conf"
# Load module if X is not running
if [ ! "$(pgrep X)" ]; then
modprobe ${module}
fi
done
}
# param 1: Xorg configuration file
......@@ -89,7 +67,6 @@ set_xorg()
if [ -e "$1" ]; then
ln -sf "$1" "${MHWDXORGCONF}"
echo "xorg configuration file: '$1'"
else
echo "warning: could not find '$1'!"
......@@ -110,7 +87,6 @@ set_Gl() {
ln -sf "$1" /usr/lib/libGL.so
ln -sf "$1" /usr/lib/libGL.so.1
ln -sf "$1" /usr/lib/libGL.so.1.2.0
echo "libGl: '$1'"
else
echo "warning: could not find '$1'!"
......@@ -120,7 +96,6 @@ set_Gl() {
ln -sf "$2" /usr/lib/libGLESv1_CM.so
ln -sf "$2" /usr/lib/libGLESv1_CM.so.1
ln -sf "$2" /usr/lib/libGLESv1_CM.so.1.1.0
echo "libGLESv1: '$2'"
else
echo "warning: could not find '$2'!"
......@@ -130,7 +105,6 @@ set_Gl() {
ln -sf "$3" /usr/lib/libGLESv2.so
ln -sf "$3" /usr/lib/libGLESv2.so.2
ln -sf "$3" /usr/lib/libGLESv2.so.2.0.0
echo "libGLESv2: '$3'"
else
echo "warning: could not find '$3'!"
......@@ -140,7 +114,6 @@ set_Gl() {
ln -sf "$4" /usr/lib/libEGL.so
ln -sf "$4" /usr/lib/libEGL.so.1
ln -sf "$4" /usr/lib/libEGL.so.1.0.0
echo "libEGL: '$4'"
else
echo "warning: could not find '$4'!"
......@@ -152,7 +125,6 @@ set_Gl() {
ln -sf "$6" /usr/lib32/libGL.so
ln -sf "$6" /usr/lib32/libGL.so.1
ln -sf "$6" /usr/lib32/libGL.so.1.2.0
echo "lib32-libGl: '$6'"
fi
......@@ -160,7 +132,6 @@ set_Gl() {
ln -sf "$7" /usr/lib32/libGLESv1_CM.so
ln -sf "$7" /usr/lib32/libGLESv1_CM.so.1
ln -sf "$7" /usr/lib32/libGLESv1_CM.so.1.1.0
echo "lib32-libGLESv1: '$7'"
fi
......@@ -168,7 +139,6 @@ set_Gl() {
ln -sf "$8" /usr/lib32/libGLESv2.so
ln -sf "$8" /usr/lib32/libGLESv2.so.2
ln -sf "$8" /usr/lib32/libGLESv2.so.2.0.0
echo "lib32-libGLESv2: '$8'"
fi
......@@ -176,7 +146,6 @@ set_Gl() {
ln -sf "$9" /usr/lib32/libEGL.so
ln -sf "$9" /usr/lib32/libEGL.so.1
ln -sf "$9" /usr/lib32/libEGL.so.1.0.0
echo "lib32-libEGL: '$9'"
fi
......@@ -184,7 +153,6 @@ set_Gl() {
if [ -e "$5" ]; then
ln -sf "$5" /usr/lib/xorg/modules/extensions/libglx.so
echo "libglx: '$5'"
else
echo "warning: could not find '$5'!"
......@@ -210,12 +178,14 @@ print_link_destination_if_exists()
print_status()
{
echo ":: status"
if [ "${MHWD64_IS_LIB32}" == "true" ];then
print_link_destination_if_exists "/usr/lib32/libGL.so" " lib32-libGl:"
print_link_destination_if_exists "/usr/lib32/libGLESv1_CM.so" " lib32-libGLESv1:"
print_link_destination_if_exists "/usr/lib32/libGLESv2.so" " lib32-libGLESv2:"
print_link_destination_if_exists "/usr/lib32/libEGL.so" " lib32-libEGL:"
fi
print_link_destination_if_exists "/usr/lib/libGL.so" " libGl:"
print_link_destination_if_exists "/usr/lib/libGLESv1_CM.so" " libGLESv1:"
print_link_destination_if_exists "/usr/lib/libGLESv2.so" " libGLESv2:"
......@@ -233,9 +203,11 @@ print_help()
echo " --check check for invalid symlinks and repair"
echo " --setgl [mesa/nvidia/catalyst] set libgl and libglx"
echo " --setxorg [PATH] set xorg configuration file"
if [ "${ARCH}" == "x86_64" ];then
echo " --setlib32 [true/false] set lib32 support"
fi
echo ""
}
......
......@@ -24,7 +24,7 @@ Config::Config(std::string configPath, std::string type)
bool Config::readConfigFile(std::string configPath)
{
std::ifstream file(configPath.c_str(), std::ios::in);
std::ifstream file(configPath.c_str());
if (!file.is_open())
{
......@@ -216,7 +216,7 @@ std::vector<std::string> Config::splitValue(Vita::string str, Vita::string onlyE
std::vector<std::string> final;
for (auto&& iterator = work.begin(); iterator != work.end();
iterator++)
++iterator)
{
if (("" != *iterator) && onlyEnding.empty())
{
......
This diff is collapsed.
......@@ -18,7 +18,8 @@ class Transaction
{
public:
Transaction() = delete;
Transaction(Data data, std::shared_ptr<Config> config, MHWD::TRANSACTIONTYPE type, bool allowReinstallation);
Transaction(Data data, std::shared_ptr<Config> config, MHWD::TRANSACTIONTYPE type,
bool allowReinstallation);
bool isAllowedToReinstall() const;
std::shared_ptr<Config> config_;
......@@ -27,6 +28,7 @@ public:
std::vector<std::shared_ptr<Config>> conflictedConfigs_;
std::vector<std::shared_ptr<Config>> configsRequirements_;
private:
bool allowedToReinstall_ = false;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment