/usr/src/kernel-patches/powerpc/unpatch/xenomai is in linux-patch-xenomai 2.5.5.2-1ubuntu2.
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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | #! /bin/bash
set -e
# This "unpatch" script was automatically generated by
# dh_installkpatches from unpatch.tmpl $Revision: 1.17.1.4.1.24.1.5 $
if ! [ -d kernel -a -d Documentation ]
then
echo >&2 "Not in kernel top level directory. Exiting"
exit 1
fi
ARCHITECTURE=`dpkg --print-installation-architecture`
PATCHID=xenomai
PATCHARCH=powerpc
TOPPATCHDIR=/usr/src/kernel-patches
DECOMPRESSOR="zcat -f"
STAMP=debian/APPLIED_${PATCHARCH}_$PATCHID
PATCH_OPTIONS="--ignore-whitespace --silent"
[ -f $STAMP ] || exit 0
if [ ! -s $STAMP ]
then
cat >&2 <<EOF
ERROR: "Xenomai realtime kernel patches" patch was applied using old mechanism.
The relevant patch file may even not be on your system any more.
I strongly suggest you remove this kernel tree and unpack a clean one.
EOF
exit 1
fi
if [ $(echo $(wc -l < $STAMP) ) != 1 ]
then
. $STAMP
else
# old format
APPLY_INFO=$(cat $STAMP)
PATCHFILE=$(echo ${APPLY_INFO} | cut -d# -f1)
STRIPLEVEL=$(echo ${APPLY_INFO} | cut -d# -f2)
fi
if [ ! -r $PATCHFILE ]
then
cat >&2 <<EOF
ERROR: applied "Xenomai realtime kernel patches" patch file could not be found.
Presumably the package containing it was removed or upgraded.
I strongly suggest you remove this kernel tree and unpack a clean one.
EOF
exit 1
fi
if grep -l "^DEPENDS=.*[' ]powerpc/unpatch/xenomai[' ]" debian/APPLIED_* >/dev/null 2>/dev/null
then
# There are patches depending on this one, to be removed before.
# the dep will be removed by the last of those other patches.
echo >&2 "NOT unpatching \"Xenomai realtime kernel patches\" since other patches still rely on it"
exit 0
fi
echo >&2 "START unpatching xenomai patch (Xenomai realtime kernel patches)"
$DECOMPRESSOR $PATCHFILE | patch -R -p$STRIPLEVEL $PATCH_OPTIONS
rm -f debian/APPLIED_${PATCHARCH}_$PATCHID debian/image.d/register-xenomai
if [ -n "$DEPENDS" ]
then
echo >&2 "Also un-applying the following patches: $DEPENDS"
for dep in $DEPENDS
do
if [ -x ${TOPPATCHDIR}/$dep ]
then
${TOPPATCHDIR}/$dep
else
echo >&2 "Could not unpatch dependency: $dep - stopping here."
echo >&2 "END unpatching xenomai patch"
exit 1
fi
done
fi
echo >&2 "Removing empty files:"
# make an exception for ./debian, or else the stamp files will go too.
find . -path ./debian -prune -o \
-type f -size 0 ! -name 'APPLIED*' -exec rm {} \; -print
echo >&2 "Done."
rmdir -p debian/image.d || true
echo >&2 "END unpatching xenomai patch"
|