]> code.ossystems Code Review - openembedded-core.git/commitdiff
systemd-boot.bbclass: Fix SYSYTEMD_BOOT_CFG creation
authorAlejandro Hernandez <alejandro.hernandez@linux.intel.com>
Mon, 5 Dec 2016 17:00:56 +0000 (11:00 -0600)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 16 Jan 2017 18:01:57 +0000 (18:01 +0000)
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>
meta/classes/systemd-boot.bbclass

index 6718783367565c6e437cc9adf154bd1c8394e974..6a2cbc8a937fe0dc6fb3e5301250ff2c8020c74e 100644 (file)
@@ -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: