Lilo loader in linux

LILO

LILO (LInux LOader) — это простой загрузчик для Linux и других операционных систем.

Установка

Установка LILO состоит из двух стадий. Первая стадия — установка самой программы в систему (но не активация LILO), вторая — установка загрузчика в MBR (активация).

USE-флаги

USE flags for sys-boot/lilo LInux LOader, the original Linux bootloader

device-mapper Enable support for device-mapper from sys-fs/lvm2
minimal Do not install the dolilo helper script
pxeserial Avoid character echo on PXE serial console
static !!do not set this during bootstrap!! Causes binaries to be statically linked instead of dynamically

Emerge

Установка программы разместит её в файловой системе, но не установит в MBR.

Установка LILO в MBR

Чтобы установить LILO в MBR или обновить LILO, выполните команду lilo . Однако перед этим необходимо настроить файл /etc/lilo.conf . Процесс настройки описано в разделе Настройка ниже.

Настройка

Пример файла lilo.conf находится в /etc/lilo.conf.example . Чтобы начать настройку LILO, скопируйте файл с примером.

Откорректируем файл /etc/lilo.conf .

Основные настройки

Настроим LILO для размещения в системе. Параметр boot указывает, куда должен быть установлен загрузчик. Обычно это блочное устройство, соответствующее первому диску (диску, с которого загружается система), например /dev/sda . Имейте в виду, что в файле lilo.conf.example все еще используются имена /dev/hda , так что не забудьте заменить /dev/hda на /dev/sda .

boot = /dev/sda map = /boot/.map

Далее, сообщим LILO, что нужно загружать по умолчанию (если пользователь не выбрал какой-либо элемент загрузочного меню). Используемое здесь имя является значением label из блоков настроек операционных систем, определяемых далее в этом файле.

LILO некоторое время показывает доступные варианты загрузки, а затем загружает выбранную по умолчанию ОС. Время ожидания определяется параметром timeout и измеряется десятыми долями секунды (так, значение 10 — одна секунда):

ФАЙЛ /etc/lilo.conf Установка пятисекундного интервала перед загрузкой умолчальной ОС

Настройка блока для Gentoo

Ниже приведен пример блока для Gentoo. Метка (label) “Gentoo” соответствует определённому ранее параметру default .

image = /boot/kernel-3.11.2-gentoo label = Gentoo read-only root = /dev/sda4

Будет загружено ядро Linux /boot/kernel-3.11.2-gentoo с корневой файловой системой /dev/sda4 .

Добавление параметров ядра

Для добавления параметров ядра к блоку ОС, используйте параметр append . Например, чтобы загрузить ядро Linux в «тихом» режиме (выводятся только критически важные сообщения ядра):

ФАЙЛ /etc/lilo.conf Использование append для передачи ядру параметра quiet

image = /boot/kernel-3.11.2-gentoo label = Gentoo read-only root = /dev/sda4 append = "quiet"

Пользователи systemd, к примеру, могут пожелать установить init=/usr/lib/systemd/systemd , чтобы использовать файл init из systemd:

append = "quiet init=/usr/lib/systemd/systemd"

Как легко заметить, дополнительные настройки ядра просто добавляются к одному и тому же параметру append .

Читайте также:  Linux check disk raid

Определение нескольких блоков

Хорошей идеей будет хранить старые определения на случай, если новое ядро не загружается. Это можно сделать, создав другой блок настроек:

image = /boot/kernel-3.9.2-gentoo root = /dev/sda4 label = OldGentoo read-only

Использование

Обновление LILO в MBR

Как упоминалось ранее, для того чтобы установить LILO в MBR, необходимо выполнить команду lilo . Этот шаг необходимо повторять каждый раз, когда изменяется файл /etc/lilo.conf , или когда обновляется ядро (или ядра) Linux, указанные в /etc/lilo.conf !

Многократный запуск команды lilo не нанесет вреда.

Двойная загрузка Gentoo и FreeBSD

Для двойной загрузки Gentoo и FreeBSD отредактируйте /etc/lilo.conf следующим образом:

large-memory lba32 boot=/dev/sda install=menu map=/boot/map prompt default=Gentoo image=/boot/vmlinuz-2.6.26 label="Gentoo" root=/dev/sda1 append="" read-only optional other=/dev/sda3 label="FreeBSD"

Убедитесь в том, что вы изменили примерный настроечный файл под ваши нужды.

Удаление

Unmerge

Предупреждение
Будьте уверены, что установили и настроили другой загрузчик перед удалением lilo ! Несоблюдение этого правила, скорее всего, приведет к тому что система не сможет загрузиться.

Смотрите также

  • GRUB — мультизагрузочный загрузчик, способный загружать ядра с различных файловых систем на большинстве системных архитектур.

Источник

LILO

The LInux LOader, or LILO for short, is a legacy multi-boot loader for Linux systems. In spite of being the standard choice over the course of several years, it has been slowly phased out. As of January 2016, LILO is no longer actively developed.

Installation

LILO is available as lilo AUR and lilo-git AUR (the development version). LILO only works on BIOS systems.

Running the command lilo (as root) will install LILO to the MBR. Before running the lilo command you should edit /etc/lilo.conf to ensure that the root entry points towards the root partition. If your root partition is on /dev/sda1 then the root entry should look like this: root=/dev/sda1 . Remember to change the root line for both the ‘arch’ and the ‘arch-fallback’ entries.

Install to partition or partitionless disk

Use the -b flag to specify a partition or the whole disk (instead of the implied -M ) to install LILO to the volume boot record (VBR) instead of the MBR. See lilo(8) and the answers by Hypnos on the Gentoo forum.

Configuration

LILO is configured by editing the /etc/lilo.conf file and running lilo afterwards to apply the new configuration.

As a reminder, consider that LILO needs to be run after every kernel upgrade, otherwise the system is likely to be left in an unbootable state.

More help on setting up LILO can be found in the LILO-mini-HOWTO.

Sample setup

Tip: If LILO is really slow while loading the bzImage, try adding compact to /etc/lilo.conf ‘s global section, as shown below.

# # /etc/lilo.conf # boot=/dev/sda # This line often fixes L40 errors on bootup # disk=/dev/sda bios=0x80 default=Arch timeout=100 lba32 prompt compact image=/boot/vmlinuz-linux label=Arch append="devfs=nomount" vga=788 root=/dev/sda2 read-only image=/boot/vmlinuz-linux label=ArchRescue root=/dev/sda8 read-only other=/dev/sda1 label=Windows # End of file

You can use hwinfo —framebuffer to determine what vga modes you can use.

Using an image as background

First prepare the background image:

  • Open it in GIMP.
  • Scale it to 640×480.
  • Change it to indexed mode (Image > Mode > Indexed).
  • Select Create optimal palette and set it to 16 colours. Choose whatever dithering method suits you.
  • Open the «Indexed Palette» dialog. Make note of which colours you want to use for menu text entries, the clock, etc. In your lilo.conf , you refer to the colours by index.
  • Export the image as a bmp in your /boot directory. In Export dialog check option Do not write color space information
Читайте также:  Kali linux user root

Now edit lilo.conf . There are a few options that can be set for your graphical menu. See man lilo.conf for more information.

  • bitmap= Set this to the file that you saved above.
  • bmp-colors=,,,,,
  • bmp-table=,,,,, This option specifies where the menu is placed. x and y are the character coordinates. You can also suffix them with a p to specify pixel coordinates.
  • bmp-timer=,,,, This option specifies the coordinates and colour of the timer that counts down the timeout before booting a default entry. It uses colour indices for the colours, and character (or pixel) coordinates.
bitmap=/boot/arch-lilo.bmp bmp-colors=1,0,8,3,8,1 bmp-table=250p,150p,1,18 bmp-timer=250p,350p,3,8,1

Save lilo.conf , run lilo as root, and reboot and see how it looks!

Pacman hook

lilo needs to be run after every kernel update. You can use a pacman hook to automate it. See Pacman#Hooks or alpm-hooks(5) .

Make the directory /etc/pacman.d/hooks if it does not already exist.

[Trigger] Operation = Install Operation = Upgrade Operation = Remove Type = Package Target = linux Target = linux-lts [Action] Description= Run lilo after kernel update When = PostTransaction Depends = lilo Exec = /usr/bin/lilo

Troubleshooting

Read write error message whilst booting

This error message is caused by a change in mkinitcpio which was in response to this Systemd commit. The change causes partitions to be fsck’ed twice when mounted read only. To fix this error edit /etc/lilo.conf and change the ‘read only’ line to ‘read write’ for both arch entries.

See this forum thread for more information.

Devmapper not found error message after kernel upgrade

It is possible that running the lilo command after a kernel upgrade results in a devmapper not found error. If this is the case run modprobe dm-mod before running lilo after a kernel upgrade.

See also

Источник

LILO

LILO (LInux LOader) is a simple boot loader to load Linux and other operating systems.

Installation

LILO’s installation is two-fold. One is the installation of the software itself on the system (but does not activate LILO), the second one is the installation (activation) of the LILO bootloader on the disk’s MBR.

USE flags

USE flags for sys-boot/lilo LInux LOader, the original Linux bootloader

device-mapper Enable support for device-mapper from sys-fs/lvm2
minimal Do not install the dolilo helper script
pxeserial Avoid character echo on PXE serial console
static !!do not set this during bootstrap!! Causes binaries to be statically linked instead of dynamically

Emerge

The software installation will only deploy the software on the file system, but will not install LILO in the MBR.

Installing LILO on the MBR

In order to install LILO on the MBR or update LILO, invoke lilo . However, before doing that, the /etc/lilo.conf file must be set up, which is covered in the Configuration section below.

Читайте также:  Iso образ arch linux

Configuration

An example lilo.conf file is provided at /etc/lilo.conf.example . To start configuring LILO, copy over the example file.

Update the /etc/lilo.conf file accordingly.

General configuration

First configure LILO to be deployed on the system. The boot parameter tells LILO where to install the LILO bootloader in. Usually, this is the block device that represents the first disk (the disk that the system will boot), such as /dev/sda . Be aware that the lilo.conf.example file still uses /dev/hda so make sure that references to /dev/hda are changed to /dev/sda .

Next, tell LILO what to boot as default (if the user does not select any other option at the boot menu). The name used here is the label value of the operating system blocks defined later in the file.

LILO will show the available options for a short while before continuing to boot the default selected operating system. How long it waits is defined by the timeout parameter and is measured in tenths of a second (so the value 10 is one second):

FILE /etc/lilo.conf Setting a 5 second timeout before continuing to boot the default OS

Configuring the Gentoo OS block

An example configuration block for Gentoo is shown below. It is given the «Gentoo» label to match the default parameter declared earlier.

image=/boot/kernel-3.11.2-gentoo label=Gentoo read-only root=/dev/sda4

This will boot the Linux kernel /boot/kernel-3.11.2-gentoo with root file system /dev/sda4 .

Adding kernel parameters

To add additional kernel parameters to the OS block, use the append parameter. For instance, to boot the Linux kernel silently (so it does not show any kernel messages unless critical):

FILE /etc/lilo.conf Showing the use of the append parameter with the quiet option

image=/boot/kernel-3.11.2-gentoo label=Gentoo read-only root=/dev/sda4 append="quiet"

systemd users for instance would want to set init=/usr/lib/systemd/systemd so that the systemd init is used:

append="quiet init=/usr/lib/systemd/systemd"

As can be seen, additional kernel parameters are just appended to the same append parameter.

Multiple block definitions

It is a good idea to keep old definitions available in case the new kernel doesn’t boot successfully. This is accomplished by creating another block:

image=/boot/kernel-3.9.2-gentoo root=/dev/sda4 label=OldGentoo read-only

Usage

Updating LILO in the MBR

As mentioned earlier, lilo has to be executed in order to install LILO in the MBR. This step has to be repeated every time /etc/lilo.conf is modified or when the Linux kernel(s) that the /etc/lilo.conf file points to are updated!

Running lilo too much doesn’t hurt.

Dual boot Gentoo and FreeBSD

To dual boot Gentoo and FreeBSD, edit /etc/lilo.conf as follows:

large-memory lba32 boot=/dev/sda install=menu map=/boot/map prompt default=Gentoo image=/boot/vmlinuz-2.6.26 label="Gentoo" root=/dev/sda1 append="" read-only optional other=/dev/sda3 label="FreeBSD"

Make sure to adapt the example configuration file to match the setup used.

Removal

Unmerge

Warning
Be sure there’s another bootloader installed and properly configured before uninstalling lilo ! Failing to do so will most likely result in the system failing to bootstrap.

See also

  • GRUB — is a multiboot secondary bootloader capable of loading kernels from a variety of filesystems on most system architectures.

Источник

Оцените статью
Adblock
detector