diff options
author | SoonKyu Park <sk7.park@samsung.com> | 2017-08-24 15:00:18 +0900 |
---|---|---|
committer | SoonKyu Park <sk7.park@samsung.com> | 2017-08-24 15:00:18 +0900 |
commit | 8592bd142d61b9084aad5b2ac0043bb93710badc (patch) | |
tree | 1a99156f1df6000b7c29e7bbb5398b7bb1702413 | |
parent | 69af6d0e1ba6b17f188213fb0d9f367b54f4753f (diff) | |
download | kickstarter-8592bd142d61b9084aad5b2ac0043bb93710badc.tar.gz kickstarter-8592bd142d61b9084aad5b2ac0043bb93710badc.tar.bz2 kickstarter-8592bd142d61b9084aad5b2ac0043bb93710badc.zip |
Add 'Runscript' templete which support script running between 'each img creation' and 'tar.gz creation'submit/tizen/20170824.111954accepted/tizen/unified/20170825.043947
Image creation order :
Create *.img, *.bin - Runscript - Create xxxx.tar.gz
Change-Id: Ia77c05072283ca8cde5b95a127a0cbb28c8edba7
-rw-r--r-- | kickstart/kickstart.tmpl | 5 | ||||
-rw-r--r-- | kswriter/KSWriter.py | 13 |
2 files changed, 17 insertions, 1 deletions
diff --git a/kickstart/kickstart.tmpl b/kickstart/kickstart.tmpl index 54f8a2e..301e3c0 100644 --- a/kickstart/kickstart.tmpl +++ b/kickstart/kickstart.tmpl @@ -132,3 +132,8 @@ ${metadata.Post} %post --nochroot ${metadata.NoChroot} %end + +%runscript +${metadata.Run} +%end + diff --git a/kswriter/KSWriter.py b/kswriter/KSWriter.py index 3117bae..b5e97a3 100644 --- a/kswriter/KSWriter.py +++ b/kswriter/KSWriter.py @@ -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'] + lval = ['Repos', 'Groups', 'PostScripts', 'NoChrootScripts', 'RemovePackages', 'ExtraPackages', 'RunScripts'] lvald = {} for l in lval: full = [] @@ -125,6 +125,16 @@ class KSWriter(): else: raise KSMetaError('%s/scripts/%s.nochroot not found, aborting.' %(meta_root, scr )) + runscript = "" + for scr in conf['RunScripts']: + if os.path.exists('%s/scripts/%s.run' %(meta_root,scr)): + f = open('%s/scripts/%s.run' %(meta_root, scr ), 'r') + runscript += f.read() + runscript += "\n" + f.close() + else: + raise KSMetaError('%s/scripts/%s.run not found, aborting.' %(meta_root, scr )) + ptab = "" for g in [ plat, img ]: if g.has_key("Part"): @@ -135,6 +145,7 @@ class KSWriter(): conf['Part'] = ptab conf['Post'] = postscript conf['NoChroot'] = nochrootscript + conf['Run'] = runscript return conf def process_files(self, meta, repos): |