• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/boot/grub2/Config.in
Gustavo ZacariasGustavo Zacarias committed 09a44ddd44728 Mar 2016
Raw file
Source viewDiff to previous
    default "boot linux ext2 fat squash4 part_msdos part_gpt normal biosdisk" if BR2_TARGET_GRUB2_I386_PC
 
1
config BR2_TARGET_GRUB2
2
    bool "grub2"
3
    depends on BR2_i386 || BR2_x86_64
4
    help
5
      GNU GRUB is a Multiboot boot loader. It was derived from
6
      GRUB, the GRand Unified Bootloader, which was originally
7
      designed and implemented by Erich Stefan Boleyn. GRUB 2 has
8
      replaced what was formerly known as GRUB (i.e. version
9
      0.9x), which has, in turn, become GRUB Legacy.
10
​
11
      Amongst others, GRUB2 offers EFI support, which GRUB Legacy
12
      doesn't provide.
13
​
14
      Notes on using Grub2 for BIOS-based platforms
15
      =============================================
16
​
17
      1. Create a disk image
18
         dd if=/dev/zero of=disk.img bs=1M count=32
19
      2. Partition it (either legacy or GPT style partitions work)
20
         cfdisk disk.img
21
          - Create one partition, type Linux, for the root
22
        filesystem. The only constraint is to make sure there
23
        is enough free space *before* the first partition to
24
        store Grub2. Leaving 1 MB of free space is safe.
25
      3. Setup loop device and loop partitions
26
         sudo losetup -f disk.img
27
         sudo partx -a /dev/loop0
28
      4. Prepare the root partition
29
         sudo mkfs.ext3 -L root /dev/loop0p1
30
         sudo mount /dev/loop0p1 /mnt
31
         sudo tar -C /mnt -xf output/images/rootfs.tar
32
         sudo umount /mnt
33
      5. Install Grub2
34
         sudo ./output/host/usr/sbin/grub-bios-setup \
35
            -b ./output/host/usr/lib/grub/i386-pc/boot.img \
36
            -c ./output/images/grub.img -d . /dev/loop0
37
      6. Cleanup loop device
38
         sudo partx -d /dev/loop0
39
         sudo losetup -d /dev/loop0
40
      7. Your disk.img is ready!
41
​
42
      Using genimage
43
      --------------
44
​
45
      If you use genimage to generate your complete image,
46
      installing Grub can be tricky. Here is how to achieve Grub's
47
      installation with genimage:
48
​
49
      partition boot {
50
          in-partition-table = "no"
51
          image = "path_to_boot.img"
52
          offset = 0
53
          size = 512
54
      }
55
      partition grub {
56
          in-partition-table = "no"
57
          image = "path_to_grub.img"
58
          offset = 512
59
      }
60
​
61
      The result is not byte to byte identical to what
62
      grub-bios-setup does but it works anyway.
63
​
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.