main/postmarketos-initramfs: init_functions: return early in load_modules
If $modules is empty, then `modprobe -a` is run which gives an error with full modprobe (i.e. not busybox variant): [pmOS-rd]: modprobe: ERROR: missing parameters. See -h. Add a check and return early to avoid potentially printing the error to users. Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7916>
This commit is contained in:
parent
8097acbe40
commit
d38b73fbdd
2 changed files with 5 additions and 1 deletions
|
|
@ -120,7 +120,7 @@ ace852ba267b3408998970df6042603c8bec1d033066d1c30ed65f1be955fee8644b57882898f102
|
|||
9b5f5bc68ede0b06b85260d9ad301892e7b45ebad7e78300be17c8a55e3fdf392b3302587bd47011ce52f213e034a0cb49d0a2b96ab012fb5dce0514f4575aa7 00-initramfs-base.files
|
||||
3c021f6ede0c13469097a8aaeb15810baf2f3be52e10928f3475ac3568d855e3ab8e747b960d47ac6af6f7f223fca5e7da12098810502e0dae55aaf6bf4f293c 00-initramfs-extra-base.files
|
||||
e90596540805662211bd2a2e427ce7cc38f6a30023267f902e23f2bae136b6cd8f4f4716b8fb611be9d671a964edd2ecce03fa32bc8024e29b8375b0097fde0c init.sh
|
||||
05d1ec265f6ca5c4073e0f985729905fdd8f8e11d64bd099f7c50f172827614dd43193399e04d5405edf20248223494b884319d3cc866a32033fb5c313c6e226 init_functions.sh
|
||||
8b0f15b84795588822a8b07b1e43ef0034da5f982ab92f0e7d3b9359fc61121f3f961006ba7d3f98f16d127d37ba833926654831b39e2df83d7384eebc786d3d init_functions.sh
|
||||
6b4881f9b43c90ebcc70d7b7a192d26a2e3ce01c43b8536fe900c2ffaf74ef035803b9aa083e7a9d5c49c75be8ba6ff22997a037ae4f399e6ee5e1978c4b3f9c init_2nd.sh
|
||||
de14f6f678856ae316f28c003a6293a383aa6b7cbb19951b981430eb0e3b91d0634dedf62d29d105845b6e172daa18e6b6e45e03342d72ae806ca611a1236d18 init_functions_2nd.sh
|
||||
675e7d5bee39b2df7d322117f8dcaccc274d61beaf4d50ead19bbf2109446d64b1c0aa0c5b4f9846eb6c1c403418f28f6364eff4537ba41120fbfcbc484b7da7 mdev.conf
|
||||
|
|
|
|||
|
|
@ -298,6 +298,10 @@ load_modules() {
|
|||
local file="$1"
|
||||
local modules="$2"
|
||||
[ -f "$file" ] && modules="$modules $(grep -v ^\# "$file")"
|
||||
|
||||
if [ -z "$modules" ]; then
|
||||
return
|
||||
fi
|
||||
# shellcheck disable=SC2086
|
||||
modprobe -a $modules
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue