- Как вы передаете VGA / VESA режимы с GRUB2?
- Пример конфигурации разрешения кадрового буфера
- Выдержка из GNU GRUB Manual 2.00
- GRUB2 и ядро vga = параметр
- Linux Video – Part2 VGA Configuration
- Explanation
- Supported Drivers
- Frame-Buffer Modes
- Configuring lilo
- Configuring grub(legacy)
- Configuring Grub2
- GRUB and VGA Modes
- VGA Modes and GRUB
- But If That Doesn’t Work.
- Available VGA Modes
- Installing Your Configuration Change
- What About The GRUB Menu Resolution?
Как вы передаете VGA / VESA режимы с GRUB2?
Одна из моих машин имеет 3-ТБ настройку HD для тройной загрузки в Mint 14 (вариант Ubuntu 12.10), Slackware 14.1 и Arch Linux. HD отформатирован с использованием системы GPT / Guid. Grub2 технически «принадлежит» установке Linux Mint, но используется для тройной загрузки всех трех систем. Установка его около 1 года назад была чрезвычайно болезненной процедурой и требовала 2-3 дня борьбы с ней и ее настройки, чтобы позволить ей распознавать установки Slackware и Arch; он всегда легко распознавал установку Mint Linux.
Мне нужно иметь возможность передавать режимы VGA / VESA в Slackware и Arch. Я использую Slackware и Arch из командной строки, поэтому разрешение консоли и размер шрифта являются важными факторами.
В GRUB2 предпочтительный метод установки разрешения кадрового буфера (для GRUB и ядра) — это редактирование, /etc/default/grub чтобы оно содержало следующие переменные:
- GRUB_GFXMODE устанавливает разрешение GRUB
- GRUB_GFXPAYLOAD_LINUX контролирует, будет ли ядро Linux сохранять разрешение, и если вы хотите, чтобы ядро Linux использовало другое разрешение, чем GRUB, вы можете установить его с помощью этой переменной в форме widthxheight .
Для отображения всех режимов вы можете использовать:
- hwinfo —framebuffer в терминале Linux
- vbeinfo в GRUB подскажите
Пример конфигурации разрешения кадрового буфера
Эти строки вставляются в /etc/default/grub :
Чтобы сгенерировать изменения, запустите
Выдержка из GNU GRUB Manual 2.00
Установите разрешение, используемое на ‘gfxterm’ графическом терминале. Обратите внимание, что вы можете использовать только те режимы, которые поддерживает ваша видеокарта через VESA BIOS Extensions (VBE), поэтому, например, собственное разрешение ЖК-панели может быть недоступно. По умолчанию используется ‘auto’ попытка выбрать предпочтительное разрешение. Смотрите gfxmode .
Установите , ‘text’ чтобы заставить ядро Linux для загрузки в обычном текстовом режиме, ‘keep’ чтобы сохранить набор графики режима использования ‘GRUB_GFXMODE’ , ‘widthxheight’ [ ‘xdepth’ ] , чтобы установить конкретный графический режим, или последовательность этих разделенных запятой или точкой с запятой , чтобы попробовать несколько режимов в последовательности. Смотрите gfxpayload .
Обратите внимание, что в зависимости от вашего ядра, вашего дистрибутива, вашей видеокарты и фазы луны, использование этой опции может привести к тому, что GNU / Linux будет страдать от различных проблем с отображением, особенно на ранних этапах загрузки. Если у вас есть проблемы, установите эту опцию на, ‘text’ и GRUB скажет Linux загрузиться в обычном текстовом режиме.
Источник
GRUB2 и ядро vga = параметр
Согласно документации, использование vga= параметра ядра устарело с GRUB2. Тот факт, что некоторые новые ядра больше не поддерживают его на определенных адаптерах, не имеет значения, поскольку моей видеокарте уже семь-восемь лет.
Проблема в том, что я хотел бы использовать текстовый режим с более высоким разрешением, например, 80×50 вместо стандартных 80×25 символов. Видимо все графики (VBE / VESA) режимы из вопроса для этой видеокарты (ATI Rage XL) — список доступных режимов показывает только 0 через 6 . 6 это , 80×60 но выглядит ужасно, поэтому я хотел бы пойти с 1 (80х50).
Я видел 80×50 и 80×60, работающие после получения списка доступных режимов, когда режим по умолчанию не поддерживался (с комментариями по умолчанию GRUB_TERMINAL=console ), и мне было предложено выбрать.
Как я могу установить режим, если я не должен устанавливать его в командной строке ядра и при каждом использовании GRUB_GFXMODE (с vbe модулем предварительной загрузки или без него ) и GRUB_GFXPAYLOAD_LINUX=keep сбой? Сбой как в: экран остается пустым, потому что это недопустимый графический режим для карты, установленной на этом аппарате?
Моя идея nomodeset состояла бы в том, чтобы все же перейти к ядру, но тогда загрузчику все равно пришлось бы устанавливать графический режим. И я не вижу никаких параметров, кроме vga= параметра ядра для этого.
Примечание: vbetest и videotest команды на GRUB2 консоль на пустой экран , а затем экран переходит в спящий режим после того, как утверждают , нет видеовхода. vbeinfo и videoinfo показать несколько доступных режимов, кроме вышеупомянутых, но нет упоминания о том, где это должно быть установлено. Кроме того, при передаче vga=1 (без nomodeset ) в командной строке ядра я вижу очень краткое предупреждение о том, что оно устарело, но его слишком долго читать полностью — и вывод не появляется dmesg .
Источник
Linux Video – Part2 VGA Configuration
Explanation
In this article I am using VGA mode to reference to the command line graphic capabilities, when in fact the video system is called the Linux frame-buffer, the reason for this use of terms is to help new users since most configurations use the VGA flags to set the frame-buffer mode to use.
The frame-buffer system in Linux based systems is used to pass a video mode to your kernel on boot, which is generally used set your monitor’s resolution for boot-loaders and CLI (Command Line interface) mode. Although the uses are limited, many users can find reasons to modify the frame-buffer mode and resolution including wanting to view more lines and character on the screen when in CLI Mode.
Your options for setting the VGA mode are limited because of the limited uses. You are limited to setting the mode in the configuration file for your chosen bootloader. In this post we will discuss the available modes and how to set them in lilo, grub legacy and grub2.
Supported Drivers
In most cases the vesafb driver is used in the kernel for frame-buffer support, but in rare cases on specific video cards and chipsets, you may need to use another frame-buffer driver. The alternate drivers will not be covered here, but if you need assistance with those you can visit the tldp.prg page on frame-buffer drivers (http://tldp.org/HOWTO/frame-buffer-HOWTO/x168.html) or ask on the Linux.com forum.
Frame-Buffer Modes
When choosing a frame-buffer mode to use, you will have values to consider, the color depth, and the resolution. You will need to choose the correct value to correspond with your desired parameters and to support your video card and monitor.
Listed below are the VGA values as they correspond to the color depth and resolution:
- 8 bit – 256 colors
- 1024×768 = 773
- 1152×864 = 353
- 1280×1024 = 775
- 1600×1200 = 796
- 16-bit – 65,536
- 1024×768 = 791
- 1152×864 = 355
- 1280×1024 = 794
- 1600×1200 = 798
- 32-bit – 16.8 million colors
- 1024×768 = 792
- 1152×864 = 356
- 1280×1024 = 795
- 1600×1200 = 799
- 64-bit
- 800×600 = ?
- 1024×768 = 791
- 1152×864 = ?
- 1280×1024 = ?
- 1600×1200 = ?
As you may have noticed I left some designations out because I have seen references to the modes being used, but could not locate the specific values necessary for the bootloaders to use, if you know of any missing values please share them in the comments.
Configuring lilo
The legacy lilo bootloader is not used by many distros anymore, but it very simple to configure and fast, so it still has a place in modern distros.
It is very simple to set the frame-buffer modes in Lilo, to pass the chosen frame-buffer mode to the kernels in all installed Linux/Unix-like operating systems, or you can choose specific values to pass to specific installed operating systems.
To set the frame-buffer mode for lilo to use and to pass to your OS kernels you need to do the following:
- Open the file /etc/lilo.conf with admin rights in yli>our favorite text editor
- Find the OS you wish to pass the option to, for example OS configuration set would be:
image = /boot/vmlinuz
root = /dev/sda6
label = Slackware-safe
read-only - In the image line, which identified the kernel to use, add vga=
on the end of the line, such as:
image = /boot/vmlinuz vga=791
root = /dev/sda6
label = Slackware-safe
read-only - Don’t forget to run the command lilo from the command line once the modifications are complete to write the modified bootloader configuration to the MBR.
You can find additional information pertaining to lilo options at http://linux.die.net/man/5/lilo.conf.
Configuring grub(legacy)
Grub(legacy) is not being used by many distros anymore because a new version (grub2) has been released which caused development to stop on the old version, but for those that prefer the old configuration method it is still an available option.
To set the frame-buffer mode for grub to use and pass to your OS kernels you need to do the following:
- Open /boot/grub/menu.lst as the admin user in your favorite text editor
- Locate the OS which you would like to modify, an example from one of my configurations is below:
title Slack64-current
root (hd0,1)
kernel /boot/s64-c/vmlinuz-generic root=/dev/sdb6 ro
initrd /boot/s64-c/initrd.gz - Add the vga=
option to the end of the kernel line of the chosen operating system, such as:
title Slack64-current
root (hd0,1)
kernel /boot/s64-c/vmlinuz-generic root=/dev/sdb6 ro vga=791
initrd /boot/s64-c/initrd.gz - Save the menu.lst file
Configuring Grub2
Grub2 is the current version of the grub bootloader and is quickly obtaining approval from several distros. Grub2 is currently under development in which your distro will be receiving regular updates which may risk overwriting your custom configuration file, so be careful.
To set the frame-buffer mode for grub2 to use and pass to your OS kernels you need to do the following:
- Open the file /etc/default/grub with admin rights in your favorite text editor.
- In any line before _?_ add the line “GRUB_GFXMODE=
x “, the color depth is optional, so to set grub to 1024×768 you can enter “GRUB_GFXMODE=1024×768” or to set it to 32-bit mode (16.8 million colors) you can enter “GRUB_GFXMODE=1024x768x32“. You can also enter multitple modes separated by a comma. - Optional: Enter “GRUB_GFXPAYLOAD_LINUX=keep” in the configuration file to tell the bootloader to push the chosen setting to the operating system kernels.
- Save the file and run the command update-grub to append the changes to the bootloader.
To set the frame-buffer mode for grub2 to pass to a specific OS kernel you need to do the following:
- Open the file /etc/lilo.conf with admin rights in your favorite text editor ind the OS you wish to pass the option to, an example of an OS configuration set would be:
title Start BackTrack frame-buffer (1024×768)
kernel /boot/vmlinuz BOOT=casper boot=casper rw quiet
initrd /boot/initrd.gz - In the image line, which identified the kernel to use, add vga=
on the end of the line, such as:
title Start BackTrack frame-buffer (1024×768)
kernel /boot/vmlinuz BOOT=casper boot=casper rw quiet vga=791
initrd /boot/initrd.gz
If you have any issues implementing any of the instructions above please post your issues as a comment and I will try to assist you through your issues.
Источник
GRUB and VGA Modes
VGA Modes and GRUB
Hopefully your Linux kernel will detect the video hardware and select a good video mode.
However, especially on virtualized platforms like Oracle VirtualBox, you may need to help it along.
The modern way to do this is through GRUB variables GRUB_GFXMODE and GRUB_GFXPAYLOAD_LINUX . Add something like the following to /etc/default/grub to set the desired width×height×depth (in pixels×pixels×bits).
You can set multiple resolutions, including the default auto ,, using something like this:
Then update the GRUB configuration:
If the command is instead grub2-mkconfig on your distribution (e.g., RHEL, CentOS, Mageia, etc), of course use that instead.
But If That Doesn’t Work.
You can add a vga= directive to the kernel line in the GRUB file, something like the following:
You will, of course, see something specific in place of X.Y.Z and you can use numbers other than 792 . That specific number yields 1024×768 with 65,536 possible colors. See the table below for a variety of choices! But first, some tips:
- The vga=XXX directive can go anywhere on the line. I put it near the beginning in this example to make it easy to spot if you’re viewing this page on a phone. But it will be easiest for you to add it to the end.
- Experiment! Press e at the GRUB menu and add an experimental string, then press -X to boot. If you get an unwanted mode, or even a totally black screen, cycle the power and try again. Once you find a useful value, you can install it as explained below.
- You might see linuxefi as in my example above, or linux , depending on your platform. Leave that alone, you’re simply looking for the line with some vmlinuz-X.Y.Z kernel file name.
Available VGA Modes
Color bits | Colors | 640×480 | 800×600 | 1024×768 | 1280×1024 | 1400×1050 | 1600×1200 |
8 bits | 256 colors | 769 | 771 | 773 | 775 | ||
15 bits | 32,768 colors | 784 | 787 | 790 | 793 | ||
16 bits | 65,536 colors | 785 | 788 | 791 | 794 | 834 | 884 |
24 bits | 16,777,216 colors | 786 | 789 | 792 | 795 |
Installing Your Configuration Change
Do not simply edit the /boot/grub/grub.cfg file!
Changes to that file will be wiped out the next time you install a kernel update.
Edit the file /etc/default/grub and look for lines like this:
Insert your addition there. If there is only one such line, add it to that string. If there are two lines, add it to the non-empty string:
Now, regenerate the GRUB configuration file. This will insert your addition to every stanza or boot target. Change the path name as needed, use completition to get it right with far less typing work.
For example, on a UEFI/GPT/ dracut platform, the GRUB configuration file might be under /boot/efi/EFI/ . On a BIOS/MBR/ isolinux platform, the directory might be /boot/grub2 rather than boot/grub . The precise location depends on your distribution.
If you instead find a file named grub.conf , then you’re on a very old system with the legacy GRUB 0.99 instead of GRUB 2.
Also, there may be a «2» in the command name: grub2-mkconfig .
What About The GRUB Menu Resolution?
Yes, there are three operating system environments on your way to what you really want to run:
- Firmware: With UEFI firmware, this can be fairly high resolution graphics. Then then firmware starts:
- GRUB boot loader: This gets whatever the UEFI has set up, although you can tell it to try a specific resolution. That’s useful to change in a virtualized environment, where the boot loader is running within a window on a graphical desktop of a host OS. Then it loads and starts:
- Operating system: The above showed how to pass a video resolution request like vga=792 to the OS kernel as it’s loaded.
To set the GRUB boot loader resolution: look for a line setting GRUB_GFXMODE within the file /etc/default/grub . Add it if needed, or change what’s there. You could use double-quotes around the resolution string but they aren’t needed:
Then regenerate the GRUB configuration file.
Источник