summaryrefslogtreecommitdiffstats
path: root/tools/templates/core_pkg/kernel/metadir/+DEINSTALL
blob: 2ecfa6eb3d22f60e9d746393ce2249299ae0fe2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/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 ]; 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 $?
OpenPOWER on IntegriCloud