diff --git a/meta/classes-recipe/rootfs-add-files.bbclass b/meta/classes-recipe/rootfs-add-files.bbclass
index 38f739ee..d135f6d7 100644
--- a/meta/classes-recipe/rootfs-add-files.bbclass
+++ b/meta/classes-recipe/rootfs-add-files.bbclass
@@ -18,24 +18,25 @@ ROOTFS_ADDITIONAL_FILES ??= ""
 python rootfs_add_files() {
     postprocess_additional_files = d.getVar('ROOTFS_ADDITIONAL_FILES').split()
     rootfsdir = d.getVar("ROOTFSDIR")
+    privileged = run_privileged_cmd(d).split()
 
     for entry in postprocess_additional_files:
         additional_file_entry = f"ROOTFS_ADDITIONAL_FILE_{entry}"
         destination = d.getVarFlag(additional_file_entry, "destination") or ""
         source = d.getVarFlag(additional_file_entry, "source") or ""
-        if os.path.exists(f"{rootfsdir}/{destination}"):
-            bb.process.run([ "/usr/bin/rm", "-f", f"{destination}"])
+        if os.path.lexists(f"{rootfsdir}/{destination}"):
+            bb.process.run(privileged + ["/usr/bin/rm", "-f", f"{rootfsdir}/{destination}"])
 
         dest_dir = os.path.dirname(destination)
-        bb.process.run(["sudo", "-E", "/usr/bin/mkdir", "-p", f"{rootfsdir}/{dest_dir}" ])
+        bb.process.run(privileged + ["/usr/bin/mkdir", "-p", f"{rootfsdir}/{dest_dir}" ])
         # empty source creates only an empty destination file
         if not source:
-            bb.process.run(["sudo", "-E", "/usr/bin/touch", f"{rootfsdir}/{destination}" ])
+            bb.process.run(privileged + ["/usr/bin/touch", f"{rootfsdir}/{destination}" ])
             return
 
         if not os.path.exists(f"{source}"):
             bb.error(f"{source} does not exists and cannot be copied to the rootfs!")
         # no recursive copy only single files
-        bb.process.run(["sudo", "-E", "/usr/bin/cp", "-a",  f"{source}", f"{rootfsdir}/{destination}" ])
+        bb.process.run(privileged + ["/usr/bin/cp", "-a",  f"{source}", f"{rootfsdir}/{destination}" ])
 }
 ROOTFS_INSTALL_COMMAND += "rootfs_add_files"
