From: Mike Frysinger Date: Mon, 11 Jan 2021 00:53:05 +0000 (-0500) Subject: installkernel: auto run grub-mkconfig on x86 systems X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=b189e842868a703f7cbb75362a2e46c051303201;p=home.git installkernel: auto run grub-mkconfig on x86 systems --- diff --git a/.bin/installkernel b/.bin/installkernel index ec6ceb6..030e21f 100755 --- a/.bin/installkernel +++ b/.bin/installkernel @@ -1,7 +1,8 @@ #!/bin/bash # 2.6.35.4-default arch/s390/boot/image System.map /boot -mmv() { [[ -e $1 ]] && mv "$1" "$2" ; } +e() { echo "+ $*"; "$@"; } +mmv() { [[ -e $1 ]] && mv "$1" "$2"; } ver=$1 img=$2 @@ -9,6 +10,9 @@ map=$3 dir=$4 mount "${dir}" >&/dev/null +if [[ ! -w "${dir}" ]] ; then + mount "${dir}" -o remount,rw +fi case ${img} in */blackfin/*) @@ -37,4 +41,13 @@ case ${img} in exit 0 ;; esac -exec /sbin/installkernel "$@" + +e /sbin/installkernel "$@" + +case ${img} in +*/x86*/*) + if [[ -e ${dir}/grub/grub.cfg ]] ; then + e grub-mkconfig -o /boot/grub/grub.cfg + fi + ;; +esac