8 Star 0 Fork 16

src-anolis-os/dracut

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0059.patch 2.23 KB
一键复制 编辑 原始数据 按行查看 历史
From 2caaf8b9ba5b95983154bd641f0f493ff1562cc0 Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong@redhat.com>
Date: Tue, 6 Aug 2019 15:39:31 +0800
Subject: [PATCH] 99squash: Only start the cleaner on switch-root
Currently it starts the cleaner early and do the clean up job if switch
root is called. It's better to just start the service only on switch
root to avoid any risk of service dependency failure and make is
simpler.
Signed-off-by: Kairui Song <kasong@redhat.com>
(cherry picked from commit 5d88809319049eb06e3472dcd11cca9c4557d8c2)
Resolves: #1678248
---
modules.d/99squash/module-setup.sh | 3 ++-
modules.d/99squash/squash-mnt-clear.service | 11 ++++-------
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh
index 935fd721..e7e9ed8e 100644
--- a/modules.d/99squash/module-setup.sh
+++ b/modules.d/99squash/module-setup.sh
@@ -25,5 +25,6 @@ install() {
inst $moddir/init.sh /squash/init.sh
inst "$moddir/squash-mnt-clear.service" "$systemdsystemunitdir/squash-mnt-clear.service"
- ln_r "$systemdsystemunitdir/squash-mnt-clear.service" "$systemdsystemunitdir/initrd.target.wants/squash-mnt-clear.service"
+ mkdir -p "$initdir$systemdsystemunitdir/initrd-switch-root.target.wants"
+ ln_r "$systemdsystemunitdir/squash-mnt-clear.service" "$systemdsystemunitdir/initrd-switch-root.target.wants/squash-mnt-clear.service"
}
diff --git a/modules.d/99squash/squash-mnt-clear.service b/modules.d/99squash/squash-mnt-clear.service
index f8d5db46..84441f60 100644
--- a/modules.d/99squash/squash-mnt-clear.service
+++ b/modules.d/99squash/squash-mnt-clear.service
@@ -4,17 +4,14 @@
[Unit]
Description=Cleanup squashfs mounts when switch root
DefaultDependencies=no
-After=initrd.target
-After=dracut-initqueue.service dracut-pre-pivot.service
-Before=initrd-cleanup.service
+Before=initrd-switch-root.service
+After=initrd-switch-root.target
ConditionPathExists=/squash/root
-Conflicts=initrd-switch-root.target
-IgnoreOnIsolate=true
[Service]
Type=oneshot
-RemainAfterExit=yes
+RemainAfterExit=no
StandardInput=null
StandardOutput=syslog+console
StandardError=syslog+console
-ExecStop=/squash/clear-squash.sh
+ExecStart=/squash/clear-squash.sh
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-anolis-os/dracut.git
git@gitee.com:src-anolis-os/dracut.git
src-anolis-os
dracut
dracut
a8

搜索帮助