Add options to Grub2 config to toggle modules

This commit is contained in:
Kevin Lange 2016-09-27 16:57:32 +09:00
parent ad1e1dd475
commit a51df3047c
2 changed files with 38 additions and 12 deletions

View File

@ -18,6 +18,18 @@ export t_resolution
export g_resolution
export t_root
set mod_deb_enabled="yes"
set mod_ata_enabled="yes"
set mod_vid_enabled="yes"
set mod_snd_enabled="yes"
set mod_net_enabled="yes"
export mod_deb_enabled
export mod_ata_enabled
export mod_vid_enabled
export mod_snd_enabled
export mod_net_enabled
insmod gfxterm
terminal_output gfxterm
@ -32,23 +44,35 @@ function load_modules {
module /mod/zero.ko
module /mod/random.ko
module /mod/serial.ko
module /mod/debug_shell.ko
if [ "${mod_deb_enabled}" = "yes" ]; then
module /mod/debug_shell.ko
fi
module /mod/procfs.ko
module /mod/tmpfs.ko
module /mod/ata.ko
if [ "${mod_ata_enabled}" = "yes" ]; then
module /mod/ata.ko
fi
module /mod/ext2.ko
module /mod/iso9660.ko
module /mod/ps2kbd.ko
module /mod/ps2mouse.ko
module /mod/lfbvideo.ko
module /mod/vboxguest.ko
module /mod/vidset.ko
if [ "${mod_vid_enabled}" = "yes" ]; then
module /mod/lfbvideo.ko
module /mod/vboxguest.ko
if [ "${mod_deb_enabled}" = "yes" ]; then
module /mod/vidset.ko
fi
fi
module /mod/packetfs.ko
module /mod/snd.ko
module /mod/ac97.ko
module /mod/net.ko
module /mod/pcnet.ko
module /mod/rtl.ko
if [ "${mod_snd_enabled}" = "yes" ]; then
module /mod/snd.ko
module /mod/ac97.ko
fi
if [ "${mod_net_enabled}" = "yes" ]; then
module /mod/net.ko
module /mod/pcnet.ko
module /mod/rtl.ko
fi
}
function load_ramdisk {

View File

@ -27,7 +27,7 @@ submenu 'Graphical terminal - boots to a terminal with a traditional login promp
set_vidmode
boot
}
submenu 'VGA console with serial debugging - disables graphical boot, loads the serial debug shell' {
submenu 'VGA text-mode console' {
multiboot /kernel start=--vga logtoserial=1 ${t_root}
load_modules
load_ramdisk
@ -98,4 +98,6 @@ submenu 'Advanced graphics configuration options...' {
}
}
submenu 'Configure optional modules' {
configfile /boot/grub/modules.cfg
}