3 # chattr-lilo - prerm script for sure kernel upgrade/remove
5 # Copyright (C) 2012-2014 Joachim Wiedorn
8 # Licensed under the terms contained in the file 'COPYING'
9 # in the source directory.
14 CHATTR=`which chattr` || exit 0
15 XFSINFO=`which xfs_info` || exit 0
17 if test -x $XFSINFO; then
18 # check whether root partition is of xfs type
19 [ `LANG=C $XFSINFO / | grep -c "attr="` -eq 1 ] || exit 0
22 # second argument gives the path and filename
23 # first argument gives only the kernel version
24 if [ -n "${2}" ]; then
26 elif [ -n "${1}" ]; then
27 IMAGE="/boot/vmlinuz-${1}"
29 echo "[prerm.d] do not execute chattr"
33 if [ -f "$IMAGE" ]; then
34 echo "[prerm.d] chattr -i ${IMAGE}" >&2