diff --git a/etc/tree/scrubs.alpha b/etc/tree/scrubs.alpha new file mode 120000 index 00000000..782e69b5 --- /dev/null +++ b/etc/tree/scrubs.alpha @@ -0,0 +1 @@ +scrubs.i386 \ No newline at end of file diff --git a/etc/tree/scrubs.i386 b/etc/tree/scrubs.i386 new file mode 100644 index 00000000..5276088c --- /dev/null +++ b/etc/tree/scrubs.i386 @@ -0,0 +1,5 @@ +# remove unnecessary directories from root +remove @instroot@/boot +remove @instroot@/home +remove @instroot@/root +remove @instroot@/tmp diff --git a/etc/tree/scrubs.ia64 b/etc/tree/scrubs.ia64 new file mode 120000 index 00000000..782e69b5 --- /dev/null +++ b/etc/tree/scrubs.ia64 @@ -0,0 +1 @@ +scrubs.i386 \ No newline at end of file diff --git a/etc/tree/scrubs.ppc b/etc/tree/scrubs.ppc new file mode 120000 index 00000000..782e69b5 --- /dev/null +++ b/etc/tree/scrubs.ppc @@ -0,0 +1 @@ +scrubs.i386 \ No newline at end of file diff --git a/etc/tree/scrubs.ppc64 b/etc/tree/scrubs.ppc64 new file mode 120000 index 00000000..66cc7aa3 --- /dev/null +++ b/etc/tree/scrubs.ppc64 @@ -0,0 +1 @@ +scrubs.ppc \ No newline at end of file diff --git a/etc/tree/scrubs.s390 b/etc/tree/scrubs.s390 new file mode 120000 index 00000000..782e69b5 --- /dev/null +++ b/etc/tree/scrubs.s390 @@ -0,0 +1 @@ +scrubs.i386 \ No newline at end of file diff --git a/etc/tree/scrubs.s390x b/etc/tree/scrubs.s390x new file mode 120000 index 00000000..580b924c --- /dev/null +++ b/etc/tree/scrubs.s390x @@ -0,0 +1 @@ +scrubs.s390 \ No newline at end of file diff --git a/etc/tree/scrubs.sparc b/etc/tree/scrubs.sparc new file mode 120000 index 00000000..782e69b5 --- /dev/null +++ b/etc/tree/scrubs.sparc @@ -0,0 +1 @@ +scrubs.i386 \ No newline at end of file diff --git a/etc/tree/scrubs.x86_64 b/etc/tree/scrubs.x86_64 new file mode 120000 index 00000000..782e69b5 --- /dev/null +++ b/etc/tree/scrubs.x86_64 @@ -0,0 +1 @@ +scrubs.i386 \ No newline at end of file diff --git a/src/pylorax/insttree.py b/src/pylorax/insttree.py index 44118cdc..d1113244 100644 --- a/src/pylorax/insttree.py +++ b/src/pylorax/insttree.py @@ -28,6 +28,10 @@ import re from utils.fileutils import copy, move, remove, replace, touch +import actions +import actions.base +from template import Template + class InstallTree(object): @@ -505,6 +509,25 @@ class InstallTree(object): os.unlink(link) os.symlink(newtarget, link) + def process_scrubs_from_template(self): + # get supported actions + supported_actions = actions.getActions(verbose=self.conf.debug) + + # variables supported in templates + vars = { "instroot": self.conf.treedir } + + # parse the template file + scrubs = os.path.join(self.conf.confdir, "tree", + "scrubs.%s" % (self.conf.buildarch,)) + + if os.path.exists(scrubs): + self.template = Template() + self.template.preparse(scrubs) + self.template.parse(supported_actions, vars) + + for action in self.template.actions: + action.execute() + def scrub(self): self.copy_stubs() self.create_dogtail_conf() @@ -526,7 +549,8 @@ class InstallTree(object): self.remove_locales() self.remove_unnecessary_files() self.remove_python_stuff() - - self.remove_unnecessary_directories() + #self.remove_unnecessary_directories() self.move_bins() + + self.process_scrubs_from_template()