This email list is read-only.  Emails sent to this list will be discarded
----------------------------------
 debian/changelog     |    5 ++++-
 libs/InstallImage.py |    2 ++
 libs/Project.py      |   27 +++++++++++++++++++++++++++
 3 files changed, 33 insertions(+), 1 deletions(-)

New commits:
commit 94416bf7971292ac2f0110b56aa179017f3daacc
Author: Prajwal Mohan <[EMAIL PROTECTED]>
Date:   Thu Aug 21 14:40:54 2008 -0700

    Adding ability to execute post install scripts


Diff in this email is a maximum of 400 lines.
diff --git a/debian/changelog b/debian/changelog
index 090b4ba..afd809b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -121,7 +121,10 @@ moblin-image-creator (0.45) UNRELEASED; urgency=low
   [ Mitsutaka Amano ]
   * Deleted unnecessary temporary Makefile.
 
- -- Mitsutaka Amano <[EMAIL PROTECTED]>  Thu, 21 Aug 2008 00:06:51 +0900
+  [ Prajwal Mohan ]
+  * Adding ability to execute post install scripts 
+
+ -- Prajwal Mohan <[EMAIL PROTECTED]>  Thu, 21 Aug 2008 14:40:28 -0700
 
 moblin-image-creator (0.44) gaston; urgency=low
 
diff --git a/libs/InstallImage.py b/libs/InstallImage.py
index a94c0af..abad843 100755
--- a/libs/InstallImage.py
+++ b/libs/InstallImage.py
@@ -249,6 +249,8 @@ class InstallImage(object):
         use squashfs on the device then the content will be copied out of the
         squashfs image during the install"""
         print _("Creating root file system...")
+        self.target.execute_post_install_scripts()
+
         # re-create fstab every time, since user could change fstab options on
         # the fly (by editing image-creator.cfg)
         fstab_path = os.path.join(self.target.fs_path, 'etc/fstab')
diff --git a/libs/Project.py b/libs/Project.py
index acaceb9..d2d40ab 100755
--- a/libs/Project.py
+++ b/libs/Project.py
@@ -238,6 +238,18 @@ class Project(FileSystem):
             self.set_target_hd_kernel_cmdline(name, 
self.platform.hd_kernel_cmdline)
             self.set_target_cd_kernel_cmdline(name, 
self.platform.cd_kernel_cmdline)
             self.set_target_nand_kernel_cmdline(name, 
self.platform.nand_kernel_cmdline)
+            #Copy post install scripts
+            if os.path.isdir(os.path.join(self.platform.path, 
"post-install-scripts")):
+                print _("Installing post install scripts")
+                try:
+                    if not os.path.isdir(os.path.join(install_path, 
"post-install-scripts")):
+                        os.makedirs(os.path.join(install_path, 
"post-install-scripts"))
+                    src_folder = os.path.join(self.platform.path, 
"post-install-scripts")
+                    dst_path = os.path.join(install_path, 
"post-install-scripts")
+                    for filename in os.listdir(src_folder):
+                        shutil.copy(os.path.join(src_folder, filename), 
dst_path)
+                except:
+                    pass
         return self.targets[name]
     
     def get_target_usb_kernel_cmdline(self, name):
@@ -442,6 +454,21 @@ class Target(FileSystem):
             if os.path.isfile(os.path.join(self.top, fset_name)):
                 return True
         return False
+    
+    def execute_post_install_scripts(self):
+        print _("Executing post install scripts")
+        script_path = os.path.join(self.path, "post-install-scripts")
+        if os.path.isdir(script_path):
+            for filename in os.listdir(script_path):
+                    print _("Executing scritp: %s") % filename
+                    cmd = "/post-install-scripts/%s" % filename
+                    #Ignore error and continue
+                    try:
+                        self.chroot(cmd)
+                    except:
+                        pass
+        else:
+            print _("No post-install-scripts found")
 
     def installFset(self, fset, debug_pkgs = 0, fsets = None, seen_fsets = 
None):
         """
_______________________________________________
Commits mailing list
[email protected]
https://www.moblin.org/mailman/listinfo/commits

Reply via email to