Fix dreport os-release script point to a symbolic link
The os-release file in the dump points to a symbolic link
rather than the actual release details.
As "cp -r" command is used to copy the contents of a symbolic
link file, it copies the link rather than the actual file.
Modified to use cp command to copy the contents of the file
Tested:
before fix
root@witherspoon:/tmp# mkdir test1
root@witherspoon:/tmp# cp -r /etc/os-release test1/
root@witherspoon:/tmp# ls -la test1/
drwxr-xr-x 2 root root 60 Jun 6 12:27 .
drwxrwxrwt 13 root root 320 Jun 6 12:26 ..
lrwxrwxrwx 1 root root 21 Jun 6 12:27 os-release -> ../usr/lib/os-release
after fix
root@witherspoon:/tmp# mkdir test2
root@witherspoon:/tmp# cp /etc/os-release test2/
root@witherspoon:/tmp# ls -la test2/
-rw-r--r-- 1 root root 295 Jun 6 12:27 os-release
Change-Id: I6980ffa40b925fb02be0bf53704d17ebc7995af0
Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
diff --git a/tools/dreport.d/plugins.d/osrelease b/tools/dreport.d/plugins.d/osrelease
index 0e89282..7cf9a43 100644
--- a/tools/dreport.d/plugins.d/osrelease
+++ b/tools/dreport.d/plugins.d/osrelease
@@ -9,4 +9,4 @@
desc="OS release info"
file_name="/etc/os-release"
-add_copy_file "$file_name" "$desc"
+add_copy_sym_link_file "$file_name" "$desc"