@@ -49,7 +49,7 @@ _require dd mkfs blkid e2fsck tune2fs evmctl setfattr
trap cleanup SIGINT SIGTERM EXIT
-cleanup() {
+_cleanup() {
if [ -e $TST_MNT ]; then
if [ $LOOPBACK_MOUNTED -eq 1 ]; then
umount $TST_MNT
@@ -61,6 +61,11 @@ cleanup() {
_report_exit_and_cleanup
}
+cleanup() {
+ _cleanup_user_mode _cleanup
+ _report_exit_and_cleanup
+}
+
# Loopback mount a file
mount_loopback_file() {
local ret
@@ -309,6 +314,15 @@ measure-ima() {
return "$error"
}
+# Run in User Mode Linux.
+_run_user_mode ../linux $PWD/$(basename $0) "UML_MODE=$UML_MODE PATH=$PATH LD_LIBRARY_PATH=$LD_LIBRARY_PATH VERBOSE=$VERBOSE"
+
+# Exit from the parent if UML was used.
+_exit_user_mode ../linux
+
+# Mount filesystems in UML environment.
+_init_user_mode
+
# Dependency on being able to read and write the IMA policy file.
# Requires both CONFIG_IMA_WRITE_POLICY, CONFIG_IMA_READ_POLICY be
# enabled.