From e6bba312c548007b7a5fb68f275187ce6fc22e2e Mon Sep 17 00:00:00 2001 From: 0xF4CED <24809481+0xF4CED@users.noreply.github.com> Date: Fri, 10 Nov 2023 16:43:56 +0100 Subject: [PATCH] Fix selinux for vtoycow in CreatePersistentImg.sh Label the overlayfs root directory in vtoycow imgs with the appropriate selinux context to enable booting without disabling selinux. --- INSTALL/CreatePersistentImg.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/INSTALL/CreatePersistentImg.sh b/INSTALL/CreatePersistentImg.sh index 21d65c47..6169fc16 100644 --- a/INSTALL/CreatePersistentImg.sh +++ b/INSTALL/CreatePersistentImg.sh @@ -118,14 +118,19 @@ mkfs -t $fstype $fsopt -L $label $freeloop sync -if [ -n "$config" ]; then +if [ -n "$config" ] || [ "$label" = "vtoycow" ]; then if [ -d ./persist_tmp_mnt ]; then rm -rf ./persist_tmp_mnt fi mkdir ./persist_tmp_mnt if mount $freeloop ./persist_tmp_mnt; then - echo '/ union' > ./persist_tmp_mnt/$config + if [ -n "$config" ]; then + echo '/ union' > ./persist_tmp_mnt/$config + elif [ "$label" = "vtoycow" ]; then + mkdir -p ./persist_tmp_mnt/vtoyoverlayfs/overlayfs/ + chcon system_u:object_r:root_t:s0 ./persist_tmp_mnt/vtoyoverlayfs/overlayfs + fi sync umount ./persist_tmp_mnt fi