[PATCH 03/37] append all start scripts into /etc/target/all_start.sh

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This should make systemd packaging a little easier.

Signed-off-by: Andy Grover <agrover@xxxxxxxxxx>
---
 targetcli/ui_root.py |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/targetcli/ui_root.py b/targetcli/ui_root.py
index 2048544..b3f78c4 100644
--- a/targetcli/ui_root.py
+++ b/targetcli/ui_root.py
@@ -89,6 +89,20 @@ class UIRoot(UINode):
         else:
             self.shell.log.warning("Aborted, configuration left untouched.")
 
+        # append all into single script
+        from glob import iglob
+        import os
+        import shutil
+        sources = iglob(os.path.join("/etc/target", '*_start.sh'))
+        # ensure tcm_start is appended first
+        sources = [x for x in sources if not 'tcm_' in x]
+        sources = [x for x in sources if not 'all_' in x]
+        sources.insert(0, '/etc/target/tcm_start.sh')
+        dest = open('/etc/target/all_start.sh', 'wb')
+        for filename in sources:
+            shutil.copyfileobj(open(filename, 'rb'), dest)
+        dest.close()
+
     def ui_command_version(self):
         '''
         Displays the targetcli and support libraries versions.
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux