]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
chore: remove boilerplate
authorJo Zzsi <jozzsicsataban@gmail.com>
Fri, 30 Aug 2024 16:01:19 +0000 (12:01 -0400)
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Mon, 2 Sep 2024 19:06:57 +0000 (15:06 -0400)
It is not required to redefine empty functions.

26 files changed:
modules.d/00bash/module-setup.sh
modules.d/00dash/module-setup.sh
modules.d/00systemd/module-setup.sh
modules.d/00warpclock/module-setup.sh
modules.d/01fips-crypto-policies/module-setup.sh
modules.d/01fips/module-setup.sh
modules.d/01systemd-ac-power/module-setup.sh
modules.d/01systemd-initrd/module-setup.sh
modules.d/01systemd-modules-load/module-setup.sh
modules.d/01systemd-repart/module-setup.sh
modules.d/01systemd-sysusers/module-setup.sh
modules.d/01systemd-tmpfiles/module-setup.sh
modules.d/04watchdog-modules/module-setup.sh
modules.d/35connman/module-setup.sh
modules.d/35network-manager/module-setup.sh
modules.d/90kernel-network-modules/module-setup.sh
modules.d/90ppcmac/module-setup.sh
modules.d/95dasd/module-setup.sh
modules.d/95rootfs-block/module-setup.sh
modules.d/95zfcp/module-setup.sh
modules.d/98dracut-systemd/module-setup.sh
modules.d/98pollcdrom/module-setup.sh
modules.d/98syslog/module-setup.sh
modules.d/99base/module-setup.sh
modules.d/99fs-lib/module-setup.sh
modules.d/99shutdown/module-setup.sh

index 89ef65414b3b32dc182d7f0e15b79173405cb6d2..b5ab780299121d4a28e7d961cbf14ee4866ee9a5 100755 (executable)
@@ -4,29 +4,17 @@
 
 # Prerequisite check(s) for module.
 check() {
-
     # If the binary(s) requirements are not fulfilled the module can't be installed.
     require_binaries bash || return 1
 
     # Return 255 to only include the module, if another module requires it.
     return 255
-
-}
-
-# Module dependency requirements.
-depends() {
-
-    # Return 0 to include the dependent module(s) in the initramfs.
-    return 0
-
 }
 
 # Install the required file(s) and directories for the module in the initramfs.
 install() {
-
     inst /bin/bash
 
     # Prefer bash as default shell if no other shell is preferred.
     [[ -L $initdir/bin/sh ]] || ln -sf bash "${initdir}/bin/sh"
-
 }
index 4a0c0e7e840d0aa9ba2e950d2dfd9bd5b9640b3c..753e2247cf0c3b83e4dffd6870348d06792a63a3 100755 (executable)
@@ -4,29 +4,17 @@
 
 # Prerequisite check(s) for module.
 check() {
-
     # If the binary(s) requirements are not fulfilled the module can't be installed.
     require_binaries dash || return 1
 
     # Return 255 to only include the module, if another module requires it.
     return 255
-
-}
-
-# Module dependency requirements.
-depends() {
-
-    # Return 0 to include the dependent module(s) in the initramfs.
-    return 0
-
 }
 
 # Install the required file(s) and directories for the module in the initramfs.
 install() {
-
     inst /bin/dash
 
     # Prefer dash as default shell if no other shell is preferred.
     [[ -L $initdir/bin/sh ]] || ln -sf dash "${initdir}/bin/sh"
-
 }
index 1cfaa6e39fcf30a795845f32149f396e4e09ece4..498cd7eddfd8e55f82fd8cf153db58f262888397 100755 (executable)
@@ -11,11 +11,6 @@ check() {
     return 255
 }
 
-# called by dracut
-depends() {
-    return 0
-}
-
 installkernel() {
     hostonly='' instmods autofs4 ipv6 algif_hash hmac sha256
     instmods -s efivarfs
index dd093f3c480ffe6e0f4abb5f2cd14f0beb53be14..5e4d74d7139f83de9f165647458b71917a9162cf 100755 (executable)
@@ -4,7 +4,6 @@
 
 # Prerequisite check(s) for module.
 check() {
-
     # hwclock does not exist on S390(x), bail out silently then
     local _arch=${DRACUT_ARCH:-$(uname -m)}
     [ "$_arch" = "s390" ] || [ "$_arch" = "s390x" ] && return 1
@@ -14,20 +13,10 @@ check() {
 
     # Return 255 to only include the module, if another module requires it.
     return 255
-
-}
-
-# Module dependency requirements.
-depends() {
-
-    # Return 0 to include the dependent module(s) in the initramfs.
-    return 0
-
 }
 
 # Install the required file(s) and directories for the module in the initramfs.
 install() {
-
     inst_hook pre-trigger 00 "$moddir/warpclock.sh"
 
     inst_multiple -o \
@@ -35,5 +24,4 @@ install() {
         /etc/localtime \
         /etc/adjtime \
         hwclock
-
 }
index ee00452e80befda0a20c932c8a4611629d5177b4..e1fbcbfec6cc94e21861fa1c8862cdc0422833d7 100755 (executable)
@@ -9,16 +9,6 @@ check() {
     return 255
 }
 
-# called by dracut
-depends() {
-    return 0
-}
-
-# called by dracut
-installkernel() {
-    return 0
-}
-
 # called by dracut
 install() {
     inst_hook pre-pivot 01 "$moddir/fips-crypto-policies.sh"
index 1e0c9d0972f41ffae1264a80fab8aaf62b4b33c5..3d24ee21d75e4c8fa385188f3a54e5a80a3853f8 100755 (executable)
@@ -5,11 +5,6 @@ check() {
     return 255
 }
 
-# called by dracut
-depends() {
-    return 0
-}
-
 # called by dracut
 installkernel() {
     local _fipsmodules _mod _bootfstype
index c4e7fdd1aef325fb798985a018937a9516099c2e..01cabc05f662c5994fe161cfcc52285f283de2ed 100755 (executable)
@@ -4,26 +4,14 @@
 
 # Prerequisite check(s) for module.
 check() {
-
     # Return 255 to only include the module, if another module requires it.
     return 255
-
-}
-
-# Module dependency requirements.
-depends() {
-
-    # Return 0 to include the dependent module(s) in the initramfs.
-    return 0
-
 }
 
 # Install the required file(s) and directories for the module in the initramfs.
 install() {
-
     inst_rules "$moddir/99-initrd-power-targets.rules"
     inst systemd-ac-power
     inst_simple "$moddir/initrd-on-ac-power.target" "$systemdsystemunitdir/initrd-on-ac-power.target"
     inst_simple "$moddir/initrd-on-battery-power.target" "$systemdsystemunitdir/initrd-on-battery-power.target"
-
 }
index 603868612a187d08761759189116c6c8d80353d7..97906edce465d9b99a7be4cee549701cede85009 100755 (executable)
@@ -13,10 +13,6 @@ depends() {
     echo base systemd-udevd systemd-journald systemd-tmpfiles
 }
 
-installkernel() {
-    return 0
-}
-
 # called by dracut
 install() {
     inst_multiple -o \
index 34778f898cbdb7bcc45b5e7d2be55a7e761aacf8..c35ab4be0003db1f2bcee3bcd7f79df243cd5ec7 100755 (executable)
@@ -4,21 +4,11 @@
 
 # Prerequisite check(s) for module.
 check() {
-
     # If the binary(s) requirements are not fulfilled the module can't be installed
     require_binaries "$systemdutildir"/systemd-modules-load || return 1
 
     # Return 255 to only include the module, if another module requires it.
     return 255
-
-}
-
-# Module dependency requirements.
-depends() {
-
-    # Return 0 to include the dependent module(s) in the initramfs.
-    return 0
-
 }
 
 # Install kernel module(s).
@@ -60,7 +50,6 @@ installkernel() {
 
 # Install the required file(s) and directories for the module in the initramfs.
 install() {
-
     inst_multiple -o \
         /usr/lib/modules-load.d/*.conf \
         "$modulesload/*.conf" \
@@ -85,5 +74,4 @@ install() {
             "$systemdsystemconfdir"/systemd-modules-load.service \
             "$systemdsystemconfdir/systemd-modules-load.service.d/*.conf"
     fi
-
 }
index 19b7e734f5d6099f4f15cce3813dc2fe24b35d1f..f9dafc76b53fe9cbfc2c6fe1da70ba700cc736df 100755 (executable)
@@ -4,26 +4,15 @@
 
 # Prerequisite check(s) for module.
 check() {
-
     # If the binary(s) requirements are not fulfilled the module can't be installed.
     require_binaries systemd-repart || return 1
 
     # Return 255 to only include the module, if another module requires it.
     return 255
-
-}
-
-# Module dependency requirements.
-depends() {
-
-    # Return 0 to include the dependent module(s) in the initramfs.
-    return 0
-
 }
 
 # Install the required file(s) for the module in the initramfs.
 install() {
-
     inst_multiple -o \
         "/usr/lib/repart.d/*.conf" \
         "$systemdsystemunitdir"/systemd-repart.service \
index 351f45c01bafd68706ff2f7b8f923bea061db3de..472a8c82554cb9e5c778e1a8a0d907b40a762a75 100755 (executable)
@@ -4,26 +4,15 @@
 
 # Prerequisite check(s) for module.
 check() {
-
     # If the binary(s) requirements are not fulfilled the module can't be installed.
     require_binaries systemd-sysusers || return 1
 
     # Return 255 to only include the module, if another module requires it.
     return 255
-
-}
-
-# Module dependency requirements.
-depends() {
-
-    # Return 0 to include the dependent module(s) in the initramfs.
-    return 0
-
 }
 
 # Install the required file(s) and directories for the module in the initramfs.
 install() {
-
     inst_simple "$moddir/sysusers-dracut.conf" "$systemdsystemunitdir/systemd-sysusers.service.d/sysusers-dracut.conf"
 
     inst_sysusers basic.conf
@@ -40,5 +29,4 @@ install() {
             "$systemdsystemconfdir"/systemd-sysusers.service \
             "$systemdsystemconfdir/systemd-sysusers.service.d/*.conf"
     fi
-
 }
index 6bd42c0a33d765f5d69ae7f5d34ac6f5aa58cbee..3643ed495c5476b2ad9118625598c726834a4b53 100755 (executable)
@@ -4,26 +4,15 @@
 
 # Prerequisite check(s) for module.
 check() {
-
     # If the binary(s) requirements are not fulfilled the module can't be installed.
     require_binaries systemd-tmpfiles || return 1
 
     # Return 255 to only include the module, if another module requires it.
     return 255
-
-}
-
-# Module dependency requirements.
-depends() {
-
-    # Return 0 to include the dependent module(s) in the initramfs.
-    return 0
-
 }
 
 # Install the required file(s) and directories for the module in the initramfs.
 install() {
-
     # Excluding "$tmpfilesdir/home.conf", sets up /home /srv
     # Excluding "$tmpfilesdir/journal-nocow.conf", requires specific btrfs setup
     # Excluding "$tmpfilesdir/legacy.conf", belongs in separated legacy module
@@ -67,5 +56,4 @@ install() {
             "$systemdsystemconfdir"/systemd-tmpfiles-setup-dev-early.service \
             "$systemdsystemconfdir/systemd-tmpfiles-setup-dev-early.service.d/*.conf"
     fi
-
 }
index 2a94e34646e9927e2971af1199457ff37a90b0d0..108d969f76f258e2161f3d4dcf88a59bd3d7dc40 100755 (executable)
@@ -5,16 +5,6 @@ check() {
     return 255
 }
 
-# called by dracut
-depends() {
-    return 0
-}
-
-# called by dracut
-install() {
-    return 0
-}
-
 installkernel() {
     local -A _drivers
     local _wdtdrv
index 5a3b0e1d6382bd048f48512e4b50d4cd439a8e8f..a7c3d565410cbefa0b6144f253d295d9c1918f8e 100755 (executable)
@@ -14,11 +14,6 @@ depends() {
     return 0
 }
 
-# called by dracut
-installkernel() {
-    return 0
-}
-
 # called by dracut
 install() {
     # We don't need `ip` but having it is *really* useful for people debugging
index 67144f36fe68ee4703a891f65171057aaf9f40e8..d82294bf757f41f422a692617bbddf1b36f3a511 100755 (executable)
@@ -14,11 +14,6 @@ depends() {
     return 0
 }
 
-# called by dracut
-installkernel() {
-    return 0
-}
-
 # called by dracut
 install() {
     local _nm_version
index 08bbbd611449c91834496f902be82b1a1d6ff7d0..04d001bfa67f574644f07daa7f42c26d969c3495 100755 (executable)
@@ -38,8 +38,3 @@ installkernel() {
         '=drivers/net/ethernet' \
         ecb arc4 bridge stp llc ipv6 bonding 8021q ipvlan macvlan af_packet virtio_net xennet
 }
-
-# called by dracut
-install() {
-    return 0
-}
index 83f54de64ee2944d656e01bdebb5793f503e8dc3..bd6e4c13955c817e55fc1dea43fe8ea6d1176b10 100755 (executable)
@@ -23,11 +23,6 @@ check() {
     return 0
 }
 
-# called by dracut
-depends() {
-    return 0
-}
-
 # called by dracut
 installkernel() {
     pmac_model() {
index c89d09eb8783111528e6e24873ce13d5000d6781..f532e55853ab8e0aafef14c0e827da6752a53913 100755 (executable)
@@ -8,11 +8,6 @@ check() {
     return 0
 }
 
-# called by dracut
-depends() {
-    return 0
-}
-
 # called by dracut
 install() {
     inst_multiple dasdconf.sh
index 1ee9836de3328663bfb880da3d3d9c06f9e40200..afec0cf9bc9bd3ccc3cd332974900457f92aef04 100755 (executable)
@@ -1,10 +1,5 @@
 #!/bin/bash
 
-# called by dracut
-check() {
-    return 0
-}
-
 # called by dracut
 depends() {
     echo base fs-lib
index 09a64207dc9df10bd4f6335b6bcad424e6d41e78..14a52b3751d157a90868e5890c7bd972b77893c4 100755 (executable)
@@ -10,11 +10,6 @@ check() {
     return 0
 }
 
-# called by dracut
-depends() {
-    return 0
-}
-
 # called by dracut
 installkernel() {
     instmods zfcp
index 6b8f42ae30bf0e47f128caf2af476bce5847b068..724b00b1d413a74aa98d1228edfbcc5daa8cdb44 100755 (executable)
@@ -26,10 +26,6 @@ depends() {
     return 0
 }
 
-installkernel() {
-    return 0
-}
-
 # called by dracut
 install() {
     inst_script "$moddir/dracut-emergency.sh" /bin/dracut-emergency
index 9684181b20ac79eb31708f13d3b9ebd075f29ee8..771d32f710dbd8fd2ee9860f462cc5bba7654c4a 100755 (executable)
@@ -5,11 +5,6 @@ check() {
     return 255
 }
 
-# called by dracut
-depends() {
-    return 0
-}
-
 # called by dracut
 install() {
     inst_hook initqueue/settled 99 "$moddir/pollcdrom.sh"
index 2909a5625bdbbf6b54253b91c1883f61d6fd2a27..dde0f3684b8b1ca69738764ed31e96ee72fd9963 100755 (executable)
@@ -6,11 +6,6 @@ check() {
     return 255
 }
 
-# called by dracut
-depends() {
-    return 0
-}
-
 # called by dracut
 install() {
     local _installs
index 09bd27c4cbc0e438499a009a98d696d9a83c06ca..8a4b17c46047f425c0a830e290aa58c09af85a14 100755 (executable)
@@ -1,10 +1,5 @@
 #!/bin/bash
 
-# called by dracut
-check() {
-    return 0
-}
-
 # called by dracut
 depends() {
     echo udev-rules shell-interpreter
index c2f5cedc51bc03c868f757553d842703e5f17687..0e611a21b27e49e1158a3b4bcbae38c602abb13f 100755 (executable)
@@ -1,10 +1,5 @@
 #!/bin/bash
 
-# called by dracut
-check() {
-    return 0
-}
-
 echo_fs_helper() {
     local fs=$2
     case "$fs" in
index f53017ff875c54b7630c765843c0b2b9a460b5e3..7cb9c5f5404806d7b3293dff4cfd6817170323c6 100755 (executable)
@@ -1,10 +1,5 @@
 #!/bin/bash
 
-# called by dracut
-check() {
-    return 0
-}
-
 # called by dracut
 depends() {
     echo base