switch to for loop
This commit is contained in:
parent
fa18801b1c
commit
b14d9ed658
24
tinyramfs
24
tinyramfs
@ -80,25 +80,13 @@ parse_args() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
prepare_environment() {
|
prepare_environment() {
|
||||||
if [ -f "$_config" ]; then
|
for _file in $_config /etc/tinyramfs/config ./config; do
|
||||||
. "$_config"
|
[ -f "$_file" ] && . "$_file" && break
|
||||||
elif [ -f /etc/tinyramfs/config ]; then
|
done || msg panic "failed to source config"
|
||||||
. /etc/tinyramfs/config
|
|
||||||
elif [ -f ./config ]; then
|
|
||||||
. ./config
|
|
||||||
else
|
|
||||||
msg panic "failed to source config"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -d "$_filesdir" ]; then
|
for _dir in $_filesdir /usr/share/tinyramfs ./usr/share/tinyramfs; do
|
||||||
filesdir="$_filesdir"
|
[ -d "$_dir" ] && filesdir="$_dir" && break
|
||||||
elif [ -d /usr/share/tinyramfs ]; then
|
done || msg panic "failed to locate required files"
|
||||||
filesdir="/usr/share/tinyramfs"
|
|
||||||
elif [ -d ./usr/share/tinyramfs ]; then
|
|
||||||
filesdir="./usr/share/tinyramfs"
|
|
||||||
else
|
|
||||||
msg panic "failed to find required files"
|
|
||||||
fi
|
|
||||||
|
|
||||||
kernel="${_kernel:-${kernel:-$(uname -r)}}"
|
kernel="${_kernel:-${kernel:-$(uname -r)}}"
|
||||||
moddir="${_moddir:-${moddir:-/lib/modules}}"
|
moddir="${_moddir:-${moddir:-/lib/modules}}"
|
||||||
|
Loading…
Reference in New Issue
Block a user