summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/initrdscripts/files/init-install.sh
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2014-05-20 10:49:47 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-05-27 16:11:53 +0100
commit45bbe3528ed932558fb3c57cf638b9994777c9ce (patch)
tree6d7cb18ef7ec8c92f3c32d98aed30071bed82bbb /meta/recipes-core/initrdscripts/files/init-install.sh
parentab332098ccf77a313b7a63040d33d52e3534da58 (diff)
downloadpoky-45bbe3528ed932558fb3c57cf638b9994777c9ce.tar.gz
initramfs-live-install: avoid using grub.d/40_custom
We have this in recipes-bsp/grub/grub/40_custom: [snip] menuentry "Linux" { set root=(hd0,1) linux /vmlinuz root=__ROOTFS__ rw __CONSOLE__ __VIDEO_MODE__ __VGA_MODE__ quiet } [snip] These lines are only for initrdscripts/files/init-install.sh, the side effect is that it would make the target's grub-mkconfig doesn't work well since the 40_custom will be installed to /etc/grub.d/40_custom, the grub-mkconfig will run the 40_custom, and there will always be a 'menuentry "Linux"' menu in grub.cfg no matter it is valid or not, we can do this in init-install.sh rather than grub to fix the problem, which is also much simpler. (From OE-Core rev: 8ae89d08454c11035eb2826a06e2243c9f2568b4) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/initrdscripts/files/init-install.sh')
-rw-r--r--meta/recipes-core/initrdscripts/files/init-install.sh15
1 files changed, 7 insertions, 8 deletions
diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh b/meta/recipes-core/initrdscripts/files/init-install.sh
index b1600030f5..f84a5eb83b 100644
--- a/meta/recipes-core/initrdscripts/files/init-install.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install.sh
@@ -168,17 +168,16 @@ umount /src_root
168# Handling of the target boot partition 168# Handling of the target boot partition
169mount $bootfs /boot 169mount $bootfs /boot
170echo "Preparing boot partition..." 170echo "Preparing boot partition..."
171if [ -f /etc/grub.d/40_custom ] ; then 171if [ -f /etc/grub.d/00_header ] ; then
172 echo "Preparing custom grub2 menu..." 172 echo "Preparing custom grub2 menu..."
173 GRUBCFG="/boot/grub/grub.cfg" 173 GRUBCFG="/boot/grub/grub.cfg"
174 mkdir -p $(dirname $GRUBCFG) 174 mkdir -p $(dirname $GRUBCFG)
175 cp /etc/grub.d/40_custom $GRUBCFG 175 cat >$GRUBCFG <<_EOF
176 sed -i "s@__ROOTFS__@$rootfs $rootwait@g" $GRUBCFG 176menuentry "Linux" {
177 sed -i "s/__VIDEO_MODE__/$3/g" $GRUBCFG 177 set root=(hd0,1)
178 sed -i "s/__VGA_MODE__/$4/g" $GRUBCFG 178 linux /vmlinuz root=$rootfs $rootwait rw $5 $3 $4 quiet
179 sed -i "s/__CONSOLE__/$5/g" $GRUBCFG 179}
180 sed -i "/#/d" $GRUBCFG 180_EOF
181 sed -i "/exec tail/d" $GRUBCFG
182 chmod 0444 $GRUBCFG 181 chmod 0444 $GRUBCFG
183fi 182fi
184grub-install /dev/${device} 183grub-install /dev/${device}