repo/grub-configmake/payload/usr/bin/grub-configmake
2021-07-12 21:01:20 +02:00

30 lines
969 B
Bash

#!/bin/sh
echo 'Running grub-configmake'
read -p "What is the install root you are using?" install_root
defaults=`cat ${install_root}/etc/grub-defaults.cfg 2>/dev/null`
if [ -z "${defaults}" ]
read -p "What is the install root you are using?" install_root
mkdir -p ${install_root}/boot/grub | echo "You probably didn't make /boot" && exit 2
read -p "What drive do you want to set root to? (Only <number> otherwise it won't work.)" grub_root
read -p "Init binary (full path only)" init_path
cat > ${install_root}/etc/grub-defaults.cfg << "EOF"
install_root=${install_root}
init_path=${init_path}
grub_root=${grub_root}
EOF
else
. ${install_root}/etc/grub-defaults.cfg
fi
cat > ${install_root}/boot/grub/grub.cfg << "EOF"
set default=0
set timeout=5
insmod ext2
set root=(hd0,${root})
menuentry "Alnux+Busybox/Linux" {
linux /boot/bzImage root=/dev/sda${grub_root} rw init=${init path} rw
}
EOF
echo "grub-configmake made the config . . ."
exit 0