summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren Hart <dvhart@linux.intel.com>2013-02-21 09:28:02 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-22 06:39:07 -0800
commit4f4d82c62c56e182907244b98497ba3cfd848eed (patch)
treeadaca951b3138b5d91a9d3513da96b41aaec9178
parentc6209c96d9e0f466eb80072e7f02f935ec0c6249 (diff)
downloadpoky-4f4d82c62c56e182907244b98497ba3cfd848eed.tar.gz
install: Look for grub2 files on the initramfs, not rootfs
Fixes [YOCTO #3870] atom-pc - cannot boot image on netbook after install The problem here is that grub2 is installed but a grub 1 menu.lst is created at install time. At boot, grub2 doesn't find a grub.cfg file and drops to the grub shell. This happens because the installer is looking for 40_custom (a grub2 file) on the rootfs, but grub2 isn't installed on the rootfs. It exists in the initramfs. Patching the installer to look on the initramfs resolves the problem. Note that the problem may have occurred if grub2 used to be installed on the rootfs but was later removed. In any case, the installer is HORRIBLE and really needs to be completely redesigned as part of the deployment effort. For now, this should get the live image installer limping along again. Tested on a Toshiba NB-305. (From OE-Core rev: 8756a19bd24045d41ad20abb581e7872d0fc9ee6) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Cc: alexandru.c.georgescu@intel.com Cc: sgw@linux.intel.com Cc: ross.burton@intel.com Cc: richard.purdie@intel.com Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/initrdscripts/files/init-install.sh25
-rw-r--r--meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb2
2 files changed, 14 insertions, 13 deletions
diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh b/meta/recipes-core/initrdscripts/files/init-install.sh
index c1f8cba5d3..2c4486a149 100644
--- a/meta/recipes-core/initrdscripts/files/init-install.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install.sh
@@ -151,14 +151,19 @@ if [ -d /ssd/etc/ ] ; then
151 fi 151 fi
152fi 152fi
153 153
154if [ -f /ssd/etc/grub.d/40_custom ] ; then 154if [ -f /etc/grub.d/40_custom ] ; then
155 echo "Preparing custom grub2 menu..." 155 echo "Preparing custom grub2 menu..."
156 sed -i "s@__ROOTFS__@$rootfs $rootwait@g" /ssd/etc/grub.d/40_custom 156 GRUBCFG="/bootmnt/boot/grub/grub.cfg"
157 sed -i "s/__VIDEO_MODE__/$3/g" /ssd/etc/grub.d/40_custom
158 sed -i "s/__VGA_MODE__/$4/g" /ssd/etc/grub.d/40_custom
159 sed -i "s/__CONSOLE__/$5/g" /ssd/etc/grub.d/40_custom
160 mount $bootfs /bootmnt 157 mount $bootfs /bootmnt
161 cp /ssd/etc/grub.d/40_custom /bootmnt/40_custom 158 mkdir -p $(dirname $GRUBCFG)
159 cp /etc/grub.d/40_custom $GRUBCFG
160 sed -i "s@__ROOTFS__@$rootfs $rootwait@g" $GRUBCFG
161 sed -i "s/__VIDEO_MODE__/$3/g" $GRUBCFG
162 sed -i "s/__VGA_MODE__/$4/g" $GRUBCFG
163 sed -i "s/__CONSOLE__/$5/g" $GRUBCFG
164 sed -i "/#/d" $GRUBCFG
165 sed -i "/exec tail/d" $GRUBCFG
166 chmod 0444 $GRUBCFG
162 umount /bootmnt 167 umount /bootmnt
163fi 168fi
164 169
@@ -171,12 +176,8 @@ grub-install --root-directory=/ssd /dev/${device}
171 176
172echo "(hd0) /dev/${device}" > /ssd/boot/grub/device.map 177echo "(hd0) /dev/${device}" > /ssd/boot/grub/device.map
173 178
174if [ -f /ssd/40_custom ] ; then 179# If grub.cfg doesn't exist, assume GRUB 0.97 and create a menu.lst
175 mv /ssd/40_custom /ssd/boot/grub/grub.cfg 180if [ ! -f /ssd/boot/grub/grub.cfg ] ; then
176 sed -i "/#/d" /ssd/boot/grub/grub.cfg
177 sed -i "/exec tail/d" /ssd/boot/grub/grub.cfg
178 chmod 0444 /ssd/boot/grub/grub.cfg
179else
180 echo "Preparing custom grub menu..." 181 echo "Preparing custom grub menu..."
181 echo "default 0" > /ssd/boot/grub/menu.lst 182 echo "default 0" > /ssd/boot/grub/menu.lst
182 echo "timeout 30" >> /ssd/boot/grub/menu.lst 183 echo "timeout 30" >> /ssd/boot/grub/menu.lst
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 ac73ef80aa..0f80f0e28a 100644
--- a/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb
+++ b/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb
@@ -3,7 +3,7 @@ LICENSE = "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 = "r7" 6PR = "r8"
7 7
8RDEPENDS_${PN} = "grub parted e2fsprogs-mke2fs" 8RDEPENDS_${PN} = "grub parted e2fsprogs-mke2fs"
9 9