Skip to content

Commit

Permalink
chore: remove boilerplate
Browse files Browse the repository at this point in the history
It is not required to redefine empty functions.
  • Loading branch information
jozzsi authored and Conan-Kudo committed Sep 2, 2024
1 parent 6243b7b commit e6117b9
Show file tree
Hide file tree
Showing 26 changed files with 0 additions and 193 deletions.
12 changes: 0 additions & 12 deletions modules.d/00bash/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

}
12 changes: 0 additions & 12 deletions modules.d/00dash/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

}
5 changes: 0 additions & 5 deletions modules.d/00systemd/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 0 additions & 12 deletions modules.d/00warpclock/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -14,26 +13,15 @@ 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 \
/usr/share/zoneinfo/UTC \
/etc/localtime \
/etc/adjtime \
hwclock

}
10 changes: 0 additions & 10 deletions modules.d/01fips-crypto-policies/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 0 additions & 5 deletions modules.d/01fips/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ check() {
return 255
}

# called by dracut
depends() {
return 0
}

# called by dracut
installkernel() {
local _fipsmodules _mod _bootfstype
Expand Down
12 changes: 0 additions & 12 deletions modules.d/01systemd-ac-power/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

}
4 changes: 0 additions & 4 deletions modules.d/01systemd-initrd/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ depends() {
echo base systemd-udevd systemd-journald systemd-tmpfiles
}

installkernel() {
return 0
}

# called by dracut
install() {
inst_multiple -o \
Expand Down
12 changes: 0 additions & 12 deletions modules.d/01systemd-modules-load/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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" \
Expand All @@ -85,5 +74,4 @@ install() {
"$systemdsystemconfdir"/systemd-modules-load.service \
"$systemdsystemconfdir/systemd-modules-load.service.d/*.conf"
fi

}
11 changes: 0 additions & 11 deletions modules.d/01systemd-repart/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
12 changes: 0 additions & 12 deletions modules.d/01systemd-sysusers/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -40,5 +29,4 @@ install() {
"$systemdsystemconfdir"/systemd-sysusers.service \
"$systemdsystemconfdir/systemd-sysusers.service.d/*.conf"
fi

}
12 changes: 0 additions & 12 deletions modules.d/01systemd-tmpfiles/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -67,5 +56,4 @@ install() {
"$systemdsystemconfdir"/systemd-tmpfiles-setup-dev-early.service \
"$systemdsystemconfdir/systemd-tmpfiles-setup-dev-early.service.d/*.conf"
fi

}
10 changes: 0 additions & 10 deletions modules.d/04watchdog-modules/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions modules.d/35connman/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions modules.d/35network-manager/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ depends() {
return 0
}

# called by dracut
installkernel() {
return 0
}

# called by dracut
install() {
local _nm_version
Expand Down
5 changes: 0 additions & 5 deletions modules.d/90kernel-network-modules/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
5 changes: 0 additions & 5 deletions modules.d/90ppcmac/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ check() {
return 0
}

# called by dracut
depends() {
return 0
}

# called by dracut
installkernel() {
pmac_model() {
Expand Down
5 changes: 0 additions & 5 deletions modules.d/95dasd/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ check() {
return 0
}

# called by dracut
depends() {
return 0
}

# called by dracut
install() {
inst_multiple dasdconf.sh
Expand Down
5 changes: 0 additions & 5 deletions modules.d/95rootfs-block/module-setup.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#!/bin/bash

# called by dracut
check() {
return 0
}

# called by dracut
depends() {
echo base fs-lib
Expand Down
5 changes: 0 additions & 5 deletions modules.d/95zfcp/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ check() {
return 0
}

# called by dracut
depends() {
return 0
}

# called by dracut
installkernel() {
instmods zfcp
Expand Down
Loading

0 comments on commit e6117b9

Please sign in to comment.