summaryrefslogtreecommitdiff
path: root/update-initramfs
diff options
context:
space:
mode:
authormaximilian attems <maks@debian.org>2009-03-30 00:13:39 +0200
committermaximilian attems <maks@debian.org>2009-03-30 00:13:39 +0200
commitff34476ecd5de0da1104b13e6b42e6cc9eff8792 (patch)
tree0ceb52be06c0df1667ff3ace8ca671c7478dd338 /update-initramfs
parentf40e826287d2776094f48302c196652f2ba8326b (diff)
downloadinitramfs-tools-ff34476ecd5de0da1104b13e6b42e6cc9eff8792.tar.gz
initramfs-tools-ff34476ecd5de0da1104b13e6b42e6cc9eff8792.zip
update-initramfs: Cleanup run_bootloader()
rework it's logic, instead of 2 nested top ifs use one if with 2 "&&" connected checks. gets us rid of one nested level. simplify codeflow inside too as bonus. make clear why mbr_check() is run.
Diffstat (limited to 'update-initramfs')
-rwxr-xr-xupdate-initramfs31
1 files changed, 15 insertions, 16 deletions
diff --git a/update-initramfs b/update-initramfs
index 3235437..2eed8cb 100755
--- a/update-initramfs
+++ b/update-initramfs
@@ -233,23 +233,22 @@ mbr_check()
run_bootloader()
{
# if both lilo and grub around, figure out if lilo needs to be run
- if [ -x "$(command -v update-grub)" ] || [ -e /boot/grub/menu.lst ] \
- || [ -e /boot/grub/grub.cfg ]; then
- if [ -e /etc/lilo.conf ] && [ -x /sbin/lilo ]; then
- [ -r "${KPKGCONF}" ] && \
- do_b=$(awk '/^do_bootloader/{print $3}' "${KPKGCONF}")
- if [ "${do_b}" = "yes" ] || [ "${do_b}" = "Yes" ] \
- || [ "${do_b}" = "YES" ]; then
- run_lilo
- return 0
- elif [ "${do_b}" = "no" ] || [ "${do_b}" = "No" ] \
- || [ "${do_b}" = "NO" ]; then
- return 0
- else
- mbr_check
- return 0
- fi
+ if ( [ -x "$(command -v update-grub)" ] || [ -e /boot/grub/menu.lst ] \
+ || [ -e /boot/grub/grub.cfg ] ) \
+ && ( [ -e /etc/lilo.conf ] && [ -x /sbin/lilo ] ); then
+ [ -r "${KPKGCONF}" ] && \
+ do_b=$(awk '/^do_bootloader/{print $3}' "${KPKGCONF}")
+ if [ "${do_b}" = "yes" ] || [ "${do_b}" = "Yes" ] \
+ || [ "${do_b}" = "YES" ]; then
+ run_lilo
+ return 0
+ elif [ "${do_b}" = "no" ] || [ "${do_b}" = "No" ] \
+ || [ "${do_b}" = "NO" ]; then
+ return 0
fi
+
+ # do_bootloader unconfigured
+ mbr_check
return 0
fi
if [ -r /etc/lilo.conf ] && [ -x /sbin/lilo ]; then