Browse Source

systemd-boot.bbclass: Fix SYSYTEMD_BOOT_CFG creation

This patch makes sure the directory which will contain
the systemd configuration (loader.conf) is created before
the configuration file is written, fixing errors when it
tried to write it to a non-existent directory

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Alejandro Hernandez 7 years ago
parent
commit
f4ba23212c
1 changed files with 3 additions and 0 deletions
  1. 3 0
      meta/classes/systemd-boot.bbclass

+ 3 - 0
meta/classes/systemd-boot.bbclass

@@ -72,6 +72,9 @@ python build_efi_cfg() {
         return
 
     cfile = d.getVar('SYSTEMD_BOOT_CFG')
+    cdir = os.path.dirname(cfile)
+    if not os.path.exists(cdir):
+        os.makedirs(cdir)
     try:
          cfgfile = open(cfile, 'w')
     except OSError: