mirror of
https://github.com/flatcar/scripts.git
synced 2026-01-23 01:11:36 +01:00
build_image: read files for IMA measurement
Signed-off-by: Vincent Batts <vbatts@kinvolk.io>
This commit is contained in:
parent
bc11ee282d
commit
84de552972
@ -613,6 +613,15 @@ EOF
|
||||
|
||||
write_contents "${root_fs_dir}" "${BUILD_DIR}/${image_contents}"
|
||||
|
||||
# read the contents of all regular files so that the IMA xattr are written
|
||||
# for each file
|
||||
if [ -d /sys/module/ima ] ; then
|
||||
echo "IMA present. Measuring files of image."
|
||||
sudo find "${root_fs_dir}" -type f -exec dd if="{}" of=/dev/null count=0 status=none \; ||:
|
||||
else
|
||||
echo "WARN: IMA not present. Not measuring files of image."
|
||||
fi
|
||||
|
||||
# Zero all fs free space to make it more compressible so auto-update
|
||||
# payloads become smaller, not fatal since it won't work on linux < 3.2
|
||||
sudo fstrim "${root_fs_dir}" || true
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user