Ubuntu11.10 GRUB21.99 compilation and Installation notes

Source: Internet
Author: User
The following installation notes are all prepared by QLi when I learned grub2 by myself. I am a newbie. If there is any error, please help me not to mention it. Latest grubV1.99 official http://grub.enbug.org ================================================== ======================================== install Grub21.99: http: // www

The following installation notes are all prepared by QLi when I learned grub2 by myself. I am a newbie. If there is any error, please help me not to mention it.

Latest grub V1.99 official http://grub.enbug.org
========================================================== ======================================
Install Grub2 1.99

:
Http://www.gnu.org/software/grub/grub-2-download.en.html

Software to be installed in advance

Notepad2 // Replace the notebook in Windows to edit the grub. cfg file
M4_1.4.16-1_i386.deb
Bison_1 % 3a2. 4.1.dfsg-3_i386.deb
Flex_2.5.35-10Ubuntu1_i386.deb
Grub-1.99.tar.gz

A freetype2 library file is missing, which is used to generate Chinese font software.

Install

The installation environment is carried out in ubuntu 11.10. You can also run # apt-get install grub2 directly for installation. 11.04 has not been tried. 10.10 is not updated. You can change it, but there is exactly 11.10, the latest version is ubuntu 11.10 beta2.
# Dpkg-I m4_1.4.16-1_i386.deb // The Relationship Between the next two software must be installed in advance

// If not, use # apt-get install m4

Selecting previusly deselected package m4.
(Reading database... 127227 files and directories currently installed .)
Unpacking m4 (from m4_1.4.16-1_i386.deb )...
Setting up m4 (1.4.16-1 )...
Processing triggers for install-info...
Processing triggers for man-db...

# Dpkg-I bison_1 % 3a2. 4.1.dfsg-3_i386.deb // required

// If not, use # apt-get install bison

Selecting previusly deselected package bison.
(Reading database... 127287 files and directories currently installed .)
Unpacking bison (from bison_1 % 3a2. 4.1.dfsg-3_i386.deb )...
Setting up bison (. 4.1.dfsg-3 )...
Update-alternatives: using/usr/bin/bison. yacc to provide/usr/bin/yacc (yacc) in auto mode.
Processing triggers for man-db...

# Dpkg-I flex_2.5.35-10ubuntu1_i386.deb // required component

If not, use # apt-get install flex.

Selecting previusly deselected package flex.
(Reading database... 127325 files and directories currently installed .)
Unpacking flex (from flex_2.5.35-10ubuntu1_i386.deb )...
Setting up flex (2.5.35-10ubuntu1 )...
Processing triggers for install-info...
Processing triggers for man-db...

# Tar-xvf grub-1.99.tar.gz // decompress grub2 to a directory
# Cd grub-1.99 // enter the Directory

Compile:
# Terminal // ubuntu 11.10 has no menu. Enter terminal in the first icon to open the command line.
#./Configure
Bash:./autogen. sh: the reason for insufficient permissions is that it is performed in Windows. Copy files to the Linux directory

After reading the final instructions, I have to create a font generation software for the freetype2 Library (the stuff created by the grub2 Chinese font library). I am not looking for a font prepared by others. I have not found it yet.
# Make
# Make install


# Fdisk-l // view the disk or disk partition
# Mount/media/uu/dev/sdb1 // before starting the USB flash drive, you must first mount it. After you insert a USB flash disk into Ubuntu 11.10, it will be displayed directly, but it is not mounted, you can click the USB flash drive with the mouse to display the file.
++ ++
Format a USB flash drive as an example:
# Sudo umount/dev/sda1 // You must uninstall the partition first.

Format as a FAT partition
# Sudo mkfs. vfat-F 32/dev/sdb1 //-F parameters must be capitalized. The parameters include and 32, which correspond to FAT12, FAT16, and FAT32 respectively.
++ ++

Disk/dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1*512 = 512 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0xb532b532

Device Boot Start End Blocks Id System
/Dev/sda1*63 61432559 30716248 + 7 HPFS/NTFS/exFAT
/Dev/sda2 61432560 488215349 213391395 f W95 Ext 'd (LBA)
/Dev/sda5 61432623 102398309 20482843 + 7 HPFS/NTFS/exFAT
/Dev/sda6 102398373 163830869 30716248 + 7 HPFS/NTFS/exFAT
/Dev/sda7 163830933 488215349 162192208 + 7 HPFS/NTFS/exFAT

Disk/dev/sdb: 8005 MB, 8005787648 bytes
255 heads, 63 sectors/track, 973 cylinders, total 15636304 sectors
Units = sectors of 1*512 = 512 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0x00432a3c

Device Boot Start End Blocks Id System
/Dev/sdb1 63 15636303 7818120 + B W95 FAT32

The USB flash disk is in sdb1, And the 1.1 must be determined.

# Grub-install -- root-directory =/media/24f2-rjf // dev/sdb // install the boot file MBR for the USB flash drive

Note:/media/24f2-0000f/After a general USB flash disk is mounted, It will be placed in the root directory/media In ubuntu. The following digits are the USB flash drive letters,

/Dev/sdb is a USB flash disk physical device sdb is the entire disk sdb1 is the disk partition, "My understanding"

Installation finished. No error reported.

# Grub-install -- root-directory =/media/24f2-0000f // dev/sdb1 // copy the file to the USB flash driveNote: "1" is added later"

/Usr/local/sbin/grub-setup: warn: Attempting to install GRUB to a partitionless disk or to a partition. This is a BAD idea ..
/Usr/local/sbin/grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. however, blocklists are UNRELIABLE and their use is discouraged ..
/Usr/local/sbin/grub-setup: error: will not proceed with blocklists.

========================================================== ====================================

Grub-install is a script that completes the following tasks:
* Call grub-mkdevicemap to create the device image file/boot/grub/device. map
* Copy *. mod *. lst *. img file to/boot/grub/
* Call grub-probe to automatically detect File System Types
* Call grub-mkimage to generate grub2 Kernel File/boot/grub/core. img
* Call grub-setup to Install Boot records to mbr or partition


The installation is complete.
++ ++
Create a text file grub. cfg in the/mnt/boot/grub/directory.

# Vi grub. cfg // you can leave nothing to write

PressEscPress":"PressQwSave the letter and exit

# Cp grub. cfg/media/24f2-0000f/boot/grub // copy the grub. cfg file to the grub directory under the USB flash drive boot folder. You can use Notepad2 to edit it in windows.

Copy unicode. pf2 to the/mnt/boot/grub/directory from the font file to/usr/share/grub/on the hard disk. The directory may be incorrect.

You can use

# Cd // return to the root directory

# Find-name unicode. pf2 // find unicode. pf2English fontIn that directory, copy the file to the grub directory under the U disk boot using cp.

 

Grub2 1.99 menu Configuration

Create grub menu: copy the following plus sign to grub. cfg.
++ ++

#
# Sample GRUB configuration file
# Set the grub. cfg Startup Menu
#
#===================================================== ====================================== #
# Start extension time, in seconds"
Set timeout = 30

# Start sequence. The default value is "0"
Set default = 1

# Return to the second Fallback to the second entry from the menu.
Set fallback = 1
#===================================================== ====================================== #
# Load the fat module. If your USB flash drive is in another format, replace it accordingly, such as insmod ntfs.
Insmod fat
# Insmod ntfs
#
# Add jpeg support. To use a png or tga file as the background, add insmod png or insmod tga.
# Insmod jpeg
Insmod png
# Insmod tga
#
# Loading the vbe module is not very clear
Insmod vbe
#
# This sentence is not cleared. No relevant information is found online, and insurance is added.
# Set gfxpayload = keep
#
# Enabling the gfxterm module depends on the gfxterm module.
Insmod gfxterm
#
Insmod font
# Insmod video
#
#===================================================== ====================================== #
# Set the terminal font to unicode. pf2
Loadfont/boot/kernel/font/unicode. pf2
# Set the terminal font to Chinese
# Loadfont/boot/kernel/font/msyh16b. pf2
#
# Set resolution \ 1024x768 \ 800x600 \ 640xlarge \
# Set gfxmode = 1024x768
# Set gfxmode = 800x600
Set gfxmode = 640x480
#
# Set the terminal to the gfxterm mode, that is, to make the above resolution take effect, you can only put it under the resolution.
# Reduce text.
Terminal_output gfxterm
# Terminal_output console
#
# Setting background images
Background_image (hd0, 1)/boot/kernel/background/bj.png
#===================================================== ====================================== #
# Font color of unselected items in the menu (font color/full background color)
# Black (transparent, different from white ),
# Dark-gray, light-gray, white, brown, yellow, red, light-red, blue, light-blue, green, light-green, cyan, light-cyan, magenta, light-magenta.
#
# Background color. If an image is displayed, It is not displayed. If the image is black, it is transparent.
Set color_normal = black/black
Set color_highlight = magenta/black
# The font color of the selected item, which is transparent when the black image is available.
Set menu_color_normal = cyan/black
Set menu_color_highlight = black/black
#===================================================== ====================================== #
# Change the colors. You can Change the background color if you cannot see it clearly.
Menuentry "Change the colors "{
Set menu_color_normal = light-green/brown
Set menu_color_highlight = red/blue
}
#===================================================== ====================================== #
# For booting Microsoft Windows
Menuentry "log on to Microsoft Windows1 "{
Set root = (hd0, 1)
Drivemap-s (hd0) $ {root}
Chainloader + 1
}
# For booting Microsoft Windows
Menuentry "log on to Microsoft Windows2 "{
Insmod fat
Insmod ntfs
Set root = (hd1, 1)
Drivemap-s (hd1) $ {root}
Chainloader + 1
}
# For booting Microsoft Windows
Menuentry "log on to Microsoft Windows3 "{
Set root = (hd2, 1)
Drivemap-s (hd2) $ {root}
Chainloader + 1
}
#===================================================== ====================================== #
# For booting Memtest86 + Memory Detection
# Menuentry "Memtest86 + "{
# Set root = (hd0, 1)
# Linux16/boot/kernel/mt86plus
#}
#===================================================== ====================================== #
# Ubuntu 11.10 DVD iso file, which starts from a USB flash drive, requires two folders: initrd. lz & vmlinuz in the disc [. disk] and [casper ].In the root directory
Menuentry "Ubuntu 11.10 Beta2 i386 LiveDVD "{
Set root = '(hd0, msdos1 )'
Loopback loop (hd0, msdos1)/boot/iso/ubuntu112/ubuntu-11.10-beta2-dvd-i386.iso
Linux (loop)/casper/vmlinuz boot = casper iso-scan/filename =/boot/iso/ubuntu112/ubuntu-11.10-beta2-dvd-i386.iso ro quiet splash locale = zh_CN.UTF-8
Initrd (loop)/casper/initrd. lz
Boot
}
#===================================================== ====================================== #
# The minimal version of CDLinux mini 0.9.6.1, with the command line. The bzlmage and initrd can be found on the disc.
Menuentry "CDLinux MINI 0.9.6.1 "{
Linux/boot/iso/cdlinux/bzImage root =/dev/ram0 vga = 791 CDL_LANG = zh_CN.UTF-8
Initrd/boot/iso/cdlinux/initrd
}
#===================================================== ====================================== #
# Linux kernel Linux cannot be started because it is not supported by the CD
Menuentry "NetbootCD-4.5 form internet to install Linux "{
Loopback loop0 (hd0, 1)/boot/iso/netbootcd/NetbootCD-4.5.iso
Set root = (loop0)
Chainloader + 1
Boot
}

# Pilot freedos to install the CD, only one of the virtual machine can run, to the dos interface, only used for testing

Menuentry "freedos "{
Linux16/boot/iso/freedos/memdisk
Initrd16/boot/iso/freedos/fdboot. img
}
#===================================================== ====================================== #
# The PE optical disc iso file is started from the USB flash drive. Now grub2 seems to have poor support for Win CDs. It is executed through the grub4dos curve. This is the menu command for executing 4dos.
# Menuentry "grub Win7 PE 6 "{
# Linux/boot/G4dos/grub1.exe
#}
#===================================================== ====================================== #
# Boot disc file, which is not supported by the Windows system installation disc. This is the boot menu for guiding General iso files
# Menuentry "Boot ISO disc "{
# Loopback loop0 (hd0, 1)/boot/pe/Win7_PE_6.ISO
# Set root = (loop0)
# Chainloader + 1
# Boot
#}
#===================================================== ====================================== #
# Mount the "non-standard" floppy disk image 1.44 and 2.88 software memdisk under Baidu, the following parameters can be seen through the software GDPARAM
Menuentry "DOS tools "{
Linux16/boot/kernel/memdisk c = 99 h = 4 s = 36 floppy
Initrd16/boot/img/DADIDos. IMA
}
#===================================================== ====================================== #
# Mount "standard" Floppy Disk Images 1.44 and 2.88
Menuentry "Win98 DOS emergency drive "{
Linux16/boot/kernel/memdisk
Initrd16/boot/img/98dosboot. IMG
}
#===================================================== ====================================== #
# Restarting a computer
Menuentry "restart-restart "{
Reboot
}
#===================================================== ====================================== #
# Shut down the computer
Menuentry "shutdown-shutdown "{
Halt
}
#===================================================== ====================================== #
# For other non-standard image attaching methods of 1.4M and 2.8M, you must specify the CHS parameter:
# Menuentry "NO Boot from IMG "{
# Linux16/memdisk c = * h = * s = * floppy
# Initrd16/xxx. img
#}
#===================================================== ====================================== #
# Linux
# Menuentry "Ubuntu 11.10-beta1-desktop "{
# Loopback loop (hd0, 3)/ubuntu. iso
# This statement uses the Playback Technology of grub2 to project the file content of ubuntu. iso to the loop. When using this command,
# You have to consider that your memory is large enough.
#
# Linux (loop)/casper/vmlinuz boot = casper iso-scan/filename =/ubuntu. iso
# This statement is used to load the kernel, where (loop) uses the device projected in the previous sentence and accesses the content of the ubuntu. iso file.
# Among them, boot = casper is to use casper to start a pre-installed live System in the iso file.
# Here, http://packages.ubuntu.com/natty/casperyou can see the basic introduction of the tutorial,
# You can also install one in your system. Use man casper to check its basic usage.
#
# The iso-scan/filename =/ubuntu. iso file uses iso-scan to locate your ubuntu. iso file.
# And mount the found iso file to the optical drive device (here, it is integrated with the find command, but more powerful)/cdrom
# Http://packages.ubuntu.com/natty/iso-scan
#
# Initrid (loop)/casper/initrid. lz
# Initrid. lz is an image file, which stores important files to be loaded by the kernel.
#
# Boot
#}
#===================================================== ====================================== #

++ ++

========================================================== ======================================
Remaining Issues

1. If you don't have any Chinese font, come back to the next database and try to tidy up your files. Or if any of your colleagues have prepared their own files, you can talk about them.

2. PE cannot be directly guided. There are many things to talk about and some ideas about it. If you have time, you can talk with your colleagues.

3. You cannot Boot Windows 7, Windows XP, and other installation disks. Currently, no learning materials are available on the Internet, and grub2 does not seem to be supported.

4. I found a mini version of CDlinux. I was not satisfied with the command line.

5. You can also modify the PE dostoolbox in the dostoolbox. It's a bit of a problem. Which of my colleagues is expected to have a copy of the software that allows me to drag and drop files under Dos.

6 grub2 has been applied in the network, and it has not been reached yet, but I have read this post.

7. Can I modify the boot file of the CD System in grub2? It's not enough now. Let's take a look.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.