Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How linux compiles grub2

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is to share with you about how linux compiles grub2, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

First, go to the official website to download the source package.

Https://ftp.gnu.org/gnu/grub/

Select grub2-2.04.tar.gz and click the link to download

Decompress to / usr/src directory, cd to grub-2.04

Compile 64-bit platform

Run. / configure-prefix=/usr-with-platform=x86_64-efi

Note: if you do not take the-- prefix parameter, it will be installed under / usr/local/lib/grub by default, and / usr/lib/grub will be installed using the-- prefix=/usr parameter.

Then, run

Make & & make install

Will generate a x86_64-efi folder as shown in the figure

If you continue to compile the 32-bit platform

Run under / usr/src/grub-2.04 first

Make clean all

Run. / configure-prefix=/usr-with-platform=i386-pc

Then, run

Make & & make install

Will generate an i386-pc folder as shown in the figure

Then, run the following command to install grub2 to the hard drive

Grub-install / dev/sda

Where sda is the hard disk on which you want to install grub2

The default is to install 64-bit platform

If you want to install 32 as the platform, you need to add parameters

Grub-install-target=i386-pc / dev/sda

This is how linux compiles grub2. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report