mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-19 09:35:12 +00:00
In ns flavor for instance the binfmt_misc is not c/r-ed, but without this cleanup the test will not detect that as it would inherit correct unchanged binfmt_misc step which was there on dump. Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
22 lines
409 B
Bash
Executable file
22 lines
409 B
Bash
Executable file
#!/bin/bash
|
|
|
|
[ "$1" == "--clean" ] || [ "$1" == "--pre-restore" ] || exit 0
|
|
|
|
name=$(basename -s .hook $0).test
|
|
|
|
tname=$(mktemp -d binfmt_misc.XXXXXX)
|
|
mount -t binfmt_misc none $tname
|
|
|
|
echo "Cleaning $name: $@"
|
|
set +e
|
|
if [ -e $tname/${name}_magic ]; then
|
|
echo -1 > $tname/${name}_magic
|
|
fi
|
|
|
|
if [ -e $tname/${name}_extension ]; then
|
|
echo -1 > $tname/${name}_extension
|
|
fi
|
|
set -e
|
|
|
|
umount "$tname"
|
|
rmdir "$tname"
|