56 |
local bls="$1" && shift |
local bls="$1" && shift |
57 |
local key="$1" && shift |
local key="$1" && shift |
58 |
|
|
59 |
echo "$(grep "^${key}[ \t]" "${bls}" | sed -e "s,^${key}[ \t]*,,")" |
echo "$(grep "^${key}[ \t]" "${bls}" | sed -e "s!^${key}[ \t]*!!")" |
60 |
} |
} |
61 |
|
|
62 |
set_bls_value() { |
set_bls_value() { |
64 |
local key="$1" && shift |
local key="$1" && shift |
65 |
local value="$1" && shift |
local value="$1" && shift |
66 |
|
|
67 |
sed -i -e "s,^${key}.*,${key} ${value}," "${bls}" |
sed -i -e "s!^${key}.*!${key} ${value}!" "${bls}" |
68 |
} |
} |
69 |
|
|
70 |
append_bls_value() { |
append_bls_value() { |
159 |
fi |
fi |
160 |
|
|
161 |
for i in ${!bls_file[@]}; do |
for i in ${!bls_file[@]}; do |
162 |
if [[ $param = "${bls_linux[$i]}" ]]; then |
if [[ $param = "${bls_linux[$i]}" || "/${param##*/}" = "${bls_linux[$i]}" ]]; then |
163 |
indexes="$indexes $i" |
indexes="$indexes $i" |
164 |
fi |
fi |
165 |
|
|
247 |
|
|
248 |
if [[ $kernel = *"vmlinuz-"* ]]; then |
if [[ $kernel = *"vmlinuz-"* ]]; then |
249 |
kernelver="${kernel##*/vmlinuz-}" |
kernelver="${kernel##*/vmlinuz-}" |
250 |
|
prefix="vmlinuz-" |
251 |
else |
else |
252 |
kernelver="${kernel##*/}" |
kernelver="${kernel##*/}" |
253 |
fi |
fi |
254 |
|
|
255 |
if [[ ! -d "/lib/modules/${kernelver}" || ! -f "/boot/vmlinuz-${kernelver}" ]] && |
if [[ ! -f "/boot/${prefix}${kernelver}" ]] && |
256 |
[[ $bad_image != "true" ]]; then |
[[ $bad_image != "true" ]]; then |
257 |
print_error "The ${kernelver} kernel isn't installed in the machine" |
print_error "The ${kernelver} kernel isn't installed in the machine" |
258 |
fi |
fi |
322 |
local add_args=($1) && shift |
local add_args=($1) && shift |
323 |
|
|
324 |
for arg in ${remove_args[*]}; do |
for arg in ${remove_args[*]}; do |
325 |
args="$(echo $args | sed -e "s,$arg[^ ]*,,")" |
args="$(echo $args | sed -e "s!$arg[^ ]*!!")" |
326 |
done |
done |
327 |
|
|
328 |
for arg in ${add_args[*]}; do |
for arg in ${add_args[*]}; do |
331 |
key=${arg%%=$value} |
key=${arg%%=$value} |
332 |
exist=$(echo $args | grep "${key}=") |
exist=$(echo $args | grep "${key}=") |
333 |
if [[ -n $exist ]]; then |
if [[ -n $exist ]]; then |
334 |
args="$(echo $args | sed -e "s,$key=[^ ]*,$key=$value,")" |
args="$(echo $args | sed -e "s!$key=[^ ]*!$key=$value!")" |
335 |
else |
else |
336 |
args="$args $key=$value" |
args="$args $key=$value" |
337 |
fi |
fi |