/usr/lib/lilo/hooks/kernel/preinst.d/chattr-lilo is in lilo 1:24.2-3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 | #!/bin/sh
#
# chattr-lilo - preinst script for sure kernel install/upgrade
#
# Copyright (C) 2012-2014 Joachim Wiedorn
# All rights reserved.
#
# Licensed under the terms contained in the file 'COPYING'
# in the source directory.
#
set -e
CHATTR=`which chattr` || exit 0
XFSINFO=`which xfs_info` || exit 0
if test -x $XFSINFO; then
# check whether root partition is of xfs type
[ `LANG=C $XFSINFO / | grep -c "attr="` -eq 1 ] || exit 0
fi
# second argument gives the path and filename
# first argument gives only the kernel version
if [ -n "${2}" ]; then
IMAGE="${2}"
elif [ -n "${1}" ]; then
IMAGE="/boot/vmlinuz-${1}"
else
echo "[preinst.d] do not execute chattr"
exit 0
fi
if [ -f "$IMAGE" ]; then
echo "[preinst.d] chattr -i ${IMAGE}" >&2
$CHATTR -i "${IMAGE}"
fi
# end of file
|