summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorTom Zanussi <tom.zanussi@intel.com>2011-09-14 13:01:55 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-09-15 11:23:58 +0100
commitbcd1bca88052bfab4aaca74608134f4c8ff797de (patch)
tree8b2a81c023f503811b9595816bea9515cf0a30e5 /meta
parent978f48b7e2654ac161d548811f3c023af4f04c62 (diff)
downloadpoky-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.sh31
-rw-r--r--meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb8
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
127mkdir /ssd 127mkdir /ssd
128mkdir /rootmnt 128mkdir /rootmnt
129mkdir /bootmnt
129 130
130mount $rootfs /ssd 131mount $rootfs /ssd
131mount -o rw,loop,noatime,nodiratime /media/$1/$2 /rootmnt 132mount -o rw,loop,noatime,nodiratime /media/$1/$2 /rootmnt
@@ -142,6 +143,16 @@ if [ -d /ssd/etc/ ] ; then
142 fi 143 fi
143fi 144fi
144 145
146if [ -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
154fi
155
145umount /ssd 156umount /ssd
146umount /rootmnt 157umount /rootmnt
147 158
@@ -151,11 +162,19 @@ grub-install --root-directory=/ssd /dev/${device}
151 162
152echo "(hd0) /dev/${device}" > /ssd/boot/grub/device.map 163echo "(hd0) /dev/${device}" > /ssd/boot/grub/device.map
153 164
154echo "default 0" > /ssd/boot/grub/menu.lst 165if [ -f /ssd/40_custom ] ; then
155echo "timeout 30" >> /ssd/boot/grub/menu.lst 166 mv /ssd/40_custom /ssd/boot/grub/grub.cfg
156echo "title Live Boot/Install-Image" >> /ssd/boot/grub/menu.lst 167 sed -i "/#/d" /ssd/boot/grub/grub.cfg
157echo "root (hd0,0)" >> /ssd/boot/grub/menu.lst 168 sed -i "/exec tail/d" /ssd/boot/grub/grub.cfg
158echo "kernel /boot/vmlinuz root=$rootfs rw $3 $4 quiet" >> /ssd/boot/grub/menu.lst 169 chmod 0444 /ssd/boot/grub/grub.cfg
170else
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
177fi
159 178
160cp /media/$1/vmlinuz /ssd/boot/ 179cp /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 @@
1DESCRIPTION = "A live image init script" 1DESCRIPTION = "A live image init script for grub"
2LICENSE = "MIT" 2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" 3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
4SRC_URI = "file://init-install.sh" 4SRC_URI = "file://init-install.sh"
5 5
6PR = "r4" 6PR = "r5"
7 7
8RDEPENDS="grub parted e2fsprogs-mke2fs" 8RDEPENDS="grub parted e2fsprogs-mke2fs"
9 9
@@ -19,6 +19,4 @@ INHIBIT_DEFAULT_DEPS = "1"
19 19
20FILES_${PN} = " /install.sh " 20FILES_${PN} = " /install.sh "
21 21
22# Alternatives to grub need adding for other arch support 22COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
23# consistent with grub 0.97
24COMPATIBLE_HOST = "i.86.*-linux"