import grubby-8.40-37.el8
This commit is contained in:
parent
108908dc41
commit
8e51a44b5a
@ -197,7 +197,7 @@ param_to_indexes() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get_prefix() {
|
get_prefix() {
|
||||||
if [[ $bootloader = grub2 ]] && grep -q /boot /proc/mounts; then
|
if [[ $bootloader = grub2 ]] && mountpoint -q /boot; then
|
||||||
echo "/boot"
|
echo "/boot"
|
||||||
else
|
else
|
||||||
echo ""
|
echo ""
|
||||||
@ -218,8 +218,20 @@ expand_var() {
|
|||||||
echo $var
|
echo $var
|
||||||
}
|
}
|
||||||
|
|
||||||
|
has_kernelopts()
|
||||||
|
{
|
||||||
|
local args=${bls_options[$1]}
|
||||||
|
local opts=(${args})
|
||||||
|
|
||||||
|
for opt in ${opts[*]}; do
|
||||||
|
[[ $opt = "\$kernelopts" ]] && return 0
|
||||||
|
done
|
||||||
|
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
get_bls_args() {
|
get_bls_args() {
|
||||||
local args=${bls_options[$i]}
|
local args=${bls_options[$1]}
|
||||||
local opts=(${args})
|
local opts=(${args})
|
||||||
|
|
||||||
for opt in ${opts[*]}; do
|
for opt in ${opts[*]}; do
|
||||||
@ -305,14 +317,26 @@ grub_class kernel${flavor}
|
|||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unset_default_bls()
|
||||||
|
{
|
||||||
|
if [[ $bootloader = grub2 ]]; then
|
||||||
|
grub2-editenv "${env}" unset saved_entry
|
||||||
|
else
|
||||||
|
sed -i -e "/^default=.*/d" "${zipl_config}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
remove_bls_fragment() {
|
remove_bls_fragment() {
|
||||||
local indexes=($(param_to_indexes "$1"))
|
local indexes=($(param_to_indexes "$1"))
|
||||||
|
|
||||||
if [[ $indexes = "-1" ]]; then
|
if [[ $indexes = "-1" ]]; then
|
||||||
print_error "The param $1 is incorrect"
|
print_error "The param $(get_prefix)$1 is incorrect"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for i in "${indexes[@]}"; do
|
for i in "${indexes[@]}"; do
|
||||||
|
if [[ $default_index = $i ]]; then
|
||||||
|
unset_default_bls
|
||||||
|
fi
|
||||||
rm -f "${bls_file[$i]}"
|
rm -f "${bls_file[$i]}"
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -456,20 +480,37 @@ update_args() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
update_bls_fragment() {
|
update_bls_fragment() {
|
||||||
|
local param="$1"
|
||||||
local indexes=($(param_to_indexes "$1")) && shift
|
local indexes=($(param_to_indexes "$1")) && shift
|
||||||
local remove_args=$1 && shift
|
local remove_args=$1 && shift
|
||||||
local add_args=$1 && shift
|
local add_args=$1 && shift
|
||||||
local initrd=$1 && shift
|
local initrd=$1 && shift
|
||||||
|
local opts
|
||||||
|
|
||||||
if [[ $indexes = "-1" ]]; then
|
if [[ $indexes = "-1" ]]; then
|
||||||
print_error "The param $1 is incorrect"
|
print_error "The param $(get_prefix)${param} is incorrect"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $param = "ALL" && $bootloader = grub2 ]] && [[ -n $remove_args || -n $add_args ]]; then
|
||||||
|
local old_args="$(grub2-editenv "${env}" list | grep kernelopts | sed -e "s/kernelopts=//")"
|
||||||
|
opts="$(update_args "${old_args}" "${remove_args}" "${add_args}")"
|
||||||
|
grub2-editenv "${env}" set kernelopts="${opts}"
|
||||||
|
elif [[ $bootloader = grub2 ]]; then
|
||||||
|
opts="$(grub2-editenv "${env}" list | grep kernelopts | sed -e "s/kernelopts=//")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for i in ${indexes[*]}; do
|
for i in ${indexes[*]}; do
|
||||||
if [[ -n $remove_args || -n $add_args ]]; then
|
if [[ -n $remove_args || -n $add_args ]]; then
|
||||||
local old_args="$(get_bls_args "$i")"
|
local old_args="$(get_bls_args "$i")"
|
||||||
local new_args="$(update_args "${old_args}" "${remove_args}" "${add_args}")"
|
local new_args="$(update_args "${old_args}" "${remove_args}" "${add_args}")"
|
||||||
set_bls_value "${bls_file[$i]}" "options" "${new_args}"
|
|
||||||
|
if [[ $param != "ALL" || ! "$(has_kernelopts "$i")" ]]; then
|
||||||
|
set_bls_value "${bls_file[$i]}" "options" "${new_args}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $bootloader = grub2 && ! "$(has_kernelopts "$i")" && $opts = $new_args ]]; then
|
||||||
|
set_bls_value "${bls_file[$i]}" "options" "\$kernelopts"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n $initrd ]]; then
|
if [[ -n $initrd ]]; then
|
||||||
@ -693,6 +734,10 @@ while [ ${#} -gt 0 ]; do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [[ -z $update_kernel && -z $kernel ]] && [[ -n $args || -n $remove_args ]]; then
|
||||||
|
print_error "no action specified"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -z $blsdir ]]; then
|
if [[ -z $blsdir ]]; then
|
||||||
blsdir="/boot/loader/entries"
|
blsdir="/boot/loader/entries"
|
||||||
fi
|
fi
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Name: grubby
|
Name: grubby
|
||||||
Version: 8.40
|
Version: 8.40
|
||||||
Release: 34%{?dist}
|
Release: 37%{?dist}
|
||||||
Summary: Command line tool for updating BootLoaderSpec files
|
Summary: Command line tool for updating BootLoaderSpec files
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
URL: https://github.com/rhinstaller/grubby
|
URL: https://github.com/rhinstaller/grubby
|
||||||
@ -85,6 +85,7 @@ Requires: grub2-tools
|
|||||||
Requires: s390utils-base
|
Requires: s390utils-base
|
||||||
%endif
|
%endif
|
||||||
Requires: findutils
|
Requires: findutils
|
||||||
|
Requires: util-linux
|
||||||
|
|
||||||
%description
|
%description
|
||||||
This package provides a grubby compatibility script that manages
|
This package provides a grubby compatibility script that manages
|
||||||
@ -165,6 +166,24 @@ current boot environment.
|
|||||||
%{_mandir}/man8/*.8*
|
%{_mandir}/man8/*.8*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon May 20 2019 Javier Martinez Canillas <javierm@redhat.com> - 8.40-37
|
||||||
|
- grubby-bls: unset default entry if is the one being removed
|
||||||
|
Resolves: rhbz#1668329
|
||||||
|
- grubby-bls: error if args or remove-args is used without update-kernel
|
||||||
|
Related: rhbz#1690765
|
||||||
|
- grubby-bls: make --update-kernel ALL to update kernelopts var in grubenv
|
||||||
|
Resolves: rhbz#1690765
|
||||||
|
- grubby-bls: fix --add-kernel not working when using the --args option
|
||||||
|
Related: rhbz#1690765
|
||||||
|
|
||||||
|
* Mon May 06 2019 Javier Martinez Canillas <javierm@redhat.com> - 8.40-36
|
||||||
|
- grubby-bls: show absolute path when printing error about incorrect param
|
||||||
|
Related: rhbz#1706091
|
||||||
|
|
||||||
|
* Fri May 03 2019 Javier Martinez Canillas <javierm@redhat.com> - 8.40-35
|
||||||
|
- Use mountpoint command to check whether /boot is a mount point
|
||||||
|
Resolves: rhbz#1706091
|
||||||
|
|
||||||
* Wed Dec 19 2018 Javier Martinez Canillas <javierm@redhat.com> - 8.40-34
|
* Wed Dec 19 2018 Javier Martinez Canillas <javierm@redhat.com> - 8.40-34
|
||||||
- grubby-bls: expand all variables in options field when updating it
|
- grubby-bls: expand all variables in options field when updating it
|
||||||
Resolves: rhbz#1660700
|
Resolves: rhbz#1660700
|
||||||
|
Loading…
Reference in New Issue
Block a user