bitbake.conf: add PERSISTENT_LOG_DIR variable
PATCH 1/2 bitbake.conf: add PERSISTENT_LOG_DIR variable
This variable is only respected when VOLATILE_LOG_DIR is "no".
The default value is "" which results in the /var/log being log directory.
The user could override this value to a path e.g "/home/root/log" which results /var/log being a link pointing to /home/root/log directory on persistent storage.
--- meta/conf/bitbake.conf | 2 ++ 1 file changed, 2 insertions(+)
meta/conf/bitbake.conf +2 -0
@@ -88,6 +88,8 @@ ROOT_HOME ??= "/home/root" # If set to boolean true ('yes', 'y', 'true', 't', '1'), /var/log links to /var/volatile/log. # If set to boolean false ('no', 'n', 'false', 'f', '0'), /var/log is on persistent storage. VOLATILE_LOG_DIR ?= "yes" +# If VOLATILE_LOG_DIR is false and PERSISTENT_LOG_DIR is set, /var/log links to PERSISTENT_LOG_DIR +PERSISTENT_LOG_DIR ??= "" ################################################################## # Architecture-dependent build variables.
Signature · 1 line
2.7.4
PATCH 2/2 base-files: respect PERSISTENT_LOG_DIR
Respect PERSISTENT_LOG_DIR variable. In this way, if the user overrides this variable to be e.g "/home/root/log", /var/log on the final image would be a link pointing to /home/root/log on persistent storage.
--- meta/recipes-core/base-files/base-files_3.0.14.bb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
meta/recipes-core/base-files/base-files_3.0.14.bb +5 -1
@@ -42,7 +42,7 @@ dirs755 = "/boot /dev ${base_bindir} ${base_sbindir} ${base_libdir} \ ${localstatedir}/backups ${localstatedir}/lib \ /sys ${localstatedir}/lib/misc ${localstatedir}/spool \ ${localstatedir}/volatile \ - ${localstatedir}/${@'volatile/' if oe.types.boolean('${VOLATILE_LOG_DIR}') else ''}log \ + ${@'${localstatedir}/volatile/log' if oe.types.boolean('${VOLATILE_LOG_DIR}') else '${PERSISTENT_LOG_DIR}' if d.getVar('PERSISTENT_LOG_DIR') else '${localstatedir}/log' } \ /home ${prefix}/src ${localstatedir}/local \ /media"
@@ -106,6 +106,10 @@ do_install () { ln -sf volatile/$d ${D}${localstatedir}/$d done + if [ ${@ oe.types.boolean('${VOLATILE_LOG_DIR}') } = False -a ! -z ${PERSISTENT_LOG_DIR} ]; then + ln -sf ${PERSISTENT_LOG_DIR} ${D}/${localstatedir}/log + fi + ln -snf ../run ${D}${localstatedir}/run ln -snf ../run/lock ${D}${localstatedir}/lock
Signature · 1 line
2.7.4
The requirement is to put logs into directories other than /var/log.
Could it be achieved by modifying the syslog daemon configuration file (e.g. /etc/syslog.conf) to replace /var/log with the specified directory. Maybe the corresponding logrotate configuration file also needs to be modified.
Best Regards,
Chen Qi
Quoted 26 lines · Ankur Tyagi
This variable is only respected when
VOLATILE_LOG_DIRis "no".The default value is "" which results in the
/var/logbeing log directory.The user could override this value to a path e.g "
/home/root/log" which results/var/logbeing a link pointing to/home/root/logdirectory on persistent storage.Signed-off-by Ankur Tyagi <[email protected]>--- meta/conf/bitbake.conf | 2 ++ 1 file changed, 2 insertions(+)meta/conf/bitbake.conf +2
-0@@ -88,6 +88,8 @@ ROOT_HOME ??= "/home/root" # If set to boolean true ('yes', 'y', 'true', 't', '1'), /var/log links to /var/volatile/log. # If set to boolean false ('no', 'n', 'false', 'f', '0'), /var/log is on persistent storage. VOLATILE_LOG_DIR ?= "yes" +# If VOLATILE_LOG_DIR is false and PERSISTENT_LOG_DIR is set, /var/log links to PERSISTENT_LOG_DIR +PERSISTENT_LOG_DIR ??= "" ################################################################## # Architecture-dependent build variables.
Initially I thought of doing that but then dropped it because it would create a dependency on syslog configuration file.
If in future syslog configuration parameter (LOGFILE) gets renamed, then we need to make corresponding change as well.
I think creating /var/log as a link is a less dependent change.
Let me know your thoughts.
Regards
Ankur
Quoted 43 lines · ChenQi
The requirement is to put logs into directories other than
/var/log. Could it be achieved by modifying the syslog daemon configuration file (e.g./etc/syslog.conf) to replace/var/logwith the specified directory. Maybe the corresponding logrotate configuration file also needs to be modified.Best Regards,
Chen QiQuoted 3 lines · Ankur Tyagi
This variable is only respected when
VOLATILE_LOG_DIRis "no".The default value is "" which results in the
/var/logbeing logdirectory.
Quoted 15 lines
The user could override this value to a path e.g "
/home/root/log" which results/var/logbeing a link pointing to/home/root/logdirectory on persistent storage.Signed-off-by Ankur Tyagi <[email protected]>--- meta/conf/bitbake.conf | 2 ++ 1 file changed, 2 insertions(+)meta/conf/bitbake.conf +0
-0meta/conf/bitbake.conf ROOT_HOME ??= "/home/root" · line 88
Quoted 1 line
meta/conf/bitbake.conf +0
-0@@ -88,6 +88,8 @@ ROOT_HOME ??= "/home/root" # If set to boolean true ('yes', 'y', 'true', 't', '1'), /var/loglinks to
/var/volatile/log.meta/conf/bitbake.conf ROOT_HOME ??= "/home/root" · line 89
Quoted 1 line
meta/conf/bitbake.conf +0
-0# If set to boolean false ('no', 'n', 'false', 'f', '0'), /var/log ison persistent storage.
meta/conf/bitbake.conf ROOT_HOME ??= "/home/root" · line 91
Quoted 2 lines
meta/conf/bitbake.conf +1
-0VOLATILE_LOG_DIR ?= "yes" +# If VOLATILE_LOG_DIR is false and PERSISTENT_LOG_DIR is set, /var/loglinks to
PERSISTENT_LOG_DIRQuoted 4 lines
meta/conf/bitbake.conf +1
-0+PERSISTENT_LOG_DIR ??= "" ################################################################## # Architecture-dependent build variables.
Ping
Regards
Ankur
Quoted 57 lines · Ankur Tyagi,
Initially I thought of doing that but then dropped it because it would create a dependency on syslog configuration file.
If in future syslog configuration parameter (LOGFILE) gets renamed, then we need to make corresponding change as well.I think creating
/var/logas a link is a less dependent change.Let me know your thoughts.
Regards
AnkurQuoted 43 lines · ChenQi
The requirement is to put logs into directories other than
/var/log. Could it be achieved by modifying the syslog daemon configuration file (e.g./etc/syslog.conf) to replace/var/logwith the specified directory. Maybe the corresponding logrotate configuration file also needs to be modified.Best Regards,
Chen QiQuoted 3 lines · Ankur Tyagi
This variable is only respected when
VOLATILE_LOG_DIRis "no".The default value is "" which results in the
/var/logbeing logdirectory.
Quoted 15 lines
The user could override this value to a path e.g "
/home/root/log" which results/var/logbeing a link pointing to/home/root/logdirectory on persistent storage.Signed-off-by Ankur Tyagi <[email protected]>--- meta/conf/bitbake.conf | 2 ++ 1 file changed, 2 insertions(+)meta/conf/bitbake.conf +0
-0meta/conf/bitbake.conf ROOT_HOME ??= "/home/root" · line 88
Quoted 1 line
meta/conf/bitbake.conf +0
-0@@ -88,6 +88,8 @@ ROOT_HOME ??= "/home/root" # If set to boolean true ('yes', 'y', 'true', 't', '1'), /var/loglinks to
/var/volatile/log.meta/conf/bitbake.conf ROOT_HOME ??= "/home/root" · line 89
Quoted 1 line
meta/conf/bitbake.conf +0
-0# If set to boolean false ('no', 'n', 'false', 'f', '0'), /var/log ison persistent storage.
meta/conf/bitbake.conf ROOT_HOME ??= "/home/root" · line 91
Quoted 2 lines
meta/conf/bitbake.conf +1
-0VOLATILE_LOG_DIR ?= "yes" +# If VOLATILE_LOG_DIR is false and PERSISTENT_LOG_DIR is set, /var/loglinks to
PERSISTENT_LOG_DIRQuoted 4 lines
meta/conf/bitbake.conf +1
-0+PERSISTENT_LOG_DIR ??= "" ################################################################## # Architecture-dependent build variables.
Ping
Regards
Ankur
Quoted 33 lines · Ankur Tyagi,
This variable is only respected when
VOLATILE_LOG_DIRis "no".The default value is "" which results in the
/var/logbeing log directory.The user could override this value to a path e.g "
/home/root/log" which results/var/logbeing a link pointing to/home/root/logdirectory on persistent storage.Signed-off-by Ankur Tyagi <[email protected]>--- meta/conf/bitbake.conf | 2 ++ 1 file changed, 2 insertions(+)meta/conf/bitbake.conf +0
-0@@ -88,6 +88,8 @@ ROOT_HOME ??= "/home/root" # If set to boolean true ('yes', 'y', 'true', 't', '1'), /var/log linksto
/var/volatile/log.
# If set to boolean false ('no', 'n', 'false', 'f', '0'),/var/logis on
persistent storage.
VOLATILE_LOG_DIR?= "yes"
+# IfVOLATILE_LOG_DIRis false andPERSISTENT_LOG_DIRis set,/var/loglinks toPERSISTENT_LOG_DIR
+PERSISTENT_LOG_DIR ??= ""##################################################################
# Architecture-dependent build variables.
--
2.7.4
Re: [rocko][sumo][master][PATCH 2/2] base-files: respect PERSISTENT_LOG_DIR
In reply to Ankur TyagiPing
Regards
Ankur
Quoted 43 lines · Ankur Tyagi,
Respect
PERSISTENT_LOG_DIRvariable. In this way, if the user overrides this variable to be e.g "/home/root/log",/var/logon the final image would be a link pointing to/home/root/logon persistent storage.Signed-off-by Ankur Tyagi <[email protected]>--- meta/recipes-core/base-files/base-files_3.0.14.bb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)meta/recipes-core/base-files/base-files_3.0.14.bb +1
-1@@ -42,7 +42,7 @@ dirs755 = "/boot /dev ${base_bindir} ${base_sbindir} ${base_libdir} \ ${localstatedir}/backups ${localstatedir}/lib \ /sys ${localstatedir}/lib/misc ${localstatedir}/spool \ ${localstatedir}/volatile \ - ${localstatedir}/${@'volatile/' if oe.types.boolean('${VOLATILE_LOG_DIR}') else ''}log \ + ${@'${localstatedir}/volatile/log' if
oe.types.boolean('${VOLATILE_LOG_DIR}')else '${PERSISTENT_LOG_DIR}' ifd.getVar('PERSISTENT_LOG_DIR') else '${localstatedir}/log' } \ /home ${prefix}/src ${localstatedir}/local \ /media"meta/recipes-core/base-files/base-files_3.0.14.bb +1
-0@@ -106,6 +106,10 @@ do_install () { ln -sf volatile/$d ${D}${localstatedir}/$d done + if [ ${@ oe.types.boolean('${VOLATILE_LOG_DIR}') } = False -a ! -z${PERSISTENT_LOG_DIR} ]; then
meta/recipes-core/base-files/base-files_3.0.14.bb +3
-1+ ln -sf ${PERSISTENT_LOG_DIR} ${D}/${localstatedir}/log + fi + ln -snf ../run ${D}${localstatedir}/run ln -snf ../run/lock ${D}${localstatedir}/lock --2.7.4
Re: [rocko][sumo][master][PATCH 2/2] base-files: respect PERSISTENT_LOG_DIR
In reply to Ankur TyagiQuoted 5 lines · Ankur Tyagi
Respect
PERSISTENT_LOG_DIRvariable. In this way, if the user overrides this variable to be e.g "/home/root/log",/var/logon the final image would be a link pointing to/home/root/logon persistent storage.
I would suggest to stick with VOLATILE_BINDS
Quoted 37 lines
Signed-off-by Ankur Tyagi <[email protected]>--- meta/recipes-core/base-files/base-files_3.0.14.bb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)meta/recipes-core/base-files/base-files_3.0.14.bb +5
-2@@ -42,7 +42,7 @@ dirs755 = "/boot /dev ${base_bindir} ${base_sbindir} ${base_libdir} \ ${localstatedir}/backups ${localstatedir}/lib \ /sys ${localstatedir}/lib/misc ${localstatedir}/spool \ ${localstatedir}/volatile \ - ${localstatedir}/${@'volatile/' if oe.types.boolean('${VOLATILE_LOG_DIR}') else ''}log \ + ${@'${localstatedir}/volatile/log' if oe.types.boolean('${VOLATILE_LOG_DIR}') else '${PERSISTENT_LOG_DIR}' if d.getVar('PERSISTENT_LOG_DIR') else '${localstatedir}/log' } \ /home ${prefix}/src ${localstatedir}/local \ /media"@@ -106,6 +106,10 @@ do_install () { ln -sf volatile/$d ${D}${localstatedir}/$d done + if [ ${@ oe.types.boolean('${VOLATILE_LOG_DIR}') } = False -a ! -z ${PERSISTENT_LOG_DIR} ]; then + ln -sf ${PERSISTENT_LOG_DIR} ${D}/${localstatedir}/log + fi + ln -snf ../run ${D}${localstatedir}/run ln -snf ../run/lock ${D}${localstatedir}/lock --2.7.4
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [rocko][sumo][master][PATCH 2/2] base-files: respect PERSISTENT_LOG_DIR
Quoted 9 lines · Khem Raj
Quoted 5 lines · Ankur Tyagi
Respect
PERSISTENT_LOG_DIRvariable. In this way, if the user overrides this variable to be e.g "/home/root/log",/var/logon the final image would be a link pointing to/home/root/logon persistent storage.I would suggest to stick with
VOLATILE_BINDS
But this won't help with VOLATILE_LOG_DIR set as "no".
I think it is a common requirement to have persistent logging mounted in a separate partition.
This patch makes it easy (hopefully) for the user to achieve the above without any additional recipe.
Quoted 38 lines
Quoted 38 lines
Signed-off-by Ankur Tyagi <[email protected]>--- meta/recipes-core/base-files/base-files_3.0.14.bb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)meta/recipes-core/base-files/base-files_3.0.14.bb +5
-2@@ -42,7 +42,7 @@ dirs755 = "/boot /dev ${base_bindir} ${base_sbindir} ${base_libdir} \ ${localstatedir}/backups ${localstatedir}/lib \ /sys ${localstatedir}/lib/misc ${localstatedir}/spool \ ${localstatedir}/volatile \ - ${localstatedir}/${@'volatile/' if oe.types.boolean('${VOLATILE_LOG_DIR}') else ''}log \ + ${@'${localstatedir}/volatile/log' if oe.types.boolean('${VOLATILE_LOG_DIR}') else '${PERSISTENT_LOG_DIR}' if d.getVar('PERSISTENT_LOG_DIR') else '${localstatedir}/log' } \ /home ${prefix}/src ${localstatedir}/local \ /media"@@ -106,6 +106,10 @@ do_install () { ln -sf volatile/$d ${D}${localstatedir}/$d done + if [ ${@ oe.types.boolean('${VOLATILE_LOG_DIR}') } = False -a ! -z ${PERSISTENT_LOG_DIR} ]; then + ln -sf ${PERSISTENT_LOG_DIR} ${D}/${localstatedir}/log + fi + ln -snf ../run ${D}${localstatedir}/run ln -snf ../run/lock ${D}${localstatedir}/lock --2.7.4
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [rocko][sumo][master][PATCH 2/2] base-files: respect PERSISTENT_LOG_DIR
Hi Khem,
Is this patch being accepted ?
regards
Ankur
Quoted 56 lines · Ankur Tyagi
Quoted 9 lines · Khem Raj
Quoted 5 lines · Ankur Tyagi
Respect
PERSISTENT_LOG_DIRvariable. In this way, if the user overrides this variable to be e.g "/home/root/log",/var/logon the final image would be a link pointing to/home/root/logon persistent storage.I would suggest to stick with
VOLATILE_BINDSBut this won't help with
VOLATILE_LOG_DIRset as "no".
I think it is a common requirement to have persistent logging mounted in a separate partition.
This patch makes it easy (hopefully) for the user to achieve the above without any additional recipe.Quoted 38 lines
Quoted 38 lines
Signed-off-by Ankur Tyagi <[email protected]>--- meta/recipes-core/base-files/base-files_3.0.14.bb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)meta/recipes-core/base-files/base-files_3.0.14.bb +5
-2@@ -42,7 +42,7 @@ dirs755 = "/boot /dev ${base_bindir} ${base_sbindir} ${base_libdir} \ ${localstatedir}/backups ${localstatedir}/lib \ /sys ${localstatedir}/lib/misc ${localstatedir}/spool \ ${localstatedir}/volatile \ - ${localstatedir}/${@'volatile/' if oe.types.boolean('${VOLATILE_LOG_DIR}') else ''}log \ + ${@'${localstatedir}/volatile/log' if oe.types.boolean('${VOLATILE_LOG_DIR}') else '${PERSISTENT_LOG_DIR}' if d.getVar('PERSISTENT_LOG_DIR') else '${localstatedir}/log' } \ /home ${prefix}/src ${localstatedir}/local \ /media"@@ -106,6 +106,10 @@ do_install () { ln -sf volatile/$d ${D}${localstatedir}/$d done + if [ ${@ oe.types.boolean('${VOLATILE_LOG_DIR}') } = False -a ! -z ${PERSISTENT_LOG_DIR} ]; then + ln -sf ${PERSISTENT_LOG_DIR} ${D}/${localstatedir}/log + fi + ln -snf ../run ${D}${localstatedir}/run ln -snf ../run/lock ${D}${localstatedir}/lock --2.7.4
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [rocko][sumo][master][PATCH 2/2] base-files: respect PERSISTENT_LOG_DIR
Quoted 5 lines · Ankur Tyagi
Hi Khem,
Is this patch being accepted ?
I am not convinced if we need this patch as we can do this using volatile binds. or base-files changes if needed.
Quoted 60 lines
regards
AnkurQuoted 56 lines · Ankur Tyagi
Quoted 9 lines · Khem Raj
Quoted 5 lines · Ankur Tyagi
Respect
PERSISTENT_LOG_DIRvariable. In this way, if the user overrides this variable to be e.g "/home/root/log",/var/logon the final image would be a link pointing to/home/root/logon persistent storage.I would suggest to stick with
VOLATILE_BINDSBut this won't help with
VOLATILE_LOG_DIRset as "no".
I think it is a common requirement to have persistent logging mounted in a separate partition.
This patch makes it easy (hopefully) for the user to achieve the above without any additional recipe.Quoted 38 lines
Quoted 38 lines
Signed-off-by Ankur Tyagi <[email protected]>--- meta/recipes-core/base-files/base-files_3.0.14.bb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)meta/recipes-core/base-files/base-files_3.0.14.bb +5
-2@@ -42,7 +42,7 @@ dirs755 = "/boot /dev ${base_bindir} ${base_sbindir} ${base_libdir} \ ${localstatedir}/backups ${localstatedir}/lib \ /sys ${localstatedir}/lib/misc ${localstatedir}/spool \ ${localstatedir}/volatile \ - ${localstatedir}/${@'volatile/' if oe.types.boolean('${VOLATILE_LOG_DIR}') else ''}log \ + ${@'${localstatedir}/volatile/log' if oe.types.boolean('${VOLATILE_LOG_DIR}') else '${PERSISTENT_LOG_DIR}' if d.getVar('PERSISTENT_LOG_DIR') else '${localstatedir}/log' } \ /home ${prefix}/src ${localstatedir}/local \ /media"@@ -106,6 +106,10 @@ do_install () { ln -sf volatile/$d ${D}${localstatedir}/$d done + if [ ${@ oe.types.boolean('${VOLATILE_LOG_DIR}') } = False -a ! -z ${PERSISTENT_LOG_DIR} ]; then + ln -sf ${PERSISTENT_LOG_DIR} ${D}/${localstatedir}/log + fi + ln -snf ../run ${D}${localstatedir}/run ln -snf ../run/lock ${D}${localstatedir}/lock --2.7.4
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [rocko][sumo][master][PATCH 2/2] base-files: respect PERSISTENT_LOG_DIR
Quoted 11 lines · Khem Raj
Quoted 5 lines · Ankur Tyagi
Hi Khem,
Is this patch being accepted ?
I am not convinced if we need this patch as we can do this using volatile binds. or base-files changes if needed.
How volatile binds will help with VOLATILE_LOG_DIR set as "no" ? This patch is modifying base-files so that users can simply set a variable in conf file instead of modifying base-files.
Quoted 60 lines
Quoted 60 lines
regards
AnkurQuoted 56 lines · Ankur Tyagi
Quoted 9 lines · Khem Raj
Quoted 5 lines · Ankur Tyagi
Respect
PERSISTENT_LOG_DIRvariable. In this way, if the user overrides this variable to be e.g "/home/root/log",/var/logon the final image would be a link pointing to/home/root/logon persistent storage.I would suggest to stick with
VOLATILE_BINDSBut this won't help with
VOLATILE_LOG_DIRset as "no".
I think it is a common requirement to have persistent logging mounted in a separate partition.
This patch makes it easy (hopefully) for the user to achieve the above without any additional recipe.Quoted 38 lines
Quoted 38 lines
Signed-off-by Ankur Tyagi <[email protected]>--- meta/recipes-core/base-files/base-files_3.0.14.bb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)meta/recipes-core/base-files/base-files_3.0.14.bb +5
-2@@ -42,7 +42,7 @@ dirs755 = "/boot /dev ${base_bindir} ${base_sbindir} ${base_libdir} \ ${localstatedir}/backups ${localstatedir}/lib \ /sys ${localstatedir}/lib/misc ${localstatedir}/spool \ ${localstatedir}/volatile \ - ${localstatedir}/${@'volatile/' if oe.types.boolean('${VOLATILE_LOG_DIR}') else ''}log \ + ${@'${localstatedir}/volatile/log' if oe.types.boolean('${VOLATILE_LOG_DIR}') else '${PERSISTENT_LOG_DIR}' if d.getVar('PERSISTENT_LOG_DIR') else '${localstatedir}/log' } \ /home ${prefix}/src ${localstatedir}/local \ /media"@@ -106,6 +106,10 @@ do_install () { ln -sf volatile/$d ${D}${localstatedir}/$d done + if [ ${@ oe.types.boolean('${VOLATILE_LOG_DIR}') } = False -a ! -z ${PERSISTENT_LOG_DIR} ]; then + ln -sf ${PERSISTENT_LOG_DIR} ${D}/${localstatedir}/log + fi + ln -snf ../run ${D}${localstatedir}/run ln -snf ../run/lock ${D}${localstatedir}/lock --2.7.4
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core