கையேடு:AMD64/தொகுதி/துவக்கஏற்றி

From Gentoo Wiki
Jump to:navigation Jump to:search
This page is a translated version of the page Handbook:AMD64/Blocks/Bootloader and the translation is 7% complete.
Outdated translations are marked like this.


லினக்ஸ் கர்னல் உள்ளமைக்கப்பட்டு, முறைமை கருவிகள் நிறுவப்பட்டு, உள்ளமைவு கோப்புகள் எல்லாம் திருத்தப்பட்டுவிட்டதால், இப்போது லினக்ஸ் நிறுவலின் இறுதி முக்கியமான பாகமான துவக்க ஏற்றியை நிறுவ வேண்டிய நேரம் வந்துவிட்டது.

துவக்க ஏற்றி, துவக்கத்தின்போது லினக்ஸ் கர்னல் துவங்குவதற்கு இது பொறுப்பாகும் - இது இல்லாமல் முறைமைக்குத் திறன் பொத்தானை அழுத்தியவுடன் எவ்வாறு மேற்கொண்டு செல்வது என்று தெரியாது.

amd64 கட்டமைப்பிற்கு, BIOS அடிப்படையிலான முறைமைகளுக்கு GRUB2 அல்லது LILO வையும், UEFI அடிப்படையிலான முறைமைகளுக்கு GRUB2 அல்லது efibootmgr வையும் எவ்வாறு உள்ளமைப்பது என நாங்கள் ஆவணப்படுத்தியுள்ளோம்.

கையேட்டின் இந்த பிரிவில், துவக்க ஏற்றித் தொகுப்பை emerge செய்தல் ற்கும், துவக்க ஏற்றியை முறைமை வட்டில் install செய்தல் ற்கும் உள்ள வேறுபாடு விரித்துரைக்கப்பட்டுள்ளது. இங்கு emerge செய்தல் என்பது ஒரு மென்பொருள் தொகுப்பை Portage இடம் கேட்டு முறைமைக்குக் கிடைக்கும்படி செய்வதாகப் பொருள் கொள்ளப்படும். மேலும், install செய்தல் என்பது துவக்க ஏற்றி, கோப்புகளை நகலெடுப்பது அல்லது முறைமையின் வட்டு இயக்ககத்தில் உள்ள பொருத்தமான பிரிவுகளில் மாற்றங்களைச் செய்வது மூலம் துவக்க ஏற்றி செயல்படுத்தப்பட்டு அடுத்த திறன் சுழலில் வேளை செய்ய ஆயத்தமான நிலையில் வைப்பதைக் குறிக்கிறது.

முன்னிருப்பு: GRUB2

இயல்பாக, பெரும்பாலான ஜென்டூ முறைமைகள் GRUB மரபுவழி யின் நேரடி பின்வருநரான GRUB ஐ சார்ந்துள்ளது (sys-boot/grub தொகுப்பில் காணப்படும்). கூடுதல் உள்ளமைவுகள் எதுவும் இல்லாமல் GRUB2 ஆனது பழைய BIOS ("pc") முறைமைகளை ஆதரிக்கிறது. கட்டுதல் நேரத்திற்கு முன் தேவைப்படும் சிறு அளவிலான உள்ளமைவுகள் மூலம், ஆறிற்கும் அதிகமான கூடுதல் இயங்குதளங்களை GRUB2 ஆதரிக்கும். மேலும் தகவல்களுக்கு, GRUB2 கட்டுரையில் உள்ள முன் தேவை பிரிவை காணவும்.

இ-ஒன்றாக்குதல் (Emerge)

MBR பகிர்வு அட்டவணைகளை மட்டுமே ஆதரிக்கும் பழைய BIOS முறைமையைப் பயன்படுத்தும் போது, GRUB ஐ emerge செய்யக் கூடுதல் உள்ளமைவுகள் எதுவும் தேவையில்லை:

root #emerge --ask --verbose sys-boot/grub:2

UEFI பயனர்களுக்கான குறிப்பு: மேலுள்ள கட்டளையை இயக்குவது செயல்படுத்தப்பட்டுள்ள GRUB_PLATFORMS மதிப்புகளை emerge செய்வதற்கு முன் வெளியிடும். UEFI திறனுடைய முறைமைகளைப் பயன்படுத்தும்போது, GRUB_PLATFORMS="efi-64" என்பது செயல்படுத்தப்பட்டுள்ளதைப் பயனர்கள் உறுதிசெய்ய வேண்டும். அவ்வாறு இல்லையென்றால், GRUB2 வை emerge செய்வதற்கு முன் /etc/portage/make.conf கோப்பில் GRUB_PLATFORMS="efi-64" என்பதைச் சேர்க்க வேண்டும். இதன்மூலம் தொகுப்பு EFI செயல்பாட்டுடன் உருவாக்கப்படும்.

root #echo 'GRUB_PLATFORMS="efi-64"' >> /etc/portage/make.conf
root #emerge --ask sys-boot/grub:2

If GRUB was somehow emerged without enabling GRUB_PLATFORMS="efi-64", the line (as shown above) can be added to make.conf and then dependencies for the world package set can be re-calculated by passing the --update --newuse options to emerge:

root #emerge --ask --update --newuse --verbose sys-boot/grub:2

GRUB2 மென்பொருள் முறைமையோடு ஒன்றாக்கப்பட்டுள்ளது, ஆனால் இன்னும் நிறுவப்படவில்லை.

நிறுவுதல்

அடுத்து, grub-install கட்டளையின் மூலம் தேவையான GRUB2 கோப்புகளை /boot/grub/ அடைவில் நிறுவவும். முதல் வட்டு (முறைமை துவங்கும் இடம்) /dev/sda என்னும் கருதலில், பின்வரும் கட்டளைகளுள் ஒன்று இதைச் செய்யும்:

  • BIOS ஐ பயன்படுத்தும்போது:
root #grub-install /dev/sda

For DOS/Legacy BIOS systems:

root #grub-install /dev/sda
  • UEFI ஐ பயன்படுத்தும்போது:
முக்கியமானது
grub-install ஐ இயக்குவதற்கு முன் EFI முறைமை பகிர்வு ஏற்றப்பட்டுள்ளதா என்பதை உறுதிசெய்து கொள்ளவும். ஏனென்றால் grub-install ஆனது GRUB EFI கோப்பை (grubx64.efi) எந்தவொரு அடையாளத்தையும் காட்டாமல் தவறான அடைவில் நிறுவி விட வாய்ப்புள்ளது.

For UEFI systems:

root #grub-install --target=x86_64-efi --efi-directory=/boot

Upon successful installation, the output should match the output of the previous command. If the output does not match exactly, then proceed to Debugging GRUB, otherwise jump to the Configure step.

Optional: Secure Boot

To successfully boot with secure boot enabled the signing certificate must either be accepted by the UEFI firmware, or shim must be used as a pre-loader. Shim is pre-signed with the third-party Microsoft Certificate, accepted by default by most UEFI motherboards.

How to configure the UEFI firmware to accept custom keys depends on the firmware vendor, which is beyond the scope of the handbook. Below is shown how to setup shim instead. Here it is assumed that the user has already followed the instructions in the previous sections to generate a signing key and to configure portage to use it. If this is not the case please return first to the Kernel installation section.

The package sys-boot/grub installs a prebuilt and signed stand-alone EFI executable if the secureboot USE flag is enabled. Install the required packages and copy the stand-alone grub, Shim, and the MokManager to the same directory on the EFI System Partition. For example:

root #emerge sys-boot/grub sys-boot/shim sys-boot/mokutil sys-boot/efibootmgr
root #cp /usr/share/shim/BOOTX64.EFI /efi/EFI/Gentoo/shimx64.efi
root #cp /usr/share/shim/mmx64.efi /efi/EFI/Gentoo/mmx64.efi
root #cp /usr/lib/grub/grub-x86_64.efi.signed /efi/EFI/Gentoo/grubx64.efi

Next register the signing key in shims MOKlist, this requires keys in the DER format, whereas sbsign and the kernel build system expect keys in the PEM format. In the previous sections of the handbook an example was shown to generate such a signing PEM key, this key must now be converted to the DER format:

root #openssl x509 -in /path/to/kernel_key.pem -inform PEM -out /path/to/kernel_key.der -outform DER
குறிப்பு
The path used here must be the path to the pem file containing the certificate belonging to the generated key. In this example both key and certificate are in the same pem file.

Then the converted certificate can be imported into Shims MOKlist, this command will ask to set some password for the import request:

root #mokutil --import /path/to/kernel_key.der
குறிப்பு
When the currently booted kernel already trusts the certificate being imported, the message "Already in kernel trusted keyring." will be returned here. If this happens, re-run the above command with the argument --ignore-keyring added.

Next, register Shim with the UEFI firmware. In the following command, boot-disk and boot-partition-id must be replaced with the disk and partition identifier of the EFI system partition:

root #efibootmgr --create --disk /dev/boot-disk --part boot-partition-id --loader '\EFI\Gentoo\shimx64.efi' --label 'GRUB via Shim' --unicode

Note that this prebuilt and signed stand-alone version of grub reads the grub.cfg from a different location then usual. Instead of the default /boot/grub/grub.cfg the config file should be in the same directory that the grub EFI executable is in, e.g. /efi/EFI/Gentoo/grub.cfg. When sys-kernel/installkernel is used to install the kernel and update the grub configuration then the GRUB_CFG environment variable may be used to override the usual location of the grub config file.

For example:

root #grub-mkconfig -o /efi/EFI/Gentoo/grub.cfg

Or, via installkernel:

கோப்பு /etc/env.d/99grub
GRUB_CFG=/efi/EFI/Gentoo/grub.cfg
root #env-update
குறிப்பு
The import process will not be completed until the system is rebooted. After completing all steps in the handbook, restart the system and Shim will load, it will find the import request registered by mokutil. The MokManager application will start and ask for the password that was set when creating the import request. Follow the on-screen instructions to complete the import of the certificate, then reboot the system into the UEFI menu and enable the Secure Boot setting.
Debugging GRUB

When debugging GRUB, there are a couple of quick fixes that may result in a bootable installation without having to reboot to a new live image environment.

In the event that "EFI variables are not supported on this system" is displayed somewhere in the output, it is likely the live image was not booted in EFI mode and is presently in Legacy BIOS boot mode. The solution is to try the removable GRUB step mentioned below. This will overwrite the executable EFI file located at /EFI/BOOT/BOOTX64.EFI. Upon rebooting in EFI mode, the motherboard firmware may execute this default boot entry and execute GRUB.

முக்கியமானது
grub-install ஆனது Could not prepare Boot variable: Read-only file system போன்ற பிழைகளை அளித்தால், வெற்றி அடைவதற்கு, efivars சிறப்பு ஏற்றத்தைப் படிக்க-எழுதக் கூடியதாக மறு ஏற்றம் செய்ய வேண்டிய தேவை ஏற்படலாம்.
root #mount -o remount,rw /sys/firmware/efi/efivars
root #mount -o remount,rw,nosuid,nodev,noexec --types efivarfs efivarfs /sys/firmware/efi/efivars

This is caused by certain non-official Gentoo environments not mounting the special EFI filesystem by default. If the previous command does not run, then reboot using an official Gentoo live image environment in EFI mode.

Some motherboard manufacturers with poor UEFI implementations seem to only support the /EFI/BOOT directory location for the .EFI file in the EFI System Partition (ESP). The GRUB installer can create the .EFI file in this location automatically by appending the --removable option to the install command. Ensure the ESP has been mounted before running the following command; presuming it is mounted at /efi (as defined earlier), run:

root #grub-install --target=x86_64-efi --efi-directory=/boot --removable

இது UEFI தனிக்குறிப்பீட்டால் வரையறுக்கப்பட்ட முன்னிருப்பு அடைவை உருவாக்கி, பின் அதில் உள்ள 'முன்னிருப்பு' EFI கோப்பு இருப்பிடத்தில் grubx64.efi கோப்பை நகலெடுத்து வைக்கும்.

உள்ளமைத்தல்

அடுத்து, /etc/default/grub கோப்பு மற்றும் /etc/grub.d குறுநிரல்களில் குறிப்பிட்டுள்ள பயனர் உள்ளமைவுகளின் அடிப்படையில் GRUB2 உள்ளமைவை உருவாக்கவும். பெரும்பாலான வழக்கில், எந்த கருநிரலை துவக்க வேண்டும் (/boot/ இல் கிடைக்கக்கூடிய மிக உயர்ந்த ஒன்று) மற்றும் என்ன வேர் கோப்பு முறைமை என்பதைத் தானியக்கமாக GRUB2 ஆனது கண்டறியும் என்பதால் பயனர் அளிக்கக்கூடிய உள்ளமைவுகள் எதுவும் தேவைப்படாது. GRUB_CMDLINE_LINUX மாறியைப் பயன்படுத்தி /etc/default/grub இல் கருநிரல் அளவுருக்களை பின்னொட்டு செய்ய இயலும்.

இறுதி GRUB2 உள்ளமைவை உருவாக்க, grub-mkconfig கட்டளையை இயக்கவும்:

root #grub-mkconfig -o /boot/grub/grub.cfg
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-6.6.21-gentoo
Found initrd image: /boot/initramfs-genkernel-amd64-6.6.21-gentoo
done

The output of the command must mention that at least one Linux image is found, as those are needed to boot the system. If an initramfs is used or genkernel was used to build the kernel, the correct initrd image should be detected as well. If this is not the case, go to /boot/ and check the contents using the ls command. If the files are indeed missing, go back to the kernel configuration and installation instructions.

துணுக்கு
இணைக்கப்பட்டுள்ள இயக்ககத்தில் உள்ள மற்ற இயக்குதளங்களைக் கண்டறிய GRUB2 உடன் os-prober பயன்கூறு நிரலைப் பயன்படுத்திக் கொள்ளலாம். இது Windows 7, 8.1, 10 மற்றும் இதர லினக்ஸ் வழங்கல்களைக் கண்டறியும். இரு துவக்க முறைமையாகப் பயன்படுத்த விரும்புவோர், sys-boot/os-prober தொகுப்பை நிறுவி பின் grub-mkconfig கட்டளையை (மேலே உள்ளது போல்) மறு-இயக்கவும். இதில் எதாவது இடர்ப்பாடு ஏற்பட்டால், ஜென்டூ சமூகக்குழுவிடம் உதவி கேட்பதற்கு முன் GRUB2 கட்டுரையை முழுவதுமாக படித்து பொருள் உணர்ந்திருப்பதை உறுதிசெய்து கொள்ளவும்.

Alternative 1: systemd-boot

Another option is systemd-boot, which works on both OpenRC and systemd machines. It is a thin chainloader and works well with secure boot.

Emerge

To install systemd-boot, enable the boot USE flag and re-install sys-apps/systemd (for systemd systems) or sys-apps/systemd-utils (for OpenRC systems):

கோப்பு /etc/portage/package.use/systemd-boot
sys-apps/systemd boot
sys-apps/systemd-utils boot
root #emerge --ask sys-apps/systemd

Or

root #emerge --ask sys-apps/systemd-utils

Installation

Now, install the systemd-boot loader to the EFI System Partition:

root #bootctl install
முக்கியமானது
Make sure the EFI system partition has been mounted before running bootctl install.

When using this bootloader, before rebooting, verify that a new bootable entry exists using:

root #bootctl list
எச்சரிக்கை
The kernel command line for new systemd-boot entries is read from /etc/kernel/cmdline or /usr/lib/kernel/cmdline. If neither file is present, then the kernel command line of the currently booted kernel is re-used (/proc/cmdline). On new installs it might therefore happen that the kernel command line of the live CD is accidentally used to boot the new kernel. The kernel command line for registered entries can be checked with:
root #bootctl list
If this does not show the desired kernel command line then create /etc/kernel/cmdline containing the correct kernel command line and re-install the kernel.

If no new entry exists, ensure the sys-kernel/installkernel package has been installed with the systemd and systemd-boot USE flags enabled, and re-run the kernel installation.

For the distribution kernels:

root #emerge --ask --config sys-kernel/gentoo-kernel

For a manually configured and compiled kernel:

root #make install
முக்கியமானது
When installing kernels for systemd-boot, no root= kernel command line argument is added by default. On systemd systems that are using an initramfs users may rely instead on systemd-gpt-auto-generator to automatically find the root partition at boot. Otherwise users should manually specify the location of the root partition by setting root= in /etc/kernel/cmdline as well as any other kernel command line arguments that should be used. And then reinstalling the kernel as described above.

Optional: Secure Boot

When the secureboot USE flag is enabled, the systemd-boot EFI executable will be signed by portage automatically. Furthermore, bootctl install will automatically install the signed version.

To successfully boot with secure boot enabled the used certificate must either be accepted by the UEFI firmware, or shim must be used as a pre-loader. Shim is pre-signed with the third-party Microsoft Certificate, accepted by default by most UEFI motherboards.

How to configure the UEFI firmware to accept custom keys depends on the firmware vendor, which is beyond the scope of the handbook. Below is shown how to setup shim instead. Here it is assumed that the user has already followed the instructions in the previous sections to generate a signing key and to configure portage to use it. If this is not the case please return first to the Kernel installation section.

root #emerge --ask sys-boot/shim sys-boot/mokutil sys-boot/efibootmgr
root #bootctl install --no-variables
root #cp /usr/share/shim/BOOTX64.EFI /efi/EFI/systemd/shimx64.efi
root #cp /usr/share/shim/mmx64.efi /efi/EFI/systemd/mmx64.efi

Shims MOKlist requires keys in the DER format, whereas sbsign and the kernel build system expect keys in the PEM format. In the previous sections of the handbook an example was shown to generate such a signing PEM key, this key must now be converted to the DER format:

root #openssl x509 -in /path/to/kernel_key.pem -inform PEM -out /path/to/kernel_key.der -outform DER
குறிப்பு
The path used here must be the path to the pem file containing the certificate belonging to the generated key. In this example both key and certificate are in the same pem file.

Then the converted certificate can be imported into Shims MOKlist:

root #mokutil --import /path/to/kernel_key.der
குறிப்பு
When the currently booted kernel already trusts the certificate being imported, the message "Already in kernel trusted keyring." will be returned here. If this happens, re-run the above command with the argument --ignore-keyring added.

And finally we register Shim with the UEFI firmware. In the following command, boot-disk and boot-partition-id must be replaced with the disk and partition identifier of the EFI system partition:

root #efibootmgr --create --disk /dev/boot-disk --part boot-partition-id --loader '\EFI\systemd\shimx64.efi' --label 'Systemd-boot via Shim' --unicode '\EFI\systemd\systemd-bootx64.efi'
குறிப்பு
The import process will not be completed until the system is rebooted. After completing all steps in the handbook, restart the system and Shim will load, it will find the import request registered by mokutil. The MokManager application will start and ask for the password that was set when creating the import request. Follow the on-screen instructions to complete the import of the certificate, then reboot the system into the UEFI menu and enable the Secure Boot setting.

மாற்றுவழி 2: efibootmgr

Computer systems with UEFI-based firmware technically do not need secondary bootloaders (e.g. GRUB) in order to boot kernels. Secondary bootloaders exist to extend the functionality of UEFI firmware during the boot process. Using GRUB (see the prior section) is typically easier and more robust because it offers a more flexible approach for quickly modifying kernel parameters at boot time.

System administrators who desire to take a minimalist, although more rigid, approach to booting the system can avoid secondary bootloaders and boot the Linux kernel as an EFI stub.

நினைவில் கொள்ளவும், sys-boot/efibootmgr செயலியானது துவக்க ஏற்றி இல்லை; இது UEFI திடப்பொருளுடன் ஊடாடி அதன் அமைப்புகளை இற்றைப்படுத்தும் ஒரு கருவியாகும், இதன் விளைவாக முன்னதாக நிறுவப்பட்ட லினக்ஸ் கருநிரல் கூடுதல் விருப்பத்தேர்வுகளுடன் (இன்றியமையாததாக இருந்தால்) துவக்க இயலும், அல்லது பல துவக்கப் பதிவுகளை அனுமதிக்கும். இந்த ஊடாடல் EFI மாறிகள் மூலம் நடக்கிறது (எனவே EFI மாறிகளின் கருநிரல் ஆதரவு தேவை).

Ensure the EFI stub kernel article has been reviewed before continuing. The kernel must have specific options enabled to be directly bootable by the UEFI firmware. It may be necessary to recompile the kernel in order to build-in this support.

It is also a good idea to take a look at the efibootmgr article for additional information.

குறிப்பு
To reiterate, efibootmgr is not a requirement to boot an UEFI system; it is merely necessary to add an entry for an EFI-stub kernel into the UEFI firmware. When built appropriately with EFI stub support, the Linux kernel itself can be booted directly. Additional kernel command-line options can be built-in to the Linux kernel (there is a kernel configuration option called CONFIG_CMDLINE. Similarly, support for initramfs can be 'built-in' to the kernel as well.

இந்த வழியைத் தேர்ந்தெடுக்க முடிவு செய்தவர்கள் இந்த மென்பொருளைக் கட்டாயம் நிறுவ வேண்டும்:

கோப்பு /etc/portage/package.accept_keywords/installkernel
sys-kernel/installkernel
sys-boot/uefi-mkconfig
app-emulation/virt-firmware
கோப்பு /etc/portage/package.use/installkernel
sys-kernel/installkernel efistub

Then reinstall installkernel, create the /efi/EFI/Gentoo directory and reinstall the kernel:

root #emerge --ask sys-kernel/installkernel
root #mkdir -p /efi/EFI/Gentoo

For distribution kernels:

root #emerge --ask --config sys-kernel/gentoo-kernel{,-bin}

For manually managed kernels:

root #make install

பிறகு, /boot/efi/boot/ இருப்பிடத்தை உருவாக்கி அதில் கர்னலை நகலெடுத்து வைக்கவும், இதை bzImage.efi என அழைக்கலாம்:

root #mkdir -p /boot/efi/boot
root #cp /boot/vmlinuz-* /boot/efi/boot/bzImage.efi

Install the efibootmgr package:

root #emerge --ask sys-boot/efibootmgr

அடுத்து, UEFI திடப்பொருளிடம் "Gentoo" என அழைக்கப்படும் துவக்கப் பதிவு உருவாக்கப்பட வேண்டும் எனக் கூறவும், இது புதிதாகத் தொகுக்கப்பட்ட EFI முளை கர்னலை கொண்டிருக்கும்:

root #efibootmgr --create --disk /dev/sda --part 2 --label "Gentoo" --loader "\efi\boot\bzImage.efi"
குறிப்பு
UEFI வரையறுத்தல்களைப் பயன்படுத்தும்போது, \ ஐ அடைவு பிரிப்பானாகப் பயன்படுத்துவது கட்டாயமாகும்.

தொடக்க RAM கோப்பு முறைமை (initramfs) பயன்படுத்தப்பட்டால், முறையான துவக்க விருப்பத்தேர்வுகளைச் சேர்க்கவும்:

root #efibootmgr -c -d /dev/sda -p 2 -L "Gentoo" -l "\efi\boot\bzImage.efi" initrd='\initramfs-genkernel-amd64-6.6.21-gentoo'
துணுக்கு
Additional kernel command line options may be parsed by the firmware to the kernel by specifying them along with the initrd=... option as shown above.

இந்த மாற்றங்கள் எல்லாம் முடிந்தவுடன், முறைமை மறு இயக்கம் செய்யும்போது, "Gentoo" என அழைக்கப்படும் துவக்கப் பதிவு கிடைக்கப்பெறும்.

Unified Kernel Image

If installkernel was configured to build and install unified kernel images. The unified kernel image should already be installed to the EFI/Linux directory on the EFI system partition, if this is not the case ensure the directory exists and then run the kernel installation again as described earlier in the handbook.

To add a direct boot entry for the installed unified kernel image:

root #efibootmgr --create --disk /dev/sda --part 1 --label "gentoo" --loader "\EFI\Linux\gentoo-x.y.z.efi"


Other Alternatives

For other options that are not covered in the Handbook, see the full list of available bootloaders.