代码拉取完成,页面将自动刷新
同步操作将从 OpenCloudOS Stream/dracut 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
diff -uprN dracut-059/modules.d/98dracut-systemd/module-setup.sh dracut-059.patch/modules.d/98dracut-systemd/module-setup.sh
--- dracut-059/modules.d/98dracut-systemd/module-setup.sh 2022-12-24 16:49:27.000000000 +0000
+++ dracut-059.patch/modules.d/98dracut-systemd/module-setup.sh 2023-11-17 07:31:15.645791475 +0000
@@ -37,6 +37,8 @@ install() {
inst_script "$moddir/rootfs-generator.sh" "$systemdutildir"/system-generators/dracut-rootfs-generator
+ inst_hook cmdline 00 "$moddir/parse-root.sh"
+
for i in \
dracut-cmdline.service \
dracut-cmdline-ask.service \
diff -uprN dracut-059/modules.d/98dracut-systemd/parse-root.sh dracut-059.patch/modules.d/98dracut-systemd/parse-root.sh
--- dracut-059/modules.d/98dracut-systemd/parse-root.sh 1970-01-01 00:00:00.000000000 +0000
+++ dracut-059.patch/modules.d/98dracut-systemd/parse-root.sh 2023-11-17 07:29:54.551079730 +0000
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+
+root=$(getarg root=)
+case "${root#block:}" in
+ LABEL=* | UUID=* | PARTUUID=* | PARTLABEL=*)
+ root="block:$(label_uuid_to_dev "$root")"
+ rootok=1
+ ;;
+ /dev/nfs | /dev/root) # ignore legacy
+ ;;
+ /dev/*)
+ root="block:${root}"
+ rootok=1
+ ;;
+esac
+
+if [ "$rootok" = "1" ]; then
+ root_dev="${root#block:}"
+ root_name="$(str_replace "$root_dev" '/' '\x2f')"
+ if ! [ -e "$hookdir/initqueue/finished/devexists-${root_name}.sh" ]; then
+
+ # If a LUKS device needs unlocking via systemd in the initrd, assume
+ # it's for the root device. In that case, don't block on it if it's
+ # after remote-fs-pre.target since the initqueue is ordered before it so
+ # it will never actually show up (think Tang-pinned rootfs).
+ cat > "$hookdir/initqueue/finished/devexists-${root_name}.sh" << EOF
+if ! grep -q After=remote-fs-pre.target /run/systemd/generator/systemd-cryptsetup@*.service 2>/dev/null; then
+ [ -e "$root_dev" ]
+fi
+EOF
+ {
+ printf '[ -e "%s" ] || ' "$root_dev"
+ printf 'warn "\"%s\" does not exist"\n' "$root_dev"
+ } >> "$hookdir/emergency/80-${root_name}.sh"
+ fi
+fi
diff -uprN dracut-059/modules.d/98dracut-systemd/rootfs-generator.sh dracut-059.patch/modules.d/98dracut-systemd/rootfs-generator.sh
--- dracut-059/modules.d/98dracut-systemd/rootfs-generator.sh 2022-12-24 16:49:27.000000000 +0000
+++ dracut-059.patch/modules.d/98dracut-systemd/rootfs-generator.sh 2023-11-17 07:31:15.645791475 +0000
@@ -6,28 +6,10 @@ generator_wait_for_dev() {
local _name
local _timeout
- _name="$(str_replace "$1" '/' '\x2f')"
+ _name=$(dev_unit_name "$1")
_timeout=$(getarg rd.timeout)
_timeout=${_timeout:-0}
- if ! [ -e "$hookdir/initqueue/finished/devexists-${_name}.sh" ]; then
-
- # If a LUKS device needs unlocking via systemd in the initrd, assume
- # it's for the root device. In that case, don't block on it if it's
- # after remote-fs-pre.target since the initqueue is ordered before it so
- # it will never actually show up (think Tang-pinned rootfs).
- cat > "$hookdir/initqueue/finished/devexists-${_name}.sh" << EOF
-if ! grep -q After=remote-fs-pre.target /run/systemd/generator/systemd-cryptsetup@*.service 2>/dev/null; then
- [ -e "$1" ]
-fi
-EOF
- {
- printf '[ -e "%s" ] || ' "$1"
- printf 'warn "\"%s\" does not exist"\n' "$1"
- } >> "$hookdir/emergency/80-${_name}.sh"
- fi
-
- _name=$(dev_unit_name "$1")
if ! [ -L "$GENERATOR_DIR"/initrd.target.wants/"${_name}".device ]; then
[ -d "$GENERATOR_DIR"/initrd.target.wants ] || mkdir -p "$GENERATOR_DIR"/initrd.target.wants
ln -s ../"${_name}".device "$GENERATOR_DIR"/initrd.target.wants/"${_name}".device
@@ -51,7 +33,6 @@ generator_mount_rootfs() {
[ -z "$1" ] && return 0
_name=$(dev_unit_name "$1")
- [ -d "$GENERATOR_DIR" ] || mkdir -p "$GENERATOR_DIR"
if ! [ -f "$GENERATOR_DIR"/sysroot.mount ]; then
{
echo "[Unit]"
@@ -101,9 +82,10 @@ case "${root#block:}" in
;;
esac
-GENERATOR_DIR="$1"
-
if [ "$rootok" = "1" ]; then
+ GENERATOR_DIR="$1"
+ [ -z "$GENERATOR_DIR" ] && exit 1
+ [ -d "$GENERATOR_DIR" ] || mkdir -p "$GENERATOR_DIR"
generator_wait_for_dev "${root#block:}" "$RDRETRY"
generator_fsck_after_pre_mount "${root#block:}"
strstr "$(cat /proc/cmdline)" 'root=' || generator_mount_rootfs "${root#block:}" "$(getarg rootfstype=)" "$(getarg rootflags=)"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。