Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/, sys-boot/grub/files/
Date: Wed, 05 Oct 2016 14:22:50
Message-Id: 1475677364.ec629c23a6e8cf6c18fa51d69ae11932c7ada3cc.floppym@gentoo
1 commit: ec629c23a6e8cf6c18fa51d69ae11932c7ada3cc
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Wed Oct 5 14:16:20 2016 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Wed Oct 5 14:22:44 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ec629c23
7
8 sys-boot/grub: Install an example grub.cfg
9
10 Package-Manager: portage-2.3.1_p6
11
12 sys-boot/grub/files/grub.cfg.example | 90 +++++++++++++++++++++++++++++++++
13 sys-boot/grub/grub-2.02_beta3-r1.ebuild | 5 ++
14 2 files changed, 95 insertions(+)
15
16 diff --git a/sys-boot/grub/files/grub.cfg.example b/sys-boot/grub/files/grub.cfg.example
17 new file mode 100644
18 index 00000000..4c6e464
19 --- /dev/null
20 +++ b/sys-boot/grub/files/grub.cfg.example
21 @@ -0,0 +1,90 @@
22 +# Example configuration for GRUB
23 +# Much of this example configuration was taken from the GRUB manual.
24 +
25 +# Menu timeout
26 +timeout=5
27 +
28 +# Default menu entry
29 +default=0
30 +
31 +# If we have a font available, start graphical output.
32 +if loadfont unifont; then
33 + # Output resolution for GRUB (eg. 1024x768 or 'auto').
34 + gfxmode=auto
35 +
36 + # Output resolution for Linux (VESAFB only).
37 + # 'keep' means use the same resolution as GRUB.
38 + # For other framebuffer drivers, pass a resolution using the video= kernel param.
39 + gfxpayload=keep
40 +
41 + # Load all video drivers.
42 + insmod all_video
43 +
44 + # Switch to graphical output.
45 + terminal_output gfxterm
46 +fi
47 +
48 +# Load modules necessary to find any boot files (/boot).
49 +
50 +# Partition table(s).
51 +insmod part_msdos
52 +#insmod part_gpt
53 +
54 +menuentry "Gentoo Linux 4.7.2" {
55 + # Filesystem for /boot
56 + #insmod btrfs
57 + insmod ext2
58 + #insmod xfs
59 + #inmod zfs
60 +
61 + # Search all block devices for a matching UUID (for /boot)
62 + search --set=root --fs-uuid 33d4013a-ec25-4462-a540-8078aeb8ed17
63 +
64 + # Load a linux kernel, passing the root filesystem and init process as parameters
65 + echo "Loading kernel..."
66 + linux /vmlinuz-4.7.2 root=UUID=e1fce3ad-d7e4-4e2f-a1f5-537642bbccd5 rootfstype=btrfs init=/usr/lib/systemd/systemd
67 +
68 + echo "Loading initramfs..."
69 + initrd /initramfs-4.7.2.img
70 +}
71 +
72 +menuentry "Windows XP" {
73 + insmod ntfs
74 + search --set=root --label WINDOWS_XP --hint hd0,msdos1
75 + ntldr /ntldr
76 +}
77 +
78 +menuentry "Windows 7" {
79 + insmod ntfs
80 + search --set=root --label WINDOWS_7 --hint hd0,msdos2
81 + ntldr /bootmgr
82 +}
83 +
84 +menuentry "FreeBSD" {
85 + insmod zfs
86 + search --set=root --label freepool --hint hd0,msdos7
87 + kfreebsd /freebsd@/boot/kernel/kernel
88 + kfreebsd_module_elf /freebsd@/boot/kernel/opensolaris.ko
89 + kfreebsd_module_elf /freebsd@/boot/kernel/zfs.ko
90 + kfreebsd_module /freebsd@/boot/zfs/zpool.cache type=/boot/zfs/zpool.cache
91 + set kFreeBSD.vfs.root.mountfrom=zfs:freepool/freebsd
92 + set kFreeBSD.hw.psm.synaptics_support=1
93 +}
94 +
95 +menuentry "Fedora 16 installer" {
96 + search --set=root --label GRUB --hint hd0,msdos5
97 + linux /fedora/vmlinuz lang=en_US keymap=sg resolution=1280x800
98 + initrd /fedora/initrd.img
99 +}
100 +
101 +menuentry "Fedora rawhide installer" {
102 + search --set=root --label GRUB --hint hd0,msdos5
103 + linux /fedora/vmlinuz repo=ftp://mirror.switch.ch/mirror/fedora/linux/development/rawhide/x86_64 lang=en_US keymap=sg resolution=1280x800
104 + initrd /fedora/initrd.img
105 +}
106 +
107 +menuentry "Debian sid installer" {
108 + search --set=root --label GRUB --hint hd0,msdos5
109 + linux /debian/dists/sid/main/installer-amd64/current/images/hd-media/vmlinuz
110 + initrd /debian/dists/sid/main/installer-amd64/current/images/hd-media/initrd.gz
111 +}
112
113 diff --git a/sys-boot/grub/grub-2.02_beta3-r1.ebuild b/sys-boot/grub/grub-2.02_beta3-r1.ebuild
114 index f54eadb..45fcb98 100644
115 --- a/sys-boot/grub/grub-2.02_beta3-r1.ebuild
116 +++ b/sys-boot/grub/grub-2.02_beta3-r1.ebuild
117 @@ -264,6 +264,8 @@ src_install() {
118
119 einstalldocs
120
121 + dodoc "${FILESDIR}/grub.cfg.example"
122 +
123 if use multislot; then
124 mv "${ED%/}"/usr/share/info/grub{,2}.info || die
125 fi
126 @@ -275,8 +277,11 @@ src_install() {
127 pkg_postinst() {
128 elog "For information on how to configure GRUB2 please refer to the guide:"
129 elog " https://wiki.gentoo.org/wiki/GRUB2_Quick_Start"
130 + elog
131 + elog "For manual configuration, see /usr/share/doc/${PF}/grub.cfg.example"
132
133 if has_version 'sys-boot/grub:0'; then
134 + elog
135 elog "A migration guide for GRUB Legacy users is available:"
136 elog " https://wiki.gentoo.org/wiki/GRUB2_Migration"
137 fi