Skip to content
Snippets Groups Projects
Commit 909361ab authored by Canek Peláez Valdés's avatar Canek Peláez Valdés :slight_smile:
Browse files

boot-manager: Now that GRUB2 is stable in Gentoo, it makes no sense to

keep supporting GRUB.
parent de11dc7c
No related branches found
No related tags found
No related merge requests found
......@@ -93,45 +93,9 @@ function update_grub2() {
/usr/sbin/grub2-mkconfig -o "${GRUB2_CONFIG_FILE}" &>> "${LOGFILE}" || die
}
function update_grub() {
einfo "Generating /boot/grub/grub.conf..."
KERNELS=$(find /boot -name "vmlinuz*" | sort -r -V)
echo "${GRUB_HEADER}" > /boot/grub/grub.conf || die
for KERNEL in ${KERNELS}; do
KV=$(echo ${KERNEL} | sed "s@/boot/vmlinuz-@@g")
cat << EOF >> /boot/grub/grub.conf || die
title ${GRUB_KERNEL_TITLE} (kernel ${KV})
root ${GRUB_ROOT_PARTITION}
kernel ${KERNEL} root=${ROOT_PARTITION} init=${INIT} ${INIT_OPTIONS}
EOF
einfo "Added ${KERNEL} kernel."
if [ -f "/boot/initrd-${KV}" ]; then
echo "initrd /boot/initrd-${KV}" >> /boot/grub/grub.conf || die
einfo "Added /boot/initrd-${KV} initramfs."
fi
done
/bin/chmod 600 /boot/grub/grub.conf
}
function update_bootmanager() {
einfo "Updating ${BOOTMANAGER}..."
case "${BOOTMANAGER}" in
GRUB)
update_grub
;;
GRUB2)
einfo "Updating GRUB2..."
update_grub2
;;
*)
ewarn "Invalid bootmanager ${BOOTMANAGER}."
esac
}
EXEC_NAME=$(/usr/bin/basename "$0")
......
# The file with the kernel configuration. This file should be in /etc.
KERNEL_CONFIG="/etc/kerninst/kernel-config"
# Init to use
INIT="/usr/lib/systemd/systemd"
# Init options
INIT_OPTIONS="quiet"
# Bootmanager (one of GRUB or GRUB2)
BOOTMANAGER="GRUB2"
# The root of GRUB
GRUB_ROOT_PARTITION="(hd0,0)"
# The root partition in the GRUB kernel command line
ROOT_PARTITION="/dev/sda1"
# The header of the GRUB configuration file
GRUB_HEADER="default 0
timeout 5"
# Title for the kernels in GRUB
GRUB_KERNEL_TITLE="Gentoo Linux"
# GRUB2 configuration file
GRUB2_CONFIG_FILE="/boot/grub2/grub.cfg"
GRUB2_CONFIG_FILE="/boot/grub/grub.cfg"
# Wether to include firmware files
INCLUDE_FIRMWARE="no"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment