]> git.wh0rd.org Git - home.git/commitdiff
installkernel: auto run grub-mkconfig on x86 systems
authorMike Frysinger <vapier@gentoo.org>
Mon, 11 Jan 2021 00:53:05 +0000 (19:53 -0500)
committerMike Frysinger <vapier@gentoo.org>
Mon, 11 Jan 2021 00:53:05 +0000 (19:53 -0500)
.bin/installkernel

index ec6ceb6c91a32ff29d38ffe143fd6b8730ed6cf0..030e21f0d9203adc9467327731a8292843311b8f 100755 (executable)
@@ -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