From 26b399129ecb9fdb3629a2def03082c8ae53be2b Mon Sep 17 00:00:00 2001 From: zhangyao Date: Mon, 15 Apr 2024 09:00:22 +0800 Subject: [PATCH] fix: resolve not mounted home --- backport-fix-resolve-not-mount-home.patch | 38 +++++++++++++++++++++++ sysmaster.spec | 6 +++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 backport-fix-resolve-not-mount-home.patch diff --git a/backport-fix-resolve-not-mount-home.patch b/backport-fix-resolve-not-mount-home.patch new file mode 100644 index 0000000..b086cf7 --- /dev/null +++ b/backport-fix-resolve-not-mount-home.patch @@ -0,0 +1,38 @@ +From 0f2708a50893911bd650e3b855e7b470b6c316a9 Mon Sep 17 00:00:00 2001 +From: zhangyao2022 +Date: Mon, 15 Apr 2024 08:14:58 +0800 +Subject: [PATCH] fix: resolve not mount home + +--- + exts/fstab/src/main.rs | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/exts/fstab/src/main.rs b/exts/fstab/src/main.rs +index 09d7dd34..4eea27dd 100644 +--- a/exts/fstab/src/main.rs ++++ b/exts/fstab/src/main.rs +@@ -136,7 +136,7 @@ fn watch_devices(fstab_items: &[FSTabItem]) -> (Inotify, HashSet) { + file_path.file_name().unwrap().to_str().unwrap(), + )); + inotify +- .add_watch(dir_path, WatchMask::CREATE) ++ .add_watch(dir_path, WatchMask::CREATE | WatchMask::MOVED_TO) + .expect("Failed to add watch."); + } + (inotify, watch_set) +@@ -171,8 +171,10 @@ fn main() { + .read_events_blocking(&mut buffer) + .expect("Failed to read events."); + for event in events { +- if event.mask == EventMask::CREATE { +- log::debug!("File created: {:?}", event.name.unwrap()); ++ if event.mask == EventMask::CREATE || event.mask == EventMask::MOVED_TO { ++ if let Some(name) = event.name { ++ log::debug!("File created or moved: {:?}", name); ++ } + watch_updated = true; + } + } +-- +2.33.0 + diff --git a/sysmaster.spec b/sysmaster.spec index 5da92ae..d628d75 100644 --- a/sysmaster.spec +++ b/sysmaster.spec @@ -12,7 +12,7 @@ Name: sysmaster Version: 1.0.0 -Release: 4 +Release: 5 Summary: redesign and reimplement process1. License: Mulan PSL v2 @@ -22,6 +22,7 @@ Source0: %{name}-%{version}.tar.xz Patch0: backport-feature-devmaster-add-net_driver-builtin-to-be-compa.patch Patch1: backport-fix-resolve-wantedby-invalid.patch Patch2: backport-fix-read-pid-cmdline-incorrect.patch +Patch3: backport-fix-resolve-not-mount-home.patch ExclusiveArch: x86_64 aarch64 @@ -163,6 +164,9 @@ if [ $1 -eq 0 ] ; then fi %changelog +* Wed Apr 17 2024 zhangyao - 1.0.0-5 +- resolve not mounted home + * Thu Apr 11 2024 zhangyao - 1.0.0-4 - read pid cmdline incorrect