From 063000a239dbdef7145e3c77f28d8ca30ff7604b Mon Sep 17 00:00:00 2001 From: hanzongcheng Date: Sat, 22 Mar 2025 12:29:44 +0800 Subject: [PATCH 1/2] systemd: update update-rtc.patch * This patch provided by openEuler doesn't work for embedded's current needs. Because embedded's "$base_bindir" is "/bin" instead of "/usr/bin". So, we need to use our updated patch. Signed-off-by: hanzongcheng --- ...-rtc-with-system-clock-when-shutdown.patch | 52 +++++++++++++++++++ .../systemd/systemd-openeuler.inc | 8 ++- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 meta-openeuler/recipes-core/systemd/files/update-rtc-with-system-clock-when-shutdown.patch diff --git a/meta-openeuler/recipes-core/systemd/files/update-rtc-with-system-clock-when-shutdown.patch b/meta-openeuler/recipes-core/systemd/files/update-rtc-with-system-clock-when-shutdown.patch new file mode 100644 index 00000000000..b68262b85bb --- /dev/null +++ b/meta-openeuler/recipes-core/systemd/files/update-rtc-with-system-clock-when-shutdown.patch @@ -0,0 +1,52 @@ +From a13f14c6a2da55b9f797b6f33449ba523c07dd46 Mon Sep 17 00:00:00 2001 +From: update-rtc-with-system-clock-when-shutdown +Date: Sat, 2 Feb 2019 02:54:52 -0500 +Subject: [PATCH] Module: modification summary +--- + units/hwclock-save.service.in | 19 +++++++++++++++++++ + units/meson.build | 2 ++ + 2 files changed, 21 insertions(+) + create mode 100644 units/hwclock-save.service.in + +diff --git a/units/hwclock-save.service.in b/units/hwclock-save.service.in +new file mode 100644 +index 0000000..db33418 +--- /dev/null ++++ b/units/hwclock-save.service.in +@@ -0,0 +1,19 @@ ++# This file is part of systemd. ++# ++# systemd is free software; you can redistribute it and/or modify it+ ++# under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++ ++[Unit] ++Description=Update RTC With System Clock ++ ++[Service] ++Type=oneshot ++ExecStart=/bin/true ++ExecStop=/sbin/hwclock --systohc ++RemainAfterExit=yes ++ ++[Install] ++WantedBy=default.target ++ +diff --git a/units/meson.build b/units/meson.build +index aa2ed11..9992389 100644 +--- a/units/meson.build ++++ b/units/meson.build +@@ -220,6 +220,8 @@ in_units = [ + 'sysinit.target.wants/'], + ['systemd-update-done.service', '', + 'sysinit.target.wants/'], ++ ['hwclock-save.service', '', ++ 'sysinit.target.wants/'], + ['systemd-update-utmp-runlevel.service', 'ENABLE_UTMP HAVE_SYSV_COMPAT', + 'multi-user.target.wants/ graphical.target.wants/ rescue.target.wants/'], + ['systemd-update-utmp.service', 'ENABLE_UTMP', +-- +2.23.0 + + diff --git a/meta-openeuler/recipes-core/systemd/systemd-openeuler.inc b/meta-openeuler/recipes-core/systemd/systemd-openeuler.inc index bac44f767b5..cddf0e16e5c 100644 --- a/meta-openeuler/recipes-core/systemd/systemd-openeuler.inc +++ b/meta-openeuler/recipes-core/systemd/systemd-openeuler.inc @@ -11,7 +11,6 @@ SRC_URI =+ " \ file://backport-sd-event-fix-error-handling.patch \ file://backport-core-refuse-dbus-activation-if-dbus-is-not-running.patch \ file://backport-core-only-refuse-Type-dbus-service-enqueuing-if-dbus.patch \ - file://update-rtc-with-system-clock-when-shutdown.patch \ file://udev-add-actions-while-rename-netif-failed.patch \ file://fix-two-VF-virtual-machines-have-same-mac-address.patch \ file://logind-set-RemoveIPC-to-false-by-default.patch \ @@ -62,3 +61,10 @@ SRC_URI =+ " \ file://delete-journal-files-except-system.journal-when-jour.patch \ file://set-the-cpuset.cpus-mems-of-machine.slice-to-all-by-.patch \ " + +# This patch provided by openEuler doesn't work for embedded's current needs. +# Because embedded's "base_dir" is "/bin" instead of "/usr/bin". So, we need +# to use our updated patch. +SRC_URI += " \ + file://update-rtc-with-system-clock-when-shutdown.patch \ +" -- Gitee From b4d123c3b7835bf9415fa770f4a774878b462cd0 Mon Sep 17 00:00:00 2001 From: hanzongcheng Date: Sat, 22 Mar 2025 12:31:35 +0800 Subject: [PATCH 2/2] coreutils: Revert "coreutils: configure the installation path" * If the "$base_bindir" is forcibly modified, it will cause some software to fail to work. For example, it will cause the "sshd.socket" provided by OpenSSH to become invalid (because the "$base_bindir" of the two are inconsistent, resulting in missing commands). A better approach is to provide commands under "/usr/bin" through usrmerge. The hwclock-save.service that previously had hard dependencies on "/usr/bin/true" have now been fixed, so revert commit 533b97b8077e. Signed-off-by: hanzongcheng --- meta-openeuler/recipes-core/coreutils/coreutils_%.bbappend | 3 --- 1 file changed, 3 deletions(-) diff --git a/meta-openeuler/recipes-core/coreutils/coreutils_%.bbappend b/meta-openeuler/recipes-core/coreutils/coreutils_%.bbappend index 3638bb8e258..2d9c3d12afc 100644 --- a/meta-openeuler/recipes-core/coreutils/coreutils_%.bbappend +++ b/meta-openeuler/recipes-core/coreutils/coreutils_%.bbappend @@ -10,9 +10,6 @@ LIC_FILES_CHKSUM += " \ file://src/ls.c;beginline=1;endline=15;md5=9ac94aaed7fd46fd8df7147a9e3410cb \ " -# To keep things in line with openEuler, we only install coreutils under /usr/bin -export base_bindir = "/usr/bin" - # files, patches can't be applied in openeuler or conflict with openeuler # remove-usr-local-lib-from-m4.patch same as bugfix-remove-usr-local-lib-from-m4.patch SRC_URI:remove = " \ -- Gitee