i586-fix.sh 1.95 KB
Newer Older
1 2 3 4
#!/bin/sh

[ "$1" != "--run" ] && echo "Fix missed 32 bit package modules on 64 bit system" && exit

5 6
. $(dirname $0)/common.sh

7
[ "$(epm print info -a)" != "x86_64" ] && echo "Only x86_64 is supported" && exit 1
8

9
epm prescription i586-support
10

11 12
get_list_alt()
{
13
repo="$(epm print info -r)"
14 15

for i in glibc-nss glibc-gconv-modules \
16
         libnm \
17
         sssd-client \
18
         primus \
19
         libvulkan1 \
20
         libd3d \
Mikhail Tergoev's avatar
Mikhail Tergoev committed
21 22 23
         libgamemodeauto0 \
         vkBasalt \
         mangohud \
24 25 26 27 28
         $(epmqp --short libnss | grep "^libnss-") \
         $(epmqp --short xorg-dri | grep "^xorg-dri-")
do
    epm --quiet installed $i && LIST="$LIST i586-$i"
done
29

30 31 32 33 34 35
[ "$repo" = "p10" ] && for i in \
         vulkan-amdgpu
do
    epm --quiet installed $i && LIST="$LIST i586-$i"
done

36 37 38 39 40
for i in \
          libxnvctrl0 \
          libnvidia-ml \
          $(epmqp --short nvidia_glx | grep "^nvidia_glx")
do
41
    epm --quiet installed $i && LIST="$LIST i586-$i"
42
done
43
}
44

45 46 47
get_list_fedora()
{

48 49 50
# /usr/share/locale/de/LC_MESSAGES/NetworkManager.mo from NetworkManager-libnm conflicts
#         NetworkManager-libnm 

51 52
for i in \
         sssd-client \
53
         mesa-vulkan-drivers mesa-dri-drivers vulkan-loader mesa-libd3d
54 55 56 57 58 59 60 61
do
    epm --quiet installed $i && LIST="$LIST $i.i686"
done
}

vendor="$(epm print info -s)"

LIST=''
62
echo
63 64 65 66 67
echo "Checking for installed packages ... "
case "$vendor" in
    "alt")
        get_list_alt
        ;;
68
    "fedora"|"centos"|"redos"|"rhel")
69 70 71 72 73 74 75 76
        get_list_fedora
        ;;
    *)
        info "Unsupported $(epm print info -e) system. Just skipping the operation."
        exit
        ;;
esac

77 78 79 80 81 82
filtered_list=""
for pkg in $LIST; do
    if epm status --installable $pkg; then
        filtered_list="$filtered_list $pkg"
    fi
done
83 84
echo
echo "Installing all appropiate 32 bit packages ..."
85 86
noremove=''
[ -n "$auto" ] && noremove='--no-remove'
87
LIST="$filtered_list"
88
epm install $noremove $LIST
89 90 91 92 93
RES=$?

[ "$RES" = "0" ] || echo "Try do epm upgrade before."

exit $RES
94