set selinux context for /overlay to default_t
@@ -118,10 +118,16 @@ sed 's/#.*//;/^[[:blank:]]*$/d' \
used_inodes=$(for (( inode=1; inode <= "$num_inodes"; inode++ )); do echo "testi <$inode>"; done | debugfs "$file" 2> /dev/null | grep -oP '(?<=Inode )[0-9]+(?= is marked in use)')
for inode in $used_inodes; do for field in {a,m,c}time; do echo "set_inode_field <$inode> $field $timestamp"; done; done | debugfs -w "$file" &> /dev/null
- chcon -R system_u:object_r:dosfs_t:s0 "$rootfs_work/boot/efi"
+ if [[ -d "$rootfs_work/boot/efi" ]]; then
+ chcon system_u:object_r:dosfs_t:s0 "$rootfs_work/boot/efi"
+ fi
rm -rf "$rootfs_work$target"
mkdir "$rootfs_work$target"
+
+ if [[ "$target" = "/overlay" ]]; then
+ chcon system_u:object_r:default_t:s0 "$rootfs_work/overlay"
+ fi
;;
"vfat")
uuid=${uuid:-$(echo "gardenlinux:$version:fs_uuid:$fs:$target" | sha256sum | cut -c -8)}
