Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
520c178b87
!141 [sync] PR-139: dracut command line options don't override .conf files
From: @openeuler-sync-bot 
Reviewed-by: @yue-yuankun 
Signed-off-by: @yue-yuankun
2024-11-25 13:26:09 +00:00
Andy Lau
b8c7678589 dracut command line options do not override .conf files
(cherry picked from commit 2cec0b535fb54fb1726fd65cbb56c28e8bd6684e)
2024-11-25 20:20:53 +08:00
openeuler-ci-bot
573f95c816
!132 fix(dracut-install): copy mode when use clone ioctl
From: @HuaxinLuGitee 
Reviewed-by: @jiayi0118 
Signed-off-by: @jiayi0118
2024-09-07 03:22:57 +00:00
openeuler-ci-bot
e4800140e4
!128 [sync] PR-127: iscsiuio已在2203-LTS上就不支持,dracut 2403-LTS需删除open-iscsi社区不维护的iscsiuio相关代码
From: @openeuler-sync-bot 
Reviewed-by: @jiayi0118 
Signed-off-by: @jiayi0118
2024-09-06 08:04:01 +00:00
root
d961cfcfec remove iscsi-related code since it is no longer maintained by open-iscsi
(cherry picked from commit c903080c7aba822715033ef94aa12cc15f6d8e4e)
2024-09-06 09:26:32 +08:00
Huaxin Lu
49edd50392 fix(dracut-install): copy mode when use clone ioctl 2024-08-21 15:39:57 +08:00
openeuler-ci-bot
b3511a02f7
!125 [sync] PR-123: add backport-fix-dracut-install-copy-xattr-when-use-clone-ioctl.patch
From: @openeuler-sync-bot 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
2024-07-11 08:24:53 +00:00
zhengxiaoxiao
7cabbe65e6 add backport-fix-dracut-install-copy-xattr-when-use-clone-ioctl.patch
(cherry picked from commit fd7c58e5b36f390d9a424f349c398563864de7b9)
2024-07-11 16:06:27 +08:00
openeuler-ci-bot
f03f219a72
!119 [sync] PR-113: 同步上游社区补丁
From: @openeuler-sync-bot 
Reviewed-by: @jiayi0118 
Signed-off-by: @jiayi0118
2024-06-14 09:20:28 +00:00
hongjinghao
f14b1e323b backport update stream
(cherry picked from commit fcda6c6d06b7f5b98775057940f899e231d0675a)
2024-06-14 09:28:07 +08:00
6 changed files with 358 additions and 1 deletions

View File

@ -0,0 +1,45 @@
From 097d4bdb20443c1c5a86cc617ac2ab0c24193d75 Mon Sep 17 00:00:00 2001
From: Pavel Valena <pvalena@redhat.com>
Date: Sat, 17 Aug 2024 01:43:50 +0200
Subject: [PATCH] feat(dracut-init.sh): give --force-add precedence over --omit
This gives precedence of force_add_dracutmodules to omit_dracutmodules,
as there is not other way to override omit_dracutmodules list, and users
would expect it to be overriden from command line.
Ref: https://github.com/dracut-ng/dracut-ng/pull/569
This way, `--add` retains it behaviour, and `--force-add` gains additional
functionality in non-hostonly mode. The module may still be skipped
if the module check returns 1, but it should throw error (as I'd expect
for `--force-add`).
Ref: https://issues.redhat.com/browse/RHEL-26114
(cherry picked from commit a669346f48cbb3278c51ba5e95b1b91f9bfdee0a)
Resolves: RHEL-26114
---
dracut-init.sh | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dracut-init.sh b/dracut-init.sh
index fe1b1426..27abb07b 100644
--- a/dracut-init.sh
+++ b/dracut-init.sh
@@ -921,8 +921,10 @@ check_module() {
[[ $2 ]] || mods_checked_as_dep+=" $_mod "
if [[ " $omit_dracutmodules " == *\ $_mod\ * ]]; then
- ddebug "dracut module '$_mod' will not be installed, because it's in the list to be omitted!"
- return 1
+ if [[ " $force_add_dracutmodules " != *\ $_mod\ * ]]; then
+ ddebug "Module '$_mod' will not be installed, because it's in the list to be omitted!"
+ return 1
+ fi
fi
if [[ " $dracutmodules $add_dracutmodules $force_add_dracutmodules" == *\ $_mod\ * ]]; then
--
2.34.1

View File

@ -0,0 +1,100 @@
From 1cf0db26e43fe4c6173acdb8047f16666ebf070a Mon Sep 17 00:00:00 2001
From: Huaxin Lu <luhuaxin1@huawei.com>
Date: Thu, 20 Jun 2024 13:38:26 +0800
Subject: [PATCH] fix(dracut-install): copy xattr when use clone ioctl
When use clone ioctl to copy a file, the extended attributes of files are
missing, which is inconsistent with the result by using the cp command.
This commit add the process to copy extended attributes after clone_file().
Signed-off-by: Huaxin Lu <luhuaxin1@huawei.com>
Reference:https://github.com/dracut-ng/dracut-ng/pull/461/commits/1cf0db26e43fe4c6173acdb8047f16666ebf070a
Conflict:NA
---
src/install/dracut-install.c | 56 ++++++++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+)
diff --git a/src/install/dracut-install.c b/src/install/dracut-install.c
index 1862c599d..dd70382cb 100644
--- a/src/install/dracut-install.c
+++ b/src/install/dracut-install.c
@@ -42,6 +42,7 @@
#include <fts.h>
#include <regex.h>
#include <sys/utsname.h>
+#include <sys/xattr.h>
#include "log.h"
#include "hashmap.h"
@@ -292,6 +293,56 @@ static inline int clone_file(int dest_fd, int src_fd)
return ioctl(dest_fd, BTRFS_IOC_CLONE, src_fd);
}
+static int copy_xattr(int dest_fd, int src_fd)
+{
+ int ret = 0;
+ ssize_t name_len = 0, value_len = 0;
+ char *name_buf = NULL, *name = NULL, *value = NULL, *value_save = NULL;
+
+ name_len = flistxattr(src_fd, NULL, 0);
+ if (name_len < 0)
+ return -1;
+
+ name_buf = calloc(1, name_len + 1);
+ if (name_buf == NULL)
+ return -1;
+
+ name_len = flistxattr(src_fd, name_buf, name_len);
+ if (name_len < 0)
+ goto out;
+
+ for (name = name_buf; name != name_buf + name_len; name = strchr(name, '\0') + 1) {
+ value_len = fgetxattr(src_fd, name, NULL, 0);
+ if (value_len < 0) {
+ ret = -1;
+ continue;
+ }
+
+ value_save = value;
+ value = realloc(value, value_len);
+ if (value == NULL) {
+ value = value_save;
+ ret = -1;
+ goto out;
+ }
+
+ value_len = fgetxattr(src_fd, name, value, value_len);
+ if (value_len < 0) {
+ ret = -1;
+ continue;
+ }
+
+ value_len = fsetxattr(dest_fd, name, value, value_len, 0);
+ if (value_len < 0)
+ ret = -1;
+ }
+
+out:
+ free(name_buf);
+ free(value);
+ return ret;
+}
+
static bool use_clone = true;
static int cp(const char *src, const char *dst)
@@ -333,6 +384,11 @@ static int cp(const char *src, const char *dst)
log_info("Failed to chown %s: %m", dst);
}
+ if (geteuid() == 0 && no_xattr == false) {
+ if (copy_xattr(dest_desc, source_desc) != 0)
+ log_error("Failed to copy xattr %s: %m", dst);
+ }
+
tv[0].tv_sec = sb.st_atime;
tv[0].tv_usec = 0;
tv[1].tv_sec = sb.st_mtime;
--
2.27.0

View File

@ -0,0 +1,31 @@
From 5d2bda46f4e75e85445ee4d3bd3f68bf966287b9 Mon Sep 17 00:00:00 2001
From: Ihno Krumreich <ihno@suse.com>
Date: Wed, 28 Feb 2024 08:24:35 +0100
Subject: [PATCH] fix(zfcp_rules): correct shellcheck regression when parsing
ccw args
Fixes 032ecd95c94b77f3f08237e0f765b355dacb9573
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/5d2bda46f4e75e85445ee4d3bd3f68bf966287b9
---
modules.d/95zfcp_rules/parse-zfcp.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/modules.d/95zfcp_rules/parse-zfcp.sh b/modules.d/95zfcp_rules/parse-zfcp.sh
index 5e7d9095..a474b81b 100755
--- a/modules.d/95zfcp_rules/parse-zfcp.sh
+++ b/modules.d/95zfcp_rules/parse-zfcp.sh
@@ -63,7 +63,8 @@ for zfcp_arg in $(getargs root=) $(getargs resume=); do
if [ -n "$ccw_arg" ]; then
OLDIFS="$IFS"
IFS="-"
- set -- "$ccw_arg"
+ # shellcheck disable=SC2086
+ set -- $ccw_arg
IFS="$OLDIFS"
_wwpn=${4%:*}
_lun=${4#*:}
--
2.33.0

View File

@ -9,7 +9,7 @@
Name: dracut
Version: 059
Release: 6
Release: 11
Summary: Initramfs generator using udev
@ -39,6 +39,12 @@ Patch11: backport-fix-fs-lib-remove-quoting-form-the-first-argument-of.patch
Patch12: backport-feat-systemd-install-systemd-executor.patch
Patch6000: backport-fix-dracut.sh-remove-microcode-check-based-on-CONFIG.patch
Patch6001: backport-fix-zfcp_rules-correct-shellcheck-regression-when-pa.patch
Patch6003: backport-fix-dracut-install-copy-xattr-when-use-clone-ioctl.patch
Patch6004: fix-dracut-install-copy-mode-when-use-clone-ioctl.patch
Patch6005: backport-feat-dracut-init.sh-give-force-add-precedence-over-o.patch
Patch9000: remove-iscsi-related-code-since-it-is-no-longer-main.patch
Source1: https://www.gnu.org/licenses/lgpl-2.1.txt
Source2: openEuler.conf.example
@ -527,6 +533,21 @@ rm -f 51-dracut-rescue-postinst.sh
%endif
%changelog
* Mon Nov 25 2024 andy <liuyang01@kylinos.cn> - 059-11
- add backport-feat-dracut-init.sh-give-force-add-precedence-over-o.patch
* Fri Sep 6 2024 luhuaxin <luhuaxin1@huawei.com> - 059-10
- fix(dracut-install): copy mode when use clone ioctl
* Mon Aug 26 2024 yanshuai <yanshuai01@kylinos.cn> - 059-9
- remove iscsi-related code since it is no longer maintained by open-iscsi
* Thu Jul 11 2024 zhengxiaoxiao <zhengxiaoxiao2@huawei.com> - 059-8
- add backport-fix-dracut-install-copy-xattr-when-use-clone-ioctl.patch
* Thu Jun 13 2024 hongjinghao <hongjinghao@huawei.com> - 059-7
- backport update stream
* Thu Apr 18 2024 wangyuhang <wangyuhang27@huawei.com> - 059-6
- Backport patches to remove microcode check based on CONFIG_MICROCODE_[AMD|INTEL]

View File

@ -0,0 +1,31 @@
From a1c9480ac9791eb961507b44b7c0813a9ffd4ca4 Mon Sep 17 00:00:00 2001
From: Huaxin Lu <luhuaxin1@huawei.com>
Date: Wed, 21 Aug 2024 14:51:53 +0800
Subject: [PATCH] fix(dracut-install): copy mode when use clone ioctl
When use clone ioctl to copy a file, the mode of files are missing,
which is inconsistent with the result by using the cp command.
This commit add the process to set mode after clone_file().
Signed-off-by: Huaxin Lu <luhuaxin1@huawei.com>
---
src/install/dracut-install.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/install/dracut-install.c b/src/install/dracut-install.c
index 291c70a..47b799e 100644
--- a/src/install/dracut-install.c
+++ b/src/install/dracut-install.c
@@ -363,6 +363,9 @@ static int cp(const char *src, const char *dst)
log_info("Failed to chown %s: %m", dst);
}
+ if (fchmod(dest_desc, sb.st_mode) != 0)
+ log_error("Failed to chown %s: %m", dst);
+
if (geteuid() == 0 && no_xattr == false) {
if (copy_xattr(dest_desc, source_desc) != 0)
log_error("Failed to copy xattr %s: %m", dst);
--
2.33.0

View File

@ -0,0 +1,129 @@
From 38a3ee547e93c0b11020818cc4a244f89d492031 Mon Sep 17 00:00:00 2001
From: luck <lucx_ii@163.com>
Date: Sun, 4 Dec 2022 16:00:32 +0800
Subject: [PATCH] remove iscsi-related code since it is no longer maintained by
open-iscsi
---
modules.d/95iscsi/cleanup-iscsi.sh | 3 ---
modules.d/95iscsi/iscsiroot.sh | 8 -------
modules.d/95iscsi/module-setup.sh | 29 +++--------------------
test/container/Dockerfile-OpenSuse-latest | 2 +-
4 files changed, 4 insertions(+), 38 deletions(-)
diff --git a/modules.d/95iscsi/cleanup-iscsi.sh b/modules.d/95iscsi/cleanup-iscsi.sh
index 8338503..13f4793 100755
--- a/modules.d/95iscsi/cleanup-iscsi.sh
+++ b/modules.d/95iscsi/cleanup-iscsi.sh
@@ -1,5 +1,2 @@
#!/bin/sh
-if [ -z "${DRACUT_SYSTEMD}" ] && { [ -e /sys/module/bnx2i ] || [ -e /sys/module/qedi ]; }; then
- killproc iscsiuio
-fi
diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh
index b6af7f4..39c5f6d 100755
--- a/modules.d/95iscsi/iscsiroot.sh
+++ b/modules.d/95iscsi/iscsiroot.sh
@@ -36,14 +36,6 @@ iroot=${iroot#:}
# figured out a way how to check whether this is built-in or not
modprobe crc32c 2> /dev/null
-# start iscsiuio if needed
-if [ -z "${DRACUT_SYSTEMD}" ] \
- && { [ -e /sys/module/bnx2i ] || [ -e /sys/module/qedi ]; } \
- && ! [ -e /tmp/iscsiuio-started ]; then
- iscsiuio
- : > /tmp/iscsiuio-started
-fi
-
handle_firmware() {
local ifaces retry _res
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
index e7d74fe..dcb6eea 100755
--- a/modules.d/95iscsi/module-setup.sh
+++ b/modules.d/95iscsi/module-setup.sh
@@ -185,7 +185,6 @@ cmdline() {
# called by dracut
install() {
- inst_multiple -o iscsiuio
inst_libdir_file 'libgcc_s.so*'
inst_multiple umount iscsi-iname iscsiadm iscsid
inst_binary sort
@@ -193,10 +192,7 @@ install() {
inst_multiple -o \
"$systemdsystemunitdir"/iscsid.socket \
"$systemdsystemunitdir"/iscsid.service \
- "$systemdsystemunitdir"/iscsiuio.service \
- "$systemdsystemunitdir"/iscsiuio.socket \
- "$systemdsystemunitdir"/sockets.target.wants/iscsid.socket \
- "$systemdsystemunitdir"/sockets.target.wants/iscsiuio.socket
+ "$systemdsystemunitdir"/sockets.target.wants/iscsid.socket
if [[ $hostonly ]]; then
local -a _filenames
@@ -227,13 +223,10 @@ install() {
"$systemdsystemunitdir"/iscsi-init.service \
"$systemdsystemunitdir"/iscsid.service \
"$systemdsystemunitdir"/iscsid.socket \
- "$systemdsystemunitdir"/iscsiuio.service \
- "$systemdsystemunitdir"/iscsiuio.socket \
iscsiadm iscsid
for i in \
- iscsid.socket \
- iscsiuio.socket; do
+ iscsid.socket; do
$SYSTEMCTL -q --root "$initdir" enable "$i"
done
@@ -253,22 +246,6 @@ install() {
echo "Before=shutdown.target sockets.target"
} > "${initdir}/$systemdsystemunitdir/iscsid.socket.d/dracut.conf"
- mkdir -p "${initdir}/$systemdsystemunitdir/iscsiuio.service.d"
- {
- echo "[Unit]"
- echo "DefaultDependencies=no"
- echo "Conflicts=shutdown.target"
- echo "Before=shutdown.target"
- } > "${initdir}/$systemdsystemunitdir/iscsiuio.service.d/dracut.conf"
-
- mkdir -p "${initdir}/$systemdsystemunitdir/iscsiuio.socket.d"
- {
- echo "[Unit]"
- echo "DefaultDependencies=no"
- echo "Conflicts=shutdown.target"
- echo "Before=shutdown.target sockets.target"
- } > "${initdir}/$systemdsystemunitdir/iscsiuio.socket.d/dracut.conf"
-
# Fedora 34 iscsid requires iscsi-shutdown.service
# which would terminate all iSCSI connections on switch root
cat > "${initdir}/$systemdsystemunitdir/iscsi-shutdown.service" << EOF
@@ -277,7 +254,7 @@ Description=Dummy iscsi-shutdown.service for the initrd
Documentation=man:iscsid(8) man:iscsiadm(8)
DefaultDependencies=no
Conflicts=shutdown.target
-After=systemd-remount-fs.service network.target iscsid.service iscsiuio.service
+After=systemd-remount-fs.service network.target iscsid.service
Before=remote-fs-pre.target
[Service]
diff --git a/test/container/Dockerfile-OpenSuse-latest b/test/container/Dockerfile-OpenSuse-latest
index 9007865..32dd8b1 100644
--- a/test/container/Dockerfile-OpenSuse-latest
+++ b/test/container/Dockerfile-OpenSuse-latest
@@ -13,7 +13,7 @@ RUN dnf -y install --setopt=install_weak_deps=False \
strace libkmod-devel gcc bzip2 xz tar wget rpm-build make git bash-completion \
sudo kernel dhcp-client qemu-kvm /usr/bin/qemu-system-$(uname -m) e2fsprogs \
tcpdump iproute iputils kbd NetworkManager btrfsprogs tgt dbus-broker \
- iscsiuio open-iscsi which ShellCheck shfmt procps pigz parted squashfs ntfsprogs \
+ open-iscsi which ShellCheck shfmt procps pigz parted squashfs ntfsprogs \
&& dnf -y remove dracut && dnf -y update && dnf clean all
# Set default command
--
2.27.0