meson will occasionally call us even though the output directory
exists. Let's just nuke and recreate in that case.
OUTFILE_FUNCS = r"""
import os, sys
+import shutil
def d(path, mode):
os.mkdir(path, mode)
os.chdir(sys.argv[1])
+if os.path.exists('sys'):
+ shutil.rmtree('sys')
"""
#
import os, sys
+import shutil
def d(path, mode):
os.mkdir(path, mode)
os.chdir(sys.argv[1])
+if os.path.exists('sys'):
+ shutil.rmtree('sys')
d('sys', 0o755)
d('sys/kernel', 0o775)
f('sys/kernel/kexec_crash_loaded', 0o664, b'0\n')