Package init

This commit is contained in:
dogsheng 2019-12-25 15:44:58 +08:00
parent 3cebff95ab
commit e7b4d9f197
3 changed files with 94 additions and 1 deletions

View File

@ -1,3 +1,4 @@
# This spec obtain from source code(dracut-049.tar.gz)
%define dracutlibdir %{_prefix}/lib/dracut
%bcond_without doc
@ -9,7 +10,7 @@
Name: dracut
Version: 049
Release: 4
Release: 5
Summary: Initramfs generator using udev
%if 0%{?fedora} || 0%{?rhel}
@ -38,6 +39,9 @@ Patch6005: 0141-95iscsi-sys-devices-platform-flashnode_sess-is_boot_.patch
Patch9000: check_vol_slaves_all-must-return-1-when-lvm-vgs-fail.patch
Patch9001: dracut-network-fixed-net-rules-issue-hence-systemd-r.patch
Patch9002: skip-the-broken-sd-in-initqueue.patch
Patch9003: use-sleep-replace-check-sys-block.patch
Source1: https://www.gnu.org/licenses/lgpl-2.1.txt
Source2: openEuler.conf.example
@ -486,6 +490,9 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
%endif
%changelog
* Mon Dec 16 2019 openEuler Buildteam <buildteam@openeuler.org> - 049-5
- Use sleep replace check /sys/block and skip the broken sd in initqueue
* Wed Sep 25 2019 hexiaowen <hexiaowen@huawei.com> - 049-4
- fix issue when anaconda pxe install for dracut-network

View File

@ -0,0 +1,48 @@
From 816a7dbff7128b4b87ea8d6abd2caf564f8f3502 Mon Sep 17 00:00:00 2001
From: gaoyi <gaoyi15@huawei.com>
Date: Fri, 18 Oct 2019 10:42:55 -0400
Subject: [PATCH] skip the broken sd in initqueue
---
.../98dracut-systemd/dracut-initqueue.sh | 25 +++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/modules.d/98dracut-systemd/dracut-initqueue.sh b/modules.d/98dracut-systemd/dracut-initqueue.sh
index 3ddc236..c7d7888 100755
--- a/modules.d/98dracut-systemd/dracut-initqueue.sh
+++ b/modules.d/98dracut-systemd/dracut-initqueue.sh
@@ -16,6 +16,31 @@ RDRETRY=${RDRETRY:-180}
RDRETRY=$(($RDRETRY*2))
export RDRETRY
+if getarg 'skipbadscsi' -d 'skipbadscsi'; then
+ sd_dir=/sys/block
+ while [ "`ls $sd_dir/`" = "" ]
+ do
+ sleep 1
+ done
+
+ dev_num=0
+ for _sd_device in `ls $sd_dir/`
+ do
+ blkid /dev/$_sd_device >/dev/null 2>&1 &
+ ((dev_num++))
+ done
+
+ sleep $dev_num
+
+ for _sd_device in `ps -eo cmd,stat | grep -Po "(?<=blkid /dev/).*(?=D)"`
+ do
+ echo offline > $sd_dir/$_sd_device/device/state
+ echo "Dev $_sd_device maybe broken, set it offline" > /dev/kmsg
+ done
+
+ udevadm settle --timeout=30
+fi
+
main_loop=0
export main_loop
--
2.19.1

View File

@ -0,0 +1,38 @@
From c7f23ea749a9bb41552d3e0ce4c86d7919dfc2f4 Mon Sep 17 00:00:00 2001
From: gaoyi <gaoyi15@huawei.com>
Date: Wed, 23 Oct 2019 12:57:01 -0400
Subject: [PATCH] use sleep replace check /sys/block
---
modules.d/98dracut-systemd/dracut-initqueue.sh | 14 ++++++++++----
2 files changed, 10 insertions(+), 4 deletions(-)
create mode 100644 .0001-delete-MACHINE_ID-to-eliminate-difference-of-vmlinuz.patch.swp
diff --git a/modules.d/98dracut-systemd/dracut-initqueue.sh b/modules.d/98dracut-systemd/dracut-initqueue.sh
index c7d7888..f8c7e66 100755
--- a/modules.d/98dracut-systemd/dracut-initqueue.sh
+++ b/modules.d/98dracut-systemd/dracut-initqueue.sh
@@ -18,10 +18,16 @@ export RDRETRY
if getarg 'skipbadscsi' -d 'skipbadscsi'; then
sd_dir=/sys/block
- while [ "`ls $sd_dir/`" = "" ]
- do
- sleep 1
- done
+
+ wait_time=$(getargs 'skipbadscsi=')
+ if [ x"$wait_time" = x"skipbadscsi" ]; then
+ wait_time=15
+ fi
+ if ! isdigit $wait_time; then
+ wait_time=15
+ fi
+
+ sleep $wait_time
dev_num=0
for _sd_device in `ls $sd_dir/`
--
2.19.1