blob: 529bbf4f2cdfb1b363fcaa586ed3477189f27f52 [file] [log] [blame]
Thiyagarajan Subramanie84935d2020-04-23 17:45:44 +05301diff --git a/builds/any/rootfs/jessie/common/all-base-packages.yml b/builds/any/rootfs/jessie/common/all-base-packages.yml
2index bbeab6b4..ca5a45cd 100644
3--- a/builds/any/rootfs/jessie/common/all-base-packages.yml
4+++ b/builds/any/rootfs/jessie/common/all-base-packages.yml
5@@ -81,3 +81,7 @@
6 - sysstat
7 - ipmitool
8 - lm-sensors
9+- python3.4
10+- python3-yaml
11+- cron
12+- logrotate
13diff --git a/packages/base/all/initrds/loader-initrd-files/src/bin/swiprep b/packages/base/all/initrds/loader-initrd-files/src/bin/swiprep
14index d5a72f8e..0b0583e1 100755
15--- a/packages/base/all/initrds/loader-initrd-files/src/bin/swiprep
16+++ b/packages/base/all/initrds/loader-initrd-files/src/bin/swiprep
17@@ -173,7 +173,46 @@ if test "$mode_install"; then
18 echo "*** invalid squashfs contents" 1>&2
19 exit 1
20 fi
21+ cp "$swipath" "$workdir"/
22+ cd "$workdir"
23+ unzip "$swipath"
24+ target=$(find . -name bal_packages)
25+ for f in "$target"/*
26+ do
27+ main_file_name=$(basename $f)
28+ full_path_name=$(echo $f | cut -c 3-)
29+ cp $full_path_name "$workdir"/$main_file_name
30+ done
31+ echo "Moving validation script to /root/"
32+ mv "$workdir"/validate_onl_installation.sh "$destdir"/root/
33+ mv "$workdir"/fetch_olt_sw_hw_details.py "$destdir"/root/
34+ mv "$workdir"/openolt* "$destdir"/
35+ echo "INFO: Copying init scripts to init.d"
36+ cp "$workdir"/start_inband_oltservices.sh "$destdir"/etc/init.d/
37+ cp "$workdir"/vlan.config "$destdir"/
38+ cd -
39 fi
40+cat > "$destdir"/etc/rc.local <<- EOF
41+#!/bin/sh -e
42+#
43+# rc.local
44+#
45+# This script is executed at the end of each multiuser runlevel.
46+# Make sure that the script will "exit 0" on success or any other
47+# value on error.
48+#
49+# In order to enable or disable this script just change the execution
50+# bits.
51+#
52+# By default this script does nothing.
53+
54+chmod 0777 /etc/init.d/start_inband_oltservices.sh
55+chmod 0777 /root/validate_onl_installation.sh
56+nohup sh /etc/init.d/start_inband_oltservices.sh > /var/log/startup.log &
57+exit 0
58+
59+EOF
60+
61 if test "$mode_overlay"; then
62 # keep the squashfs file around
63 mv $workdir/rootfs.sqsh /tmp/.rootfs
64diff --git a/tools/switool.py b/tools/switool.py
65index 26eb2fb1..6c783c3d 100755
66--- a/tools/switool.py
67+++ b/tools/switool.py
68@@ -79,6 +79,26 @@ if ops.create or ops.overwrite:
69 swi = OnlSwitchImage(ops.swi, 'w')
70 swi.add_rootfs(ops.rootfs)
71 swi.add_manifest(ops.manifest)
72+
73+ try:
74+ bal_files = []
75+ onl_path = os.environ.get("ONL")
76+ bal_package_path=onl_path+"/bal_packages"
77+ cwd = os.getcwd()
78+ if os.path.isdir(bal_package_path):
79+ os.chdir(bal_package_path)
80+ for root, dirs, files in os.walk(bal_package_path):
81+ for file_name in files:
82+ file_real_path = os.path.realpath(file_name)
83+ bal_files.append(file_real_path)
84+
85+ os.chdir(cwd)
86+ for f_name in bal_files:
87+ print("INFO: File Name - ", f_name)
88+ swi.add(f_name)
89+ except KeyError:
90+ print("Not exist environment value for %s" % "key_maybe_not_exist")
91+
92 for f in ops.add_files:
93 swi.add(f, arcname=f)
94