summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kickstart/kickstart.tmpl9
-rw-r--r--kswriter/KSWriter.py13
2 files changed, 21 insertions, 1 deletions
diff --git a/kickstart/kickstart.tmpl b/kickstart/kickstart.tmpl
index 10059a8..3ada3d6 100644
--- a/kickstart/kickstart.tmpl
+++ b/kickstart/kickstart.tmpl
@@ -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
+
diff --git a/kswriter/KSWriter.py b/kswriter/KSWriter.py
index 9449eb4..fdc27e8 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', '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