diff options
author | Tom Zanussi <tom.zanussi@intel.com> | 2011-09-14 13:01:55 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-09-15 11:23:58 +0100 |
commit | bcd1bca88052bfab4aaca74608134f4c8ff797de (patch) | |
tree | 8b2a81c023f503811b9595816bea9515cf0a30e5 /meta | |
parent | 978f48b7e2654ac161d548811f3c023af4f04c62 (diff) | |
download | poky-bcd1bca88052bfab4aaca74608134f4c8ff797de.tar.gz |
initramfs-live-install: add support for grub2
grub2 needs a different set of install steps from grub 0.97. This
adds them to init-install.sh and adds an install-time check that
determines which version is being used and which steps to use
depending on the version of grub selected.
(From OE-Core rev: c67d03eb3684acab89e5972609e397087727e74e)
Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-core/initrdscripts/files/init-install.sh | 31 | ||||
-rw-r--r-- | meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb | 8 |
2 files changed, 28 insertions, 11 deletions
diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh b/meta/recipes-core/initrdscripts/files/init-install.sh index 5e6b81c9d3..fb6cea8d31 100644 --- a/meta/recipes-core/initrdscripts/files/init-install.sh +++ b/meta/recipes-core/initrdscripts/files/init-install.sh | |||
@@ -1,6 +1,6 @@ | |||
1 | #!/bin/sh -e | 1 | #!/bin/sh -e |
2 | # | 2 | # |
3 | # Copyright (C) 2008 Intel | 3 | # Copyright (C) 2008-2011 Intel |
4 | # | 4 | # |
5 | # install.sh [device_name] [rootfs_name] [video_mode] [vga_mode] | 5 | # install.sh [device_name] [rootfs_name] [video_mode] [vga_mode] |
6 | # | 6 | # |
@@ -126,6 +126,7 @@ mkswap $swap | |||
126 | 126 | ||
127 | mkdir /ssd | 127 | mkdir /ssd |
128 | mkdir /rootmnt | 128 | mkdir /rootmnt |
129 | mkdir /bootmnt | ||
129 | 130 | ||
130 | mount $rootfs /ssd | 131 | mount $rootfs /ssd |
131 | mount -o rw,loop,noatime,nodiratime /media/$1/$2 /rootmnt | 132 | mount -o rw,loop,noatime,nodiratime /media/$1/$2 /rootmnt |
@@ -142,6 +143,16 @@ if [ -d /ssd/etc/ ] ; then | |||
142 | fi | 143 | fi |
143 | fi | 144 | fi |
144 | 145 | ||
146 | if [ -f /ssd/etc/grub.d/40_custom ] ; then | ||
147 | echo "Preparing custom grub2 menu..." | ||
148 | sed -i "s@__ROOTFS__@$rootfs@g" /ssd/etc/grub.d/40_custom | ||
149 | sed -i "s/__VIDEO_MODE__/$3/g" /ssd/etc/grub.d/40_custom | ||
150 | sed -i "s/__VGA_MODE__/$4/g" /ssd/etc/grub.d/40_custom | ||
151 | mount $bootfs /bootmnt | ||
152 | cp /ssd/etc/grub.d/40_custom /bootmnt/40_custom | ||
153 | umount /bootmnt | ||
154 | fi | ||
155 | |||
145 | umount /ssd | 156 | umount /ssd |
146 | umount /rootmnt | 157 | umount /rootmnt |
147 | 158 | ||
@@ -151,11 +162,19 @@ grub-install --root-directory=/ssd /dev/${device} | |||
151 | 162 | ||
152 | echo "(hd0) /dev/${device}" > /ssd/boot/grub/device.map | 163 | echo "(hd0) /dev/${device}" > /ssd/boot/grub/device.map |
153 | 164 | ||
154 | echo "default 0" > /ssd/boot/grub/menu.lst | 165 | if [ -f /ssd/40_custom ] ; then |
155 | echo "timeout 30" >> /ssd/boot/grub/menu.lst | 166 | mv /ssd/40_custom /ssd/boot/grub/grub.cfg |
156 | echo "title Live Boot/Install-Image" >> /ssd/boot/grub/menu.lst | 167 | sed -i "/#/d" /ssd/boot/grub/grub.cfg |
157 | echo "root (hd0,0)" >> /ssd/boot/grub/menu.lst | 168 | sed -i "/exec tail/d" /ssd/boot/grub/grub.cfg |
158 | echo "kernel /boot/vmlinuz root=$rootfs rw $3 $4 quiet" >> /ssd/boot/grub/menu.lst | 169 | chmod 0444 /ssd/boot/grub/grub.cfg |
170 | else | ||
171 | echo "Preparing custom grub menu..." | ||
172 | echo "default 0" > /ssd/boot/grub/menu.lst | ||
173 | echo "timeout 30" >> /ssd/boot/grub/menu.lst | ||
174 | echo "title Live Boot/Install-Image" >> /ssd/boot/grub/menu.lst | ||
175 | echo "root (hd0,0)" >> /ssd/boot/grub/menu.lst | ||
176 | echo "kernel /boot/vmlinuz root=$rootfs rw $3 $4 quiet" >> /ssd/boot/grub/menu.lst | ||
177 | fi | ||
159 | 178 | ||
160 | cp /media/$1/vmlinuz /ssd/boot/ | 179 | cp /media/$1/vmlinuz /ssd/boot/ |
161 | 180 | ||
diff --git a/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb index 0eeabf1774..619b16c7c7 100644 --- a/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb +++ b/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb | |||
@@ -1,9 +1,9 @@ | |||
1 | DESCRIPTION = "A live image init script" | 1 | DESCRIPTION = "A live image init script for grub" |
2 | LICENSE = "MIT" | 2 | LICENSE = "MIT" |
3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | 3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" |
4 | SRC_URI = "file://init-install.sh" | 4 | SRC_URI = "file://init-install.sh" |
5 | 5 | ||
6 | PR = "r4" | 6 | PR = "r5" |
7 | 7 | ||
8 | RDEPENDS="grub parted e2fsprogs-mke2fs" | 8 | RDEPENDS="grub parted e2fsprogs-mke2fs" |
9 | 9 | ||
@@ -19,6 +19,4 @@ INHIBIT_DEFAULT_DEPS = "1" | |||
19 | 19 | ||
20 | FILES_${PN} = " /install.sh " | 20 | FILES_${PN} = " /install.sh " |
21 | 21 | ||
22 | # Alternatives to grub need adding for other arch support | 22 | COMPATIBLE_HOST = "(i.86|x86_64).*-linux" |
23 | # consistent with grub 0.97 | ||
24 | COMPATIBLE_HOST = "i.86.*-linux" | ||