summaryrefslogtreecommitdiff
path: root/slackware-bootstrap/update-current
blob: 2ec182805b01051a95773cc6d44623be8850a10a (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
#!/bin/sh
basedir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

printf "\x1b[1;31m======================= [ \x1b[7;31m ATTENTION \x1b[0;0m\x1b[1;31m ] ========================\n\x1b[0;0m"
printf "\x1b[16;32mREAD CAREFULLY:\n\x1b[0;0m"
echo "you will now have to switch the branch to -current"
echo "same as before, you will have to manually"
echo "edit the mirror list."
echo "scroll down below the 15.0 section"
echo "and select a suitable -current mirror"
printf "\x1b[1;31m================================================================\n\x1b[0;0m"

read -p "press enter to continue"
nano /etc/slackpkg/mirrors

cp -f $basedir/slackpkg-blacklist-allowkern /etc/slackpkg/blacklist
echo "running full system update ..."
slackpkg update
slackpkg update gpg
printf "\x1b[1;31m======================= [ \x1b[7;31m ATTENTION \x1b[0;0m\x1b[1;31m ] ========================\n\x1b[0;0m"
echo "updating slackpkg, if prompted to overwrite configuration files"
echo "pick 'Remove (R)' !!!!"
read -p "press enter to continue"
slackpkg upgrade slackpkg
echo "==== [ updating system... ] ===="
slackpkg update gpg
slackpkg upgrade glibc libgcrypt aaa_glibc-solibs glib2 libffi
slackpkg upgrade gnupg gnupg2 openssl openssl-solibs openssl11 openssl11-solibs
slackpkg update gpg
cp -f $basedir/slackpkg-nogpg.conf /etc/slackpkg/slackpkg.conf
slackpkg install-new
slackpkg upgrade-all
slackpkg update gpg
slackpkg upgrade-all
cp -f $basedir/slackpkg-blacklist /etc/slackpkg/blacklist
cp -f $basedir/slackpkg.conf /etc/slackpkg/slackpkg.conf

isgeneric=1
kernel=$(ls /boot | grep "vmlinuz-generic-" | sort | tail -1 | cut -d '-' -f 3)
if [[ $kernel == "" ]]; then
  kernel=$(ls /boot | grep "vmlinuz-[0-9]" | sort | tail -1 | cut -d '-' -f 2)
  isgeneric=0
fi

initrdcmd="$(/usr/share/mkinitrd/mkinitrd_command_generator.sh -k $kernel)"
initrdcmd=$(echo $initrdcmd | tail -1)
$initrdcmd

echo "==================== [ kernel update ] =========================="
echo "your kernel has been updated by slackpkg. in order to boot,"
echo "you will need to update your bootloader config."
echo "if you do not use LILO, or do not boot off of your slackware disk"
echo "simply input 'n'"
echo "================================================================="

read -p "would you like to update your bootloader? [y/n] (y): " choice
if [[ $choice != 'n' ]]; then
  liloconfig
fi

rm /boot/vmlinuz
if [[ $isgeneric == 1 ]]; then
  ln -s /boot/vmlinuz-generic-$kernel /boot/vmlinuz
else
  ln -s /boot/vmlinuz-$kernel /boot/vmlinuz
fi

rm /boot/System.map
if [[ $isgeneric == 1 ]]; then
  ln -s /boot/System.map-generic-$kernel /boot/System.map
else
  ln -s /boot/System.map-$kernel /boot/System.map
fi

rm /boot/config
if [[ $isgeneric == 1 ]]; then
  ln -s /boot/config-generic-$kernel.x64 /boot/config
else
  ln -s /boot/config-$kernel.x64 /boot/config
fi

touch ~/.current-done