summaryrefslogtreecommitdiffstats
path: root/abs/core/update81-82.sh
blob: 8967549d894dd2394cc4955d0af7a389806146f9 (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#!/bin/bash
#This script should be used to update from R8.1 to R8.2 ONLY
#

#touch /bin/this_should_stop_it

echo ""
echo "About to update the OS to LinHES 8.2"
echo "This process will only work if currently running LinHES 8.1 or later"
echo "*  Please respond with Y to ALL the yes/no questions"
echo "*  Answer Y to remove sysvinit"
echo "*  If prompted about libgl, select the gl that is appropiate for your system"
echo ""
echo "Press Y to continue, any other key to stop"


read a
if [ x$a != "xY" ]
then
    echo " Y NOT selected, exiting"
    exit 3
fi


pacman -Ssyy LinHES-system | awk '{print $2}' | grep -q "8.2-"
pr=$?
if [ $pr != 0 ]
then
    echo ""
    echo "WARNING! The current repos in /etc/pacman.conf do not look like they"
    echo "         contain packages for LinHES 8.2."
    echo "Press Y to continue (not recommended), any other key to stop"

    read ans
    if [ x$ans != "xY" ]
    then
        echo " Y NOT selected, exiting"
        exit 3
    fi
fi



echo "Downloading filesystem and glibc for later use, please wait..."
curl -o filesystem-itermediate.pkg.tar.xz http://linhes.org/repo/x86_64/filesystem-itermediate.pkg.tar.xz
rc=$?
if [ $rc != 0 ]
then
    echo "Couldn't download filesystem pkg"
    exit 1
else
    echo "Filesystem pkg downloaded"
fi

curl -o glibc-2.18-11-x86_64.pkg.tar.xz http://linhes.org/repo/x86_64/core-testing/glibc-2.18-11-x86_64.pkg.tar.xz
rc=$?
if [ $rc != 0 ]
then
    echo "Couldn't download glibc pkg"
    exit 1
else
    echo "glibc pkg downloaded"
fi


pacman -S --noconfirm tdb

echo "Removing select symlinks and files not in poweroff-scripts package..."

rm -f /usr/lib/libtalloc.so.1
rm -f /usr/lib/libtalloc.so.2

if [ -L /usr/sbin ]
then
    rm -f /usr/sbin/reb*
    rm -f /usr/sbin/pow*
    rm -f /usr/sbin/hal*
fi

if [ -L /sbin ]
then
    rm -f /sbin/reb*
    rm -f /sbin/pow*
    rm -f /sbin/hal*
fi


echo "Updating packages..."
pacman -Syu --ignore filesystem,bash,glibc
pacman -R tcp_wrappers  --noconfirm
pacman -S bash --noconfirm


pacman -U ./glibc-2.18-11-x86_64.pkg.tar.xz ./filesystem-itermediate.pkg.tar.xz --noconfirm
rc=$?
if [ $rc != 0 ]
then
  echo "Filesystem-itermediate update was unable to install"
  echo "Please check /bin /usr/sbin /sbin "
  echo "for packages that need to be updated"
  exit 2
fi
pacman -Su


if [ -e /etc/udev/rules.d/80-net-name-slot.rules ]
then
  rm -f /etc/udev/rules.d/80-net-name-slot.rules
fi

ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules

pacman -S linux --noconfirm
pacman -S filesystem --noconfirm
rc=$?
if [ $rc != 0 ]
then
  echo "Filesystem update was unable to install"
  echo "Please check /bin /usr/sbin /sbin "
  echo "for packages that need to be updated"
  exit 2
else
  echo "New filesystem in place"
  echo "upgrade was a success"
  echo "please reboot"
fi