On 3/7/24 16:14, Alexander Kanavin wrote:
CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know
the content is safe.
Thanks, the patch is ok, but you need to actually open a dnf pull
request with the patch, and not just the ticket (also 'Submitted'
means that the patch was actually provided to upstream). It's okay if
upstream then rejects the patch. We'll at least try to convince them
:)
Alex
ok, I will send an pull request and send a v2 with the pull request.
Thanks
Changqing
On Thu, 7 Mar 2024 at 07:49, Changqing Li
<[email protected]> wrote:
From: Changqing Li <[email protected]>
dnf has a bug, refer [1], it causes that log_lock.pid may not removed
after dnf exit. And for native dnf, since we change the lock file path
to /, it will never be removed, and make the rootfs not clean,refer
[2][3]. This patch is a workaround to fix above issue.
[1] https://github.com/rpm-software-management/dnf/issues/1963
[2]
https://git.openembedded.org/openembedded-core/commit/?id=742a1b71249f4da1c8d8e13e270b0eb6128a3f66
[3]
https://github.com/rpm-software-management/dnf/blob/master/etc/tmpfiles.d/dnf.conf
Signed-off-by: Changqing Li <[email protected]>
---
...n.py-remove-log_lock.pid-before-exit.patch | 41 +++++++++++++++++++
meta/recipes-devtools/dnf/dnf_4.18.2.bb | 3 +-
2 files changed, 43 insertions(+), 1 deletion(-)
create mode 100644
meta/recipes-devtools/dnf/dnf/0001-main.py-remove-log_lock.pid-before-exit.patch
diff --git
a/meta/recipes-devtools/dnf/dnf/0001-main.py-remove-log_lock.pid-before-exit.patch
b/meta/recipes-devtools/dnf/dnf/0001-main.py-remove-log_lock.pid-before-exit.patch
new file mode 100644
index 0000000000..ae036cbbd6
--- /dev/null
+++
b/meta/recipes-devtools/dnf/dnf/0001-main.py-remove-log_lock.pid-before-exit.patch
@@ -0,0 +1,41 @@
+From bdf17281385cf33ad59267fe75a9e427e6e2ffc4 Mon Sep 17 00:00:00 2001
+From: Changqing Li <[email protected]>
+Date: Thu, 7 Mar 2024 14:03:07 +0800
+Subject: [PATCH] main.py: remove log_lock.pid before exit
+
+dnf has a bug, refer [1], it causes that log_lock.pid may not removed
+after dnf exit. And for native dnf, since we change the lock file path
+to /, it will never be removed, and make the rootfs not clean,refer
+[2][3]. This patch is a workaround to fix above issue.
+
+[1] https://github.com/rpm-software-management/dnf/issues/1963
+[2]
https://git.openembedded.org/openembedded-core/commit/?id=742a1b71249f4da1c8d8e13e270b0eb6128a3f66
+[3]
https://github.com/rpm-software-management/dnf/blob/master/etc/tmpfiles.d/dnf.conf
+
+Upstream-Status: Submited [ report to
https://github.com/rpm-software-management/dnf/issues/1963]
+
+Signed-off-by: Changqing Li <[email protected]>
+---
+ dnf/cli/main.py | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/dnf/cli/main.py b/dnf/cli/main.py
+index 2a7f92d54..2f672cff2 100644
+--- a/dnf/cli/main.py
++++ b/dnf/cli/main.py
+@@ -200,6 +200,12 @@ def user_main(args, exit_code=False):
+
+ errcode = main(args)
+ if exit_code:
++ for arg in args:
++ if arg.startswith("--installroot="):
++ root=arg.split("=")[1]
++ if os.path.exists(os.path.join(root, "log_lock.pid")):
++ os.unlink(os.path.join(root, "log_lock.pid"))
++ break
+ sys.exit(errcode)
+ return errcode
+
+--
+2.25.1
+
diff --git a/meta/recipes-devtools/dnf/dnf_4.18.2.bb
b/meta/recipes-devtools/dnf/dnf_4.18.2.bb
index dc0c18be5e..7770c9d7e0 100644
--- a/meta/recipes-devtools/dnf/dnf_4.18.2.bb
+++ b/meta/recipes-devtools/dnf/dnf_4.18.2.bb
@@ -17,7 +17,8 @@ SRC_URI =
"git://github.com/rpm-software-management/dnf.git;branch=master;protoc
file://0001-set-python-path-for-completion_helper.patch \
"
-SRC_URI:append:class-native =
"file://0001-dnf-write-the-log-lock-to-root.patch"
+SRC_URI:append:class-native =
"file://0001-dnf-write-the-log-lock-to-root.patch \
+
file://0001-main.py-remove-log_lock.pid-before-exit.patch"
SRCREV = "1c43d0999178d492381ad0b43917ffd9c74016f8"
UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)"
--
2.25.1
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#196779):
https://lists.openembedded.org/g/openembedded-core/message/196779
Mute This Topic: https://lists.openembedded.org/mt/104782944/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-