diff options
Diffstat (limited to 'tools/templates/core_pkg/kernel/metadir/+DEINSTALL')
-rw-r--r-- | tools/templates/core_pkg/kernel/metadir/+DEINSTALL | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/templates/core_pkg/kernel/metadir/+DEINSTALL b/tools/templates/core_pkg/kernel/metadir/+DEINSTALL new file mode 100644 index 0000000..2ecfa6e --- /dev/null +++ b/tools/templates/core_pkg/kernel/metadir/+DEINSTALL @@ -0,0 +1,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 $? |