#!/bin/sh
. /opt/hmc/bin/functions
mkdir -p /tmp/mnt
mount -t ext3 /dev/${HDP}2 /tmp/mnt
#sed -e s'/default 1/default 0/g' /tmp/mnt/boot/grub/grub.conf > /tmp/new_grub.conf
#mv /tmp/new_grub.conf /tmp/mnt/boot/grub/grub.conf

chmod -x /tmp/mnt/etc/grub.d/40_hmc-altdisk*
mount -t proc proc /tmp/mnt/proc
mount --bind /dev /tmp/mnt/dev

chroot /tmp/mnt /usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg
chroot /tmp/mnt /bin/systemctl set-default multi-user.target 2>&1 >/dev/null

umount /tmp/mnt/dev
umount /tmp/mnt/proc

#sed -e s'/^id:1/id:5/g' /tmp/mnt/etc/inittab > /tmp/_new_inittab
#mv /tmp/_new_inittab /tmp/mnt/etc/inittab
umount /tmp/mnt
