Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 1/2] manpages.bbclass: Fix rootfs host corruption
@ 2019-12-19 22:17 Alex Kiernan
  2019-12-19 22:17 ` [PATCH 2/2] rootfs-postcommands: Enable rootfs_check_host_user_contaminated Alex Kiernan
  2020-01-09  2:30 ` [PATCH 1/2] manpages.bbclass: Fix rootfs host corruption Alex Kiernan
  0 siblings, 2 replies; 12+ messages in thread
From: Alex Kiernan @ 2019-12-19 22:17 UTC (permalink / raw)
  To: openembedded-core

When running mandb we end up with files owned by the build user, correct
this. Also pick up non-default locales and relocate their index.db files
to /var/cache.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---

 meta/classes/manpages.bbclass | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/meta/classes/manpages.bbclass b/meta/classes/manpages.bbclass
index 50c254763e89..1e66780646ea 100644
--- a/meta/classes/manpages.bbclass
+++ b/meta/classes/manpages.bbclass
@@ -18,8 +18,15 @@ pkg_postinst_append_${MAN_PKG} () {
 		if test -n "$D"; then
 			if ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'true','false', d)}; then
 				sed "s:\(\s\)/:\1$D/:g" $D${sysconfdir}/man_db.conf | ${@qemu_run_binary(d, '$D', '${bindir}/mandb')} -C - -u -q $D${mandir}
+				chown -R root:root $D${mandir}
 				mkdir -p $D${localstatedir}/cache/man
-				mv $D${mandir}/index.db $D${localstatedir}/cache/man
+				cd $D${mandir}
+				find . -name index.db | while read index; do
+					mkdir -p $D${localstatedir}/cache/man/$(dirname ${index})
+					mv ${index} $D${localstatedir}/cache/man/${index}
+					chown man:man $D${localstatedir}/cache/man/${index}
+				done
+				cd -
 			else
 				$INTERCEPT_DIR/postinst_intercept delay_to_first_boot ${PKG} mlprefix=${MLPREFIX}
 			fi
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-06-22 10:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-19 22:17 [PATCH 1/2] manpages.bbclass: Fix rootfs host corruption Alex Kiernan
2019-12-19 22:17 ` [PATCH 2/2] rootfs-postcommands: Enable rootfs_check_host_user_contaminated Alex Kiernan
2020-01-02 23:20   ` Ross Burton
2020-05-21 14:14     ` [OE-core] [OE-Core][PATCH " Alex Kiernan
     [not found]     ` <161110ADA6F0224D.21901@lists.openembedded.org>
2020-06-09 15:08       ` Alex Kiernan
2020-06-20 12:45         ` Richard Purdie
2020-06-21 15:24           ` Alex Kiernan
2020-06-21 16:00             ` Richard Purdie
2020-06-22 10:58               ` Alex Kiernan
2020-01-09  2:30 ` [PATCH 1/2] manpages.bbclass: Fix rootfs host corruption Alex Kiernan
2020-01-09 13:36   ` Ross Burton
2020-01-09 14:43     ` Alex Kiernan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox