From b189e842868a703f7cbb75362a2e46c051303201 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 10 Jan 2021 19:53:05 -0500 Subject: [PATCH] installkernel: auto run grub-mkconfig on x86 systems --- .bin/installkernel | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) 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 -- 2.39.5