Add 'UmountScripts' templete which support '%post-umount' section 86/239186/2 accepted/tizen_6.0_unified accepted/tizen_6.0_unified_hotfix accepted/tizen_6.5_unified accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix accepted/tizen_8.0_unified accepted/tizen_9.0_unified accepted/tizen_unified tizen tizen_6.0 tizen_6.0_hotfix tizen_6.5 tizen_7.0 tizen_7.0_hotfix tizen_8.0 tizen_9.0 accepted/tizen/6.0/unified/20201030.110920 accepted/tizen/6.0/unified/hotfix/20201102.233723 accepted/tizen/6.0/unified/hotfix/20201103.051725 accepted/tizen/6.5/unified/20211029.013845 accepted/tizen/7.0/unified/20221110.063434 accepted/tizen/7.0/unified/hotfix/20221116.110922 accepted/tizen/8.0/unified/20231005.095009 accepted/tizen/9.0/unified/20241030.235953 accepted/tizen/unified/20200727.075556 submit/tizen/20200724.131026 submit/tizen_6.0/20201029.205502 submit/tizen_6.0_hotfix/20201102.192902 submit/tizen_6.0_hotfix/20201103.115102 submit/tizen_6.5/20211028.163401 tizen_6.0.m2_release tizen_6.5.m2_release tizen_7.0_m2_release tizen_8.0_m2_release tizen_9.0_m2_release
authorDohyung Kim <dohyung2.kim@samsung.com>
Tue, 21 Nov 2017 07:36:14 +0000 (16:36 +0900)
committerINSUN PYO <insun.pyo@samsung.com>
Wed, 22 Jul 2020 10:23:52 +0000 (19:23 +0900)
Change-Id: If5c94ef67305bd04c6919e65ea7e3bd6a8e4e594
Signed-off-by: Dohyung Kim <dohyung2.kim@samsung.com>
kickstart/kickstart.tmpl
kswriter/KSWriter.py

index 10059a8..3ada3d6 100644 (file)
@@ -139,7 +139,16 @@ ${metadata.Post}
 ${metadata.NoChroot}
 %end
 
+#if $metadata.Run != ""
 %runscript
 ${metadata.Run}
 %end
+#end if
+
+#if $metadata.Umount != ""
+%post-umount
+${metadata.Umount}
+%end
+#end if
+
 
index 9449eb4..fdc27e8 100644 (file)
@@ -92,7 +92,7 @@ class KSWriter():
         plat = copy.copy(self.image_meta[img['Platform']])
         conf.update(plat)
         conf.update(img)
-        lval = ['Repos', 'Groups', 'PostScripts', 'NoChrootScripts', 'RemovePackages', 'ExtraPackages', 'RunScripts', 'EnvScripts']
+        lval = ['Repos', 'Groups', 'PostScripts', 'NoChrootScripts', 'RemovePackages', 'ExtraPackages', 'RunScripts', 'EnvScripts', 'UmountScripts']
         lvald = {}
         for l in lval:
             full = []
@@ -145,6 +145,16 @@ class KSWriter():
             else:
                 raise KSMetaError('%s/scripts/%s.env not found, aborting.' %(meta_root, scr ))
 
+        umountscript = ""
+        for scr in conf['UmountScripts']:
+            if os.path.exists('%s/scripts/%s.umount' %(meta_root,scr)):
+                f = open('%s/scripts/%s.umount' %(meta_root, scr ), 'r')
+                umountscript += f.read()
+                umountscript += "\n"
+                f.close()
+            else:
+                raise KSMetaError('%s/scripts/%s.umount not found, aborting.' %(meta_root, scr ))
+
         ptab = ""
         for g in [ plat, img ]:
             if g.has_key("Part"):
@@ -166,6 +176,7 @@ class KSWriter():
         conf['Post'] = postscript
         conf['NoChroot'] = nochrootscript
         conf['Run'] = runscript
+        conf['Umount'] = umountscript
         if envscript:
             conf['Env'] = envscript
         return conf