diff --git a/3b45c7e1a0234cae165300844c817e50e6bace9b.patch b/3b45c7e1a0234cae165300844c817e50e6bace9b.patch new file mode 100644 index 0000000000000000000000000000000000000000..88740e6db4b5ba7df14a684154f40eb920b49928 --- /dev/null +++ b/3b45c7e1a0234cae165300844c817e50e6bace9b.patch @@ -0,0 +1,13 @@ +diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh +index 4a8e140b3..cfe0b965a 100755 +--- a/modules.d/95nfs/module-setup.sh ++++ b/modules.d/95nfs/module-setup.sh +@@ -38,7 +38,7 @@ depends() { + + # called by dracut + installkernel() { +- hostonly='' instmods =net/sunrpc =fs/nfs ipv6 nfs_acl nfs_layout_nfsv41_files ++ hostonly=$(optional_hostonly) instmods =net/sunrpc =fs/nfs ipv6 nfs_acl nfs_layout_nfsv41_files + } + + cmdline() { diff --git a/5698258d3022dd73045e2ffb279c799a70c3fef9.patch b/5698258d3022dd73045e2ffb279c799a70c3fef9.patch new file mode 100644 index 0000000000000000000000000000000000000000..b628487400a4c3fc99d00d4f8aef755287d78317 --- /dev/null +++ b/5698258d3022dd73045e2ffb279c799a70c3fef9.patch @@ -0,0 +1,35 @@ +diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh +index 3ba2f1901..af1535280 100755 +--- a/modules.d/40network/module-setup.sh ++++ b/modules.d/40network/module-setup.sh +@@ -8,6 +8,9 @@ check() { + # called by dracut + depends() { + echo -n "kernel-network-modules " ++ ++ is_qemu_virtualized && echo -n "qemu-net " ++ + if ! dracut_module_included "network-legacy" && [ -x "$dracutsysrootdir/usr/libexec/nm-initrd-generator" ] ; then + echo "network-manager" + else +diff --git a/modules.d/90qemu-net/module-setup.sh b/modules.d/90qemu-net/module-setup.sh +index 0e45a417f..f188eaa23 100755 +--- a/modules.d/90qemu-net/module-setup.sh ++++ b/modules.d/90qemu-net/module-setup.sh +@@ -2,10 +2,15 @@ + + # called by dracut + check() { +- if [[ $hostonly ]] || [[ $mount_needs ]]; then ++ if [[ $hostonly ]]; then ++ return 255 ++ fi ++ ++ if [[ $mount_needs ]]; then + is_qemu_virtualized && return 0 + return 255 + fi ++ + return 0 + } + diff --git a/5817934936e4656034328ad475b884f5ecf8bd45.patch b/5817934936e4656034328ad475b884f5ecf8bd45.patch new file mode 100644 index 0000000000000000000000000000000000000000..99d0c46a1d4828a7d398ab37aa13e9839689ef97 --- /dev/null +++ b/5817934936e4656034328ad475b884f5ecf8bd45.patch @@ -0,0 +1,41 @@ +diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh +index 73df29bf5..49609855e 100755 +--- a/modules.d/90kernel-modules/module-setup.sh ++++ b/modules.d/90kernel-modules/module-setup.sh +@@ -35,8 +35,9 @@ installkernel() { + install_block_modules () { + instmods \ + scsi_dh_rdac scsi_dh_emc scsi_dh_alua \ ++ =drivers/usb/storage \ + =ide nvme vmd \ +- virtio_blk ++ virtio_blk virtio_scsi + + dracut_instmods -o -s "${_blockfuncs}" "=drivers" + } +@@ -48,7 +49,6 @@ installkernel() { + ohci-hcd ohci-pci \ + uhci-hcd \ + xhci-hcd xhci-pci xhci-plat-hcd \ +- "=drivers/pinctrl" \ + ${NULL} + + hostonly=$(optional_hostonly) instmods \ +@@ -56,15 +56,15 @@ installkernel() { + "=drivers/tty/serial" \ + "=drivers/input/serio" \ + "=drivers/input/keyboard" \ +- "=drivers/usb/storage" \ + "=drivers/pci/host" \ + "=drivers/pci/controller" \ ++ "=drivers/pinctrl" \ + ${NULL} + + instmods \ + yenta_socket \ + atkbd i8042 usbhid firewire-ohci pcmcia hv-vmbus \ +- virtio virtio_ring virtio_pci virtio_scsi pci_hyperv \ ++ virtio virtio_ring virtio_pci pci_hyperv \ + "=drivers/pcmcia" + + if [[ "${DRACUT_ARCH:-$(uname -m)}" == arm* || "${DRACUT_ARCH:-$(uname -m)}" == aarch64 ]]; then diff --git a/5a49fd36569ebf477ec14d14939326ddda2d5ab7.patch b/5a49fd36569ebf477ec14d14939326ddda2d5ab7.patch new file mode 100644 index 0000000000000000000000000000000000000000..18b125115f3d70d401da2030b0c9d03f4a383904 --- /dev/null +++ b/5a49fd36569ebf477ec14d14939326ddda2d5ab7.patch @@ -0,0 +1,51 @@ +diff --git a/modules.d/04watchdog-modules/module-setup.sh b/modules.d/04watchdog-modules/module-setup.sh +index 5fbd769b4..705592fac 100755 +--- a/modules.d/04watchdog-modules/module-setup.sh ++++ b/modules.d/04watchdog-modules/module-setup.sh +@@ -18,41 +18,18 @@ install() { + installkernel() { + local -A _drivers + local _alldrivers _wdtdrv _wdtppath _dir +- [[ -d /sys/class/watchdog/ ]] || return +- for _dir in /sys/class/watchdog/*; do +- [[ -d "$_dir" ]] || continue +- [[ -f "$_dir/state" ]] || continue +- # device/modalias will return driver of this device +- _wdtdrv=$(< "$_dir/device/modalias") +- # There can be more than one module represented by same +- # modalias. Currently load all of them. +- # TODO: Need to find a way to avoid any unwanted module +- # represented by modalias +- _wdtdrv=$(modprobe --set-version "$kernel" -R $_wdtdrv 2>/dev/null) ++ ++ for _wd in /sys/class/watchdog/*; do ++ ! [ -e $_wd ] && continue ++ _wdtdrv=$(get_dev_module $_wd) + if [[ $_wdtdrv ]]; then + instmods $_wdtdrv + for i in $_wdtdrv; do + _drivers[$i]=1 + done + fi +- # however in some cases, we also need to check that if there is +- # a specific driver for the parent bus/device. In such cases +- # we also need to enable driver for parent bus/device. +- _wdtppath=$(readlink -f "$_dir/device") +- while [[ -d "$_wdtppath" ]] && [[ "$_wdtppath" != "/sys" ]]; do +- _wdtppath=$(readlink -f "$_wdtppath/..") +- [[ -f "$_wdtppath/modalias" ]] || continue +- +- _wdtdrv=$(< "$_wdtppath/modalias") +- _wdtdrv=$(modprobe --set-version "$kernel" -R $_wdtdrv 2>/dev/null) +- if [[ $_wdtdrv ]]; then +- instmods $_wdtdrv +- for i in $_wdtdrv; do +- _drivers[$i]=1 +- done +- fi +- done + done ++ + # ensure that watchdog module is loaded as early as possible + _alldrivers="${!_drivers[*]}" + [[ $_alldrivers ]] && echo "rd.driver.pre=${_alldrivers// /,}" > ${initdir}/etc/cmdline.d/00-watchdog.conf diff --git a/6375d5d504c5eac1cc5e7d7e26a8643b7e7e1b3b.patch b/6375d5d504c5eac1cc5e7d7e26a8643b7e7e1b3b.patch new file mode 100644 index 0000000000000000000000000000000000000000..f1b8e0eaaa999484acb10b968ebf997d9dc08347 --- /dev/null +++ b/6375d5d504c5eac1cc5e7d7e26a8643b7e7e1b3b.patch @@ -0,0 +1,56 @@ +diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh +index a45722596..73df29bf5 100755 +--- a/modules.d/90kernel-modules/module-setup.sh ++++ b/modules.d/90kernel-modules/module-setup.sh +@@ -3,6 +3,7 @@ + # called by dracut + installkernel() { + local _blockfuncs='ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_add_host|scsi_add_host_with_dma' ++ local _hostonly_drvs + + find_kernel_modules_external () { + local _OLDIFS +@@ -19,13 +20,19 @@ installkernel() { + IFS=$_OLDIFS + } + +- is_block_dev() { +- [ -e /sys/dev/block/$1 ] && return 0 ++ record_block_dev_drv() { ++ for _mod in $(get_dev_module /dev/block/$1); do ++ [[ " $_hostonly_drvs " != *$_mod* ]] && _hostonly_drvs+=" $_mod" ++ done ++ [[ "$_hostonly_drvs" ]] && return 0 + return 1 + } + ++ install_block_modules_strict () { ++ hostonly='' instmods $_hostonly_drvs ++ } ++ + install_block_modules () { +- hostonly='' instmods sg sr_mod sd_mod scsi_dh ata_piix + instmods \ + scsi_dh_rdac scsi_dh_emc scsi_dh_alua \ + =ide nvme vmd \ +@@ -93,8 +100,18 @@ installkernel() { + + find_kernel_modules_external | instmods + +- if ! [[ $hostonly ]] || for_each_host_dev_and_slaves is_block_dev; then +- install_block_modules ++ # if not on hostonly mode, or there are hostonly block device ++ # install block drivers ++ if ! [[ $hostonly ]] || \ ++ for_each_host_dev_and_slaves_all record_block_dev_drv; ++ then ++ hostonly='' instmods sg sr_mod sd_mod scsi_dh ata_piix ++ ++ if [[ "$hostonly_mode" == "strict" ]]; then ++ install_block_modules_strict ++ else ++ install_block_modules ++ fi + fi + + # if not on hostonly mode, install all known filesystems, diff --git a/831e310adfadeb11db5856778e93fb63cae029a9.patch b/831e310adfadeb11db5856778e93fb63cae029a9.patch new file mode 100644 index 0000000000000000000000000000000000000000..20f9189868bb060be3ce1ae76789e216103e9e31 --- /dev/null +++ b/831e310adfadeb11db5856778e93fb63cae029a9.patch @@ -0,0 +1,11 @@ +diff --git a/modules.d/90qemu-net/module-setup.sh b/modules.d/90qemu-net/module-setup.sh +index f188eaa23..0fa49aa80 100755 +--- a/modules.d/90qemu-net/module-setup.sh ++++ b/modules.d/90qemu-net/module-setup.sh +@@ -17,5 +17,5 @@ check() { + # called by dracut + installkernel() { + # qemu specific modules +- hostonly='' instmods virtio_net e1000 8139cp pcnet32 e100 ne2k_pci ++ hostonly=$(optional_hostonly) instmods virtio_net e1000 8139cp pcnet32 e100 ne2k_pci + } diff --git a/ab17cb851579476dc355aa7e812aacfd82d82aeb.patch b/ab17cb851579476dc355aa7e812aacfd82d82aeb.patch new file mode 100644 index 0000000000000000000000000000000000000000..ac9e388ebfbafc4e9bd09e09fd0d52d19d83483a --- /dev/null +++ b/ab17cb851579476dc355aa7e812aacfd82d82aeb.patch @@ -0,0 +1,20 @@ +diff --git a/dracut-functions.sh b/dracut-functions.sh +index 530452068..a8887dcc6 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -526,7 +526,6 @@ check_block_and_slaves() { + if [[ -f /sys/dev/block/$2/../dev ]] && [[ /sys/dev/block/$2/../subsystem -ef /sys/class/block ]]; then + check_block_and_slaves $1 $(<"/sys/dev/block/$2/../dev") && return 0 + fi +- [[ -d /sys/dev/block/$2/slaves ]] || return 1 + for _x in /sys/dev/block/$2/slaves/*; do + [[ -f $_x/dev ]] || continue + [[ $_x/subsystem -ef /sys/class/block ]] || continue +@@ -545,7 +544,6 @@ check_block_and_slaves_all() { + if [[ -f /sys/dev/block/$2/../dev ]] && [[ /sys/dev/block/$2/../subsystem -ef /sys/class/block ]]; then + check_block_and_slaves_all $1 $(<"/sys/dev/block/$2/../dev") && _ret=0 + fi +- [[ -d /sys/dev/block/$2/slaves ]] || return 1 + for _x in /sys/dev/block/$2/slaves/*; do + [[ -f $_x/dev ]] || continue + [[ $_x/subsystem -ef /sys/class/block ]] || continue diff --git a/cbafcd0fc739f92a6a6a4777a102dae7c96a6c86.patch b/cbafcd0fc739f92a6a6a4777a102dae7c96a6c86.patch new file mode 100644 index 0000000000000000000000000000000000000000..3ce1284f0ce9a7ca2a44620050d9a81555d43134 --- /dev/null +++ b/cbafcd0fc739f92a6a6a4777a102dae7c96a6c86.patch @@ -0,0 +1,13 @@ +diff --git a/dracut-functions.sh b/dracut-functions.sh +index a8887dcc6..e5e6884b0 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -889,3 +889,8 @@ block_is_fcoe() { + block_is_netdevice() { + block_is_nbd "$1" || block_is_iscsi "$1" || block_is_fcoe "$1" + } ++ ++# get the corresponding kernel modules of a /sys/class/*/* or/dev/* device ++get_dev_module() { ++ udevadm info -a "$1" | sed -n 's/\s*DRIVERS=="\(\S\+\)"/\1/p' ++} diff --git a/dracut.spec b/dracut.spec index a85222233131910388f3d23c3e58b39f36bc6365..a157c6b16dd6f5d740df4310586f433199cf8ef0 100644 --- a/dracut.spec +++ b/dracut.spec @@ -9,7 +9,7 @@ Name: dracut Version: 050 -Release: 3 +Release: 4 Summary: Initramfs generator using udev @@ -38,6 +38,14 @@ Patch10: dracut-lib.sh-quote-variables-in-parameter-expansion.patch Patch11: dracut-90crypt-module-setup.sh-fix-force-on-multiple-lines.patch Patch12: Fix-test-in-lsinitrd.patch Patch13: add-option-to-include-file-metadata-in-initramfs.patch +Patch6000: ab17cb851579476dc355aa7e812aacfd82d82aeb.patch +Patch6001: cbafcd0fc739f92a6a6a4777a102dae7c96a6c86.patch +Patch6002: 5a49fd36569ebf477ec14d14939326ddda2d5ab7.patch +Patch6003: 6375d5d504c5eac1cc5e7d7e26a8643b7e7e1b3b.patch +Patch6004: 5817934936e4656034328ad475b884f5ecf8bd45.patch +Patch6005: 3b45c7e1a0234cae165300844c817e50e6bace9b.patch +Patch6006: 5698258d3022dd73045e2ffb279c799a70c3fef9.patch +Patch6007: 831e310adfadeb11db5856778e93fb63cae029a9.patch Source1: https://www.gnu.org/licenses/lgpl-2.1.txt Source2: openEuler.conf.example @@ -488,6 +496,9 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne %endif %changelog +* 20201030173007664500 patch-tracking 050-4 +- append patch file of upstream repository from to <831e310adfadeb11db5856778e93fb63cae029a9> + * Thu Jul 23 2020 Liquor - 050-1 - Update to 050 @@ -516,4 +527,4 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne - Delete redundant information * Thu Aug 29 2019 openEuler Buildteam - 049-1 -- Package init +- Package init \ No newline at end of file