sync patches from upstream

This commit is contained in:
chenjiayi 2024-04-19 04:13:43 +08:00
parent deb88caec6
commit 53936c6f15
2 changed files with 47 additions and 1 deletions

View File

@ -0,0 +1,42 @@
From 5ce27d9ee552ffe24ffdc234467ae4b817b956d1 Mon Sep 17 00:00:00 2001
From: chenjiayi <chenjiayi22@huawei.com>
Date: Fri, 19 Apr 2024 03:16:26 +0800
Subject: [PATCH 1/1] fix(devmaster): add device property when cmdline
parameter has no value
If cmdline parameter has no value, assign "1" to it and add property
to the device.
---
exts/devmaster/src/lib/rules/exec_mgr.rs | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/exts/devmaster/src/lib/rules/exec_mgr.rs b/exts/devmaster/src/lib/rules/exec_mgr.rs
index 54e0093e..4dd15a00 100644
--- a/exts/devmaster/src/lib/rules/exec_mgr.rs
+++ b/exts/devmaster/src/lib/rules/exec_mgr.rs
@@ -908,11 +908,20 @@ impl ExecuteManager {
return Ok(token.read().unwrap().as_ref().unwrap().op == OperatorType::Nomatch);
}
- let value = cmdline.get_param(&token_value);
+ let value = match cmdline.get_param(&token_value) {
+ Some(v) => {
+ if v.is_empty() {
+ "1".to_string()
+ } else {
+ v
+ }
+ }
+ None => "1".to_string(),
+ };
execute_err!(
token.read().unwrap().as_ref().unwrap(),
- device.add_property(&token_value, &value.unwrap_or_default())
+ device.add_property(&token_value, &value)
)?;
Ok(token.read().unwrap().as_ref().unwrap().op == OperatorType::Match)
--
2.33.0

View File

@ -12,7 +12,7 @@
Name: sysmaster
Version: 1.0.0
Release: 6
Release: 7
Summary: redesign and reimplement process1.
License: Mulan PSL v2
@ -26,6 +26,7 @@ Patch3: backport-fix-resolve-not-mount-home.patch
Patch4: backport-fix-devmaster-correct-the-database-path.patch
Patch5: backport-fix-devmaster-fix-incorrect-cmdline-parameter-value-.patch
Patch6: backport-fix-devmaster-supply-log-messages-on-loading-.link-c.patch
Patch7: backport-fix-devmaster-add-device-property-when-cmdline-param.patch
ExclusiveArch: x86_64 aarch64
@ -167,6 +168,9 @@ if [ $1 -eq 0 ] ; then
fi
%changelog
* Tue Apr 23 2024 chenjiayi<chenjiayi22@huawei.com> - 1.0.0-7
- sync patches from upstream
* Thu Apr 18 2024 chenjiayi<chenjiayi22@huawei.com> - 1.0.0-6
- sync patches from upstream