diff --git a/deployment/puppet/umm/files/umm-install.rh6 b/deployment/puppet/umm/files/umm-install.rh6 index ca0333c15b..cc37c31fdf 100755 --- a/deployment/puppet/umm/files/umm-install.rh6 +++ b/deployment/puppet/umm/files/umm-install.rh6 @@ -2,4 +2,25 @@ sed -e '/post-stop script/,/end script/!d' \ -e '/post-stop script/a\ \ \ \ \ [ -f /usr/lib/umm/umm_svc ] && /usr/lib/umm/umm_svc' \ -/etc/init/rcS.conf >/etc/init/rcS.override \ No newline at end of file +/etc/init/rcS.conf >/etc/init/rcS.override + +[ -f /boot/grub/grub.conf ] && GRC=/boot/grub/grub.conf + + +if [ ! -z "$GRC" ]; then + sed -e '/#UMM BEGIN/,/#UMM END/d' -i $GRC + eval $(sed -n -e '/default=/ p' $GRC) + ST='-e 1,/^title/d' + until [ "$default" == "0" ] ; do + ST="$ST -e 1,/^title/d" + default=$(($default - 1)) + done; + echo "#UMM BEGIN" >/tmp/mm-gr + echo "title Unified Mintenance mode (UMM)" >>/tmp/mm-gr + sed $ST -e 's/\(^\s*kernel .*\)/\1 umm/' -e '/^title/,$ d' $GRC>>/tmp/mm-gr + echo "#UMM END" >>/tmp/mm-gr + cat /tmp/mm-gr >>$GRC + + rm /tmp/mm-gr +fi + diff --git a/deployment/puppet/umm/files/umm-install.u1404 b/deployment/puppet/umm/files/umm-install.u1404 index f546821ac8..ad1b8b8477 100755 --- a/deployment/puppet/umm/files/umm-install.u1404 +++ b/deployment/puppet/umm/files/umm-install.u1404 @@ -24,3 +24,11 @@ script initctl emit umm end script EOF + +cat >/etc/grub.d/55_umm << "EOF" +if [ -f /etc/grub.d/10_linux ] ; then + /etc/grub.d/10_linux | sed -n -e '/menuentry.*{/,/}/p' | sed -e "s/menuentry\s*'[^']*' /menuentry 'Unified maintenance mode (UMM) '/" -e 's/\(^\s*linux\s.*\)/\1 umm/' -e '/}/,$d'; echo '}' +fi +EOF + +update-grub \ No newline at end of file