blob: aab42e4bdc3b86325e3d91e3d81e53ad3d9a63ce (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#!/bin/sh
if [ "${2}" != "DEINSTALL" ]; then
exit 0
fi
echo "===> Keeping a copy of current kernel in /boot/kernel.old"
# Check if there is a current kernel to be moved
if [ ! -f /boot/kernel/kernel.gz ] \
&& [ ! -f /boot/kernel/kernel ]; then
echo "ERROR: Current kernel not found"
exit 1
fi
[ -d /boot/kernel.old ] \
&& rm -rf /boot/kernel.old
cp -r /boot/kernel /boot/kernel.old
exit $?
|