projects
/
grml-debootstrap.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
94b63ad
)
grub_install: use same method for checking grub-install and update-grub
author
Chris Hofstaedtler
<chris@hofstaedtler.name>
Mon, 13 Nov 2023 22:30:33 +0000
(23:30 +0100)
committer
Chris Hofstaedtler
<chris@hofstaedtler.name>
Fri, 17 Nov 2023 15:25:08 +0000
(16:25 +0100)
chroot-script
patch
|
blob
|
history
diff --git
a/chroot-script
b/chroot-script
index
ad23449
..
8f8e5ff
100755
(executable)
--- a/
chroot-script
+++ b/
chroot-script
@@
-717,6
+717,10
@@
grub_install() {
echo "Error: grub-install not available. (Error while installing grub package?)" >&2
return 1
fi
echo "Error: grub-install not available. (Error while installing grub package?)" >&2
return 1
fi
+ if ! [ -x "$(command -v update-grub)" ] ; then
+ echo "Error: update-grub not available. (Error while installing grub package?)" >&2
+ return 1
+ fi
if [ -n "$SELECTED_PARTITIONS" ] ; then # using sw-raid
for device in $SELECTED_PARTITIONS ; do
if [ -n "$SELECTED_PARTITIONS" ] ; then # using sw-raid
for device in $SELECTED_PARTITIONS ; do
@@
-741,16
+745,6
@@
grub_install() {
echo "Adjusting grub configuration for use on ${GRUB}."
echo "Adjusting grub configuration for use on ${GRUB}."
- # finally install grub
- if [ -x /usr/sbin/update-grub ] ; then
- UPDATEGRUB='/usr/sbin/update-grub'
- elif [ -x /sbin/update-grub ] ; then
- UPDATEGRUB='/sbin/update-grub'
- else
- echo "Error: update-grub not available, can not execute it." >&2
- return 1
- fi
-
if [ -n "${BOOT_APPEND}" ] ; then
echo "Adding BOOT_APPEND configuration ['${BOOT_APPEND}'] to /etc/default/grub."
sed -i "/GRUB_CMDLINE_LINUX_DEFAULT/ s#\"\$# ${BOOT_APPEND}\"#" /etc/default/grub
if [ -n "${BOOT_APPEND}" ] ; then
echo "Adding BOOT_APPEND configuration ['${BOOT_APPEND}'] to /etc/default/grub."
sed -i "/GRUB_CMDLINE_LINUX_DEFAULT/ s#\"\$# ${BOOT_APPEND}\"#" /etc/default/grub
@@
-758,7
+752,8
@@
grub_install() {
mountpoint /boot/efi &>/dev/null && umount /boot/efi
mountpoint /boot/efi &>/dev/null && umount /boot/efi
- $UPDATEGRUB
+ # finally install grub. Existence of update-grub is checked above.
+ update-grub
}
# }}}
}
# }}}